:root {
  /* Día cálido — fondo con atmósfera; azul intenso solo en dormir */
  --sky: #F0E6DA;
  --sky-mid: #F7F1E9;
  --moon: #6F9A94;
  --moon-dark: #557F7A;
  --moon-deeper: #3A3F4A;
  --moon-light: #EAF2F0;
  --moon-mid: #8FB0AB;
  --star: rgba(212, 160, 120, 0.32);
  --dawn: #D4A078;
  --dawn-soft: #F6E8DA;
  --peach: #D4A078;
  --peach-soft: #F6E8DA;
  --butter: #F0E4C8;
  --mint: #7AAB9A;
  --sand: #F3E9DC;
  --bg: #F5EDE3;
  --bg-glow: #EAD9C8;
  --surface: #ffffff;
  --surface-elevated: #ffffff;
  --white: #ffffff;
  --text: #3A3F4A;
  --text-muted: #757A84;
  --border: rgba(111, 154, 148, 0.22);
  --border-mid: rgba(111, 154, 148, 0.36);
  --success: #1D9E75;
  --danger: #E24B4A;
  --gradient-night: linear-gradient(155deg, #6F9A94 0%, #8BAE9F 100%);
  --gradient-sky: linear-gradient(
    165deg,
    #F3D9C4 0%,
    #F5E6D4 28%,
    #F3EDE4 58%,
    #E8EFEA 100%
  );
  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 100px;
  --font-display: "Manrope", system-ui, -apple-system, sans-serif;
  --font-ui: "Manrope", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  height: 100%;
  min-height: 100%;
  background: #E8D5C2;
  font-family: var(--font-ui);
  color: var(--text);
}

.app {
  height: 100dvh;
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse 90% 48% at 18% -8%, rgba(232, 150, 100, 0.28) 0%, transparent 58%),
    radial-gradient(ellipse 70% 42% at 92% 8%, rgba(214, 176, 120, 0.22) 0%, transparent 52%),
    radial-gradient(ellipse 80% 45% at 70% 100%, rgba(122, 171, 154, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse 55% 35% at 0% 55%, rgba(240, 210, 170, 0.35) 0%, transparent 60%),
    var(--gradient-sky);
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(58, 63, 74, 0.1);
}

/* Escritorio: ocupa el ancho usable (fin del “chorizo” fino centrado) */
@media (min-width: 700px) {
  html {
    font-size: 16px;
  }

  body {
    background:
      radial-gradient(ellipse 60% 50% at 20% 0%, rgba(232, 150, 100, 0.2), transparent 50%),
      radial-gradient(ellipse 50% 40% at 85% 100%, rgba(122, 171, 154, 0.15), transparent 50%),
      #E8D5C2;
  }

  .app {
    max-width: min(720px, 100%);
    width: 100%;
    min-height: 100dvh;
    margin: 0 auto;
    box-shadow: none;
    border-left: 0.5px solid var(--border);
    border-right: 0.5px solid var(--border);
  }

  .scroll {
    padding-left: 28px;
    padding-right: 28px;
  }

  .topbar {
    padding-left: 28px;
    padding-right: 28px;
  }

  .tabbar {
    padding-left: 12px;
    padding-right: 12px;
  }

  .hero-time {
    font-size: 60px;
  }

  .hero.asleep .hero-time {
    font-size: 42px;
  }
}

@media (min-width: 1100px) {
  .app {
    max-width: min(820px, 92vw);
  }
}

/* Atmósfera: brillos + velo cálido */
.app::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
  background-image:
    radial-gradient(1.8px 1.8px at 16% 18%, rgba(255, 220, 180, 0.7), transparent),
    radial-gradient(1.2px 1.2px at 72% 12%, rgba(255, 240, 210, 0.55), transparent),
    radial-gradient(1px 1px at 48% 6%, rgba(255, 210, 160, 0.45), transparent),
    radial-gradient(1.4px 1.4px at 88% 28%, rgba(180, 210, 195, 0.4), transparent),
    radial-gradient(1px 1px at 28% 42%, rgba(255, 230, 190, 0.35), transparent);
}

.app::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    linear-gradient(180deg, rgba(255, 248, 238, 0.35) 0%, transparent 28%),
    linear-gradient(25deg, transparent 40%, rgba(255, 200, 150, 0.08) 62%, transparent 78%);
  mix-blend-mode: soft-light;
  opacity: 0.9;
}

.app > * {
  position: relative;
  z-index: 1;
}

.screen {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.screen.active {
  display: flex;
}

.screen.onb {
  overflow: hidden;
}

.topbar {
  padding: 14px 20px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  border-bottom: 0.5px solid var(--border);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.brand {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--moon-deeper);
  letter-spacing: -0.02em;
}

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

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0.5px solid var(--border-mid);
  background: var(--moon-light);
  color: var(--moon-deeper);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-ui);
}

.icon-btn.has-avatar {
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
}

.icon-btn.top-av {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* La tabbar ya está fuera del screen (flex); no hace falta 88px extra */
  padding: 16px 18px 20px;
}

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

.setup-screen {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 24px 22px calc(48px + env(safe-area-inset-bottom));
}

.lbl-opt {
  font-weight: 400;
  color: var(--text-muted);
}

.baby-age-display {
  margin-top: 8px;
  font-size: 13px;
  color: var(--moon);
  font-weight: 500;
}

.baby-emoji-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-top: 4px;
}

.baby-emoji-btn {
  width: 100%;
  aspect-ratio: 1;
  border: 0.5px solid var(--border-mid);
  border-radius: 12px;
  background: var(--white);
  font-size: 22px;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  line-height: 1;
}

.baby-emoji-btn.sel {
  background: var(--moon-light);
  border-color: var(--moon);
  box-shadow: 0 0 0 1.5px var(--moon);
}

.soft-toggle-home {
  margin: 4px 0 28px;
}

body.sheet-open .audio-dock {
  display: none !important;
}

/* —— Onboarding / setup (estilo Bokadito) —— */
.onb {
  background: var(--bg);
}

.auth-logo-wrap {
  display: flex;
  justify-content: center;
  margin: 4px 0 16px;
}

.auth-logo {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  display: block;
  object-fit: cover;
  box-shadow: 0 6px 20px rgba(74, 91, 181, 0.22);
}

.setup-title {
  font-family: var(--font-display);
  font-size: 24px;
  text-align: center;
  line-height: 1.25;
  margin: 0 0 8px;
  color: var(--text);
}

.setup-sub {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 22px;
}

.register-privacy-block {
  margin: 8px 0 16px;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 0.5px solid var(--border);
  background: var(--white);
  font-size: 12px;
  line-height: 1.45;
  color: var(--text);
}

.register-privacy-block > p {
  margin: 0 0 10px;
  color: var(--text-muted);
}

.role-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.role-opt {
  border: 0.5px solid var(--border);
  background: var(--white);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}

.role-opt.sel,
.role-opt.active {
  background: var(--moon-light);
  border-color: var(--moon);
  color: var(--moon);
  font-weight: 600;
}

.baby-avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 8px;
}

.baby-avatar-btn {
  aspect-ratio: 1;
  border: 0.5px solid var(--border-mid);
  border-radius: 16px;
  background: var(--white);
  color: var(--moon-deeper);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-family: inherit;
}

.baby-avatar-btn.sel {
  background: var(--moon-light);
  border-color: var(--moon);
  box-shadow: 0 0 0 1.5px var(--moon);
  color: var(--moon);
}

.baby-avatar-btn svg {
  width: 22px;
  height: 22px;
  display: block;
}

.sync-consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0 0 14px;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 0.5px solid var(--border);
  background: var(--bg);
  font-size: 12px;
  line-height: 1.45;
  color: var(--text);
  cursor: pointer;
}

.sync-consent input {
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--moon);
}

.linkish-inline {
  border: 0;
  background: none;
  padding: 0;
  color: var(--moon);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.sync-pending-box {
  padding: 14px;
  border-radius: var(--radius);
  border: 0.5px solid var(--border-mid);
  background: var(--moon-light);
  margin-bottom: 12px;
}

.sp-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  color: var(--moon-deeper);
}

.sp-body {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
}

.carers-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 16px 0 8px;
}

.sheet-familia .carers-section-label:first-of-type {
  margin-top: 4px;
}

.familia-scroll {
  padding: 12px 16px 20px;
}

.familia-scroll .carers-section-label:first-of-type {
  margin-top: 4px;
}

