/* ============================================================
   PULSO — sistema visual
   Black / bone / signal. Built for the phone first.
   ============================================================ */

@font-face {
  font-family: "Sora";
  src: url("../assets/fonts/sora-var.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("../assets/fonts/instrument-sans-var.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-stretch: 100%;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../assets/fonts/plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../assets/fonts/plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #050606;
  --bg-soft: #080a09;
  --panel: rgba(255, 255, 255, 0.032);
  --panel-strong: #0b0d0c;
  --text: #f2f1eb;
  --text-soft: #c9c9c1;
  --muted: #8b8f88;
  --muted-2: #5f635d;
  --line: rgba(242, 241, 235, 0.105);
  --line-soft: rgba(242, 241, 235, 0.062);
  --line-strong: rgba(242, 241, 235, 0.22);
  --positive: #b9e8a8;
  --negative: #ff9b9b;
  --warn: #e5c174;
  --radius: 21px;
  --radius-sm: 13px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.33, 1, 0.68, 1);
  --font-display: "Sora", "Helvetica Neue", sans-serif;
  --font-ui: "Instrument Sans", "Helvetica Neue", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --rail: 248px;
}

* { box-sizing: border-box; }
html {
  height: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
  overscroll-behavior-x: none;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
  overscroll-behavior-x: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  min-width: 320px;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(1000px 620px at 82% -12%, rgba(242, 241, 235, 0.06), transparent 62%),
    radial-gradient(700px 600px at -12% 38%, rgba(159, 232, 174, 0.025), transparent 64%),
    linear-gradient(180deg, #050606 0%, #070807 52%, #050606 100%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0.032;
  background-image: url("../assets/noise.png");
  background-size: 128px 128px;
  mix-blend-mode: soft-light;
}
body.is-locked { overflow: hidden; }

::selection { background: var(--text); color: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
button { padding: 0; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
h1, h2, h3, p { margin: 0; }
b, strong { font-weight: 600; }
[hidden] { display: none !important; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #222521; border: 2px solid var(--bg); border-radius: 10px; }
:focus-visible { outline: 1px solid var(--text); outline-offset: 3px; }

/* ---------- utility type ---------- */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.145em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow .dot-sep {
  display: inline-block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--muted-2);
}
.dot-sep {
  display: inline-block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--muted-2);
  vertical-align: middle;
}
.mono { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; }
.tag {
  display: inline-flex;
  align-items: center;
  height: 15px;
  padding: 0 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.tag-ghost { border-color: transparent; color: var(--muted-2); padding: 0 0 0 4px; }
.positive { color: var(--positive) !important; }
.negative { color: var(--negative) !important; }
.muted { color: var(--muted); }
.page-title {
  margin-top: 10px;
  font-family: var(--font-display);
  font-size: clamp(44px, 5.3vw, 64px);
  font-weight: 300;
  letter-spacing: -0.055em;
  line-height: 0.97;
}
.title-muted { color: #a4a69f; }
.title-accent { color: var(--muted-2); }
.lede {
  max-width: 480px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.fine-copy {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
}

/* ---------- app shell ---------- */
.app { min-height: 100dvh; }
.rail {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  width: var(--rail);
  padding: 30px 20px 22px;
  border-right: 1px solid var(--line-soft);
  background:
    linear-gradient(180deg, rgba(8, 10, 9, 0.92), rgba(5, 6, 6, 0.96)),
    radial-gradient(300px 400px at 20% 0%, rgba(255, 255, 255, 0.03), transparent 70%);
  backdrop-filter: blur(18px);
}
.rail-brand { padding: 0 8px; }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}
.brand-mark::before {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  height: 1px;
  background: var(--text);
  box-shadow: 0 0 10px rgba(242, 241, 235, 0.8);
}
.brand-mark i {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text);
  right: 6px;
  top: 9px;
}
.brand-word {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.07em;
}
.brand-sub {
  margin: 13px 0 0 9px;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.brand-sub span { color: #3e423d; }
.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 62px;
}
.rail-link {
  position: relative;
  display: grid;
  grid-template-columns: 22px 30px 1fr;
  align-items: center;
  gap: 9px;
  width: 100%;
  height: 45px;
  padding: 0 9px;
  border-radius: 10px;
  color: var(--muted);
  text-align: left;
  transition: color 220ms var(--ease), background 220ms var(--ease);
}
.rail-link:hover { color: var(--text-soft); background: rgba(255, 255, 255, 0.025); }
.rail-index {
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--muted-2);
  transition: color 220ms var(--ease);
}
.rail-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  transition: background 260ms var(--ease), color 260ms var(--ease), transform 260ms var(--ease);
}
.rail-icon svg { width: 17px; height: 17px; }
.rail-label { font-size: 13.5px; font-weight: 500; letter-spacing: 0.005em; }
.rail-link.is-active { color: var(--text); }
.rail-link.is-active .rail-index { color: var(--text); }
.rail-link.is-active .rail-icon {
  color: #060707;
  background: var(--text);
  box-shadow: 0 0 24px rgba(242, 241, 235, 0.16);
}
.rail-link.is-active::after {
  content: "";
  position: absolute;
  right: 8px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text);
}
.rail-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 14px; }
.rail-status {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.018);
  text-align: left;
  transition: border-color 220ms var(--ease), background 220ms var(--ease);
}
.rail-status:hover { border-color: var(--line); background: rgba(255, 255, 255, 0.03); }
.rail-status > span:nth-child(2) { display: flex; flex-direction: column; min-width: 0; }
.rail-status strong { font-size: 11.5px; font-weight: 500; }
.rail-status small { font-size: 9.5px; color: var(--muted-2); }
.rail-status .tag { margin-left: auto; }
.status-orbit {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  border: 1px solid rgba(242, 241, 235, 0.2);
  border-radius: 50%;
}
.status-orbit i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--positive);
  box-shadow: 0 0 0 0 rgba(185, 232, 168, 0.4);
  animation: orbitPulse 2.8s infinite;
}
@keyframes orbitPulse {
  0% { box-shadow: 0 0 0 0 rgba(185, 232, 168, 0.35); }
  60% { box-shadow: 0 0 0 5px rgba(185, 232, 168, 0); }
  100% { box-shadow: 0 0 0 0 rgba(185, 232, 168, 0); }
}
.rail-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 8px;
  border-radius: 10px;
  text-align: left;
  transition: background 200ms var(--ease);
}
.rail-profile:hover { background: rgba(255, 255, 255, 0.03); }
.rail-profile-copy { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.rail-profile-copy strong { font-size: 12px; font-weight: 500; }
.rail-profile-copy small { font-size: 9px; color: var(--muted-2); }
.rail-profile .icon-xs { width: 14px; height: 14px; color: var(--muted-2); }
.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--text);
  color: #070807;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.stage {
  position: relative;
  min-height: 100dvh;
  margin-left: var(--rail);
}
.stage::before {
  content: "";
  position: fixed;
  inset: 0 0 0 var(--rail);
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 74px 74px;
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 55% 0%, #000 10%, transparent 78%);
  mask-image: radial-gradient(ellipse 75% 65% at 55% 0%, #000 10%, transparent 78%);
}

/* ---------- topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  padding: 0 38px;
  border-bottom: 1px solid transparent;
  background: linear-gradient(180deg, rgba(5, 6, 6, 0.94) 0%, rgba(5, 6, 6, 0.7) 68%, rgba(5, 6, 6, 0) 100%);
  backdrop-filter: blur(16px) saturate(130%);
}
.topbar-left { display: flex; align-items: center; gap: 20px; }
.topbar-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.live-clock { color: var(--muted); font-variant-numeric: tabular-nums; }
.meta-slash { color: #333630; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.sync-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.018);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: border-color 200ms var(--ease), color 200ms var(--ease);
}
.sync-pill:hover { color: var(--text-soft); border-color: var(--line); }
.sync-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 8px rgba(229, 193, 116, 0.4);
  flex: 0 0 auto;
}
.rail-status .status-orbit i {
  background: var(--warn);
  box-shadow: none;
  animation: none;
}
.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-soft);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.018);
  color: var(--text-soft);
  transition: background 220ms var(--ease), color 220ms var(--ease), border-color 220ms var(--ease), transform 220ms var(--ease);
}
.icon-btn:hover { background: var(--text); color: var(--bg); border-color: var(--text); transform: rotate(90deg); }
.icon-btn svg { width: 16px; height: 16px; }
.quick-btn svg { width: 18px; height: 18px; }
.quick-btn:hover { transform: rotate(90deg); }
.avatar-btn {
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: transform 220ms var(--ease), box-shadow 220ms var(--ease);
}
.avatar-btn:hover { transform: scale(1.05); box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.06); }
.mobile-brand { display: none; }
main {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 32px 38px 92px;
}

/* ---------- view + reveal ---------- */
.view { position: relative; }
.view.is-active .reveal {
  animation: riseIn 750ms var(--ease) both;
  animation-delay: calc(var(--reveal-i, 0) * 55ms);
}
@keyframes riseIn {
  from { opacity: 0; transform: translateY(13px); }
  to { opacity: 1; transform: translateY(0); }
}
.view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}
.view-head-side { display: flex; align-items: center; gap: 14px; padding-bottom: 4px; }
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 31px;
  padding: 0 10px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.status-chip .status-orbit { width: 17px; height: 17px; border-color: transparent; }
.status-chip .status-orbit i { width: 4px; height: 4px; }
.status-chip.is-error { color: var(--warn); border-color: rgba(229, 193, 116, 0.22); }
.status-chip.is-error .status-orbit i { background: var(--warn); }
.status-chip.is-syncing .status-orbit i { background: var(--warn); animation-duration: 1.2s; }
.offline-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 11px 13px;
  border: 1px solid rgba(229, 193, 116, 0.2);
  border-radius: 11px;
  background: rgba(229, 193, 116, 0.035);
}
.offline-banner span {
  flex: 0 0 auto;
  color: var(--warn);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.offline-banner p { color: var(--muted); font-size: 10px; line-height: 1.4; }
.solid-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--text);
  color: #070807;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: transform 220ms var(--ease), box-shadow 220ms var(--ease);
}
.solid-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(242, 241, 235, 0.12); }
.solid-btn svg { width: 15px; height: 15px; stroke-width: 2; }

/* ---------- day hero ---------- */
.day-hero {
  position: relative;
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 30px;
  overflow: hidden;
  padding: 26px 32px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background:
    radial-gradient(720px 280px at 18% 0%, rgba(255, 255, 255, 0.06), transparent 64%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01) 58%, rgba(255, 255, 255, 0.024));
  box-shadow: 0 30px 80px -50px #000, inset 0 1px 0 rgba(255, 255, 255, 0.055);
  isolation: isolate;
}
.day-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.085) 0.55px, transparent 0.55px);
  background-size: 5px 5px;
  opacity: 0.12;
  -webkit-mask-image: linear-gradient(120deg, transparent 8%, #000 72%);
  mask-image: linear-gradient(120deg, transparent 8%, #000 72%);
}
.day-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-right: 30px;
  border-right: 1px solid var(--line-soft);
}
.score-dial {
  position: relative;
  width: 252px;
  height: 252px;
  flex: 0 0 auto;
}
.score-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.score-halo {
  fill: none;
  stroke: rgba(255, 255, 255, 0.05);
  stroke-width: 1;
  stroke-dasharray: 1 6;
}
.score-track {
  fill: none;
  stroke: #202420;
  stroke-width: 2;
}
.score-arc {
  fill: none;
  stroke: var(--text);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dashoffset 1100ms cubic-bezier(0.16, 1, 0.3, 1);
  filter: drop-shadow(0 0 10px rgba(242, 241, 235, 0.28));
}
.score-ticks line {
  stroke: rgba(242, 241, 235, 0.13);
  stroke-width: 1;
  transition: stroke 480ms var(--ease), opacity 480ms var(--ease);
}
.score-ticks line.is-on { stroke: rgba(242, 241, 235, 0.86); }
.score-core {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.score-kicker {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.14em;
}
.score-number { display: flex; align-items: baseline; gap: 5px; margin: 1px 0 0; }
.score-number strong {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 76px;
  font-weight: 380;
  letter-spacing: -0.08em;
  line-height: 0.92;
  font-variant-numeric: tabular-nums;
}
.score-number span {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.02em;
}
.score-coverage {
  margin-top: 8px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 6.5px;
  letter-spacing: 0.11em;
}
.score-dial.is-partial .score-coverage { color: var(--warn); border-color: rgba(229, 193, 116, 0.22); }
.score-foot {
  max-width: 220px;
  margin-top: 12px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 7px;
  line-height: 1.55;
  letter-spacing: 0.05em;
  text-align: center;
  text-transform: uppercase;
}
.day-hero-copy { display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: 8px 0; }
.day-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.score-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.score-state::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--positive);
  box-shadow: 0 0 8px rgba(190, 222, 155, 0.5);
}
.day-hero h2 {
  max-width: 560px;
  margin: 14px 0 9px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(30px, 3vw, 43px);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 0.98;
}
.day-score-copy {
  max-width: 570px;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.58;
}
.score-breakdown {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 21px 0 16px;
  padding-top: 15px;
  border-top: 1px solid var(--line-soft);
}
.score-component { min-width: 0; }
.score-component-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 5px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 6.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.score-component-head small { color: var(--muted-2); font-size: 6px; }
.score-component-value {
  margin: 5px 0 7px;
  color: var(--text-soft);
  font-family: var(--font-display);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}
.score-component-bar { height: 2px; background: var(--line-soft); overflow: hidden; }
.score-component-bar i { display: block; height: 100%; background: var(--text-soft); transition: width 800ms var(--ease); }
.score-component.is-empty { opacity: 0.42; }
.score-component.is-empty .score-component-bar { background: repeating-linear-gradient(90deg, var(--line-soft) 0 3px, transparent 3px 6px); }
.score-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 2px; }
.score-coverage-note { color: var(--muted-2); font-family: var(--font-mono); font-size: 7px; letter-spacing: 0.06em; text-transform: uppercase; }

.signal-rail {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 18px;
}
.signal-card {
  position: relative;
  min-width: 0;
  min-height: 103px;
  padding: 11px 13px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.026), rgba(255, 255, 255, 0.008));
  overflow: hidden;
  transition: border-color 220ms var(--ease), transform 220ms var(--ease);
}
.signal-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.signal-card header { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted-2); font-family: var(--font-mono); font-size: 6.5px; letter-spacing: 0.08em; text-transform: uppercase; }
.signal-card header svg { width: 12px; height: 12px; stroke-width: 1.4; }
.signal-card strong {
  display: block;
  margin-top: 10px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.signal-card small { display: block; margin-top: 5px; color: var(--muted); font-family: var(--font-mono); font-size: 7.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.signal-line { height: 2px; margin-top: 9px; background: var(--line-soft); overflow: hidden; }
.signal-line i { display: block; height: 100%; background: var(--text-soft); transition: width 900ms var(--ease); }
.signal-card[data-signal="sleep"].is-empty strong { color: var(--muted-2); font-size: 18px; letter-spacing: -0.02em; }
.score-sheet-total {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 18px 0 7px;
  border-bottom: 1px solid var(--line-soft);
}
.score-sheet-total strong {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 66px;
  font-weight: 380;
  letter-spacing: -0.075em;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
}
.score-sheet-total span { color: var(--muted-2); font-family: var(--font-mono); font-size: 9px; }
.score-sheet-total small { margin-left: auto; color: var(--muted); font-family: var(--font-mono); font-size: 7px; letter-spacing: 0.06em; text-transform: uppercase; }
.score-rules { display: flex; flex-direction: column; margin-top: 9px; }
.score-rule {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 126px 28px;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  border-top: 1px solid var(--line-soft);
}
.score-rule:first-child { border-top: 0; }
.score-rule-copy strong { display: block; color: var(--text-soft); font-size: 11.5px; font-weight: 500; }
.score-rule-copy small { display: block; margin-top: 2px; color: var(--muted-2); font-family: var(--font-mono); font-size: 6.5px; letter-spacing: 0.04em; text-transform: uppercase; }
.score-rule-meter { height: 2px; background: var(--line-soft); overflow: hidden; }
.score-rule-meter i { display: block; height: 100%; background: var(--text-soft); }
.score-rule-value { color: var(--text-soft); font-family: var(--font-display); font-size: 19px; text-align: right; font-variant-numeric: tabular-nums; }
.score-rule.is-empty { opacity: 0.45; }
.score-rule.is-empty .score-rule-meter { background: repeating-linear-gradient(90deg, var(--line-soft) 0 3px, transparent 3px 6px); }

/* ---------- hero ---------- */
.hero-panel {
  position: relative;
  overflow: hidden;
  padding: 27px 32px 0;
  border: 1px solid var(--line);
  border-radius: 26px;
  background:
    radial-gradient(860px 300px at 25% 10%, rgba(255, 255, 255, 0.055), transparent 62%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012) 58%, rgba(255, 255, 255, 0.026));
  box-shadow: 0 30px 80px -50px #000, inset 0 1px 0 rgba(255, 255, 255, 0.055);
  isolation: isolate;
}
.hero-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.09) 0.55px, transparent 0.55px);
  background-size: 5px 5px;
  opacity: 0.11;
  -webkit-mask-image: linear-gradient(120deg, transparent 10%, #000 75%);
  mask-image: linear-gradient(120deg, transparent 10%, #000 75%);
}
.spotlight::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(420px circle at var(--mx, 68%) var(--my, 20%), rgba(255, 255, 255, 0.055), transparent 55%);
  opacity: 0;
  transition: opacity 300ms var(--ease);
}
.spotlight:hover::after { opacity: 1; }
.spotlight > * { position: relative; z-index: 1; }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.hero-status {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--positive);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.1em;
}
.hero-status i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--positive);
  box-shadow: 0 0 10px rgba(185, 232, 168, 0.5);
}
.hero-main {
  display: flex;
  align-items: flex-end;
  gap: clamp(28px, 5vw, 70px);
  padding: 20px 0 30px;
}
.readiness {
  display: grid;
  grid-template-columns: auto auto;
  align-items: end;
  flex: 0 0 auto;
}
.readiness-num {
  font-family: var(--font-display);
  font-size: clamp(104px, 14vw, 172px);
  font-weight: 300;
  letter-spacing: -0.09em;
  line-height: 0.72;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #fffef8 10%, #b9baB2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 60px rgba(255, 255, 255, 0.08);
}
.readiness-den {
  margin: 0 0 1px 7px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
}
.readiness-label {
  grid-column: 1 / -1;
  margin-top: 17px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.16em;
  line-height: 1.5;
}
.hero-copy { max-width: 390px; padding-bottom: 3px; }
.hero-copy h2 {
  font-family: var(--font-display);
  font-size: clamp(21px, 2.5vw, 29px);
  font-weight: 400;
  letter-spacing: -0.035em;
}
.hero-copy p {
  max-width: 370px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 15px;
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 500;
  transition: color 200ms var(--ease), gap 240ms var(--ease);
}
.text-link:hover { color: var(--text); gap: 9px; }
.text-link svg { width: 13px; height: 13px; }
.text-link.small { margin-top: 0; font-size: 10.5px; color: var(--muted); }
.hero-ecg {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 74px;
  z-index: -1;
  width: 100%;
  height: 90px;
  opacity: 0.35;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 20%, #000 70%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 20%, #000 70%, transparent);
}
.ecg-base { fill: none; stroke: rgba(242, 241, 235, 0.16); stroke-width: 0.8; }
.ecg-run {
  fill: none;
  stroke: rgba(242, 241, 235, 0.6);
  stroke-width: 1;
  stroke-dasharray: 140 1300;
  stroke-dashoffset: 140;
  animation: ecgRun 7s linear infinite;
}
@keyframes ecgRun {
  0% { stroke-dashoffset: 140; opacity: 0; }
  8% { opacity: 1; }
  60% { opacity: 1; }
  75%, 100% { stroke-dashoffset: -1200; opacity: 0; }
}
.hero-factors {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line-soft);
  margin: 0 -32px;
  padding: 0 32px;
}
.factor {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 15px 18px 18px;
  border-left: 1px solid var(--line-soft);
}
.factor:first-child { border-left: 0; padding-left: 0; }
.factor-label {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.factor strong {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 300;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.factor strong em { color: var(--muted-2); font-family: var(--font-mono); font-size: 8px; font-style: normal; letter-spacing: 0.03em; }
.factor small { color: var(--muted-2); font-family: var(--font-mono); font-size: 8px; }

/* ---------- generic panel ---------- */
.home-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr); gap: 18px; margin-top: 18px; align-items: start; }
.home-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.panel {
  position: relative;
  padding: 21px 22px 17px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.036), rgba(255, 255, 255, 0.012));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 17px;
}
.section-title-wrap { display: flex; align-items: center; gap: 9px; min-width: 0; }
.section-index {
  display: inline-grid;
  place-items: center;
  min-width: 19px;
  height: 17px;
  padding: 0 4px;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.03em;
}
.section-title-wrap h2 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: -0.025em;
  white-space: nowrap;
}
.head-actions { display: flex; align-items: center; gap: 14px; }
.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color 200ms var(--ease);
  white-space: nowrap;
}
.link-btn:hover { color: var(--text); }
.link-btn svg { width: 12px; height: 12px; transition: transform 220ms var(--ease); }
.link-btn:hover svg { transform: translateX(2px); }
.fraction { color: var(--text); font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.04em; }
.source-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.source-tag svg { width: 11px; height: 11px; }
.source-tag .sync-dot { width: 4px; height: 4px; }
.panel-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted-2);
  font-size: 10.5px;
}
.panel-footer.split { justify-content: space-between; }
.panel-footer b { color: var(--text-soft); font-weight: 500; }
.streak-line { display: inline-flex; align-items: center; gap: 5px; }
.streak-line svg { width: 12px; height: 12px; color: #d7a97b; }
.round-link {
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text-soft);
  transition: background 220ms var(--ease), color 220ms var(--ease);
}
.round-link:hover { background: var(--text); color: var(--bg); }
.round-link svg { width: 15px; height: 15px; }