.fam-topbar .fam-title {
  margin: 0;
}

.fam-topbar .fam-sub {
  margin: 2px 0 0;
}

.fam-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.main-topbar-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.topbar-help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-ui);
  color: var(--moon-deeper);
  background: var(--moon-light);
  border: 0.5px solid var(--border-mid);
  border-radius: var(--radius-pill);
  cursor: pointer;
  line-height: 1.2;
  white-space: nowrap;
  -webkit-appearance: none;
  appearance: none;
}

.topbar-help-btn:active {
  opacity: 0.92;
}

.how-body {
  margin: 8px 0 18px;
}

.how-body p {
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  margin-bottom: 10px;
}

#sheet-how {
  z-index: 22;
}

.fam-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--moon-deeper);
  margin: 0;
  line-height: 1.15;
}

.fam-sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.fam-admin-pill {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--moon) 22%, transparent);
  color: var(--moon-deeper);
  border: 0.5px solid var(--border);
}

.baby-profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 0.5px solid var(--border-mid);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #f7f9fc 0%, var(--white) 100%);
  cursor: pointer;
  text-align: left;
  font-family: var(--font-ui);
  -webkit-appearance: none;
  appearance: none;
  margin-bottom: 4px;
}

.baby-profile-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--moon-light);
  font-size: 22px;
  flex: 0 0 auto;
}

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

.baby-profile-name {
  margin: 0;
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--moon-deeper);
}

.baby-profile-meta {
  margin: 2px 0 0;
  display: block;
  font-size: 12px;
  color: var(--text-muted);
}

.baby-profile-action {
  font-size: 13px;
  font-weight: 600;
  color: var(--moon);
  flex: 0 0 auto;
}

.edit-block {
  margin: 8px 0 4px;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 0.5px solid var(--border);
  background: var(--moon-light);
}

.edit-block .field {
  margin-bottom: 10px;
}

.carer-card.you-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 0.5px solid color-mix(in srgb, var(--moon) 28%, var(--border));
  background: color-mix(in srgb, var(--moon) 8%, white);
  margin-bottom: 8px;
}

.you-av {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--moon-light);
  color: var(--moon-deeper);
  font-size: 12px;
  font-weight: 700;
}

.you-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.you-body strong {
  font-size: 14px;
  color: var(--moon-deeper);
}

.you-body span {
  font-size: 12px;
  color: var(--text-muted);
}

.family-code-card {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 0.5px solid var(--border-mid);
  background: var(--white);
}

.family-code-card .family-code-box {
  margin-bottom: 8px;
}

.btn-copy-code {
  width: auto;
  margin: 0;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: 0.5px solid var(--border-mid);
  background: var(--moon-light);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--moon-deeper);
  cursor: pointer;
}

.btn-regen-code {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-pill);
  border: 0.5px solid var(--border-mid);
  background: transparent;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--moon-deeper);
  cursor: pointer;
}

.btn-regen-code:active {
  background: var(--moon-light);
}

.carers-help-text {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-muted);
}

.account-rows {
  display: flex;
  flex-direction: column;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--white);
  margin-bottom: 8px;
}

.account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 13px 14px;
  border: none;
  border-bottom: 0.5px solid var(--border);
  background: var(--white);
  cursor: pointer;
  text-align: left;
  font-family: var(--font-ui);
  -webkit-appearance: none;
  appearance: none;
}

.account-row:last-child {
  border-bottom: none;
}

.account-row:active {
  background: var(--moon-light);
}

.account-row-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--moon-deeper);
}

.account-row-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.account-plan-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  background: var(--moon-light);
  color: var(--moon-deeper);
}

.account-row-danger .account-row-label {
  color: #b42318;
}

.account-row-chev {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1;
}

.account-sheet-block {
  margin-bottom: 16px;
}

.account-sheet-block h3 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--moon-deeper);
}

.account-sheet-block p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}

.account-sheet-link {
  display: inline-block;
  margin-top: 8px;
  padding: 0;
  border: none;
  background: none;
  color: var(--moon);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-ui);
  cursor: pointer;
  text-decoration: underline;
}

.carers-actions {
  margin-top: 12px;
  margin-bottom: 4px;
}

.carers-leave-btn {
  width: 100%;
}

.carer-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 0.5px solid var(--border);
  margin-bottom: 8px;
  background: var(--white);
}

.carer-card.me {
  border-color: color-mix(in srgb, var(--moon) 28%, var(--border));
  background: color-mix(in srgb, var(--moon) 8%, white);
}

.carer-card .avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--moon-light);
  color: var(--moon-deeper);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.carer-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--moon-deeper);
}

.carer-tag-me {
  font-weight: 500;
  color: var(--text-muted);
}

.carer-role {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.sheet-familia {
  padding: 16px 16px 24px;
  max-height: min(92vh, 820px);
  overflow: auto;
}

.sheet-familia .sync-consent {
  margin: 8px 0 10px;
  font-size: 12px;
}

.sheet-familia .field {
  margin-bottom: 10px;
}

.sheet-familia .forgot-link {
  margin-top: 8px;
  padding: 10px;
}

.join-req-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 0.5px solid var(--border);
  background: var(--white);
  margin-bottom: 8px;
}

.jr-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--moon-deeper);
}

.jr-actions {
  display: flex;
  gap: 8px;
}

.sync-carers {
  margin-bottom: 12px;
}

.sync-carer-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-top: 0.5px solid var(--border);
  font-size: 13px;
  color: var(--text);
}

.scr-role {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
}

.sheet-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin: -4px 0 14px;
}

.privacy-body {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
  max-height: 55vh;
  overflow: auto;
  margin-bottom: 12px;
}

.privacy-body p {
  margin: 0 0 12px;
}

.privacy-body b {
  color: var(--moon-deeper);
}

.privacy-med {
  background: #FCEBEB;
  border-radius: var(--radius-sm);
  padding: 12px;
  margin: 8px 0 4px;
  font-size: 12px;
  color: #A32D2D;
  line-height: 1.55;
}

.field-hint {
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.35;
}

.danger-zone {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 0.5px solid var(--border);
}

.danger-zone-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 8px;
}

.onb-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text);
  cursor: pointer;
}

.onb-check input {
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--moon);
}

#onb-privacy-open {
  margin-bottom: 12px;
}

#onb-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.cuento-hero {
  position: relative;
  height: 88px;
  margin: 0 0 12px;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(160deg, #2F3F7A 0%, #5B73D4 55%, #8EB8D4 100%);
}

.ch-moon {
  position: absolute;
  right: 28px;
  top: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #F7F2E4;
  box-shadow: 0 0 24px rgba(247, 242, 228, 0.45);
}

.ch-stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 18% 30%, rgba(255,255,255,0.9) 0 1.5px, transparent 2px),
    radial-gradient(circle at 40% 55%, rgba(255,255,255,0.7) 0 1px, transparent 2px),
    radial-gradient(circle at 62% 25%, rgba(255,255,255,0.8) 0 1.2px, transparent 2px),
    radial-gradient(circle at 78% 70%, rgba(255,255,255,0.55) 0 1px, transparent 2px);
}

.cuento-frame .cf-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--moon);
  margin-bottom: 4px;
}

.cuento-steps {
  margin: 0 0 12px;
  padding-left: 18px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.55;
}

.cuento-steps li {
  margin-bottom: 4px;
}

.cf-tipo-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 10px;
  line-height: 1.4;
}

.cuento-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

#btn-sound {
  position: relative;
}

#btn-sound.sound-active {
  border-color: color-mix(in srgb, var(--moon) 45%, var(--border));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--moon) 18%, transparent);
}

#btn-sound.sound-locked {
  opacity: 0.72;
}

.push-kinds {
  margin-top: 4px;
}

.push-kind-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 0.5px solid var(--border);
  cursor: pointer;
}

.push-kind-row:last-child {
  border-bottom: none;
}

.push-kind-row input {
  margin-top: 3px;
  flex-shrink: 0;
}

.push-kind-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 14px;
  color: var(--text);
}

.push-kind-text span {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
}

.sound-live {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--moon);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--moon) 45%, transparent);
  animation: sound-pulse 1.6s ease-out infinite;
}

@keyframes sound-pulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--moon) 40%, transparent);
  }
  70% {
    box-shadow: 0 0 0 8px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

.audio-dock {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(64px + env(safe-area-inset-bottom));
  z-index: 14;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 10px;
  row-gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 16px;
  background: var(--white);
  border: 0.5px solid var(--border-mid);
  box-shadow: 0 8px 28px rgba(44, 53, 88, 0.1);
  max-width: calc(100% - 24px);
  box-sizing: border-box;
}

.audio-dock[hidden] {
  display: none !important;
}

.sound-home-bar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "kicker kicker"
    "status stop";
  align-items: stretch;
  column-gap: 10px;
  row-gap: 8px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin-top: 0;
  padding: 0;
  border: 0;
  background: transparent;
  min-width: 0;
}

.sound-home-bar[hidden] {
  display: none !important;
}

.sound-home-kicker {
  grid-area: kicker;
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--moon-deeper);
}

.sound-home-status {
  grid-area: status;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 16px;
  border: 0.5px solid var(--border-mid);
  background: var(--moon-light);
  text-align: left;
}

.sound-home-type {
  min-width: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
  overflow-wrap: anywhere;
}

.sound-home-timer {
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.sound-home-stop {
  grid-area: stop;
  align-self: stretch;
  border: 0;
  border-radius: 16px;
  padding: 12px 18px;
  min-height: 52px;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 700;
  background: var(--moon);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}

.sound-home-stop:active {
  opacity: 0.88;
}

body.has-audio-dock .scroll {
  padding-bottom: 24px;
}

.ad-stop {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 0;
  background: var(--moon-light);
  color: var(--moon-deeper);
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
  grid-row: 1;
  grid-column: 1;
}

.ad-info {
  min-width: 0;
  grid-row: 1;
  grid-column: 2;
}

.ad-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--moon-deeper);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ad-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.ad-chips {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  grid-row: 2;
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
}

.ad-chip {
  min-width: 0;
  width: 100%;
  height: 30px;
  padding: 0 4px;
  border-radius: 999px;
  border: 0.5px solid var(--border-mid);
  background: var(--bg);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
}

.ad-chip.on {
  background: var(--moon);
  border-color: var(--moon);
  color: #fff;
}

.sound-timer-block {
  margin-top: 4px;
}

.sound-timer-chips {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.sound-timer-chips .ad-chip {
  height: 36px;
  font-size: 12px;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.field input,
.field select {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 0.5px solid var(--border-mid);
  background: var(--white);
  font-size: 16px;
  font-family: var(--font-ui);
  color: var(--text);
  outline: none;
  min-height: 48px;
  box-sizing: border-box;
}

.field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236B7389' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.field input:focus,
.field select:focus {
  border-color: var(--moon);
  box-shadow: 0 0 0 3px rgba(107, 158, 174, 0.22);
}

.btn {
  width: 100%;
  padding: 15px 18px;
  border: none;
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font-ui);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.btn:active {
  opacity: 0.9;
  transform: scale(0.99);
}

.btn-primary {
  background: var(--moon);
  color: #fff;
  box-shadow: 0 4px 14px rgba(107, 158, 174, 0.3);
  margin-top: auto;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 0.5px solid var(--border-mid);
  margin-top: 10px;
}

.export-actions {
  margin-top: 4px;
}

.export-actions .btn-primary {
  margin-top: 0;
}

.btn-export-img {
  margin-top: 10px;
  background: var(--surface-elevated, #fff);
  color: var(--moon-deeper);
  border: 1.5px solid var(--moon);
  box-shadow: none;
}

.export-actions .btn-ghost {
  margin-top: 10px;
}

/* —— Home hero (propuesta ensayo: card blanca + Tipo de sueño) —— */
.status-chip {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  color: var(--moon-deeper);
  margin: 0 0 14px;
  padding: 12px 16px;
  border-radius: 18px;
  border: 0.5px solid var(--border);
  background: #fff;
  box-shadow: 0 2px 10px rgba(85, 127, 140, 0.08);
  cursor: default;
  -webkit-tap-highlight-color: transparent;
  text-align: left;
}

.status-chip-icon {
  display: flex;
  color: var(--moon-dark);
  flex-shrink: 0;
}

.status-chip-label {
  flex: 1;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.status-chip::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
}

/* Modo dormido v1 — ensayo limpio */
#screen-home.is-asleep {
  background: linear-gradient(165deg, #0b0e1c 0%, #12182e 42%, #1a2040 100%);
}

#screen-home.is-asleep .topbar {
  background: transparent;
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

#screen-home.is-asleep .brand,
#screen-home.is-asleep .brand span {
  color: #f2f5ff;
}

#screen-home.is-asleep .topbar-help-btn,
#screen-home.is-asleep #sync-label {
  color: rgba(242, 245, 255, 0.65);
}

#screen-home.is-asleep .topbar-help-btn {
  display: none !important;
}

#screen-home.is-asleep .status-chip {
  width: auto;
  max-width: 100%;
  margin: 8px auto 8px;
  padding: 10px 18px;
  gap: 10px;
  border-radius: 999px;
  background: rgba(26, 34, 56, 0.92);
  color: #c8f5dc;
  border: 1px solid rgba(125, 255, 168, 0.28);
  box-shadow: none;
  justify-content: center;
  text-align: center;
}

#screen-home.is-asleep .status-chip-icon {
  display: none;
}

#screen-home.is-asleep .status-chip-label {
  flex: 0 1 auto;
  font-size: 14px;
  font-weight: 600;
}

#screen-home.is-asleep .status-chip::after {
  display: none;
}

#screen-home.is-asleep .status-chip::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #7dffa8;
  flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(125, 255, 168, 0.55);
  animation: live-dot 1.5s ease-out infinite;
}

#screen-home.is-paused .status-chip {
  color: #ffe9c2;
  border-color: rgba(255, 200, 87, 0.4);
}

#screen-home.is-paused .status-chip::before {
  background: #ffc857;
  animation: none;
}

@keyframes live-dot {
  0% {
    box-shadow: 0 0 0 0 rgba(125, 255, 168, 0.55);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(125, 255, 168, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(125, 255, 168, 0);
  }
}

.hero {
  background: #fff;
  color: var(--text);
  border-radius: 22px;
  padding: 20px 20px 18px;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
  border: 0.5px solid var(--border-mid);
  box-shadow: 0 6px 20px rgba(85, 127, 140, 0.1);
  animation: hero-in 0.5s ease both;
  text-align: center;
}

.hero.asleep {
  background: transparent;
  color: #fff;
  box-shadow: none;
  border: none;
  text-align: center;
  padding: 16px 12px 8px;
  margin-bottom: 4px;
  overflow: visible;
}

.hero-kicker {
  position: relative;
  z-index: 1;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7a8699;
  margin-bottom: 6px;
}

.hero-time {
  position: relative;
  z-index: 1;
  font-family: var(--font-ui);
  font-size: 56px;
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--moon);
}

.hero-cloud {
  display: flex;
  justify-content: center;
  margin-bottom: 6px;
  opacity: 0.85;
}

.hero.asleep .hero-cloud {
  display: none;
}

.hero-ring-moon {
  display: none;
}

.hero-timer-block {
  position: relative;
  z-index: 1;
}

.hero-ring {
  display: none;
}

.hero-waves {
  display: none;
}

.hero.asleep .hero-timer-block {
  width: min(280px, 78vw);
  aspect-ratio: 1;
  margin: 4px auto 0;
  display: grid;
  place-items: center;
}

.hero.asleep .hero-ring {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero-ring-track {
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 6;
}

.hero-ring-prog {
  stroke: #8ec8ff;
  stroke-width: 6.5;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s ease, stroke 0.3s ease;
}

.hero.asleep.is-over-guide .hero-ring-prog,
.hero.asleep.over-guide .hero-ring-prog {
  stroke: #ffc857;
}

.hero.asleep .hero-timer-core {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px 16px 14px;
  max-width: 78%;
}

.hero.asleep .hero-ring-moon {
  display: flex;
  color: rgba(142, 200, 255, 0.9);
  margin-bottom: 6px;
}

.hero.asleep .hero-kicker {
  display: none;
}

.hero.asleep .hero-time {
  font-size: clamp(34px, 9vw, 44px);
  font-weight: 300;
  letter-spacing: 0.04em;
  color: #fff;
  line-height: 1;
}

.hero-why {
  position: relative;
  z-index: 1;
  margin: 8px auto 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--moon-dark);
  max-width: 34ch;
}

.hero.asleep .hero-why {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.72);
  max-width: 16ch;
  line-height: 1.35;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.hero.asleep .hero-why-kind {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
}

.hero.asleep .hero-why-mins {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  letter-spacing: 0.01em;
}