/* ---------- home: sleep ---------- */
.sleep-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 18px;
  align-items: start;
}
.sleep-main-stat { display: flex; flex-direction: column; gap: 4px; }
.sleep-main-stat strong {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 300;
  letter-spacing: -0.06em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.sleep-main-stat .delta { font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.02em; }
.score-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 57px;
  height: 57px;
  border: 1px solid color-mix(in srgb, var(--score-color, #57b68a) 42%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--score-color, #57b68a) 8%, transparent);
  color: var(--score-color, #7ed1a6);
}
.score-badge span { font-family: var(--font-display); font-size: 17px; font-weight: 400; line-height: 1; }
.score-badge small { margin-top: 2px; font-family: var(--font-mono); font-size: 6.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-2); }
.sleep-mini-facts {
  display: flex;
  grid-column: 1 / -1;
  gap: 18px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}
.sleep-mini-facts span { display: inline-flex; align-items: center; gap: 5px; }
.sleep-mini-facts b { color: var(--text-soft); font-family: var(--font-mono); font-size: 9px; font-weight: 400; }
.stage-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; }
.stage-dot.deep { background: #2f8f65; }
.stage-dot.rem { background: #79c9a0; }
.stage-dot.light { background: #375149; }
.stage-dot.awake { background: #cf7c76; }
.sleep-skyline {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 91px;
  margin-top: 19px;
  padding-top: 7px;
}
.sleep-skyline::before {
  content: "7h 30";
  position: absolute;
  right: 0;
  bottom: 80.6%;
  padding-left: 4px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 6.5px;
  letter-spacing: 0.04em;
  background: var(--bg);
  z-index: 2;
  transform: translateY(50%);
}
.sleep-skyline::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 80.6%;
  border-top: 1px dashed rgba(255, 255, 255, 0.15);
  pointer-events: none;
}
.sky-bar {
  position: relative;
  flex: 1;
  min-width: 2px;
  border-radius: 2px 2px 1px 1px;
  background: var(--bar-color, #2e7657);
  opacity: 0.78;
  transform-origin: bottom;
  animation: barIn 900ms var(--ease) both;
  animation-delay: calc(var(--i, 0) * 13ms);
}
.sky-bar.is-last { opacity: 1; box-shadow: 0 0 13px color-mix(in srgb, var(--bar-color) 38%, transparent); }
.sky-bar.is-today { outline: 1px solid rgba(255, 255, 255, 0.6); outline-offset: 2px; }
@keyframes barIn {
  from { transform: scaleY(0); opacity: 0; }
  to { transform: scaleY(1); opacity: 0.78; }
}
.chart-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 9px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 6.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.legend-inline { display: inline-flex; align-items: center; gap: 4px; color: var(--muted-2); font-family: var(--font-ui); font-size: 8.5px; letter-spacing: 0; text-transform: none; }
.legend-inline i { width: 12px; height: 4px; border-radius: 1px; background: linear-gradient(90deg, #0e4a32, #2c8b63, #a79b52, #d37c5d); }

/* ---------- home: habits ---------- */
.habit-list { display: flex; flex-direction: column; }
.habit-row {
  position: relative;
  display: grid;
  grid-template-columns: 29px 29px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 51px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  transition: background 220ms var(--ease);
}
.habit-list .habit-row:last-child { border-bottom: 0; }
.habit-row:hover { background: rgba(255, 255, 255, 0.018); }
.habit-check {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: #070807;
  background: transparent;
  transition: background 260ms var(--ease), border-color 260ms var(--ease), transform 260ms var(--ease);
}
.habit-check:hover { border-color: var(--text); transform: scale(1.06); }
.habit-check svg { width: 13px; height: 13px; opacity: 0; transform: scale(0.45); stroke-width: 2.2; transition: opacity 200ms var(--ease), transform 300ms var(--ease); }
.habit-row.is-done .habit-check { background: var(--habit-accent, var(--text)); border-color: var(--habit-accent, var(--text)); }
.habit-row.is-done .habit-check svg { opacity: 1; transform: scale(1); }
.habit-row.is-done .habit-name { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line); }
.habit-icon {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 1px solid color-mix(in srgb, var(--habit-accent) 18%, transparent);
  border-radius: 8px;
  color: color-mix(in srgb, var(--habit-accent) 78%, white);
  background: color-mix(in srgb, var(--habit-accent) 6%, transparent);
}
.habit-icon svg { width: 14px; height: 14px; }
.habit-name {
  overflow: hidden;
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 450;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 200ms var(--ease);
}
.habit-meta { display: flex; align-items: center; gap: 11px; }
.habit-streak { display: inline-flex; align-items: center; gap: 3px; color: var(--muted-2); font-family: var(--font-mono); font-size: 8.5px; font-variant-numeric: tabular-nums; }
.habit-streak svg { width: 10px; height: 10px; color: #d9a878; }
.habit-week { display: flex; align-items: center; gap: 3px; }
.habit-week i { width: 4px; height: 4px; border-radius: 50%; background: rgba(255, 255, 255, 0.12); }
.habit-week i.on { background: var(--habit-accent); }
.habit-menu {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-right: -5px;
  border-radius: 50%;
  color: var(--muted-2);
  opacity: 0;
  transition: opacity 200ms var(--ease), background 200ms var(--ease), color 200ms var(--ease);
}
.habit-row:hover .habit-menu, .habit-menu:focus-visible { opacity: 1; }
.habit-menu:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.habit-menu svg { width: 14px; height: 14px; }
.habit-list.compact .habit-row { min-height: 47px; }
.habit-list.compact .habit-name { font-size: 12px; }
.habit-list.compact .habit-week { display: none; }

/* ---------- home: body ---------- */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.metric { position: relative; padding: 13px 12px 13px 0; }
.metric + .metric { padding-left: 14px; border-left: 1px solid var(--line-soft); }
.metric-label { color: var(--muted-2); font-family: var(--font-mono); font-size: 7.5px; letter-spacing: 0.07em; text-transform: uppercase; }
.metric-value { display: flex; align-items: baseline; gap: 4px; margin-top: 6px; }
.metric-value strong { font-family: var(--font-display); font-size: 24px; font-weight: 300; letter-spacing: -0.055em; line-height: 1; font-variant-numeric: tabular-nums; }
.metric-value span { color: var(--muted-2); font-family: var(--font-mono); font-size: 7px; }
.metric-delta {
  position: absolute;
  right: 0;
  top: 12px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 7.5px;
}
.metric + .metric .metric-delta { right: 0; }
.mini-chart-head {
  display: flex;
  justify-content: space-between;
  margin-top: 17px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.mini-chart-head em { font-style: normal; }
.hr-chart { width: 100%; height: 76px; margin-top: 7px; }
.hr-chart.small { height: 58px; }
.hr-chart svg { width: 100%; height: 100%; overflow: visible; }
.chart-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 6.5px;
  letter-spacing: 0.03em;
}
.body-link { margin-top: 9px; }

/* ---------- nutrition, shared ---------- */
.nutrition-headline {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 15px;
}
.nutrition-remaining { display: flex; align-items: baseline; gap: 6px; }
.nutrition-remaining strong {
  font-family: var(--font-display);
  font-size: 39px;
  font-weight: 300;
  letter-spacing: -0.06em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.nutrition-remaining span { color: var(--muted-2); font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.03em; }
.nutrition-target { color: var(--muted); font-family: var(--font-mono); font-size: 8px; text-align: right; line-height: 1.6; }
.nutrition-target b { color: var(--text-soft); font-weight: 400; }
.budget-bar {
  position: relative;
  display: flex;
  height: 7px;
  margin-top: 15px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.budget-bar i { display: block; height: 100%; background: var(--text); }
.budget-bar i + i { background: rgba(255, 255, 255, 0.23); border-left: 1px solid var(--bg); }
.budget-caption {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 6.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.macros { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
.macro { display: flex; flex-direction: column; gap: 5px; }
.macro-top { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; }
.macro-top span { color: var(--muted-2); font-family: var(--font-mono); font-size: 7px; letter-spacing: 0.06em; text-transform: uppercase; }
.macro-top b { color: var(--text-soft); font-family: var(--font-mono); font-size: 8.5px; font-weight: 400; white-space: nowrap; }
.macro-track { height: 2px; background: rgba(255, 255, 255, 0.08); border-radius: 2px; overflow: hidden; }
.macro-track i { display: block; height: 100%; background: var(--macro-color, var(--text-soft)); border-radius: inherit; }
.macro:nth-child(1) { --macro-color: #d9d8cf; }
.macro:nth-child(2) { --macro-color: #848a80; }
.macro:nth-child(3) { --macro-color: #555b53; }
.nutrition-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}
.nutrition-cta .source-tag { color: var(--muted-2); }
.ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 10px;
  transition: background 200ms var(--ease), color 200ms var(--ease);
}
.ghost-btn:hover { background: var(--text); color: var(--bg); }
.ghost-btn svg { width: 12px; height: 12px; }

/* ---------- home: goal strip ---------- */
.goal-strip {
  display: grid;
  grid-template-columns: 1fr 95px 37px;
  align-items: center;
  gap: 18px;
  padding: 18px 4px 18px 6px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.goal-strip h2 { margin-top: 6px; font-family: var(--font-display); font-size: 18px; font-weight: 400; letter-spacing: -0.03em; }
.goal-strip p:not(.eyebrow) { margin-top: 3px; color: var(--muted-2); font-size: 10px; }
.goal-strip-meter { display: flex; flex-direction: column; gap: 7px; }
.goal-strip-meter strong { font-family: var(--font-display); font-size: 24px; font-weight: 300; letter-spacing: -0.05em; text-align: right; }
.goal-strip-meter strong span { color: var(--muted-2); font-family: var(--font-mono); font-size: 8px; }
.thin-track { height: 1px; background: rgba(255, 255, 255, 0.1); }
.thin-track i { display: block; height: 1px; background: var(--text); }

/* ============================================================
   SUEÑO
   ============================================================ */
.sleep-head-stats { gap: 26px; }
.sleep-head-stats > div { display: flex; flex-direction: column; gap: 5px; }
.sleep-head-stats strong { font-family: var(--font-display); font-size: 21px; font-weight: 300; letter-spacing: -0.04em; }
.sleep-month-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-top: 2px;
  padding: 18px 0 30px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line);
}
.sleep-big-stat { display: flex; flex-direction: column; gap: 6px; }
.sleep-big-number {
  display: flex;
  align-items: baseline;
  gap: 2px;
  font-family: var(--font-display);
  font-size: clamp(74px, 9vw, 112px);
  font-weight: 300;
  letter-spacing: -0.075em;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
}
.sleep-big-number small { margin-right: 13px; color: var(--muted); font-family: var(--font-ui); font-size: 21px; font-weight: 400; letter-spacing: 0; }
.sleep-big-number.is-empty {
  align-items: center;
  font-size: clamp(34px, 5vw, 46px);
  letter-spacing: -0.035em;
  line-height: 1.1;
  color: var(--muted);
}
.sleep-big-meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.sleep-big-meta .mono { color: var(--muted-2); }
.quality-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--positive); box-shadow: 0 0 8px rgba(185, 232, 168, 0.4); }
.sleep-hero-side {
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: 0;
  border-left: 1px solid var(--line-soft);
}
.sleep-hero-fact {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 105px;
  padding: 3px 22px 0;
  border-right: 1px solid var(--line-soft);
}
.sleep-hero-fact:last-child { border-right: 0; padding-right: 0; }
.sleep-hero-fact strong { font-family: var(--font-display); font-size: 18px; font-weight: 300; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.sleep-map-panel { margin-top: 18px; padding: 24px 26px 18px; }

.heatmap-layout {
  display: grid;
  grid-template-columns: minmax(0, 620px) minmax(200px, 260px);
  align-items: start;
  justify-content: start;
  gap: 26px;
  margin-top: 24px;
}
.heatmap-stage {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 17px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.006)),
    repeating-linear-gradient(0deg, transparent 0 29px, rgba(255, 255, 255, 0.018) 29px 30px);
}
.heatmap-stage pulso-heatmap { width: 100%; }
.heatmap-summary {
  min-width: 0;
  padding: 4px 0 0 22px;
  border-left: 1px solid var(--line-soft);
}
.heatmap-summary .eyebrow { white-space: nowrap; }
.heatmap-average { display: flex; flex-direction: column; gap: 3px; margin-top: 15px; }
.heatmap-average strong {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 300;
  letter-spacing: -0.06em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.heatmap-average span { color: var(--muted-2); font-family: var(--font-mono); font-size: 7px; letter-spacing: 0.06em; text-transform: uppercase; }
.heatmap-stat-list { display: flex; flex-direction: column; margin-top: 18px; }
.heatmap-stat-list > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid var(--line-soft);
}
.heatmap-stat-list span { color: var(--muted-2); font-family: var(--font-mono); font-size: 6.5px; letter-spacing: 0.07em; text-transform: uppercase; }
.heatmap-stat-list b { color: var(--text-soft); font-family: var(--font-mono); font-size: 9px; font-weight: 400; text-align: right; white-space: nowrap; }
.heatmap-summary .month-note { margin-top: 15px; color: var(--muted-2); font-size: 9.5px; line-height: 1.55; }
.segmented.compact { padding: 2px; }
.segmented.compact button { height: 23px; padding: 0 9px; font-size: 6.5px; }
.sleep-scale { display: flex; align-items: center; gap: 7px; color: var(--muted-2); font-family: var(--font-mono); font-size: 6.5px; letter-spacing: 0.08em; }
.sleep-scale-bar {
  display: block;
  width: 112px;
  height: 5px;
  border-radius: 9px;
  background: linear-gradient(90deg, #17201b 0%, #255c46 52%, #3f9a73 100%);
  transition: background 300ms var(--ease);
}
#sleep-scale.is-traffic .sleep-scale-bar {
  background: linear-gradient(90deg, #a23e42 0%, #b8873f 52%, #4f9a63 100%);
}
.sleep-legend p { max-width: 480px; line-height: 1.45; }

.map-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.map-head h2 { margin-top: 7px; font-family: var(--font-display); font-size: 22px; font-weight: 300; letter-spacing: -0.04em; }
.map-controls { display: flex; align-items: center; gap: 10px; }
.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
}
.segmented button {
  height: 27px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: background 240ms var(--ease), color 240ms var(--ease);
}
.segmented button.is-active { background: var(--text); color: var(--bg); }
.map-nav { display: flex; gap: 4px; }
.map-nav button {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border: 1px solid var(--line-soft);
  border-radius: 50%;
  color: var(--muted);
  transition: border-color 200ms var(--ease), color 200ms var(--ease);
}
.map-nav button:hover { border-color: var(--line-strong); color: var(--text); }
.map-nav button:disabled { opacity: 0.25; pointer-events: none; }
.map-nav svg { width: 13px; height: 13px; }
.sleep-map-layout {
  display: grid;
  grid-template-columns: minmax(0, 720px) 210px;
  align-items: start;
  justify-content: space-between;
  gap: 30px;
  margin-top: 25px;
}
.sleep-map-layout .map-stage { margin-top: 0; }
.map-summary {
  padding: 4px 0 0 22px;
  border-left: 1px solid var(--line-soft);
}
.map-summary .eyebrow { white-space: nowrap; }
.month-average { display: flex; flex-direction: column; gap: 3px; margin-top: 15px; }
.month-average strong {
  font-family: var(--font-display);
  font-size: 39px;
  font-weight: 300;
  letter-spacing: -0.055em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.month-average span { color: var(--muted-2); font-family: var(--font-mono); font-size: 7px; letter-spacing: 0.06em; text-transform: uppercase; }
.month-stat-list { display: flex; flex-direction: column; margin-top: 18px; }
.month-stat-list > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid var(--line-soft);
}
.month-stat-list span { color: var(--muted-2); font-family: var(--font-mono); font-size: 6.5px; letter-spacing: 0.07em; text-transform: uppercase; }
.month-stat-list b { color: var(--text-soft); font-family: var(--font-mono); font-size: 9px; font-weight: 400; text-align: right; white-space: nowrap; }
.month-note { margin-top: 15px; color: var(--muted-2); font-size: 9.5px; line-height: 1.55; }
.map-stage { margin-top: 25px; animation: mapIn 450ms var(--ease) both; }
@keyframes mapIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.weekday-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  padding: 0 1px 7px;
}
.weekday-row span {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.08em;
  text-align: center;
}
.sleep-calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.sleep-day {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  height: 55px;
  border-radius: 13px;
  background: transparent;
  transition: background 200ms var(--ease), transform 200ms var(--ease);
}
.sleep-day:hover { background: rgba(255, 255, 255, 0.035); transform: translateY(-1px); }
.sleep-day .sd-dot {
  position: relative;
  display: grid;
  place-items: center;
  width: 88%;
  height: 88%;
  max-width: 42px;
  max-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.16), transparent 42%),
    var(--dot-color, #27312b);
  box-shadow: inset 0 -8px 16px rgba(0, 0, 0, 0.16);
  transition: box-shadow 220ms var(--ease), transform 220ms var(--ease);
}
.sleep-day:hover .sd-dot { transform: scale(1.05); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 0 20px color-mix(in srgb, var(--dot-color) 30%, transparent); }
.sleep-day .sd-num {
  color: rgba(255, 255, 255, 0.92);
  font-family: var(--font-mono);
  font-size: clamp(8px, 1.2vw, 11px);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.sleep-day.is-light .sd-num { color: rgba(15, 16, 14, 0.82); text-shadow: none; }
.sleep-day.is-selected .sd-dot { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--text), 0 0 30px color-mix(in srgb, var(--dot-color) 35%, transparent); }
.sleep-day.is-today::after {
  content: "";
  position: absolute;
  bottom: 1px;
  left: 50%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text);
  transform: translateX(-50%);
}
.sleep-day.is-empty { pointer-events: none; }
.sleep-day.is-empty .sd-dot { background: transparent; border-color: var(--line-soft); box-shadow: none; }
.sleep-day.is-empty .sd-num { color: #353934; }
.sleep-day.is-future { opacity: 0.32; pointer-events: none; }
.sleep-day.is-future .sd-dot { background: transparent; border-style: dashed; }
.sleep-day.is-future .sd-num { color: var(--muted-2); }
.sleep-day.is-outside { opacity: 0.18; pointer-events: none; }
.sleep-day.is-outside .sd-dot { background: transparent; border-color: transparent; box-shadow: none; }
.sleep-day.is-outside .sd-num { color: var(--muted-2); }
.sleep-detail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 22px;
  padding: 13px 15px;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.018);
  animation: mapIn 300ms var(--ease) both;
}
.detail-main { display: flex; align-items: center; gap: 13px; min-width: 0; }
.detail-date { display: flex; flex-direction: column; gap: 2px; min-width: 92px; }
.detail-date strong { font-size: 11.5px; font-weight: 500; color: var(--text-soft); }
.detail-date span { color: var(--muted-2); font-family: var(--font-mono); font-size: 7.5px; letter-spacing: 0.04em; text-transform: uppercase; }
.detail-hours { font-family: var(--font-display); font-size: 22px; font-weight: 300; letter-spacing: -0.04em; white-space: nowrap; }
.detail-hours small { color: var(--muted-2); font-size: 9px; letter-spacing: 0; }
.detail-stages { display: flex; width: min(290px, 40vw); min-width: 150px; height: 5px; border-radius: 9px; overflow: hidden; }
.detail-stages i { display: block; height: 100%; }
.detail-stages .deep { background: #2f8f65; }
.detail-stages .rem { background: #79c9a0; }
.detail-stages .light { background: #375149; }
.detail-stages .awake { background: #cf7c76; }
.detail-score { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.detail-score strong { font-family: var(--font-display); font-size: 19px; font-weight: 400; }
.detail-score span { color: var(--muted-2); font-family: var(--font-mono); font-size: 7px; letter-spacing: 0.05em; text-transform: uppercase; }
.sleep-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 17px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}
.legend-scale { display: flex; align-items: center; gap: 7px; color: var(--muted-2); font-family: var(--font-mono); font-size: 6.5px; letter-spacing: 0.08em; }
.scale-bar {
  display: block;
  width: 100px;
  height: 5px;
  border-radius: 9px;
  background: linear-gradient(90deg, #0c3e2a 0%, #1d6f4c 28%, #8e8550 58%, #c77558 78%, #f2707e 100%);
}
.sleep-legend p { color: var(--muted-2); font-size: 9.5px; }
.sleep-legend .mono { color: #3f433d; font-size: 7px; }
.year-stage { margin-top: 22px; }
.year-map-head { display: flex; justify-content: space-between; color: var(--muted-2); font-family: var(--font-mono); font-size: 7.5px; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 10px; }
.year-map { display: flex; flex-direction: column; gap: 6px; }
.year-row { display: grid; grid-template-columns: 26px 1fr; align-items: center; gap: 8px; }
.year-month { color: var(--muted-2); font-family: var(--font-mono); font-size: 7px; letter-spacing: 0.02em; text-transform: uppercase; }
.year-days { display: grid; grid-template-columns: repeat(31, minmax(0, 1fr)); gap: 2px; }
.year-day {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 2px;
  background: var(--dot-color, #27312b);
  border: 0;
  transition: transform 160ms var(--ease), box-shadow 160ms var(--ease);
}
.year-day:hover { transform: scale(1.45); box-shadow: 0 0 0 1px var(--text); z-index: 2; }
.year-day.is-selected { box-shadow: 0 0 0 1px var(--text); }
.year-day.is-empty { background: transparent; pointer-events: none; }
.year-day.is-future { background: rgba(255, 255, 255, 0.035); pointer-events: none; }
.sleep-lower-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); gap: 18px; margin-top: 18px; }
.stage-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 16px; color: var(--muted); font-size: 9.5px; }
.stage-legend span { display: inline-flex; align-items: center; gap: 5px; }
.stage-row { display: grid; grid-template-columns: 44px 1fr 38px; align-items: center; gap: 10px; padding: 6px 0; }
.stage-date { color: var(--muted-2); font-family: var(--font-mono); font-size: 8.5px; text-transform: uppercase; }
.stage-bar { display: flex; height: 14px; border-radius: 5px; overflow: hidden; background: rgba(255, 255, 255, 0.04); }
.stage-bar i { height: 100%; transition: width 700ms var(--ease); }
.stage-bar .deep { background: #2f8f65; }
.stage-bar .rem { background: #79c9a0; }
.stage-bar .light { background: #375149; }
.stage-bar .awake { background: #cf7c76; }
.stage-duration { color: var(--muted-2); font-family: var(--font-mono); font-size: 8px; text-align: right; font-variant-numeric: tabular-nums; }
.insight-list { display: flex; flex-direction: column; }
.insight-row {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 9px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
}
.insight-row:last-child { border-bottom: 0; }
.insight-index { color: var(--muted-2); font-family: var(--font-mono); font-size: 8px; padding-top: 2px; }
.insight-row p { color: var(--text-soft); font-size: 12px; line-height: 1.45; }
.insight-row p b { color: var(--text); font-weight: 500; }
.insight-row small { display: block; margin-top: 3px; color: var(--muted-2); font-size: 10px; }

/* ============================================================
   HÁBITOS
   ============================================================ */
.habit-overview {
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) 1.18fr;
  align-items: center;
  gap: 30px;
  padding: 23px 0 27px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line);
}
.habit-overview-main { display: flex; align-items: center; gap: 26px; }
.habit-day-score { display: flex; flex-direction: column; gap: 4px; }
.big-fraction {
  display: flex;
  align-items: baseline;
  gap: 2px;
  font-family: var(--font-display);
  font-size: clamp(64px, 8vw, 91px);
  font-weight: 300;
  letter-spacing: -0.08em;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
}
.big-fraction small { margin: 0 3px; color: var(--muted-2); font-family: var(--font-mono); font-size: 18px; font-weight: 400; letter-spacing: 0; }
.big-fraction span:last-child { color: var(--muted); }
.habit-day-score p { max-width: 170px; margin-top: 7px; color: var(--muted); font-size: 10.5px; line-height: 1.45; }
.day-progress-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 104px;
  height: 104px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: conic-gradient(var(--text) calc(var(--p) * 1%), rgba(255, 255, 255, 0.07) 0);
}
.day-progress-ring::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: var(--bg);
}
.day-progress-ring span {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 300;
  letter-spacing: -0.04em;
}
.day-progress-ring small {
  position: absolute;
  z-index: 1;
  bottom: 27px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 6px;
  letter-spacing: 0.08em;
}
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.week-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 8px 3px 7px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: var(--muted);
  transition: background 220ms var(--ease), border-color 220ms var(--ease), color 220ms var(--ease);
}
.week-day:hover { background: rgba(255, 255, 255, 0.035); color: var(--text-soft); }
.week-day.is-selected { border-color: var(--line); background: rgba(255, 255, 255, 0.045); color: var(--text); }
.week-day.is-today .week-num { color: var(--text); }
.week-label { font-family: var(--font-mono); font-size: 6.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-2); }
.week-num { font-family: var(--font-display); font-size: 16px; font-weight: 300; letter-spacing: -0.03em; line-height: 1; }
.week-meter { width: 18px; height: 2px; border-radius: 3px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.week-meter i { display: block; height: 100%; background: var(--text); border-radius: inherit; }
.week-pct { color: var(--muted-2); font-family: var(--font-mono); font-size: 6px; }
.habits-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr); gap: 18px; margin-top: 18px; align-items: start; }
.habit-list.full .habit-row { grid-template-columns: 33px 33px minmax(0, 1fr) auto; min-height: 61px; gap: 13px; }
.habit-list.full .habit-check { width: 31px; height: 31px; }
.habit-list.full .habit-icon { width: 31px; height: 31px; }
.habit-list.full .habit-name { font-size: 13.5px; }
.habit-list.full .habit-meta { gap: 15px; }
.habit-list.full .habit-week i { width: 5px; height: 5px; }
.habit-list.full .habit-menu { opacity: 0.6; }
.habits-side { display: flex; flex-direction: column; gap: 18px; }
.consistency-map {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(7, 1fr);
  grid-auto-flow: column;
  gap: 4px;
  margin-top: 5px;
}
.consistency-day {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.055);
  transition: transform 150ms var(--ease), box-shadow 150ms var(--ease);
}
.consistency-day:hover { transform: scale(1.28); box-shadow: 0 0 0 1px var(--text); z-index: 2; }
.consistency-legend { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 12px; color: var(--muted-2); font-family: var(--font-mono); font-size: 6.5px; letter-spacing: 0.06em; }
.consistency-legend i { width: 9px; height: 9px; border-radius: 2px; background: rgba(255, 255, 255, 0.07); }
.consistency-legend .l2 { background: rgba(255, 255, 255, 0.22); }
.consistency-legend .l3 { background: rgba(255, 255, 255, 0.48); }
.consistency-legend .l4 { background: var(--text); }
.consistency-panel .panel-footer { justify-content: space-between; }
.habit-legend-panel .fine-copy { max-width: 330px; }
.habit-legend-panel .eyebrow { margin-bottom: 10px; }

/* ============================================================
   CUERPO
   ============================================================ */
.vitals-hero {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 27px 48px;
  padding: 24px 0 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line);
}
.vital-main { display: flex; flex-direction: column; gap: 9px; padding-bottom: 25px; }
.vital-number { display: flex; align-items: baseline; gap: 9px; }
.vital-number strong {
  font-family: var(--font-display);
  font-size: clamp(76px, 9vw, 104px);
  font-weight: 300;
  letter-spacing: -0.08em;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
}
.vital-number span { color: var(--muted-2); font-family: var(--font-mono); font-size: 10px; }
.vital-delta { color: var(--muted); font-size: 10px; }
.vital-delta .positive { margin-right: 5px; font-family: var(--font-mono); font-size: 8px; }
.vital-side { display: grid; grid-template-columns: repeat(4, 1fr); align-self: center; }
.vital-cell { display: flex; flex-direction: column; gap: 4px; padding: 4px 20px; border-left: 1px solid var(--line-soft); }
.vital-cell:first-child { border-left: 0; }
.vital-cell strong { font-family: var(--font-display); font-size: 24px; font-weight: 300; letter-spacing: -0.045em; font-variant-numeric: tabular-nums; }
.vital-cell strong small { margin-left: 3px; color: var(--muted-2); font-family: var(--font-mono); font-size: 6.5px; letter-spacing: 0; }
.vital-cell > span:last-child { color: var(--muted-2); font-family: var(--font-mono); font-size: 7.5px; }
.vitals-chart { grid-column: 1 / -1; margin: 0 -38px; padding: 16px 38px 14px; border-top: 1px solid var(--line-soft); }
.vitals-chart .hr-chart { height: 115px; }
.vitals-chart .chart-axis { margin-top: 2px; }
.body-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr); gap: 18px; margin-top: 18px; }
.steps-headline { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.steps-headline > div { display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; }
.steps-headline .eyebrow { width: 100%; }
.steps-headline strong { font-family: var(--font-display); font-size: 37px; font-weight: 300; letter-spacing: -0.06em; line-height: 1; font-variant-numeric: tabular-nums; }
.steps-headline span:not(.eyebrow):not(.delta) { color: var(--muted-2); font-family: var(--font-mono); font-size: 8px; }
.steps-headline .delta { color: var(--muted); font-family: var(--font-mono); font-size: 8px; }
.steps-chart {
  --goal-line: 66.6%;
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 9px;
  height: 122px;
  margin-top: 18px;
  padding-top: 8px;
}
.steps-chart::after {
  content: "META";
  position: absolute;
  right: 0;
  bottom: var(--goal-line);
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 6px;
  letter-spacing: 0.08em;
  background: var(--bg);
  padding-left: 4px;
}
.steps-chart::before {
  content: "";
  position: absolute;
  top: calc(100% - var(--goal-line));
  right: 0;
  left: 0;
  border-top: 1px dashed rgba(255, 255, 255, 0.15);
}
.step-col { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: flex-end; gap: 5px; height: 100%; min-width: 0; }
.step-col i {
  width: 100%;
  max-width: 23px;
  min-height: 2px;
  border-radius: 4px 4px 2px 2px;
  background: rgba(255, 255, 255, 0.16);
  animation: barIn 800ms var(--ease) both;
  animation-delay: calc(var(--i, 0) * 55ms);
}
.step-col.is-today i { background: var(--text); box-shadow: 0 0 18px rgba(255, 255, 255, 0.12); }
.step-col span { color: var(--muted-2); font-family: var(--font-mono); font-size: 7px; text-transform: uppercase; }
.step-col.is-today span { color: var(--text); }
.recovery-list { display: flex; flex-direction: column; gap: 11px; padding-top: 2px; }
.recovery-row { display: grid; grid-template-columns: 74px 1fr 26px; align-items: center; gap: 10px; }
.recovery-row > span { color: var(--muted); font-size: 10px; }
.recovery-row b { color: var(--text-soft); font-family: var(--font-mono); font-size: 8.5px; font-weight: 400; text-align: right; }
.mini-track { height: 3px; border-radius: 4px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.mini-track i { display: block; height: 100%; background: linear-gradient(90deg, #767c73, var(--text)); border-radius: inherit; }
.recovery-note { display: flex; gap: 8px; margin-top: 16px; padding-top: 13px; border-top: 1px solid var(--line-soft); }
.recovery-note svg { width: 13px; height: 13px; flex: 0 0 auto; margin-top: 2px; color: var(--muted); }
.recovery-note p { color: var(--muted-2); font-size: 9.5px; line-height: 1.5; }

/* nutrition full */
.nutrition-full {
  margin-top: 18px;
  padding: 25px 26px 20px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background:
    radial-gradient(700px 250px at 15% 0%, rgba(255, 255, 255, 0.045), transparent 65%),
    linear-gradient(150deg, rgba(255, 255, 255, 0.034), rgba(255, 255, 255, 0.011));
}
.nutrition-full .section-head { margin-bottom: 18px; }
.nutrition-full-grid { display: grid; grid-template-columns: minmax(240px, 0.72fr) minmax(0, 1.28fr); gap: 35px; }
.nutrition-full-left { display: flex; flex-direction: column; }
.kcal-big { display: flex; align-items: baseline; gap: 7px; margin-top: 5px; }
.kcal-big strong { font-family: var(--font-display); font-size: clamp(52px, 6vw, 73px); font-weight: 300; letter-spacing: -0.07em; line-height: 0.92; font-variant-numeric: tabular-nums; }
.kcal-big span { color: var(--muted-2); font-family: var(--font-mono); font-size: 8px; }
.kcal-sub { margin-top: 4px; color: var(--muted); font-size: 10.5px; }
.kcal-sub b { color: var(--text-soft); font-weight: 500; }
.nutrition-full-left .budget-bar { margin-top: 19px; }
.nutrition-full-left .macros { margin-top: 20px; gap: 18px; }
.nutrition-full-left .macro-track { height: 3px; }
.meal-list { display: flex; flex-direction: column; }
.meal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.meal-head .mono { color: var(--muted-2); font-size: 7px; }
.nutrition-right { min-width: 0; }
.meal-row {
  display: grid;
  grid-template-columns: 37px minmax(0, 1fr) auto 22px;
  align-items: center;
  gap: 11px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}
.meal-row:last-child { border-bottom: 0; }
.meal-icon { display: grid; place-items: center; width: 33px; height: 33px; border: 1px solid var(--line-soft); border-radius: 9px; color: var(--muted); background: rgba(255, 255, 255, 0.02); }
.meal-icon svg { width: 14px; height: 14px; }
.meal-copy { min-width: 0; }
.meal-copy strong { display: block; overflow: hidden; color: var(--text-soft); font-size: 11.5px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.meal-copy span { display: block; overflow: hidden; color: var(--muted-2); font-family: var(--font-mono); font-size: 7px; letter-spacing: 0.03em; text-transform: uppercase; margin-top: 1px; text-overflow: ellipsis; white-space: nowrap; }
.meal-kcal { color: var(--text-soft); font-family: var(--font-mono); font-size: 10px; text-align: right; }
.meal-kcal span { display: block; color: var(--muted-2); font-size: 6.5px; }
.meal-remove { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: var(--muted-2); opacity: 0.55; transition: color 180ms var(--ease), background 180ms var(--ease), opacity 180ms var(--ease); }
.meal-remove:hover { color: var(--negative); background: rgba(255, 155, 155, 0.08); opacity: 1; }
.meal-remove svg { width: 11px; height: 11px; }
.meal-actions { display: flex; align-items: center; gap: 8px; margin-top: 9px; }
.meal-actions .text-link { margin-top: 0; }
.yazio-strip {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 15px;
  margin-top: 21px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}
.yazio-mark { display: inline-flex; align-items: center; gap: 6px; color: var(--text-soft); font-family: var(--font-display); font-size: 12px; font-weight: 500; letter-spacing: 0.02em; }
.yazio-mark i { width: 6px; height: 6px; border-radius: 50%; background: #d6b77a; }
.yazio-strip p { color: var(--muted-2); font-size: 9.5px; line-height: 1.4; }
.yazio-state { color: var(--muted-2); font-family: var(--font-mono); font-size: 7px; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }

/* ============================================================
   METAS
   ============================================================ */
.goal-overview {
  display: grid;
  grid-template-columns: 220px 1fr 190px;
  align-items: center;
  gap: 35px;
  padding: 23px 0 27px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line);
}
.goal-overview-score { display: flex; flex-direction: column; gap: 5px; }
.goal-overview-score > strong { font-family: var(--font-display); font-size: clamp(58px, 7vw, 78px); font-weight: 300; letter-spacing: -0.08em; line-height: 0.9; font-variant-numeric: tabular-nums; }
.goal-overview-score > strong span { color: var(--muted-2); font-family: var(--font-mono); font-size: 12px; font-weight: 400; letter-spacing: 0; }
.goal-overview-score p { color: var(--muted-2); font-size: 9.5px; }
.goal-overview-bars { display: flex; flex-direction: column; gap: 11px; }
.goal-overview-bar { display: grid; grid-template-columns: 95px 1fr 66px; align-items: center; gap: 12px; }
.goal-overview-bar span { color: var(--muted); font-size: 10px; }
.goal-overview-bar i { height: 2px; background: rgba(255, 255, 255, 0.09); }
.goal-overview-bar i b { display: block; height: 100%; background: var(--text); }
.goal-overview-bar em { color: var(--muted-2); font-family: var(--font-mono); font-size: 8px; font-style: normal; text-align: right; white-space: nowrap; }
.goal-overview-side { display: flex; flex-direction: column; align-items: flex-start; gap: 9px; padding-left: 22px; border-left: 1px solid var(--line-soft); }
.goal-overview-side p { color: var(--muted-2); font-size: 9px; line-height: 1.5; }
.goals-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.7fr); gap: 18px; margin-top: 18px; align-items: start; }
.goals-list { display: flex; flex-direction: column; gap: 12px; }
.goal-card {
  position: relative;
  padding: 21px 22px 18px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.032), rgba(255, 255, 255, 0.01));
  transition: border-color 250ms var(--ease), transform 250ms var(--ease);
}
.goal-card:hover { border-color: var(--line); transform: translateY(-1px); }
.goal-card.featured {
  background:
    radial-gradient(600px 180px at 15% 0%, rgba(255, 255, 255, 0.05), transparent 65%),
    linear-gradient(150deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
  padding: 25px 24px 20px;
}
.goal-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.goal-card-title { display: flex; gap: 12px; align-items: flex-start; }
.goal-icon { display: grid; place-items: center; width: 31px; height: 31px; flex: 0 0 auto; border: 1px solid var(--line-soft); border-radius: 50%; color: var(--muted); }
.goal-icon svg { width: 14px; height: 14px; }
.goal-card h3 { font-family: var(--font-display); font-size: 17px; font-weight: 400; letter-spacing: -0.025em; line-height: 1.2; }
.goal-card .goal-sub { margin-top: 4px; color: var(--muted-2); font-size: 9.5px; }
.goal-pct { font-family: var(--font-display); font-size: 21px; font-weight: 300; letter-spacing: -0.04em; color: var(--text-soft); white-space: nowrap; }
.goal-pct span { color: var(--muted-2); font-family: var(--font-mono); font-size: 7px; letter-spacing: 0; }
.goal-progress { display: flex; align-items: center; gap: 10px; margin-top: 17px; }
.goal-progress-track { flex: 1; height: 2px; background: rgba(255, 255, 255, 0.09); }
.goal-progress-track i { display: block; height: 100%; background: var(--text); }
.goal-progress-value { color: var(--muted); font-family: var(--font-mono); font-size: 8px; white-space: nowrap; }
.goal-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; color: var(--muted-2); font-size: 9px; }
.goal-card-footer .tag { border-color: transparent; padding-left: 0; }
.goal-card-actions { display: flex; gap: 4px; }
.goal-card-actions button { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; color: var(--muted-2); transition: color 180ms var(--ease), background 180ms var(--ease); }
.goal-card-actions button:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.goal-card-actions svg { width: 12px; height: 12px; }
.goals-side { display: flex; flex-direction: column; gap: 18px; }
.review-panel .fine-copy { margin-bottom: 16px; }
.review-checklist { display: flex; flex-direction: column; }
.review-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 0;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 10.5px;
  text-align: left;
}
.review-item span { display: grid; place-items: center; width: 17px; height: 17px; flex: 0 0 auto; border: 1px solid var(--line-strong); border-radius: 50%; }
.review-item span svg { width: 9px; height: 9px; opacity: 0; }
.review-item.is-done { color: var(--text-soft); }
.review-item.is-done span { background: var(--text); border-color: var(--text); color: var(--bg); }
.review-item.is-done span svg { opacity: 1; }
.goal-quote {
  position: relative;
  padding: 22px 21px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.026), transparent);
}
.goal-quote > .eyebrow { margin-bottom: 8px; }
.rule-row {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--line-soft);
}
.rule-row span {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 7.5px;
  padding-top: 3px;
}
.rule-row p {
  color: var(--text-soft);
  font-size: 11.5px;
  line-height: 1.45;
}