.hero.asleep .hero-waves {
  display: block;
  width: min(240px, 70vw);
  height: 28px;
  margin: 18px auto 0;
  opacity: 0.55;
}

.hero.asleep .hero-waves svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.hero.asleep .hero-waves path {
  stroke: rgba(142, 200, 255, 0.55);
  stroke-width: 1.4;
  stroke-linecap: round;
}

.hero.asleep .hero-waves .hw-b {
  stroke: rgba(142, 200, 255, 0.28);
}

.hero.asleep.sound-on .hero-waves {
  opacity: 0.85;
  animation: waves-soft 3.2s ease-in-out infinite;
}

@keyframes waves-soft {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.7;
  }
  50% {
    transform: translateY(-2px);
    opacity: 0.95;
  }
}

.hero-meta {
  position: relative;
  z-index: 1;
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.hero:not(.asleep) .hero-meta:empty {
  display: none;
}

.hero.asleep .hero-meta {
  display: none;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--moon-light);
  color: var(--moon-deeper);
  font-size: 12px;
  font-weight: 500;
}

.hero.paused .hero-time {
  opacity: 0.72;
}

.hero.asleep.paused .hero-ring-prog {
  stroke: #ffc857;
}

.hero-kind {
  position: relative;
  z-index: 1;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 0.5px solid var(--border);
  text-align: left;
}

.hero.asleep .hero-kind {
  display: none;
}

.kind-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.kind-pills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.kind-pill {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  padding: 12px 10px;
  border-radius: var(--radius-pill);
  border: 1.5px solid #d5dde4;
  background: #fff;
  color: #9aa3b2;
  cursor: pointer;
}

.kind-pill.active {
  border-color: var(--moon);
  color: var(--moon);
  background: #fff;
}

.home-blocks {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
  padding-bottom: 8px;
}

.home-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border-radius: 16px;
  border: 0.5px solid var(--border);
  background: #fff;
  box-shadow: 0 2px 10px rgba(85, 127, 140, 0.06);
  font-family: var(--font-ui);
  color: var(--text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.home-row-ico {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--moon-light);
  color: var(--moon-deeper);
}

.home-row-ico svg {
  display: block;
}

.home-row-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.home-row-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--moon-deeper);
  line-height: 1.25;
}

.home-row-sub {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.35;
}

.home-row-chev {
  flex-shrink: 0;
  font-size: 22px;
  font-weight: 400;
  color: var(--moon);
  line-height: 1;
}

.home-row-toggle {
  cursor: default;
}

.home-row-toggle input[type="checkbox"] {
  width: 44px;
  height: 26px;
  flex-shrink: 0;
  accent-color: var(--moon);
}

.home-row-panel {
  margin: -2px 0 4px;
  padding: 12px 14px 14px;
  border-radius: 14px;
  border: 0.5px solid var(--border);
  background: #f7fafb;
}

.home-row-panel[hidden] {
  display: none !important;
}

.home-row-panel .dc-note {
  width: 100%;
  margin-top: 10px;
}

.home-row-panel .tp-tips {
  margin: 0;
  padding-left: 1.1rem;
}

.home-row-panel .insight-extra {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-muted);
}

#screen-home.is-asleep .home-blocks {
  display: none;
}

.home-scroll {
  padding-bottom: 12px;
}

#screen-home.is-asleep .home-scroll {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100dvh - 140px);
  padding-bottom: 24px;
}

#screen-home.is-asleep .actions {
  margin-top: 18px;
  gap: 12px;
}

#screen-home.is-asleep .action.wake {
  background: #c45c4a;
  color: #fff;
  border: none;
}

#screen-home.is-asleep #btn-sound {
  background: transparent;
  border: none;
  box-shadow: none;
  color: rgba(242, 245, 255, 0.78);
  padding: 12px 4px;
  gap: 12px;
  align-items: center;
}

#screen-home.is-asleep #btn-sound .sound-note {
  color: rgba(242, 245, 255, 0.78);
}

#screen-home.is-asleep #btn-sound .sound-row-text {
  flex: 1;
  min-width: 0;
  gap: 6px;
}

#screen-home.is-asleep #btn-sound .sound-row-line {
  display: none;
}

#screen-home.is-asleep #btn-sound.sound-active {
  box-shadow: none;
  border: none;
}

#screen-home.is-asleep #btn-sound .t {
  font-size: 14px;
  font-weight: 500;
  color: rgba(242, 245, 255, 0.9);
}

#screen-home.is-asleep #btn-sound .d {
  display: block;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.92);
  margin-top: 2px;
}

#screen-home.is-asleep .sound-home-bar {
  display: none !important;
}

#screen-home.is-asleep .icon-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #f2f5ff;
  border-color: rgba(255, 255, 255, 0.12);
}

#screen-home.is-asleep .sync-dot {
  box-shadow: 0 0 0 2px rgba(11, 14, 28, 0.8);
}

/* —— Qué hacer hoy —— */
.today-plan {
  margin: 0 0 16px;
  padding: 14px 16px 12px;
  border-radius: var(--radius);
  background: linear-gradient(165deg, #eef1fa 0%, #f7f8fc 100%);
  border: 0.5px solid var(--border);
  animation: fade-up 0.4s ease both;
}

.today-plan.tone-action {
  background: linear-gradient(165deg, #e8eefc 0%, #f3f6fd 100%);
  border-color: color-mix(in srgb, var(--moon) 35%, var(--border));
}

.today-plan.tone-soft {
  background: linear-gradient(165deg, #eef2f6 0%, #f7f8fa 100%);
}

/* —— Actions —— */
.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.action {
  padding: 18px 14px;
  border-radius: var(--radius);
  border: 0.5px solid var(--border-mid);
  background: var(--moon-light);
  cursor: pointer;
  text-align: left;
  font-family: var(--font-ui);
  color: var(--text);
}

.action:active {
  transform: scale(0.98);
}

.action.primary {
  background: var(--moon);
  border: none;
  color: white;
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(107, 158, 174, 0.28);
}

.action.primary .btn-chev {
  margin-left: auto;
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
  opacity: 0.9;
}

.action.primary .t {
  flex: 1;
  text-align: center;
  margin-left: 22px;
}

#btn-sound[hidden] {
  display: none !important;
}

.action.wake {
  background: linear-gradient(160deg, #c4784a 0%, #e09a5c 100%);
  border: none;
  color: white;
  grid-column: 1 / -1;
  box-shadow: 0 4px 14px rgba(196, 120, 74, 0.28);
}

.timer-live {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 10px;
}

.timer-live[hidden],
.timer-setup[hidden] {
  display: none !important;
}

.timer-live .action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  border-radius: 14px;
}

.timer-live .action .btn-ico {
  display: flex;
  flex-shrink: 0;
}

.timer-live .action .t {
  font-size: 15px;
  font-weight: 600;
}

.timer-live .action.pause {
  text-align: center;
  background: #2a3348;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f2f5ff;
}

.timer-live .action.pause .ico-play {
  display: none;
}

.timer-live .action.pause.is-paused .ico-pause {
  display: none;
}

.timer-live .action.pause.is-paused .ico-play {
  display: block;
}

.timer-live .action.pause.is-paused {
  border-color: rgba(255, 200, 87, 0.45);
  background: #3a3540;
  color: #ffe9c2;
}

.timer-live .action.wake {
  grid-column: auto;
  text-align: center;
  background: #c45c4a;
  border: none;
  color: #fff;
  box-shadow: none;
}

.action.sound-row {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 14px 16px;
}

.action.sound-row .sound-note {
  display: flex;
  color: var(--moon-dark);
  flex-shrink: 0;
}

.action.sound-row .sound-row-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.action.sound-row .sound-row-line {
  display: none;
  flex: 0 0 48px;
  height: 1px;
  background: rgba(255, 255, 255, 0.22);
  align-self: center;
}

.action.sound-row .d {
  font-size: 12px;
  font-weight: 500;
  opacity: 0.7;
}

.today-plan .tp-kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.today-plan .tp-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--moon-deeper);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.today-plan .tp-body {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
}

.today-plan .tp-tips {
  margin: 10px 0 0;
  padding: 0 0 0 1.1em;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-muted);
}

.today-plan .tp-tips li {
  margin-bottom: 4px;
}

.timer-setup {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.timer-setup .kind-row {
  grid-column: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.timer-setup #btn-sleep {
  margin: 0;
}

.timer-nap-note {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.35;
  text-align: center;
}

.kind-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.action.kind {
  text-align: center;
  padding: 14px 12px;
}

.action.kind.active {
  border-color: var(--moon);
  border-width: 1.5px;
  background: color-mix(in srgb, var(--moon) 22%, #fff);
  color: var(--moon-deeper);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--moon) 25%, transparent);
}

.action.kind .t {
  font-size: 14px;
}

#btn-sound {
  grid-column: 1 / -1;
}

.action .t {
  font-size: 15px;
  font-weight: 600;
  display: block;
}

.action .d {
  font-size: 12px;
  opacity: 0.75;
  margin-top: 4px;
  display: block;
}

/* —— Insight —— */
.insight {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--star);
  color: var(--moon-deeper);
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 18px;
  animation: fade-up 0.45s ease both;
}

.insight strong {
  font-weight: 600;
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 10px;
  letter-spacing: 0.02em;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.section-title .hint {
  font-weight: 500;
  font-size: 11px;
  opacity: 0.85;
}

.section-title .linkish,
.topbar .linkish,
.linkish {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  font-size: 12px;
  color: var(--moon);
  cursor: pointer;
}

/* —— Mapa del día (arco con carácter) —— */
.day-map {
  margin: 0 0 16px;
  padding: 16px 14px 16px;
  border-radius: 20px;
  background:
    radial-gradient(ellipse 90% 70% at 50% 0%, rgba(91, 111, 191, 0.1) 0%, transparent 60%),
    var(--white);
  border: 0.5px solid var(--border-mid);
  box-shadow: 0 8px 24px rgba(44, 53, 88, 0.06);
  animation: fade-up 0.4s ease both;
}

.day-map-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.day-map-title {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--moon-deeper);
  letter-spacing: 0.01em;
}

.day-map-sub {
  display: none;
}

.day-map-legend {
  display: none;
}

.day-map-legend .lg {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 3px;
}

.day-map-legend .lg.nap {
  background: var(--moon-mid);
}

.day-map-legend .lg.night {
  background: var(--moon-deeper);
}

.day-map-stage {
  position: relative;
  margin: 2px auto 0;
  max-width: 380px;
  width: 100%;
}

.day-map-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.dm-track-soft {
  fill: none;
  stroke: url(#dmTrackGrad);
  stroke-width: 20;
  stroke-linecap: round;
  opacity: 0.58;
}

.dm-track {
  fill: none;
  stroke: color-mix(in srgb, var(--moon) 20%, #e8ebf4);
  stroke-width: 12;
  stroke-linecap: round;
}

.dm-bowl {
  pointer-events: none;
}

.dm-tick {
  stroke: color-mix(in srgb, var(--moon) 28%, transparent);
  stroke-width: 1.2;
}

.dm-tick-lbl {
  fill: var(--text-muted);
  font-size: 6.5px;
  font-family: var(--font-ui);
  font-weight: 600;
  opacity: 0.85;
}

.dm-arc {
  fill: none;
  stroke-width: 12;
  stroke-linecap: round;
  filter: drop-shadow(0 1px 2px rgba(44, 53, 88, 0.12));
  opacity: 1;
}

.dm-arc.nap {
  stroke: var(--moon-mid);
}

.dm-arc.night {
  stroke: var(--moon-deeper);
}

.dm-arc.open {
  stroke-dasharray: 5 6;
  opacity: 0.95;
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--moon-mid) 45%, transparent));
}

.dm-arc.paused {
  opacity: 0.5;
}

.dm-mark-halo {
  fill: color-mix(in srgb, var(--dawn) 25%, transparent);
  stroke: none;
}

.dm-mark circle {
  fill: var(--dawn);
  stroke: #fff;
  stroke-width: 1.5;
}

.dm-mark .dm-mark-core {
  fill: #fff;
  stroke: none;
}

.dm-mark.next .dm-mark-halo {
  fill: color-mix(in srgb, var(--moon) 22%, transparent);
}

.dm-mark.next circle {
  fill: transparent;
}

.dm-mark.next .dm-mark-ring {
  fill: none;
  stroke: var(--moon-dark);
  stroke-width: 2;
  stroke-dasharray: 2.5 2;
}

.dm-mark.next .dm-mark-core {
  fill: var(--moon-dark);
}

.dm-mark-lbl {
  fill: var(--moon-deeper);
  font-size: 7px;
  font-family: var(--font-ui);
  font-weight: 700;
}

.dm-now-halo {
  fill: color-mix(in srgb, var(--moon-deeper) 22%, transparent);
  stroke: none;
}

.dm-now-dot {
  fill: var(--moon-deeper);
  stroke: #fff;
  stroke-width: 1.6;
}

.dm-now-ring {
  stroke: color-mix(in srgb, var(--moon-deeper) 45%, var(--moon-mid));
  stroke-width: 1.2;
}

.day-map-center {
  position: absolute;
  left: 50%;
  top: 62%;
  transform: translate(-50%, -42%);
  text-align: center;
  pointer-events: none;
  width: 46%;
  max-width: 168px;
  padding: 0 8px;
}

.day-map-summary {
  display: none;
}

.dm-center-k {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.2;
}

.dm-center-n {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--moon-deeper);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-top: 4px;
}

.dm-center-s {
  margin-top: 5px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.3;
}

.dm-center-pills,
.day-map-meta,
.day-map-rail {
  display: none;
}

.day-map-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 0.5px solid var(--border);
}

.dm-split-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.dm-split-item.nap {
  background: color-mix(in srgb, var(--moon-mid) 22%, var(--moon-light));
  color: var(--moon-dark);
}

.dm-split-item.night {
  background: color-mix(in srgb, var(--moon-deeper) 14%, #e8eaf2);
  color: var(--moon-deeper);
}

.day-map-split .lg {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

.day-map-split .lg.nap {
  background: var(--moon-mid);
}

.day-map-split .lg.night {
  background: var(--moon-deeper);
}

.dm-split-sep {
  display: none;
}

.dm-rail-track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--moon) 10%, #eef1f8);
  overflow: hidden;
}

.dm-rail-seg {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 999px;
}

.dm-rail-seg.nap {
  background: var(--moon-mid);
}

.dm-rail-seg.night {
  background: var(--moon-deeper);
}

.dm-rail-seg.open {
  opacity: 0.75;
}

.dm-rail-seg.paused {
  opacity: 0.45;
}

.dm-rail-now {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 3px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: var(--moon-deeper);
  box-shadow: 0 0 0 2px #fff;
}

.dm-rail-lbls {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
}

.week-jump {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 0.5px solid var(--border);
  background: var(--white);
  cursor: pointer;
  font-family: var(--font-ui);
  text-align: left;
  color: var(--text);
}

.week-jump:active {
  transform: scale(0.99);
  background: var(--moon-light);
}

.week-jump .wj-title {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--moon-deeper);
}

.week-jump .wj-sub {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--moon);
  white-space: nowrap;
}

.week-jump {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 0.5px solid var(--border);
  background: var(--white);
  cursor: pointer;
  font-family: var(--font-ui);
  text-align: left;
  color: var(--text);
}

.week-jump:active {
  transform: scale(0.99);
  background: var(--moon-light);
}

.week-jump .wj-title {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--moon-deeper);
}

.week-jump .wj-sub {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--moon);
  white-space: nowrap;
}

.week-chart {
  margin-bottom: 16px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.stat {
  background: var(--moon-light);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 10px;
  text-align: center;
}

.stat .n {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--moon-deeper);
  line-height: 1.1;
}

.stat .l {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

.tl-item {
  cursor: pointer;
  border-radius: var(--radius-sm);
  margin: 0 -6px;
  padding-left: 6px;
  padding-right: 6px;
}

.tl-item:active {
  background: var(--moon-light);
}

.tl-body .edit-hint {
  font-size: 11px;
  color: var(--moon);
  font-weight: 500;
  margin-top: 4px;
}

.sync-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
}

.sync-dot.on {
  background: var(--success);
}

.forgot-link {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  border: 0.5px solid var(--border-mid);
  border-radius: var(--radius-pill);
  background: transparent;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  text-align: center;
}

.forgot-link:active {
  background: var(--moon-light);
}

.family-code-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--moon-light);
  border-radius: var(--radius-sm);
  border: 0.5px solid var(--border-mid);
  margin-bottom: 12px;
}

.family-code-box .code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--moon-deeper);
}

.day-context {
  margin: 0 0 12px;
  padding: 0;
  background: transparent;
  border: none;
}