/* ============================================================
   SHEET / FORMS / TOAST
   ============================================================ */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.66);
  backdrop-filter: blur(9px);
  animation: fadeIn 280ms var(--ease) both;
}
.sheet {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 201;
  width: min(570px, 100%);
  max-height: min(88dvh, 760px);
  margin: 0 auto;
  padding: 9px 25px calc(25px + env(safe-area-inset-bottom));
  overflow: auto;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 25px 25px 0 0;
  background:
    radial-gradient(500px 250px at 15% 0%, rgba(255, 255, 255, 0.055), transparent 65%),
    #0a0c0b;
  box-shadow: 0 -30px 90px rgba(0, 0, 0, 0.55);
  animation: sheetUp 420ms var(--ease) both;
}
@keyframes sheetUp { from { transform: translateY(24px); opacity: 0.7; } to { transform: translateY(0); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.sheet-grab { width: 35px; height: 3px; margin: 0 auto 18px; border-radius: 4px; background: rgba(255, 255, 255, 0.17); }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding-bottom: 19px; border-bottom: 1px solid var(--line-soft); }
.sheet-head h2 { margin-top: 6px; font-family: var(--font-display); font-size: 25px; font-weight: 300; letter-spacing: -0.04em; }
.sheet-close { width: 32px; height: 32px; }
.sheet-close:hover { transform: rotate(90deg); }
.sheet-body { padding-top: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label, .field-label { color: var(--muted); font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.08em; text-transform: uppercase; }
.field input, .field select {
  width: 100%;
  height: 43px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: 0;
  background: rgba(255, 255, 255, 0.028);
  color: var(--text);
  font-size: 13px;
  transition: border-color 200ms var(--ease), background 200ms var(--ease);
}
.field input:focus, .field select:focus { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.045); }
.field input::placeholder { color: #494d47; }
.field-hint { color: var(--muted-2); font-size: 9px; line-height: 1.4; }
.form-actions { display: flex; gap: 9px; margin-top: 21px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 43px;
  padding: 0 17px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 500;
  transition: background 200ms var(--ease), color 200ms var(--ease), border-color 200ms var(--ease);
}
.btn:hover { border-color: var(--line-strong); color: var(--text); }
.btn.primary { background: var(--text); border-color: var(--text); color: var(--bg); }
.btn.primary:hover { background: #fffef8; }
.btn.danger { color: var(--negative); border-color: rgba(255, 155, 155, 0.22); }
.btn.danger:hover { background: rgba(255, 155, 155, 0.08); }
.btn.flex { flex: 1; }
.btn svg { width: 14px; height: 14px; }
.icon-choices { display: flex; flex-wrap: wrap; gap: 7px; }
.icon-choice { position: relative; }
.icon-choice input { position: absolute; opacity: 0; pointer-events: none; }
.icon-choice span {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 180ms var(--ease), color 180ms var(--ease), background 180ms var(--ease);
}
.icon-choice span svg { width: 16px; height: 16px; }
.icon-choice input:checked + span { border-color: var(--text); background: var(--text); color: var(--bg); }
.color-choices { display: flex; gap: 8px; }
.color-choice { position: relative; }
.color-choice input { position: absolute; opacity: 0; pointer-events: none; }
.color-choice span { display: block; width: 25px; height: 25px; border: 2px solid transparent; border-radius: 50%; background: var(--swatch); cursor: pointer; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12) inset; transition: border-color 180ms var(--ease), transform 180ms var(--ease); }
.color-choice input:checked + span { border-color: var(--bg); box-shadow: 0 0 0 2px var(--text); transform: scale(1.06); }
.sheet-note {
  display: flex;
  gap: 9px;
  margin-top: 18px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.018);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}
.sheet-note svg { width: 14px; height: 14px; flex: 0 0 auto; margin-top: 1px; color: var(--muted-2); }
.settings-section { padding: 17px 0; border-bottom: 1px solid var(--line-soft); }
.settings-section:first-child { padding-top: 0; }
.settings-section:last-child { border-bottom: 0; padding-bottom: 0; }
.settings-title { margin-bottom: 13px; color: var(--muted); font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.1em; text-transform: uppercase; }
.connection-row {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 0;
  border-top: 1px solid var(--line-soft);
  color: inherit;
  text-align: left;
}
.connection-row:first-of-type { border-top: 0; }
.connection-icon { display: grid; place-items: center; width: 31px; height: 31px; border: 1px solid var(--line-soft); border-radius: 9px; color: var(--muted); }
.connection-icon svg { width: 15px; height: 15px; }
.connection-copy { flex: 1; min-width: 0; }
.connection-copy strong { display: block; font-size: 11.5px; font-weight: 500; }
.connection-copy small { display: block; color: var(--muted-2); font-size: 9px; }
.connection-state { font-family: var(--font-mono); font-size: 7px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-2); border: 1px solid var(--line-soft); border-radius: 4px; padding: 3px 5px; }
.settings-link { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 11px 0; border-top: 1px solid var(--line-soft); color: var(--text-soft); font-size: 11px; text-align: left; }
.settings-link:first-of-type { border-top: 0; }
.settings-link span { display: flex; align-items: center; gap: 8px; }
.settings-link svg { width: 13px; height: 13px; color: var(--muted); }
.settings-link:hover { color: var(--text); }
.settings-footer { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.disclaimer { margin-top: 17px; color: #464a44; font-size: 8.5px; line-height: 1.55; }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.quick-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 13px;
  min-height: 100px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.022);
  text-align: left;
  transition: border-color 200ms var(--ease), background 200ms var(--ease), transform 200ms var(--ease);
}
.quick-card:hover { border-color: var(--line); background: rgba(255, 255, 255, 0.04); transform: translateY(-2px); }
.quick-card svg { width: 18px; height: 18px; color: var(--muted); }
.quick-card strong { display: block; font-size: 12px; font-weight: 500; }
.quick-card small { display: block; margin-top: 2px; color: var(--muted-2); font-size: 9px; }
.toast-region {
  position: fixed;
  right: 0;
  bottom: 26px;
  left: 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  padding: 0 18px;
}
.toast {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 92vw;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(16, 18, 16, 0.94);
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.45);
  color: var(--text-soft);
  font-size: 11px;
  backdrop-filter: blur(12px);
  animation: toastIn 350ms var(--ease) both;
}
.toast.is-out { animation: toastOut 260ms var(--ease) both; }
.toast i { width: 5px; height: 5px; border-radius: 50%; background: var(--positive); }
@keyframes toastIn { from { opacity: 0; transform: translateY(9px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px) scale(0.98); } }
.chart-tip {
  position: fixed;
  z-index: 180;
  pointer-events: none;
  padding: 7px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: rgba(12, 14, 12, 0.96);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transform: translate(-50%, -115%);
}
.chart-tip b { font-weight: 500; }
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 35px 15px;
  color: var(--muted-2);
  text-align: center;
}
.empty-state strong { color: var(--text-soft); font-family: var(--font-display); font-size: 18px; font-weight: 300; }
.empty-state p { max-width: 260px; font-size: 11px; line-height: 1.5; }