.dc-fold {
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  padding: 0;
  overflow: hidden;
}

.dc-fold > summary {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  cursor: pointer;
}

.dc-fold > summary::-webkit-details-marker {
  display: none;
}

.dc-fold[open] > summary {
  border-bottom: 0.5px solid var(--border);
}

.dc-fold .dc-chips,
.dc-fold .dc-note {
  margin: 10px 14px 12px;
}

.dc-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 10px;
}

.dc-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--moon-deeper);
}

.dc-hint {
  font-size: 11px;
  color: var(--text-muted);
}

.dc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.dc-chip {
  border: 0.5px solid var(--border-mid);
  background: var(--white);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 10px;
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.dc-chip.on {
  background: var(--moon);
  color: #fff;
  border-color: var(--moon);
}

.dc-note {
  width: 100%;
  border: 0.5px solid var(--border-mid);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--text);
  background: var(--white);
}

.week-chart {
  margin: 0 0 16px;
  padding: 14px 14px 10px;
  background: var(--moon-light);
  border-radius: var(--radius);
  border: 0.5px solid var(--border);
}

.week-chart-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
}

.week-chart-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--moon-deeper);
}

.week-chart-legend {
  font-size: 10px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.week-chart-legend .lg {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.week-chart-legend .lg.nap {
  background: var(--moon-mid);
}

.week-chart-legend .lg.night {
  background: var(--moon-dark);
}

.week-chart-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
  height: 100px;
  padding-bottom: 2px;
}

.wbar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  min-width: 0;
}

.week-chart-legend .lg.empty {
  background: transparent;
  border: 1px dashed var(--border-mid);
}

.wbar.empty .wbar-stack {
  background: repeating-linear-gradient(
    -45deg,
    rgba(107, 127, 215, 0.06),
    rgba(107, 127, 215, 0.06) 4px,
    rgba(255, 255, 255, 0.5) 4px,
    rgba(255, 255, 255, 0.5) 8px
  );
  border: 1px dashed var(--border-mid);
  justify-content: center;
  align-items: center;
  min-height: 28px;
  flex: 0 0 36%;
}

.wbar-empty-mark {
  color: var(--text-muted);
  font-size: 11px;
  opacity: 0.55;
  line-height: 1;
}

.wbar-stack {
  flex: 1;
  width: 100%;
  max-width: 28px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border-radius: 4px 4px 2px 2px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.45);
}

.wbar-seg {
  width: 100%;
  min-height: 0;
}

.wbar-seg.nap {
  background: var(--moon-mid);
}

.wbar-seg.night {
  background: var(--moon-dark);
}

.wbar-lbl {
  flex-shrink: 0;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 6px;
  text-transform: capitalize;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  text-align: center;
}

.week-chart-trend {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 10px;
  line-height: 1.4;
}

.sound-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  margin-bottom: 8px;
  border-radius: var(--radius-sm);
  border: 0.5px solid var(--border-mid);
  background: var(--moon-light);
  font-family: var(--font-ui);
  cursor: pointer;
  color: var(--text);
}

.sound-row.on {
  border-color: var(--moon);
  background: #e8ecff;
}

.sound-row.locked {
  opacity: 0.85;
}

.sr-title {
  font-size: 14px;
  font-weight: 600;
}

.sr-title .crown {
  color: #C9A84C;
  margin-right: 4px;
}

.sr-detail {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.sr-act {
  font-size: 12px;
  font-weight: 700;
  color: var(--moon);
  flex-shrink: 0;
}

.toast {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(72px + env(safe-area-inset-bottom));
  z-index: 40;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--moon-deeper);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
}

.toast.show {
  opacity: 1;
  transform: none;
}

.danger-btn {
  width: 100%;
  margin-top: 14px;
  padding: 13px;
  border-radius: var(--radius-pill);
  border: 0.5px solid rgba(226, 75, 74, 0.35);
  background: #fff5f5;
  color: var(--danger);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-ui);
  cursor: pointer;
}

/* —— Timeline —— */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.tl-item {
  display: grid;
  grid-template-columns: 56px 14px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px 0;
}

.tl-time {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  padding-top: 2px;
  text-align: right;
}

.tl-dot-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}

.tl-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--moon);
  flex-shrink: 0;
  margin-top: 4px;
}

.tl-dot.awake {
  background: var(--star);
  border: 2px solid var(--moon);
}

.tl-line {
  width: 2px;
  flex: 1;
  background: var(--border);
  margin-top: 4px;
  min-height: 16px;
}

.tl-body .title {
  font-size: 14px;
  font-weight: 600;
}

.tl-body .sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.empty {
  text-align: center;
  padding: 28px 12px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

/* —— Tab bar —— */
.tabbar {
  flex-shrink: 0;
  display: flex;
  margin: 0 10px calc(8px + env(safe-area-inset-bottom));
  border: 0.5px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  padding: 6px 8px;
  gap: 4px;
  z-index: 15;
  border-radius: var(--radius-pill);
  box-shadow: 0 6px 20px rgba(44, 53, 88, 0.1);
}

.tabbar[hidden] {
  display: none !important;
}

.tab {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-family: var(--font-ui);
  font-size: 9.5px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 8px 1px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.tab.active {
  color: var(--moon-deeper);
  background: var(--moon-light);
}

.tab-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1.2;
  color: var(--moon);
  height: 22px;
}

.tab-ico svg {
  display: block;
}

/* —— Calma —— */
.calma-lead {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 14px;
}

.calma-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}

.calma-tabs .chip {
  flex: 0 0 auto;
  padding: 8px 14px;
  font-size: 12px;
}

.calma-tabs .chip-ico-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px 8px 10px;
}

.calma-tabs .chip-ico {
  display: flex;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  align-items: center;
  justify-content: center;
  background: var(--moon-light);
  color: var(--moon-deeper);
  flex-shrink: 0;
}

.calma-tabs .chip-ico svg {
  display: block;
}

.calma-tabs .chip.active .chip-ico {
  background: rgba(255, 255, 255, 0.55);
  color: var(--moon-deeper);
}

.guide-card {
  display: block;
  width: 100%;
  text-align: left;
  border: 0.5px solid var(--border);
  background: var(--bg);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  font-family: var(--font-ui);
  color: var(--text);
}

.guide-card:active {
  background: var(--moon-light);
}

.guide-card .gc-kicker {
  font-size: 11px;
  font-weight: 600;
  color: var(--moon);
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}

.guide-card .gc-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--moon-deeper);
  margin-bottom: 4px;
}

.guide-card .gc-preview {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}

.guide-topic {
  margin-bottom: 10px;
  border: 0.5px solid var(--border-mid);
  border-radius: var(--radius);
  background: linear-gradient(165deg, #f7f9fc 0%, #fff 70%);
  overflow: hidden;
}

.guide-topic summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.guide-topic summary::-webkit-details-marker {
  display: none;
}

.gt-ico {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--moon-light);
  color: var(--moon-deeper);
}

.gt-ico svg {
  display: block;
}

.guide-topic[open] .gt-ico {
  background: color-mix(in srgb, var(--moon) 18%, #fff);
  color: var(--moon-dark);
}

.gt-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.gt-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--moon-deeper);
}

.gt-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.gt-count {
  flex: 0 0 auto;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  background: var(--moon-light);
  color: var(--moon-deeper);
  border: 0.5px solid var(--border);
}

.gt-cards {
  padding: 0 10px 10px;
  border-top: 0.5px solid var(--border);
}

.gt-cards .guide-card {
  margin-bottom: 8px;
  background: var(--white);
}

.gt-cards .guide-card:last-child {
  margin-bottom: 0;
}

.day-log {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--white);
}

.day-log-legend {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px 12px;
  font-size: 11px;
  color: var(--text-muted);
  border-bottom: 0.5px solid var(--border);
  background: var(--moon-light);
}

.day-log-legend .lg {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: -1px;
}

.day-log-legend .lg.night {
  background: var(--moon-dark);
}

.day-log-legend .lg.nap {
  background: var(--moon-mid);
}

.day-log-row {
  display: grid;
  grid-template-columns: 72px 1fr 48px;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  row-gap: 2px;
  padding: 10px 12px;
  border-bottom: 0.5px solid var(--border);
}

.day-log-row:last-child {
  border-bottom: none;
}

.day-log-row.is-today {
  background: color-mix(in srgb, var(--moon) 8%, white);
}

.dl-day {
  grid-column: 1;
  grid-row: 1;
  font-size: 12px;
  font-weight: 700;
  color: var(--moon-deeper);
  text-transform: capitalize;
}

.dl-bar {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--moon-light);
  border: 0.5px solid var(--border);
}

.dl-seg {
  display: block;
  height: 100%;
}

.dl-seg.night {
  background: var(--moon-dark);
}

.dl-seg.nap {
  background: var(--moon-mid);
}

.dl-empty {
  font-size: 10px;
  color: var(--text-muted);
  padding: 0 8px;
  line-height: 14px;
}

.dl-total {
  grid-column: 3;
  grid-row: 1;
  font-size: 13px;
  font-weight: 700;
  color: var(--moon-deeper);
  text-align: right;
}

.dl-ctx {
  grid-column: 1 / -1;
  grid-row: 2;
  font-size: 11px;
  color: var(--text-muted);
}

.report-box {
  background: var(--moon-light);
  border-radius: var(--radius);
  padding: 16px;
  border: 0.5px solid var(--border-mid);
  margin-bottom: 14px;
}

.report-box h3 {
  font-family: var(--font-display);
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--moon-deeper);
}

.report-box .r-sum {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 12px;
}

.report-day {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-top: 0.5px solid var(--border);
  font-size: 12px;
}

.report-day.is-today {
  background: color-mix(in srgb, var(--moon) 8%, transparent);
  margin: 0 -10px;
  padding-left: 10px;
  padding-right: 10px;
  border-radius: 8px;
  border-top-color: transparent;
}

.report-day .rd-label {
  font-weight: 600;
  color: var(--moon-deeper);
}

.rd-ctx {
  font-size: 10px;
  font-weight: 500;
  color: var(--moon);
  margin-top: 3px;
  line-height: 1.3;
}

.report-day .rd-meta {
  color: var(--text-muted);
  text-align: right;
}

.analysis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.an-card {
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  border: 0.5px solid var(--border);
}

.an-k {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.an-v {
  font-size: 15px;
  font-weight: 700;
  color: var(--moon-deeper);
}

.an-banner {
  font-size: 13px;
  line-height: 1.45;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  font-weight: 500;
}

.an-banner.ok {
  background: rgba(61, 207, 154, 0.16);
  color: #7DE8B8;
}

.an-banner.warn {
  background: rgba(224, 180, 138, 0.18);
  color: #E0B48A;
}

.an-banner.muted {
  background: var(--white);
  color: var(--text-muted);
  border: 0.5px solid var(--border);
}

.an-source {
  font-size: 11px !important;
  color: var(--text-muted) !important;
  margin-bottom: 12px !important;
  line-height: 1.4;
}

.an-section {
  margin-top: 10px;
}

.an-section .an-h {
  font-size: 12px;
  font-weight: 700;
  color: var(--moon);
  margin-bottom: 6px;
}

.an-section ul {
  margin: 0;
  padding-left: 1.1em;
}

.an-section li {
  font-size: 12.5px;
  line-height: 1.45;
  margin-bottom: 5px;
  color: var(--text);
}

.an-ped {
  padding: 10px 12px;
  background: var(--white);
  border-radius: var(--radius-sm);
  border: 0.5px solid var(--border-mid);
}

.an-try {
  padding: 10px 12px;
  background: color-mix(in srgb, var(--moon) 8%, #fff);
  border-radius: var(--radius-sm);
  border: 0.5px solid color-mix(in srgb, var(--moon) 28%, var(--border));
  margin-bottom: 10px;
}

.cuento-frame {
  background: var(--moon-light);
  border-radius: var(--radius);
  padding: 16px;
  border: 0.5px solid var(--border-mid);
  margin-bottom: 14px;
}

.cuento-frame .cf-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--moon-deeper);
  margin-bottom: 6px;
}

.cuento-frame .cf-meta {
  font-size: 13px;
  color: var(--text);
  margin-bottom: 8px;
}

.cuento-frame .cf-hint {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 12px;
}

.cuento-result {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}

.cuento-layer {
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: var(--white);
}

.cuento-layer .cl-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--moon);
  margin-bottom: 8px;
}

.cuento-layer .cl-text {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
}

.sheet-tall {
  max-height: min(88dvh, 640px);
  overflow-y: auto;
}

.guide-audio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.guide-kicker {
  font-size: 12px;
  font-weight: 600;
  color: var(--moon);
  margin-bottom: 4px !important;
}

.guide-body {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  margin-bottom: 18px;
}

.guide-body p {
  margin-bottom: 12px;
  color: var(--text);
  font-size: 14px;
}

.guide-body ol {
  margin: 8px 0 16px 1.1em;
  padding: 0;
}

.guide-body li {
  margin-bottom: 8px;
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.45;
}

.guide-disc {
  font-size: 12px !important;
  color: var(--text-muted) !important;
  background: var(--moon-light);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin-top: 8px;
}

.guide-sources {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 0.5px solid var(--border);
}

.guide-sources .gs-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--moon);
  margin-bottom: 8px;
}

.guide-sources ul {
  margin: 0;
  padding-left: 1.1em;
}

.guide-sources li {
  font-size: 11.5px !important;
  color: var(--text-muted) !important;
  line-height: 1.4;
  margin-bottom: 6px;
}

.guide-sources a {
  color: var(--moon-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.medline-block {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 0.5px solid var(--border);
}

.medline-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--bg);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 8px;
}

.medline-card:active {
  background: var(--moon-light);
}

.medline-card .mc-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--moon-deeper);
  margin-bottom: 4px;
}

.medline-card .mc-snip {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.medline-card .mc-go {
  font-size: 11px;
  font-weight: 600;
  color: var(--moon);
  margin-top: 6px;
}

.medline-attr,
.medline-loading {
  font-size: 11px !important;
  color: var(--text-muted) !important;
  line-height: 1.4;
  margin-top: 8px;
}

/* —— Sheet —— */
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(44, 53, 88, 0.35);
  display: none;
  z-index: 40;
  pointer-events: none;
}

.sheet-backdrop.open {
  display: block;
  pointer-events: auto;
}

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--white);
  border-radius: 22px 22px 0 0;
  border-top: 0.5px solid var(--border);
  padding: 20px 20px 28px;
  z-index: 41;
  transform: translateY(110%);
  transition: transform 0.28s ease;
  box-shadow: 0 -8px 28px rgba(44, 53, 88, 0.12);
  visibility: hidden;
  pointer-events: none;
  max-height: min(92vh, 820px);
  overflow: auto;
}

.sheet.open {
  transform: translateY(0);
  visibility: visible;
  pointer-events: auto;
}

.sheet h2 {
  font-family: var(--font-display);
  font-size: 22px;
  margin-bottom: 6px;
}

.sheet p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}

.sheet-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.chip {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 0.5px solid var(--border-mid);
  background: var(--moon-light);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-ui);
  color: var(--text);
  text-align: center;
}

.chip.active {
  background: var(--moon);
  color: white;
  border-color: var(--moon);
}

@keyframes hero-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero,
  .insight {
    animation: none;
  }
  .sheet {
    transition: none;
  }
}

/* —— Chart taller + valores —— */
.week-chart.tall .week-chart-bars {
  height: 140px;
}

.week-chart-bars {
  height: 112px;
}

.wbar-val {
  font-size: 9px;
  font-weight: 600;
  color: var(--moon-deeper);
  margin-top: 4px;
  line-height: 1;
}

.wbar-val.muted {
  color: var(--text-muted);
  font-weight: 500;
}

.wbar.is-today .wbar-lbl {
  color: var(--moon-deeper);
  font-weight: 700;
}

/* —— Reporte visual filas —— */
.report-h {
  font-size: 15px;
  font-weight: 700;
  color: var(--moon-deeper);
  margin: 0 0 10px;
}

.plus-lock-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 12px;
  border-radius: var(--radius);
  border: 0.5px solid var(--border-mid);
  background: linear-gradient(165deg, #f7f4ef 0%, #fff 70%);
}

.plus-lock-crown {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--moon-light);
  color: var(--moon-deeper);
  font-size: 14px;
  font-weight: 700;
}

.plus-lock-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.plus-lock-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--moon-deeper);
}

.plus-lock-sub {
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-muted);
}

.plus-lock-btn {
  flex-shrink: 0;
  padding: 8px 12px !important;
  font-size: 12px !important;
  margin: 0 !important;
  width: auto !important;
}

.plan-compare {
  margin: 10px 0 0;
  padding-left: 1.1em;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-muted);
}