.sleep-empty-state {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  padding: 8px 0 12px;
}
.sleep-empty-state strong {
  font-family: var(--font-display);
  font-size: clamp(36px, 9vw, 44px);
  font-weight: 300;
  letter-spacing: -0.055em;
  line-height: 1;
}
.sleep-empty-state p {
  max-width: 380px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
}
.sleep-empty-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 7px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.sleep-empty-meta b { color: var(--text-soft); font-weight: 400; }
.data-empty-banner {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-top: 22px;
  padding: 15px 16px;
  border: 1px solid rgba(229, 193, 116, 0.22);
  border-radius: 13px;
  background: rgba(229, 193, 116, 0.045);
}
.data-empty-icon {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  border: 1px solid rgba(229, 193, 116, 0.2);
  border-radius: 50%;
  color: var(--warn);
}
.data-empty-icon svg { width: 14px; height: 14px; }
.data-empty-banner strong { display: block; color: var(--text-soft); font-size: 11.5px; font-weight: 500; }
.data-empty-banner p { max-width: 600px; margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.chart-empty {
  display: grid;
  place-items: center;
  min-height: 76px;
  margin-top: 10px;
  padding: 14px;
  border: 1px dashed var(--line-soft);
  border-radius: 10px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.04em;
  text-align: center;
}
.step-col.is-missing i {
  height: 4px !important;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  background: transparent;
  box-shadow: none;
}
.step-col.is-missing span { color: #3f433d; }

/* ============================================================
   HEATMAP REUTILIZABLE
   ============================================================ */
pulso-heatmap {
  --hm-cell: 12px;
  --hm-gap: 3px;
  display: block;
  min-width: 0;
}
.hm-month-view { display: flex; flex-direction: column; gap: 7px; max-width: 560px; }
.hm-month-head {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}
.hm-month-head span {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.08em;
  text-align: center;
}
.hm-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}
.hm-cell {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-width: 0;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: transparent;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  transition: transform 180ms var(--ease), border-color 180ms var(--ease), background 180ms var(--ease), outline-color 180ms var(--ease);
}
.hm-cell:hover { transform: translateY(-1px); border-color: var(--line-strong); }
.hm-cell.has-data {
  border-color: color-mix(in srgb, var(--hm-color) 60%, transparent);
  background: var(--hm-color);
  color: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 -12px 22px rgba(0, 0, 0, 0.16);
}
.hm-cell.has-data:hover { box-shadow: inset 0 -12px 22px rgba(0, 0, 0, 0.12), 0 0 18px color-mix(in srgb, var(--hm-color) 24%, transparent); }
.hm-cell.has-data.is-light { color: rgba(8, 10, 9, 0.82); }
.hm-cell.is-empty { background: rgba(255, 255, 255, 0.012); }
.hm-cell.is-future { opacity: 0.28; border-style: dashed; pointer-events: none; }
.hm-cell.is-outside { border-color: transparent; background: transparent; pointer-events: none; }
.hm-cell.is-selected { outline: 1px solid var(--text); outline-offset: 2px; z-index: 2; }
.hm-cell.is-selected::after {
  content: "";
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text);
}

pulso-heatmap.is-year {
  --hm-cell: 11px;
  --hm-gap: 3px;
}
.hm-year-view {
  display: grid;
  grid-template-columns: 15px minmax(0, 1fr);
  gap: 7px;
  min-width: 0;
}
.hm-weekdays {
  display: grid;
  grid-template-rows: repeat(7, var(--hm-cell));
  gap: var(--hm-gap);
  padding-top: 18px;
}
.hm-weekdays span {
  align-self: center;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 6px;
  line-height: 1;
  text-align: right;
}
.hm-scroll {
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: #252a26 transparent;
  padding-bottom: 4px;
}
.hm-canvas { min-width: max-content; }
.hm-months {
  display: grid;
  gap: var(--hm-gap);
  height: 14px;
  margin-bottom: 4px;
}
.hm-months span {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 6px;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.hm-weeks { display: flex; gap: var(--hm-gap); }
.hm-week { display: flex; flex-direction: column; gap: var(--hm-gap); }
pulso-heatmap.is-year .hm-cell {
  width: var(--hm-cell);
  height: var(--hm-cell);
  aspect-ratio: auto;
  border-width: 1px;
  border-radius: 2px;
  font-size: 0;
}
pulso-heatmap.is-year .hm-cell.is-selected { outline-offset: 1px; }
pulso-heatmap.is-year .hm-cell.is-selected::after { display: none; }

/* ============================================================
   FINANZAS
   ============================================================ */
.finance-month-rail { display: flex; gap: 6px; margin: -3px 0 14px; overflow-x: auto; scrollbar-width: none; }
.finance-month-rail::-webkit-scrollbar { display: none; }
.finance-month {
  display: flex; align-items: baseline; gap: 4px; flex: 0 0 auto; height: 31px; padding: 0 11px;
  border: 1px solid var(--line-soft); border-radius: 999px; color: var(--muted);
  font-family: var(--font-mono); font-size: 7.5px; letter-spacing: 0.06em;
  transition: background 200ms var(--ease), color 200ms var(--ease), border-color 200ms var(--ease);
}
.finance-month small { color: var(--muted-2); font-size: 6px; }
.finance-month.is-active { border-color: var(--text); background: var(--text); color: var(--bg); }
.finance-month.is-active small { color: rgba(5, 6, 6, 0.55); }
.finance-hero {
  position: relative; overflow: hidden; padding: 23px 25px 17px; border: 1px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(620px 230px at 12% 0%, rgba(201, 226, 101, 0.055), transparent 65%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.042), rgba(255, 255, 255, 0.01) 62%, rgba(255, 255, 255, 0.022));
}
.finance-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 0.55px, transparent 0.55px);
  background-size: 5px 5px; opacity: 0.11;
  -webkit-mask-image: linear-gradient(115deg, transparent 10%, #000 70%);
  mask-image: linear-gradient(115deg, transparent 10%, #000 70%);
}
.finance-hero-main {
  position: relative; z-index: 1; display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(180px, 0.7fr) auto;
  align-items: center; gap: 30px;
}
.finance-net strong {
  display: block; margin-top: 8px; color: var(--text); font-family: var(--font-display);
  font-size: clamp(38px, 4.5vw, 58px); font-weight: 380; letter-spacing: -0.065em;
  line-height: 0.95; font-variant-numeric: tabular-nums;
}
.finance-net strong.is-negative { color: var(--negative); }
.finance-net p { margin-top: 8px; color: var(--muted); font-size: 10px; }
.finance-flow { display: flex; flex-direction: column; gap: 6px; padding-top: 1px; }
.finance-flow-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; color: var(--muted-2); font-family: var(--font-mono); font-size: 6.5px; letter-spacing: 0.08em; text-transform: uppercase; }
.finance-flow-row b { color: var(--text-soft); font-family: var(--font-mono); font-size: 10px; font-weight: 400; letter-spacing: 0; }
.finance-flow-track { display: grid; gap: 3px; }
.finance-flow-track i { display: block; height: 3px; border-radius: 3px; transition: width 900ms var(--ease); }
.finance-flow-track .income { background: #a8c97f; }
.finance-flow-track .expense { background: #d9876f; }
.finance-ring {
  --pct: 0; --ring-color: #a8c97f; position: relative; display: grid; place-items: center;
  width: 94px; height: 94px; border-radius: 50%; flex: 0 0 auto;
  background: conic-gradient(var(--ring-color) calc(var(--pct) * 1%), #222822 0);
}
.finance-ring::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: #0b0d0c; }
.finance-ring.is-warn { --ring-color: var(--warn); }
.finance-ring.is-over { --ring-color: var(--negative); }
.finance-ring > div { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.finance-ring strong { font-family: var(--font-display); font-size: 21px; font-weight: 400; letter-spacing: -0.04em; }
.finance-ring small { color: var(--muted-2); font-family: var(--font-mono); font-size: 5.5px; letter-spacing: 0.07em; }
.finance-stack { position: relative; z-index: 1; display: flex; gap: 3px; height: 9px; margin-top: 22px; border-radius: 6px; overflow: hidden; }
.finance-stack i { display: block; min-width: 2px; background: var(--category); transition: width 800ms var(--ease); }
.finance-stack-legend { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px 17px; margin-top: 9px; }
.finance-stack-legend span { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-family: var(--font-mono); font-size: 6.5px; letter-spacing: 0.04em; text-transform: uppercase; }
.finance-stack-legend i, .finance-category-dot { width: 5px; height: 5px; flex: 0 0 auto; border-radius: 50%; background: var(--category); }
.finance-stack-legend b { color: var(--text-soft); font-weight: 400; }
.finance-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(340px, 0.88fr); gap: 18px; margin-top: 18px; }
.finance-category-panel, .finance-year-panel { min-width: 0; padding: 22px 23px 17px; }
.finance-category-panel .section-head, .finance-year-panel .section-head { margin-bottom: 9px; }
.finance-categories { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.finance-category { min-width: 0; padding: 11px 0 9px; border-top: 1px solid var(--line-soft); }
.finance-category.is-empty { opacity: 0.42; }
.finance-category-head { display: flex; align-items: center; gap: 7px; min-width: 0; }
.finance-category-head strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-soft); font-size: 10.5px; font-weight: 500; }
.finance-category-amount { margin-left: auto; color: var(--text-soft); font-family: var(--font-mono); font-size: 9px; font-variant-numeric: tabular-nums; }
.finance-category-bar { height: 2px; margin: 8px 0 6px 12px; background: var(--line-soft); overflow: hidden; }
.finance-category-bar i { display: block; height: 100%; background: var(--category); transition: width 800ms var(--ease); }
.finance-category-meta { display: flex; justify-content: space-between; gap: 8px; padding-left: 12px; color: var(--muted-2); font-family: var(--font-mono); font-size: 6px; letter-spacing: 0.03em; text-transform: uppercase; }
.finance-category-meta b { color: var(--muted); font-weight: 400; }
.finance-category.is-over .finance-category-meta b { color: var(--negative); }
.finance-year-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 12px 0 15px; border-top: 1px solid var(--line-soft); }
.finance-year-totals div { min-width: 0; }
.finance-year-totals span { display: block; color: var(--muted-2); font-family: var(--font-mono); font-size: 6px; letter-spacing: 0.07em; text-transform: uppercase; }
.finance-year-totals strong { display: block; margin-top: 5px; color: var(--text-soft); font-family: var(--font-display); font-size: 18px; font-weight: 400; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.finance-year-chart { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: end; gap: 5px; height: 122px; padding-top: 8px; border-bottom: 1px solid var(--line-soft); }
.finance-year-month { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.finance-year-bars { display: flex; align-items: flex-end; justify-content: center; gap: 2px; width: 100%; height: 94px; }
.finance-year-bars i { display: block; width: 4px; min-height: 2px; border-radius: 2px 2px 0 0; opacity: 0.35; transition: height 700ms var(--ease), opacity 200ms var(--ease); }
.finance-year-bars .income { background: #a8c97f; }
.finance-year-bars .expense { background: #d9876f; }
.finance-year-month.has-data .finance-year-bars i { opacity: 1; }
.finance-year-month span { color: var(--muted-2); font-family: var(--font-mono); font-size: 5.5px; letter-spacing: 0.03em; }
.finance-year-month.has-data span { color: var(--muted); }
.finance-year-legend { display: flex; align-items: center; gap: 13px; margin-top: 10px; color: var(--muted-2); font-family: var(--font-mono); font-size: 6.5px; letter-spacing: 0.04em; text-transform: uppercase; }
.finance-year-legend span { display: inline-flex; align-items: center; gap: 5px; }
.finance-year-legend i { width: 5px; height: 5px; border-radius: 50%; }
.finance-year-legend .income { background: #a8c97f; }
.finance-year-legend .expense { background: #d9876f; }
.finance-year-legend .mono { margin-left: auto; }
.finance-ledger { margin-top: 18px; padding: 22px 23px 9px; }
.finance-ledger-list { display: flex; flex-direction: column; }
.finance-ledger-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line-soft); }
.finance-ledger-date { color: var(--muted-2); font-family: var(--font-mono); font-size: 7px; letter-spacing: 0.03em; text-transform: uppercase; }
.finance-ledger-copy { min-width: 0; }
.finance-ledger-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-soft); font-size: 10.5px; font-weight: 500; }
.finance-ledger-copy small { display: block; margin-top: 2px; color: var(--muted-2); font-family: var(--font-mono); font-size: 6.5px; letter-spacing: 0.03em; text-transform: uppercase; }
.finance-ledger-amount { color: var(--text-soft); font-family: var(--font-mono); font-size: 9.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.finance-empty { padding: 22px 0; color: var(--muted); font-size: 10px; }
.finance-source-note { margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line-soft); color: var(--muted-2); font-size: 8.5px; line-height: 1.5; }

/* ============================================================
   ENTRENO
   ============================================================ */
.training-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 20px;
  margin: 0 0 16px;
  padding: 14px 17px;
  border: 1px solid var(--line-soft);
  border-radius: 15px;
  background: linear-gradient(135deg, rgba(168, 201, 127, 0.035), rgba(255, 255, 255, 0.008));
}
.training-strip-lead { min-width: 0; }
.training-strip-lead .eyebrow { display: flex; align-items: center; gap: 7px; }
.training-strip-lead strong { display: block; margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-soft); font-size: 13px; font-weight: 500; }
.training-strip-lead small { display: block; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-family: var(--font-mono); font-size: 7px; }
.training-strip-stats { display: flex; gap: 24px; }
.training-strip-stats span { display: block; color: var(--muted-2); font-family: var(--font-mono); font-size: 6px; letter-spacing: 0.06em; text-transform: uppercase; }
.training-strip-stats b { display: block; margin-top: 3px; color: var(--text-soft); font-family: var(--font-display); font-size: 17px; font-weight: 400; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.training-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 26px;
  padding: 24px 26px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(600px 220px at 15% 0%, rgba(168, 201, 127, 0.045), transparent 65%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.008));
}
.training-hero-main strong {
  display: block; margin-top: 7px; color: var(--text); font-family: var(--font-display);
  font-size: clamp(40px, 5vw, 58px); font-weight: 380; letter-spacing: -0.06em; line-height: 0.95;
}
.training-hero-main p { margin-top: 8px; color: var(--muted); font-size: 10px; }
.training-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-left: 1px solid var(--line-soft); }
.training-stats div { min-width: 0; padding: 9px 0 9px 20px; border-bottom: 1px solid var(--line-soft); }
.training-stats div:nth-last-child(-n+2) { border-bottom: 0; }
.training-stats span { display: block; color: var(--muted-2); font-family: var(--font-mono); font-size: 6px; letter-spacing: 0.06em; text-transform: uppercase; }
.training-stats b { display: block; margin-top: 4px; color: var(--text-soft); font-family: var(--font-display); font-size: 22px; font-weight: 400; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.training-stats small { display: block; margin-top: 2px; color: var(--muted-2); font-family: var(--font-mono); font-size: 6px; }
.training-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 0.85fr); gap: 18px; margin-top: 18px; }
.training-last-panel, .training-load-panel, .training-pr-panel, .training-history-panel { min-width: 0; padding: 22px 23px 18px; }
.training-last-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted-2); font-family: var(--font-mono); font-size: 6.5px; letter-spacing: 0.04em; text-transform: uppercase; }
.training-source { color: var(--positive); }
.training-last-panel h3 { margin: 9px 0 15px; color: var(--text); font-family: var(--font-display); font-size: 27px; font-weight: 400; letter-spacing: -0.045em; }
.training-last-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 13px 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.training-last-stats span { display: block; color: var(--muted-2); font-family: var(--font-mono); font-size: 6px; letter-spacing: 0.05em; text-transform: uppercase; }
.training-last-stats strong { display: block; margin-top: 4px; color: var(--text-soft); font-family: var(--font-mono); font-size: 10px; font-weight: 400; white-space: nowrap; }
.training-last-panel p { margin-top: 11px; color: var(--muted-2); font-size: 9px; }
.training-weeks { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); align-items: end; gap: 6px; height: 150px; padding-top: 12px; }
.training-week { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 7px; }
.training-week-bar { display: flex; align-items: flex-end; width: 100%; height: 112px; border-bottom: 1px solid var(--line-soft); }
.training-week-bar i { display: block; width: 100%; min-height: 2px; border-radius: 3px 3px 0 0; background: #a8c97f; opacity: 0.85; transition: height 700ms var(--ease); }
.training-week span { color: var(--muted-2); font-family: var(--font-mono); font-size: 6px; letter-spacing: 0.02em; white-space: nowrap; }
.training-load-note { margin-top: 8px; color: var(--muted-2); font-size: 8px; line-height: 1.45; }
.training-pr-panel { margin-top: 18px; }
.training-pr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line-soft); }
.training-pr > div { min-width: 0; padding: 14px 18px 0 0; border-right: 1px solid var(--line-soft); }
.training-pr > div + div { padding-left: 18px; }
.training-pr > div:last-child { border-right: 0; }
.training-pr span { display: block; color: var(--muted-2); font-family: var(--font-mono); font-size: 6px; letter-spacing: 0.06em; text-transform: uppercase; }
.training-pr strong { display: block; margin-top: 5px; color: var(--text-soft); font-family: var(--font-display); font-size: 24px; font-weight: 400; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.training-pr small { display: block; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted-2); font-family: var(--font-mono); font-size: 6.5px; }
.training-history-panel { margin-top: 18px; }
.training-history { display: flex; flex-direction: column; }
.training-row { display: grid; grid-template-columns: 56px 62px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line-soft); }
.training-row-date { color: var(--muted-2); font-family: var(--font-mono); font-size: 7px; letter-spacing: 0.02em; text-transform: uppercase; }
.training-type { color: var(--muted); font-family: var(--font-mono); font-size: 6.5px; letter-spacing: 0.04em; text-transform: uppercase; }
.training-row-copy { min-width: 0; }
.training-row-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-soft); font-size: 10.5px; font-weight: 500; }
.training-row-copy small { display: block; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted-2); font-family: var(--font-mono); font-size: 6.5px; }
.training-row-figures { display: flex; align-items: baseline; gap: 10px; color: var(--muted-2); font-family: var(--font-mono); font-size: 7px; white-space: nowrap; }
.training-row-figures b { color: var(--text-soft); font-weight: 400; }
.training-empty { padding: 18px 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.training-source-note { margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line-soft); color: var(--muted-2); font-size: 8.5px; line-height: 1.5; }