.plan-compare li {
  margin-bottom: 6px;
}

.plan-compare b {
  color: var(--moon-deeper);
}

#sound-fade-lock[hidden] {
  display: none !important;
}

.report-range {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 0 14px;
}

.rr-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 6px;
  border-radius: var(--radius-pill);
  border: 0.5px solid var(--border-mid);
  background: #fff;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  color: var(--moon-deeper);
  cursor: pointer;
}

.rr-chip .rr-ico {
  display: flex;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  background: var(--moon-light);
  color: var(--moon-deeper);
  flex-shrink: 0;
}

.rr-chip .rr-ico svg {
  display: block;
}

.rr-chip.active {
  background: var(--moon);
  color: #fff;
  border-color: var(--moon);
}

.rr-chip.active .rr-ico {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.rr-chip:active {
  transform: scale(0.98);
}

.report-box-tight {
  padding: 12px;
  margin-top: 12px;
}

.report-summary {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rs-hero {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 4px 2px 2px;
}

.rs-ico {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: var(--moon-deeper);
  border: 0.5px solid var(--border);
}

.rs-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.rs-kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.rs-value {
  font-family: var(--font-ui);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--moon-deeper);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.rs-hint {
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-muted);
}

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

.rs-item {
  background: #fff;
  border: 0.5px solid var(--border);
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
}

.rs-ik {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.rs-iv {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--moon-deeper);
  font-variant-numeric: tabular-nums;
}

.report-empty {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 8px 4px;
}

.report-empty-ico {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: var(--moon-deeper);
  border: 0.5px solid var(--border);
}

.report-empty-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.report-empty-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--moon-deeper);
}

.report-empty-hint {
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-muted);
}

.report-panel summary {
  display: flex;
  align-items: center;
  gap: 12px;
}

.report-panel .rp-sum-text {
  flex: 1;
}

.report-day-fold {
  margin-top: 12px;
}

.report-panels {
  margin-top: 12px;
}

.week-chart.mid .week-chart-bars,
.week-chart.dense .week-chart-bars {
  gap: 3px;
}

.week-chart.dense .wbar-lbl {
  font-size: 9px;
  letter-spacing: -0.02em;
}

.week-chart.mid .wbar-lbl {
  font-size: 10px;
}

.rd-visual {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rdv-row {
  display: grid;
  grid-template-columns: 36px 1fr 52px;
  align-items: center;
  gap: 8px 10px;
  padding: 6px 4px;
  border-radius: 8px;
}

.rdv-row.is-today {
  background: color-mix(in srgb, var(--moon) 10%, transparent);
}

.rdv-day {
  font-size: 12px;
  font-weight: 700;
  color: var(--moon-deeper);
  text-transform: capitalize;
}

.rdv-track {
  display: flex;
  height: 18px;
  border-radius: 999px;
  background: var(--moon-light);
  overflow: hidden;
  border: 0.5px solid var(--border);
}

.rdv-fill {
  height: 100%;
}

.rdv-fill.night {
  background: var(--moon-dark);
}

.rdv-fill.nap {
  background: var(--moon-mid);
}

.rdv-empty {
  width: 100%;
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  line-height: 14px;
  font-style: italic;
}

.rdv-total {
  font-size: 12px;
  font-weight: 700;
  color: var(--moon-deeper);
  text-align: right;
  white-space: nowrap;
}

.rdv-ctx {
  grid-column: 2 / -1;
  font-size: 10px;
  color: var(--moon);
  font-weight: 500;
  margin-top: -4px;
}

.rdv-row.empty .rdv-total {
  color: var(--text-muted);
  font-weight: 500;
}

/* —— Range gauge —— */
.range-gauge {
  margin: 10px 0 12px;
  padding: 12px;
  background: var(--white);
  border-radius: var(--radius-sm);
  border: 0.5px solid var(--border);
}

.rg-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--moon-deeper);
  margin-bottom: 10px;
}

.rg-ref {
  color: var(--text-muted);
  font-weight: 500;
}

.rg-track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: var(--moon-light);
  margin-bottom: 8px;
}

.rg-band {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--moon) 35%, transparent);
}

.rg-marker {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  margin-top: -7px;
  border-radius: 50%;
  background: var(--moon-deeper);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(45, 27, 78, 0.25);
}

.rg-caption {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

.an-fold {
  margin: 8px 0;
  padding: 8px 10px;
  background: var(--white);
  border-radius: var(--radius-sm);
  border: 0.5px solid var(--border);
}

.an-fold summary {
  font-size: 13px;
  font-weight: 700;
  color: var(--moon-deeper);
  cursor: pointer;
  list-style: none;
}

.an-fold summary::-webkit-details-marker {
  display: none;
}

.an-fold summary::after {
  content: " ›";
  color: var(--moon);
  font-weight: 500;
}

.an-fold[open] summary::after {
  content: " ˅";
}

.an-fold ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.an-fold li {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
  margin-bottom: 4px;
}

/* —— Report insight panels —— */
.report-panels {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0 4px;
}

.report-panel {
  border-radius: var(--radius);
  border: 0.5px solid var(--border-mid);
  background: linear-gradient(165deg, #f7f9fc 0%, #ffffff 55%);
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(74, 91, 181, 0.06);
}

.report-panel-ped {
  background: linear-gradient(165deg, #eef3fa 0%, #ffffff 60%);
}

.report-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.report-panel summary::-webkit-details-marker {
  display: none;
}

.rp-sum-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.rp-sum-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--moon-deeper);
}

.rp-sum-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.rp-chev {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--moon-light);
  border: 0.5px solid var(--border);
  position: relative;
}

.rp-chev::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--moon);
  border-bottom: 2px solid var(--moon);
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.2s ease;
}

.report-panel[open] .rp-chev::before {
  transform: translateY(2px) rotate(225deg);
}

.rp-body {
  padding: 0 16px 16px;
  border-top: 0.5px solid var(--border);
  animation: rp-open 0.28s ease both;
}

@keyframes rp-open {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.rp-visual {
  margin-top: 12px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.85);
  border: 0.5px solid var(--border);
}

.rp-visual .week-chart {
  margin: 0 0 10px;
}

.rp-visual .range-gauge {
  margin: 0;
}

.rp-block {
  margin-top: 12px;
}

.rp-h {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--moon-deeper);
}

.rp-block ul {
  margin: 0;
  padding-left: 18px;
}

.rp-block li {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
  margin-bottom: 5px;
}

.rp-note {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-muted);
}

.rp-stats-mini {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.rp-stats-mini span {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--moon-light);
  color: var(--moon-deeper);
  border: 0.5px solid var(--border);
}

.rp-export {
  margin-top: 14px;
}

.week-chart.compact .week-chart-bars {
  min-height: 72px;
}

.week-chart.compact .wbar-stack {
  min-height: 56px;
}

.week-chart.compact .wbar-lbl {
  font-size: 10px;
}

.soft-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 0.5px solid var(--border-mid);
  background: var(--moon-light);
  cursor: pointer;
}

.soft-toggle-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: var(--text-muted);
}

.soft-toggle-text strong {
  font-size: 14px;
  color: var(--moon-deeper);
}

.soft-toggle input {
  width: 20px;
  height: 20px;
  accent-color: var(--moon);
}

/* —— SOS madrugada —— */
.sos-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 24px 18px calc(24px + env(safe-area-inset-bottom));
  background: rgba(18, 22, 40, 0.72);
  backdrop-filter: blur(8px);
}

.sos-overlay[hidden] {
  display: none !important;
}

.sos-card {
  width: min(420px, 100%);
  padding: 28px 22px 22px;
  border-radius: 22px;
  background: linear-gradient(165deg, #1c2438 0%, #12182a 100%);
  color: #e8eaf2;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

.sos-kicker {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(232, 234, 242, 0.55);
}

.sos-title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  line-height: 1.15;
}

.sos-body {
  margin: 0 0 22px;
  font-size: 15px;
  line-height: 1.45;
  color: rgba(232, 234, 242, 0.78);
}

.sos-card .action {
  margin-bottom: 10px;
}

.sos-card .sos-main {
  background: #c9d0f5;
  color: #1a2034;
  border: none;
}

.sos-card .sos-secondary {
  background: transparent;
  border: 0.5px solid rgba(232, 234, 242, 0.28);
  color: #e8eaf2;
}

.sos-dismiss {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px;
  border: 0;
  background: transparent;
  color: rgba(232, 234, 242, 0.55);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