/* ============================================================
   TABBAR
   ============================================================ */
.tabbar {
  --tab-x: 50%;
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 80;
  display: none;
  align-items: flex-start;
  justify-content: space-around;
  height: calc(65px + env(safe-area-inset-bottom));
  padding: 8px 7px env(safe-area-inset-bottom);
  background: transparent;
  isolation: isolate;
}
.tabbar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-top: 1px solid var(--line-soft);
  background: rgba(7, 8, 8, 0.9);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-mask: radial-gradient(circle 27px at var(--tab-x) 0, transparent 0 26px, #000 27px);
  mask: radial-gradient(circle 27px at var(--tab-x) 0, transparent 0 26px, #000 27px);
}
.tab {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
  color: var(--muted-2);
  transition: color 220ms var(--ease);
}
.tab-icon {
  display: grid;
  place-items: center;
  width: 35px;
  height: 27px;
  border-radius: 999px;
  transition: opacity 180ms var(--ease), transform 260ms var(--ease);
}
.tab-icon svg { width: 17px; height: 17px; }
.tab-label { font-size: 8px; font-weight: 500; letter-spacing: 0.02em; }
.tab.is-active { color: var(--text); }
.tab.is-active .tab-icon { opacity: 0; transform: translateY(-2px); }
.tab:active .tab-icon { transform: scale(0.93); }
.tab-flow {
  position: absolute;
  left: var(--tab-x);
  top: -23px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  transform: translateX(-50%);
  box-shadow: 0 10px 24px -8px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(5, 6, 6, 0.3);
  transition: left 520ms cubic-bezier(0.22, 1, 0.36, 1), transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  will-change: left, transform;
}
.tab-flow svg { width: 19px; height: 19px; }
.tab-flow.is-moving { animation: tabFlowSquash 520ms cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes tabFlowSquash {
  0%, 100% { transform: translateX(-50%) scale(1); }
  38% { transform: translateX(-50%) scale(1.1, 0.9); }
  70% { transform: translateX(-50%) scale(0.96, 1.04); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1300px) {
  .sleep-map-layout { grid-template-columns: 1fr; gap: 0; }
  .map-summary { display: none; }
}

@media (max-width: 1180px) {
  :root { --rail: 220px; }
  .rail { padding-right: 15px; padding-left: 15px; }
  main { padding-right: 28px; padding-left: 28px; }
  .topbar { padding-right: 28px; padding-left: 28px; }
  .stage::before { left: var(--rail); }
  .vitals-chart { margin-right: -28px; margin-left: -28px; padding-right: 28px; padding-left: 28px; }
  .home-grid { grid-template-columns: minmax(0, 1.1fr) minmax(330px, 0.9fr); }
  .sleep-hero-side { grid-template-columns: repeat(2, auto); }
  .sleep-hero-fact:nth-child(3) { border-right: 0; }
  .sleep-hero-fact { padding-top: 6px; padding-bottom: 6px; }
}

@media (max-width: 1000px) {
  .rail { display: none; }
  .stage { margin-left: 0; }
  .stage::before { left: 0; }
  .mobile-brand { display: inline-flex; }
  .topbar-meta { display: none; }
  .tabbar { display: flex; }
  main { padding-bottom: 114px; }
  .toast-region { bottom: 86px; }
  .sheet { padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
  .home-grid { grid-template-columns: minmax(0, 1.08fr) minmax(315px, 0.92fr); }
  .training-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .home-grid { grid-template-columns: 1fr; }
  .home-col { gap: 14px; }
  .home-grid { gap: 14px; }
  .sleep-lower-grid, .body-grid { grid-template-columns: 1fr; }
  .habits-layout, .goals-layout { grid-template-columns: 1fr; }
  .habit-overview { grid-template-columns: 1fr; gap: 22px; }
  .week-strip { max-width: 100%; }
  .goal-overview { grid-template-columns: 190px 1fr; gap: 25px; }
  .goal-overview-side { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; padding: 15px 0 0; border-top: 1px solid var(--line-soft); border-left: 0; }
  .vitals-hero { grid-template-columns: 1fr; gap: 20px; }
  .vital-side { max-width: 520px; }
  .vitals-chart { margin-top: 3px; }
  .sleep-month-hero { flex-direction: column; align-items: flex-start; gap: 25px; }
  .sleep-hero-side { width: 100%; grid-template-columns: repeat(4, 1fr); border-left: 0; border-top: 1px solid var(--line-soft); padding-top: 16px; }
  .sleep-hero-fact { min-width: 0; padding: 0 14px; }
  .sleep-hero-fact:first-child { padding-left: 0; }
  .sleep-hero-fact:nth-child(3) { border-right: 1px solid var(--line-soft); }
  .nutrition-full-grid { grid-template-columns: 1fr; gap: 22px; }
}

@media (max-width: 640px) {
  main { padding: 22px 16px 108px; }
  .topbar { height: 59px; padding: 0 16px; }
  .topbar-actions { gap: 7px; }
  .sync-pill { height: 31px; gap: 5px; padding: 0 7px; }
  .sync-word { display: inline; }
  .sync-pill .tag { font-size: 6px; padding: 0 4px; }
  .icon-btn { width: 33px; height: 33px; }
  .avatar { width: 32px; height: 32px; font-size: 11px; }
  .brand-mark { width: 27px; height: 27px; }
  .brand-word { font-size: 15px; }
  .view-head { align-items: flex-start; gap: 12px; margin-bottom: 21px; }
  .view-head .eyebrow { font-size: 7.5px; letter-spacing: 0.1em; }
  .page-title { font-size: 42px; margin-top: 9px; }
  .lede { margin-top: 10px; font-size: 12.5px; }
  .view-head-side { padding-top: 25px; }
  .view-head-side .status-chip { display: none; }
  .view-head-side .solid-btn { height: 33px; padding: 0 11px; font-size: 10px; }
  .view-head-side .solid-btn svg { width: 13px; height: 13px; }
  .hero-panel { padding: 19px 19px 0; border-radius: 21px; }
  .hero-top { align-items: flex-start; }
  .hero-top .eyebrow { font-size: 7.5px; letter-spacing: 0.1em; }
  .hero-status { font-size: 7px; white-space: nowrap; }
  .hero-main { display: block; padding: 16px 0 22px; }
  .readiness { display: flex; align-items: flex-end; gap: 7px; }
  .readiness-num { font-size: 103px; }
  .readiness-den { margin-bottom: 3px; }
  .readiness-label { display: none; }
  .hero-copy { margin-top: 21px; padding-bottom: 0; }
  .hero-copy h2 { font-size: 21px; }
  .hero-copy p { font-size: 11.5px; line-height: 1.55; max-width: 310px; }
  .hero-copy .text-link { font-size: 10px; margin-top: 11px; }
  .hero-ecg { bottom: 112px; height: 60px; opacity: 0.23; }
  .hero-factors { grid-template-columns: 1fr 1fr; margin: 0 -19px; padding: 0 19px; }
  .factor { padding: 11px 13px 13px; }
  .factor:nth-child(3) { border-left: 0; padding-left: 0; }
  .factor:nth-child(n+3), .factor:nth-child(4) { border-top: 1px solid var(--line-soft); }
  .factor strong { font-size: 16px; }
  .factor small { font-size: 7px; }
  .home-grid { margin-top: 14px; gap: 14px; }
  .panel { padding: 17px 16px 14px; border-radius: 17px; }
  .section-title-wrap h2 { font-size: 14px; }
  .section-index { min-width: 17px; height: 15px; font-size: 6.5px; }
  .link-btn { font-size: 6.8px; }
  .link-btn svg { width: 10px; height: 10px; }
  .source-tag { font-size: 6.5px; }
  .sleep-main-stat strong { font-size: 34px; }
  .score-badge { width: 51px; height: 51px; }
  .score-badge span { font-size: 15px; }
  .sleep-skyline { height: 80px; margin-top: 17px; gap: 2px; }
  .sleep-mini-facts { gap: 13px; font-size: 9px; }
  .chart-caption { font-size: 5.8px; letter-spacing: 0.03em; }
  .legend-inline { display: none; }
  .panel-footer { font-size: 9.5px; }
  .habit-list.compact .habit-row { grid-template-columns: 27px 27px minmax(0, 1fr) auto; gap: 8px; }
  .habit-list.compact .habit-name { font-size: 11.5px; }
  .habit-streak { font-size: 7.5px; }
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metric { padding: 11px 7px 11px 0; }
  .metric + .metric { padding-left: 9px; }
  .metric-label { font-size: 6.5px; }
  .metric-value strong { font-size: 20px; }
  .metric-value span { font-size: 6px; }
  .metric-delta { top: 10px; font-size: 6.5px; }
  .goal-strip { grid-template-columns: 1fr 70px 33px; gap: 10px; padding: 15px 2px; }
  .goal-strip h2 { font-size: 15px; }
  .goal-strip p:not(.eyebrow) { font-size: 8.5px; }
  .goal-strip-meter strong { font-size: 20px; }
  .goal-strip .round-link { width: 31px; height: 31px; }
  .sleep-head-stats { gap: 16px; padding-top: 2px; }
  .sleep-head-stats strong { font-size: 16px; }
  .sleep-head-stats .eyebrow { font-size: 6.5px; }
  .view[data-view="sueno"] .view-head { display: block; }
  .view[data-view="sueno"] .view-head-side {
    margin-top: 18px;
    padding: 14px 0 0;
    border-top: 1px solid var(--line-soft);
    gap: 32px;
  }
  .sleep-head-stats > div { flex-direction: row; align-items: baseline; gap: 8px; }
  .sleep-head-stats .eyebrow { white-space: nowrap; }
  .sleep-big-number { gap: 0; }
  .sleep-big-number small { margin-right: 7px; font-size: 16px; }
  .sleep-month-hero { padding: 15px 0 23px; gap: 18px; }
  .sleep-big-number { font-size: 76px; }
  .sleep-big-number small { font-size: 16px; margin-right: 9px; }
  .sleep-big-meta { font-size: 9.5px; }
  .sleep-hero-side { grid-template-columns: 1fr 1fr; gap: 12px 0; padding-top: 14px; }
  .sleep-hero-fact { padding: 0 13px; border-width: 0 0 1px 1px; }
  .sleep-hero-fact:nth-child(2) { border-right: 0; border-left: 0; }
  .sleep-hero-fact:nth-child(3) { border-left: 0; border-bottom: 0; padding-bottom: 0; }
  .sleep-hero-fact:nth-child(4) { border-bottom: 0; }
  .sleep-hero-fact strong { font-size: 15px; }
  .sleep-map-panel { padding: 17px 14px 14px; }
  .map-head { flex-direction: column; gap: 14px; }
  .map-head h2 { font-size: 18px; margin-top: 5px; }
  .map-controls { width: 100%; justify-content: space-between; }
  .segmented button { height: 26px; padding: 0 11px; }
  .map-nav button { width: 27px; height: 27px; }
  .map-stage { margin-top: 17px; }
  .sleep-map-layout { margin-top: 17px; }
  .weekday-row { gap: 3px; }
  .sleep-calendar { gap: 3px; }
  .sleep-day { height: auto; aspect-ratio: 1.06; border-radius: 9px; }
  .sleep-day .sd-dot { width: 91%; height: 91%; }
  .sleep-day:hover { transform: none; }
  .sleep-detail { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 12px; margin-top: 15px; }
  .detail-main { gap: 11px; }
  .detail-date { min-width: 0; }
  .detail-stages { width: 100%; grid-column: 1 / -1; order: 3; min-width: 0; }
  .detail-hours { font-size: 19px; }
  .detail-score strong { font-size: 17px; }
  .sleep-legend { flex-wrap: wrap; gap: 8px 13px; margin-top: 12px; padding-top: 11px; }
  .sleep-legend p { display: none; }
  .sleep-legend .mono { margin-left: auto; }
  .year-map { gap: 5px; }
  .year-row { grid-template-columns: 22px 1fr; gap: 6px; }
  .year-days { gap: 2px; }
  .year-day { border-radius: 1.5px; }
  .year-map-head { font-size: 6.5px; }
  .stage-row { grid-template-columns: 37px 1fr 32px; gap: 7px; }
  .stage-date { font-size: 7.5px; }
  .stage-duration { font-size: 7px; }
  .insight-row p { font-size: 11px; }
  .habit-overview { padding: 15px 0 20px; gap: 19px; }
  .habit-overview-main { gap: 16px; }
  .big-fraction { font-size: 65px; }
  .habit-day-score p { font-size: 9.5px; max-width: 150px; }
  .day-progress-ring { width: 82px; height: 82px; }
  .day-progress-ring span { font-size: 18px; }
  .day-progress-ring small { bottom: 20px; font-size: 5px; }
  .week-strip { gap: 2px; }
  .week-day { padding: 6px 1px; gap: 5px; border-radius: 8px; }
  .week-num { font-size: 14px; }
  .week-label { font-size: 5.8px; }
  .week-pct { display: none; }
  .habit-list.full .habit-row { grid-template-columns: 30px 29px minmax(0, 1fr) auto; gap: 10px; min-height: 57px; }
  .habit-list.full .habit-check { width: 29px; height: 29px; }
  .habit-list.full .habit-icon { width: 29px; height: 29px; }
  .habit-list.full .habit-name { font-size: 12.5px; }
  .habit-week { display: none; }
  .habit-list.full .habit-menu { opacity: 0.55; }
  .habit-menu { opacity: 0.55; }
  .consistency-map { gap: 3px; }
  .vitals-hero { padding-top: 17px; gap: 17px; }
  .vital-number strong { font-size: 78px; }
  .vital-side { grid-template-columns: 1fr 1fr; gap: 15px 0; }
  .vital-cell { padding: 0 14px; }
  .vital-cell:nth-child(3) { border-left: 0; }
  .vital-cell strong { font-size: 21px; }
  .vitals-chart { margin-right: -16px; margin-left: -16px; padding: 13px 16px 10px; }
  .vitals-chart .hr-chart { height: 90px; }
  .body-grid { gap: 14px; margin-top: 14px; }
  .steps-chart { height: 105px; gap: 5px; }
  .step-col i { max-width: 20px; }
  .goal-overview { grid-template-columns: 1fr; gap: 19px; padding: 17px 0 21px; }
  .goal-overview-score > strong { font-size: 61px; }
  .goal-overview-bar { grid-template-columns: 82px 1fr 58px; gap: 9px; }
  .goal-overview-side { padding-top: 12px; }
  .goal-card { padding: 17px 16px 15px; border-radius: 17px; }
  .goal-card.featured { padding: 20px 17px 17px; }
  .goal-card h3 { font-size: 15px; }
  .goal-card .goal-sub { font-size: 8.5px; }
  .goal-pct { font-size: 18px; }
  .goal-card-footer { font-size: 8px; }
  .nutrition-full { padding: 18px 16px 15px; border-radius: 17px; }
  .nutrition-full .section-head .source-tag { display: none; }
  .kcal-big strong { font-size: 59px; }
  .yazio-strip { grid-template-columns: 1fr auto; gap: 8px 12px; }
  .yazio-strip p { grid-column: 1 / -1; grid-row: 2; }
  .yazio-state { grid-column: 2; grid-row: 1; }
  .macro-top { flex-direction: column; align-items: flex-start; gap: 2px; }
  .macro-top b { font-size: 7.5px; }
  .vitals-hero { gap: 0; }
  .vital-main { padding-bottom: 16px; }
  .vital-side { border-top: 1px solid var(--line-soft); padding-top: 15px; }
  .meal-row { grid-template-columns: 33px minmax(0, 1fr) auto 20px; gap: 8px; }
  .meal-copy strong { font-size: 10.5px; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .sheet { padding-right: 19px; padding-left: 19px; }
  .sheet-head h2 { font-size: 22px; }
  .quick-grid { gap: 7px; }
  .quick-card { min-height: 92px; padding: 12px; }
}

@media (max-width: 1100px) {
  .day-hero { grid-template-columns: 274px minmax(0, 1fr); gap: 22px; padding: 24px 26px; }
  .score-dial { width: 230px; height: 230px; }
  .score-number strong { font-size: 68px; }
  .day-score { padding-right: 22px; }
  .heatmap-layout { grid-template-columns: minmax(0, 1fr) 200px; gap: 20px; }
  .finance-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .day-hero { grid-template-columns: 238px minmax(0, 1fr); gap: 20px; }
  .score-dial { width: 212px; height: 212px; }
  .score-number strong { font-size: 62px; }
  .day-score { padding-right: 18px; }
  .finance-hero-main { grid-template-columns: minmax(0, 1fr) auto; gap: 16px 24px; }
  .finance-flow { grid-column: 1 / -1; grid-row: 2; }
  .finance-ring { width: 86px; height: 86px; }
  .finance-net strong { font-size: 46px; }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .home-grid { grid-template-columns: minmax(0, 1.04fr) minmax(300px, 0.96fr); gap: 14px; }
  .signal-rail { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .day-hero { grid-template-columns: 1fr; gap: 0; padding: 18px 18px 16px; border-radius: 21px; }
  .day-score { padding: 0 0 12px; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .score-dial { width: 168px; height: 168px; }
  .score-kicker { font-size: 6px; }
  .score-number strong { font-size: 52px; }
  .score-coverage { margin-top: 6px; font-size: 6px; }
  .score-foot { display: none; }
  .day-hero-copy { padding: 13px 0 0; }
  .day-hero-top .eyebrow { font-size: 7px; }
  .day-hero h2 { margin-top: 7px; margin-bottom: 6px; font-size: 29px; }
  .day-score-copy { font-size: 11px; line-height: 1.45; }
  .score-breakdown { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; margin: 13px 0 11px; padding-top: 11px; }
  .score-component-head { display: block; font-size: 5.8px; line-height: 1.35; }
  .score-component-head small { display: none; }
  .score-component-value { font-size: 15px; margin: 4px 0 6px; }
  .score-actions { align-items: center; flex-direction: row; flex-wrap: wrap; gap: 6px 12px; }
  .score-coverage-note { font-size: 6.5px; }
  .score-rule { grid-template-columns: minmax(0, 1fr) 74px 24px; gap: 9px; }
  .score-sheet-total strong { font-size: 56px; }
  .signal-rail {
    grid-auto-flow: column;
    grid-auto-columns: 148px;
    grid-template-columns: none;
    gap: 7px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    margin-right: -16px;
    padding-right: 16px;
    padding-bottom: 3px;
    scrollbar-width: none;
  }
  .signal-rail::-webkit-scrollbar { display: none; }
  .signal-card { scroll-snap-align: start; min-height: 100px; }
  .map-head { flex-direction: column; gap: 15px; }
  .map-controls { width: 100%; justify-content: space-between; flex-wrap: wrap; gap: 7px; }
  .heatmap-layout { grid-template-columns: 1fr; gap: 0; }
  .heatmap-stage { padding: 10px; border-radius: 14px; }
  .heatmap-summary {
    margin-top: 16px;
    padding: 16px 0 0;
    border-top: 1px solid var(--line-soft);
    border-left: 0;
  }
  .heatmap-average { margin-top: 0; }
  .heatmap-stat-list { margin-top: 12px; }
  .heatmap-summary .month-note { margin-top: 12px; }
  .sleep-legend { flex-wrap: wrap; gap: 10px; }
  .sleep-scale { width: 100%; }
  .sleep-legend .mono { margin-left: auto; }
  .finance-hero { padding: 18px 17px 14px; border-radius: 20px; }
  .finance-hero-main { grid-template-columns: 1fr; gap: 14px; }
  .finance-flow { grid-column: 1; grid-row: auto; }
  .finance-ring { width: 78px; height: 78px; position: absolute; top: 16px; right: 17px; }
  .finance-net { padding-right: 90px; }
  .finance-net strong { font-size: 42px; }
  .finance-stack { margin-top: 18px; }
  .finance-categories { grid-template-columns: 1fr; }
  .finance-grid { gap: 14px; margin-top: 14px; }
  .finance-category-panel, .finance-year-panel, .finance-ledger { padding: 18px 17px 13px; }
  .finance-year-totals strong { font-size: 15px; }
  .finance-year-chart { gap: 3px; height: 108px; }
  .finance-year-bars { height: 82px; gap: 1px; }
  .finance-year-bars i { width: 3px; }
  .finance-ledger-row { grid-template-columns: 42px minmax(0, 1fr) auto; gap: 8px; }
  .finance-ledger-amount { font-size: 8.5px; }
  .training-strip { grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; padding: 13px 14px; }
  .training-strip-stats { grid-column: 1 / -1; grid-row: 2; gap: 20px; }
  .training-strip .round-link { grid-column: 2; grid-row: 1; }
  .training-hero { grid-template-columns: 1fr; gap: 16px; padding: 19px 17px; border-radius: 20px; }
  .training-stats { border-top: 1px solid var(--line-soft); border-left: 0; padding-top: 7px; }
  .training-stats div { padding: 9px 14px 9px 0; }
  .training-grid { gap: 14px; margin-top: 14px; }
  .training-last-panel, .training-load-panel, .training-pr-panel, .training-history-panel { padding: 18px 17px 14px; }
  .training-last-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .training-pr { grid-template-columns: 1fr; }
  .training-pr > div { padding: 12px 0; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .training-pr > div + div { padding-left: 0; }
  .training-pr > div:last-child { border-bottom: 0; }
  .training-row { grid-template-columns: 48px 52px minmax(0, 1fr) auto; gap: 8px; }
  .training-row-figures { display: block; text-align: right; }
  .training-row-figures b { display: block; margin-top: 2px; }
  .training-weeks { height: 130px; gap: 4px; }
  .training-week-bar { height: 96px; }
}

@media (max-width: 380px) {
  main { padding-right: 13px; padding-left: 13px; }
  .topbar { padding: 0 13px; }
  .day-hero { padding-right: 16px; padding-left: 16px; }
  .score-dial { width: 154px; height: 154px; }
  .score-number strong { font-size: 48px; }
  .score-breakdown { gap: 6px; }
  .signal-rail { margin-right: -13px; padding-right: 13px; }
  .hero-panel { padding-right: 16px; padding-left: 16px; }
  .hero-factors { margin-right: -16px; margin-left: -16px; padding-right: 16px; padding-left: 16px; }
  .readiness-num { font-size: 90px; }
  .page-title { font-size: 38px; }
  .sync-pill .tag { display: none; }
  .sleep-day .sd-num { font-size: 8px; }
  .detail-date strong { font-size: 10px; }
  .detail-hours { font-size: 17px; }
  .goal-overview-bar { grid-template-columns: 74px 1fr 52px; }
  .goal-overview-bar span { font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
  .hero-ecg { display: none; }
}
