/* ============================================================================
   Cradle Web — live dashboard
   Layered on styles.css. Same dusk tokens, same glass material.
   ========================================================================= */

.dash { padding: 26px 0 80px; }
.dash-wrap { width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 24px; }

/* ------------------------------------------------------------ dash head */
.dhead { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.child-chip {
  display: flex; align-items: center; gap: 12px;
  background: var(--glass-strong); border: 1px solid var(--glass-rim);
  border-radius: var(--r-pill); padding: 7px 18px 7px 8px; box-shadow: var(--shadow-card);
}
.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: linear-gradient(150deg, var(--sleep-night), var(--dusk-accent));
  color: #fff; font-weight: 700; font-size: 15px; letter-spacing: -0.02em;
}
.child-chip .n { display: block; font-weight: 700; font-size: 15.5px; letter-spacing: -0.02em; line-height: 1.15; }
.child-chip .a { display: block; font-size: 12px; color: var(--plum-soft); line-height: 1.2; }

.live-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(62,156,122,0.14); border: 1px solid rgba(49,124,97,0.3);
  color: #235C46; border-radius: var(--r-pill); padding: 8px 15px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--cta-ink); flex: none;
  box-shadow: 0 0 0 0 rgba(49,124,97,0.6); animation: pulse 2s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(49,124,97,0.55); }
  70%  { box-shadow: 0 0 0 9px rgba(49,124,97,0); }
  100% { box-shadow: 0 0 0 0 rgba(49,124,97,0); }
}
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

.simclock {
  margin-left: auto; display: flex; align-items: center; gap: 14px;
  font-variant-numeric: tabular-nums;
}
.simclock .t { font-size: 25px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.simclock .d { font-size: 11.5px; color: var(--plum-soft); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }

.crew { display: flex; align-items: center; }
.crew .av {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: #fff; border: 2px solid rgba(255,255,255,0.85);
  margin-left: -9px; box-shadow: 0 2px 6px rgba(59,48,104,0.18);
}
.crew .av:first-child { margin-left: 0; }

/* ---------------------------------------------------------------- grid  */
.dgrid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.c3{grid-column:span 3}.c4{grid-column:span 4}.c5{grid-column:span 5}
.c6{grid-column:span 6}.c7{grid-column:span 7}.c8{grid-column:span 8}
.c9{grid-column:span 9}.c12{grid-column:span 12}

.dcard {
  background: var(--glass-strong); border: 1px solid var(--glass-rim);
  border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow-card);
  position: relative; overflow: hidden;
}
.dcard-hd { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.dcard-hd h3 {
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--plum-soft);
}
.hint { font-size: 11.5px; color: var(--plum-soft); font-weight: 600; }

.big { font-size: 40px; font-weight: 700; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.big .u { font-size: 20px; font-weight: 600; opacity: .55; letter-spacing: 0; }
.sub { font-size: 13px; color: var(--plum-soft); margin-top: 7px; line-height: 1.45; }

.chip {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700;
  padding: 4px 10px; border-radius: var(--r-pill); letter-spacing: 0.01em;
}
.chip-up   { background: rgba(62,156,122,0.16); color: #235C46; }
.chip-down { background: rgba(217,89,75,0.14);  color: #8C2F24; }
.chip-flat { background: rgba(59,48,104,0.10);  color: var(--plum-soft); }
.chip-live { background: rgba(94,77,168,0.15);  color: #3A2D7A; }

/* --------------------------------------------------------- live sleep   */
.sleeping {
  background:
    radial-gradient(520px 260px at 12% 0%, rgba(255,255,255,0.16), transparent 65%),
    linear-gradient(140deg, #241C46, #33276B 55%, #3F3080);
  border-color: rgba(255,255,255,0.18); color: #fff;
}
.sleeping .dcard-hd h3 { color: rgba(255,255,255,0.62); }
.sleeping .sub { color: rgba(255,255,255,0.72); }
.sleeping .hint { color: rgba(255,255,255,0.6); }
/* Must NOT be scoped to .sleeping — when the card flips to .awake the SVG
   would fall back into flow and shove the card's content down. */
.stars2 { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .5s; }
.sleeping .stars2 { opacity: .6; }

.awake {
  background:
    radial-gradient(520px 260px at 12% 0%, rgba(255,255,255,0.55), transparent 65%),
    linear-gradient(140deg, #FBF0E4, #F6E3D6 60%, #F3D9DF);
  border-color: rgba(255,255,255,0.8);
}

.timer { font-size: 54px; font-weight: 700; letter-spacing: -0.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.timer .u { font-size: 24px; font-weight: 600; opacity: .5; letter-spacing: 0; margin: 0 2px 0 1px; }

.bar-track { height: 9px; border-radius: 99px; background: rgba(255,255,255,0.22); overflow: hidden; margin-top: 14px; }
.awake .bar-track { background: rgba(59,48,104,0.12); }
.bar-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--sleep-nap), #fff); transition: width .6s cubic-bezier(.3,.8,.3,1); }
.awake .bar-fill { background: linear-gradient(90deg, var(--dusk-accent), var(--sleep-night)); }
.bar-legend { display: flex; justify-content: space-between; margin-top: 7px; font-size: 11.5px; font-weight: 600; opacity: .72; }

/* ------------------------------------------------------------- stream   */
.stream { display: flex; flex-direction: column; gap: 8px; max-height: 372px; overflow-y: auto; padding-right: 4px; }
.stream::-webkit-scrollbar { width: 5px; }
.stream::-webkit-scrollbar-thumb { background: rgba(59,48,104,0.18); border-radius: 99px; }

.ev {
  display: flex; align-items: center; gap: 11px;
  background: rgba(255,255,255,0.6); border: 1px solid rgba(255,255,255,0.75);
  border-radius: 14px; padding: 9px 12px;
  animation: evIn .55s cubic-bezier(.2,.8,.3,1);
}
@keyframes evIn {
  from { opacity: 0; transform: translateY(-10px) scale(.97); background: rgba(117,99,194,.22); }
  to   { opacity: 1; transform: none; }
}
/* Rows caught up at load shouldn't all slide in at once. */
.ev-quiet { animation: none; }
@media (prefers-reduced-motion: reduce) { .ev { animation: none; } }

.ev .ic { width: 30px; height: 30px; border-radius: 10px; flex: none; display: grid; place-items: center; }
.ev .tx { flex: 1; min-width: 0; }
.ev .ti { font-size: 13.5px; font-weight: 700; letter-spacing: -0.015em; }
.ev .ts { font-size: 11.5px; color: var(--plum-soft); margin-top: 1px; }
.ev .tm { font-size: 11.5px; font-weight: 700; color: var(--plum-soft); flex: none; font-variant-numeric: tabular-nums; }
.ev .who {
  font-size: 9.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 5px; margin-left: 6px; vertical-align: 1px;
}

/* ----------------------------------------------------------- kpi tiles  */
.kpi { display: flex; flex-direction: column; gap: 2px; }
.kpi .spark { margin-top: 10px; }

/* ------------------------------------------------------------ timeline  */
.tl-wrap { position: relative; }
.tl-hours { display: flex; justify-content: space-between; margin-top: 7px; font-size: 10.5px; color: var(--plum-soft); font-weight: 600; }

/* --------------------------------------------------------------- misc   */
.legend2 { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 11px; }
.legend2 span { font-size: 11.5px; color: var(--plum-soft); font-weight: 600; display: inline-flex; align-items: center; }
.legend2 i { width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; display: inline-block; }

.ring-wrap { display: flex; align-items: center; gap: 16px; }
.comp { display: grid; gap: 7px; flex: 1; min-width: 0; }
.comp-row { display: grid; grid-template-columns: 82px 1fr 32px; align-items: center; gap: 9px; font-size: 11.5px; font-weight: 600; }
.comp-row .t2 { color: var(--plum-soft); }
.comp-track { height: 6px; border-radius: 99px; background: rgba(59,48,104,0.10); overflow: hidden; }
.comp-fill { height: 100%; border-radius: 99px; background: var(--sleep-night); transition: width .8s cubic-bezier(.3,.8,.3,1); }
.comp-row .v { text-align: right; font-variant-numeric: tabular-nums; color: var(--plum); }

.flash { animation: flash .9s ease; }
@keyframes flash { 0% { background: rgba(117,99,194,.20); } 100% { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .flash { animation: none; } }

.demo-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: rgba(255,255,255,0.55); border: 1px dashed rgba(59,48,104,0.28);
  border-radius: var(--r-lg); padding: 12px 18px; margin-bottom: 20px;
  font-size: 13.5px; color: var(--plum);
}
.demo-banner b { font-weight: 700; }
.speed { display: flex; gap: 6px; margin-left: auto; }
.speed button {
  border: 1px solid var(--glass-rim); background: rgba(255,255,255,0.6); color: var(--plum);
  border-radius: var(--r-pill); padding: 5px 13px; font-size: 12px; font-weight: 700;
  transition: background .18s;
}
.speed button:hover { background: rgba(255,255,255,0.9); }
.speed button[aria-pressed="true"] { background: var(--plum); color: #fff; border-color: var(--plum); }

/* --------------------------------------------------- wake window band */
.ww-grid { display: grid; grid-template-columns: 1.15fr 1.15fr 1fr; gap: 30px; }
.ww-cell { min-width: 0; }

.ww-gauge {
  position: relative; height: 30px; border-radius: 9px; overflow: hidden;
  margin-top: 16px; display: flex;
}
.ww-zone { height: 100%; }
.ww-under { flex: 0 0 50%; background: rgba(182,169,224,0.55); }
.ww-in    { flex: 0 0 25%; background: rgba(62,156,122,0.42); }
.ww-over  { flex: 1;       background: rgba(217,89,75,0.34); }
.ww-needle {
  position: absolute; top: -3px; bottom: -3px; width: 3px; border-radius: 2px;
  background: var(--plum); box-shadow: 0 0 0 2px rgba(255,255,255,0.85);
  transition: left .6s cubic-bezier(.3,.8,.3,1);
}
.ww-scale {
  display: flex; justify-content: space-between; margin-top: 7px;
  font-size: 10.5px; font-weight: 700; color: var(--plum-soft); font-variant-numeric: tabular-nums;
}

.ww-ramp { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; align-items: end; }
.ww-ramp .col { text-align: center; }
.ww-ramp .bar {
  border-radius: 7px 7px 0 0; background: linear-gradient(180deg, var(--sleep-nap), var(--sleep-night));
  transition: height .6s cubic-bezier(.3,.8,.3,1);
}
.ww-ramp .bar.on { background: linear-gradient(180deg, #8FD9B6, var(--cta-ink)); }
.ww-ramp .v { font-size: 12px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; }
.ww-ramp .l { font-size: 10px; font-weight: 600; color: var(--plum-soft); margin-top: 2px; line-height: 1.25; }

.ww-ladder { display: grid; gap: 6px; margin-top: 12px; }
.ww-lrow { display: grid; grid-template-columns: 58px 1fr 74px; align-items: center; gap: 9px; font-size: 11px; }
.ww-lrow .age { font-weight: 700; color: var(--plum-soft); }
.ww-lrow .track { height: 15px; border-radius: 5px; background: rgba(59,48,104,0.07); position: relative; }
.ww-lrow .bar { position: absolute; top: 0; bottom: 0; border-radius: 5px; background: var(--sleep-nap); opacity: .6; }
.ww-lrow .val { text-align: right; color: var(--plum-soft); font-weight: 600; font-variant-numeric: tabular-nums; }
.ww-lrow.cur .age, .ww-lrow.cur .val { color: var(--plum); }
.ww-lrow.cur .bar { background: var(--sleep-night); opacity: 1; }
.ww-lrow.cur .track { background: rgba(94,77,168,0.12); box-shadow: 0 0 0 1px rgba(94,77,168,0.28); }

.ww-src {
  margin-top: 22px; padding-top: 15px; border-top: 1px solid rgba(59,48,104,0.10);
  font-size: 12.5px; color: var(--plum-soft); line-height: 1.55;
}
.ww-src b { color: var(--plum); }
.ww-src a { color: var(--accent-ink); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.ww-dis { display: block; margin-top: 4px; font-size: 11.5px; color: var(--plum-soft); font-style: italic; }

@media (max-width: 1080px) { .ww-grid { grid-template-columns: 1fr; gap: 26px; } }

/* ------------------------------------------------------ under the hood */
.hood {
  background: linear-gradient(150deg, #12102A, #1B1740 60%, #241C46);
  border: 1px solid rgba(255,255,255,0.13); color: #E7E2F7;
}
.hood .dcard-hd h3 { color: rgba(231,226,247,0.55); }
.hood .hint { color: rgba(231,226,247,0.5); }
.hood-mono {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11.5px; line-height: 1.65;
}
.hood-feed { max-height: 250px; overflow-y: auto; display: flex; flex-direction: column; gap: 7px; padding-right: 4px; }
.hood-feed::-webkit-scrollbar { width: 5px; }
.hood-feed::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.16); border-radius: 99px; }
.row-json {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.09);
  border-radius: 10px; padding: 8px 11px; white-space: pre-wrap; word-break: break-word;
  animation: evIn .5s cubic-bezier(.2,.8,.3,1);
}
@media (prefers-reduced-motion: reduce) { .row-json { animation: none; } }
.k  { color: #A99CE8; }   /* key */
.s  { color: #8FD9B6; }   /* string */
.nu { color: #F2C48B; }   /* number */
.nl { color: #7E76A8; }   /* null */
.op { color: #6B639B; }   /* punctuation */

.pipe { display: grid; gap: 0; }
.pipe-step {
  display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 11px; align-items: start;
  padding: 9px 0; position: relative;
}
.pipe-step + .pipe-step::before {
  content: ""; position: absolute; left: 10.5px; top: -8px; height: 18px;
  border-left: 1px dashed rgba(255,255,255,0.22);
}
.pipe-num {
  width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center;
  background: rgba(255,255,255,0.10); font-size: 10.5px; font-weight: 800; color: #C9BFF5;
}
.pipe-fn { font-size: 12.5px; font-weight: 700; letter-spacing: -0.01em; min-width: 0; }
.pipe-fn code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px; color: #C4B7F5;
  overflow-wrap: anywhere;
}
.pipe-src { font-size: 10.5px; color: rgba(231,226,247,0.42); margin-top: 2px;
            font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
            overflow-wrap: anywhere; }
.pipe-out { font-size: 11.5px; color: #8FD9B6; margin-top: 3px; font-variant-numeric: tabular-nums;
            overflow-wrap: anywhere; }

.math { display: grid; gap: 9px; }
.math-row {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.09);
  border-radius: 10px; padding: 9px 11px;
}
.math-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.math-name { font-size: 12px; font-weight: 700; letter-spacing: -0.01em; }
.math-w { font-size: 10.5px; color: rgba(231,226,247,0.45); font-family: ui-monospace, Menlo, monospace; }
.math-expr {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10.5px;
  color: #A99CE8; margin-top: 4px; word-break: break-word;
}
.math-val { font-size: 12.5px; font-weight: 700; color: #8FD9B6; font-variant-numeric: tabular-nums; }
.math-total {
  border-top: 1px solid rgba(255,255,255,0.14); padding-top: 11px; margin-top: 2px;
  display: flex; align-items: baseline; justify-content: space-between;
}
.math-total .l { font-size: 12px; font-weight: 700; color: rgba(231,226,247,0.6); }
.math-total .v { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }

@media (max-width: 1080px) {
  .c3,.c4,.c5,.c6,.c7,.c8,.c9 { grid-column: span 6; }
}
@media (max-width: 720px) {
  .dgrid > * { grid-column: span 12 !important; }
  .simclock { margin-left: 0; width: 100%; }
}

/* ═══════════════════════════════════ app-parity cards (Reports mirror) ══ */

/* section headers — mirror the app's icon + label rows */
.dsec {
  display: flex; align-items: center; gap: 9px;
  margin: 34px 0 14px; font-size: 12.5px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--plum-soft);
}
.dsec-ic { font-size: 14px; opacity: .75; }
.dsec .range { margin-left: auto; display: flex; gap: 5px; }
.dsec .range button {
  border: 1px solid var(--glass-rim); background: rgba(255,255,255,0.55); color: var(--plum);
  border-radius: var(--r-pill); padding: 5px 14px; font-size: 12px; font-weight: 700;
  letter-spacing: 0; text-transform: none;
}
.dsec .range button[aria-pressed="true"] { background: #fff; box-shadow: var(--shadow-card); }

.milestones-link {
  font-size: 13.5px; font-weight: 700; color: var(--cta-ink);
  text-decoration: underline; text-underline-offset: 3px;
}

/* WeekPulse — keeps the app's CATEGORY colours, per the dusk rule:
   surfaces go dusk, but sleep-blue / feed-coral / diaper-gold stay legible. */
.pulse { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.pulse-pill { border-radius: var(--r-lg); border: 1.5px solid; padding: 14px 16px; }
.pulse-l { font-size: 10.5px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; opacity: .85; }
.pulse-v { font-size: 27px; font-weight: 700; letter-spacing: -0.035em; margin-top: 3px; font-variant-numeric: tabular-nums; }
.pulse-v .u { font-size: 15px; font-weight: 600; opacity: .6; }
.pulse-d { font-size: 12.5px; font-weight: 700; margin-top: 3px; }
.goal-link {
  display: inline-block; margin-top: 14px; font-size: 14px; font-weight: 700;
  color: var(--cta-ink); text-decoration: underline; text-underline-offset: 3px;
}

/* NextStepRibbon */
.ribbon { border-left: 4px solid var(--dusk-accent); }
.ribbon.urgent { border-left-color: var(--warning); }
.rib-title { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.3; }
.rib-body { font-size: 13.5px; color: var(--plum-soft); line-height: 1.5; margin-top: 7px; }
.rib-cta { margin-top: 12px; font-size: 13px; font-weight: 700; color: var(--cta-ink); }

/* Insights list */
.ins-list { display: grid; gap: 8px; }
.ins-row {
  display: flex; gap: 11px; align-items: flex-start;
  background: rgba(255,255,255,0.55); border: 1px solid rgba(255,255,255,0.7);
  border-radius: 13px; padding: 10px 13px;
}
.ins-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; margin-top: 6px; }
.ins-t { font-size: 13.5px; font-weight: 700; letter-spacing: -0.015em; }
.ins-s { font-size: 12.5px; color: var(--plum-soft); margin-top: 2px; line-height: 1.45; }

/* Pattern (CalendarChart) header stats */
.pat-stats { display: flex; gap: 30px; margin-bottom: 14px; }
.pat-stats .pl { display: block; font-size: 10px; font-weight: 800; letter-spacing: 0.1em;
                 text-transform: uppercase; color: var(--plum-soft); }
.pat-stats .pv { display: block; font-size: 19px; font-weight: 700; letter-spacing: -0.03em;
                 font-variant-numeric: tabular-nums; margin-top: 2px; }

/* shared headline + stat rows */
.fr-head { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.35; margin-bottom: 12px; }
.fr-stats { display: flex; gap: 26px; margin-bottom: 12px; flex-wrap: wrap; }
.fr-stats .l { display: block; font-size: 10px; font-weight: 800; letter-spacing: 0.09em;
               text-transform: uppercase; color: var(--plum-soft); }
.fr-stats .v { display: block; font-size: 18px; font-weight: 700; letter-spacing: -0.03em;
               margin-top: 2px; font-variant-numeric: tabular-nums; }

/* 100%-stacked split bars (laterality, feed mix) */
.split-bar { display: flex; height: 26px; border-radius: 8px; overflow: hidden; margin: 4px 0 9px; }
.split-bar span { height: 100%; display: block; }
.split-lb { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 700; }

/* TypicalDayClock */
.clock-wrap { display: flex; gap: 26px; align-items: center; flex-wrap: wrap; }
.clock-side { flex: 1; min-width: 190px; }
.ck-head { font-size: 15px; font-weight: 600; line-height: 1.5; letter-spacing: -0.01em; }
.ck-head b { font-weight: 800; }

/* TotalSleepVsAge band */
.band-viz { position: relative; height: 24px; border-radius: 8px; background: rgba(59,48,104,0.08);
            margin: 12px 0 6px; overflow: visible; }
.band-healthy { position: absolute; top: 0; bottom: 0; background: rgba(62,156,122,0.3); border-radius: 8px; }
.band-dot { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px;
            border-radius: 50%; background: var(--plum); border: 2px solid #fff;
            box-shadow: 0 1px 4px rgba(59,48,104,0.3); transition: left .7s cubic-bezier(.3,.8,.3,1); }
.band-scale { display: flex; justify-content: space-between; font-size: 10.5px; font-weight: 700;
              color: var(--plum-soft); }

.what-moves {
  margin-top: 12px; padding: 11px 13px; border-radius: 12px;
  background: rgba(117,99,194,0.10); border: 1px solid rgba(117,99,194,0.2);
  font-size: 12.5px; line-height: 1.5; color: var(--plum);
}

/* DiaperHealth */
.dh-row { display: flex; gap: 18px; align-items: center; margin-bottom: 12px; }
.dh-stats { display: grid; gap: 10px; flex: 1; }
.dh-stats .l { font-size: 10px; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase;
               color: var(--plum-soft); }
.dh-stats .v { font-size: 17px; font-weight: 700; letter-spacing: -0.03em; }

/* Growth — the honest can't-build card */
.offline { background: rgba(255,255,255,0.42); border-style: dashed; border-color: rgba(59,48,104,0.25); }
.off-body { display: flex; gap: 14px; align-items: flex-start; color: var(--plum-soft); }
.off-t { font-size: 14.5px; font-weight: 700; color: var(--plum); letter-spacing: -0.015em; }
.off-s { font-size: 13px; line-height: 1.55; margin-top: 5px; }
.off-s code { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; color: var(--accent-ink); }

/* Solids */
.sol-row { display: flex; gap: 34px; margin-bottom: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chips span {
  font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: var(--r-pill);
  background: rgba(199,103,155,0.14); color: #7A2E5A; border: 1px solid rgba(199,103,155,0.25);
}

.big .u { font-size: 15px; font-weight: 600; opacity: .55; letter-spacing: 0; }

@media (max-width: 720px) {
  .pulse { grid-template-columns: 1fr 1fr; }
  .clock-wrap { justify-content: center; }
  .dsec .range { width: 100%; margin-left: 0; margin-top: 8px; }
}

/* Monospace panels must never widen their card — a 1fr track sizes to
   min-content, and code strings have no break opportunities. */
.hood-mono, .pipe, .math { min-width: 0; }
.math-expr, .math-name { overflow-wrap: anywhere; }
.dcard, .dcard-hd, .dcard-hd h3 { min-width: 0; }
.dcard-hd { flex-wrap: wrap; }

/* Touch targets. The speed and range pills are the only controls on this page,
   and at 26px tall they were under any reasonable thumb size. */
@media (max-width: 980px) {
  .speed button, .dsec .range button {
    min-height: 38px; padding: 8px 16px; font-size: 13px;
  }
  .speed, .dsec .range { gap: 8px; }
  .milestones-link { padding: 10px 0; display: inline-block; }
  .demo-banner { padding: 14px 16px; }
  .dhead { gap: 12px; }
  /* The 24h axis labels get cramped below ~420px. */
  .tl-hours span:nth-child(even) { display: none; }
}

/* ═══════════════════════════════════════════════ sleep insights page ══ */
.ins-hero { max-width: 780px; margin: 20px 0 34px; }
.ins-h1 { font-size: clamp(32px, 4.4vw, 52px); letter-spacing: -0.035em; line-height: 1.06; margin-bottom: 18px; }
.ins-lede { font-size: 17.5px; line-height: 1.6; color: var(--plum); }
.ins-stamp { display: flex; align-items: center; gap: 16px; margin-top: 22px; flex-wrap: wrap; }
.ins-method-link { font-size: 14px; font-weight: 700; color: var(--accent-ink);
                   text-decoration: underline; text-underline-offset: 3px; }

.ins-stat .ins-big {
  font-size: clamp(38px, 4.4vw, 54px); font-weight: 700; letter-spacing: -0.045em;
  line-height: 1; font-variant-numeric: tabular-nums;
}
.ins-stat .ins-big .u {
  display: block; font-size: 13px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--plum-soft); margin-top: 8px;
}

.ins-dark {
  background: radial-gradient(420px 300px at 25% 10%, rgba(255,255,255,0.10), transparent 65%),
              linear-gradient(150deg, #12102A, #1E1848 60%, #2A2159);
  border-color: rgba(255,255,255,0.14); color: #E7E2F7;
}
.ins-dark .dcard-hd h3, .ins-dark .hint { color: rgba(231,226,247,0.55); }
.ins-ring { display: grid; place-items: center; padding: 6px 0 4px; }

.ins-axis {
  margin-top: 12px; text-align: center;
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.11em; text-transform: uppercase;
  color: var(--plum-soft);
}
.ins-dark .ins-axis { color: rgba(231,226,247,0.5); }

.ins-claim { font-size: 25px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.28; }
.ins-claim b { color: var(--accent-ink); }
.ins-body { font-size: 15px; line-height: 1.62; color: var(--plum); margin-top: 14px; }
.ins-body a { color: var(--accent-ink); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }

.ins-dots { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 20px; max-width: 340px; }
.ins-dot { width: 15px; height: 15px; border-radius: 50%; background: rgba(59,48,104,0.14); }
.ins-dot.on { background: var(--sleep-night); box-shadow: 0 0 0 3px rgba(94,77,168,0.18); }
.ins-note { font-size: 12.5px; color: var(--plum-soft); margin-top: 10px; }

.ins-method .mrow { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 26px; }
.ins-method .mlab {
  font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent-ink); margin-bottom: 8px;
}
.ins-method p { font-size: 14px; line-height: 1.58; color: var(--plum); }
.ins-method .mfoot {
  margin-top: 22px; padding-top: 16px; border-top: 1px solid rgba(59,48,104,0.12);
  font-size: 12.5px; color: var(--plum-soft); font-style: italic;
}
@media (max-width: 900px) { .ins-method .mrow { grid-template-columns: 1fr 1fr; gap: 20px; } }
@media (max-width: 620px) { .ins-method .mrow { grid-template-columns: 1fr; } }

/* ─────────────────────────────────────────── age reference tool ────── */
.at-card { padding: 26px 28px; }
.at-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.at-kick { font-size: 11.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--plum-soft); }
.at-age { font-size: clamp(26px, 3.4vw, 38px); font-weight: 700; letter-spacing: -.035em; margin-top: 4px; }
.at-presets { display: flex; gap: 7px; flex-wrap: wrap; }
.at-preset {
  border: 1px solid var(--glass-rim); background: rgba(255,255,255,0.6); color: var(--plum);
  border-radius: var(--r-pill); padding: 9px 15px; font-size: 13px; font-weight: 700;
}
.at-preset[aria-pressed="true"] { background: var(--plum); color: #fff; border-color: var(--plum); }

.at-slider { -webkit-appearance: none; appearance: none; width: 100%; height: 8px;
  border-radius: 99px; margin: 22px 0 6px; background: linear-gradient(90deg, #B6A9E0, #5E4DA8); }
.at-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 30px; height: 30px; border-radius: 50%;
  background: #fff; border: 3px solid var(--sleep-night); cursor: grab;
  box-shadow: 0 3px 10px rgba(59,48,104,.28);
}
.at-slider::-moz-range-thumb {
  width: 26px; height: 26px; border-radius: 50%; background: #fff;
  border: 3px solid var(--sleep-night); cursor: grab;
}
.at-scale { display: flex; justify-content: space-between; font-size: 11px; font-weight: 700;
            color: var(--plum-soft); margin-bottom: 24px; }

.at-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; margin-bottom: 26px; }
.at-metric { background: rgba(255,255,255,0.52); border: 1px solid var(--glass-rim);
             border-radius: var(--r-lg); padding: 18px; }
.at-ml { font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--plum-soft); }
.at-mv { font-size: 32px; font-weight: 700; letter-spacing: -.04em; margin: 6px 0 8px;
         font-variant-numeric: tabular-nums; }
.at-ms { font-size: 13px; line-height: 1.5; color: var(--plum-soft); }

.at-split { display: grid; grid-template-columns: 1fr 1fr; gap: 34px; align-items: start; }
.at-sub { font-size: 15.5px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 10px; }
.at-ramp { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px;
           align-items: end; margin-top: 16px; }
.at-col { text-align: center; }
.at-bar { border-radius: 8px 8px 0 0; background: linear-gradient(180deg, #B6A9E0, #5E4DA8); }
.at-v { font-size: 13px; font-weight: 700; margin-top: 7px; }
.at-l { font-size: 10.5px; font-weight: 600; color: var(--plum-soft); margin-top: 2px; }

.at-next { display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 26px; padding: 14px 18px; border-radius: var(--r-lg);
  background: rgba(62,156,122,0.10); border: 1px solid rgba(49,124,97,0.22);
  font-size: 14.5px; color: var(--plum); }
.at-nl { font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #235C46; }

.at-foot { margin-top: 20px; padding-top: 16px; border-top: 1px solid rgba(59,48,104,.12);
           font-size: 13px; line-height: 1.55; color: var(--plum-soft); }
.at-foot a { color: var(--accent-ink); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 900px) {
  .at-grid { grid-template-columns: 1fr; }
  .at-split { grid-template-columns: 1fr; gap: 26px; }
}

/* ───────────────────────────────────── shareable insight cards ─────── */
.sc-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 26px; }
.sc { margin: 0; }
.sc-frame {
  border-radius: 20px; overflow: hidden; background: #EDE8F8;
  box-shadow: var(--shadow-lift); border: 1px solid var(--glass-rim);
  transition: transform .25s cubic-bezier(.2,.7,.3,1), box-shadow .25s;
}
.sc:hover .sc-frame { transform: translateY(-4px); box-shadow: var(--shadow-deep); }
.sc-bar { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* One control by default. Studio-only chrome is hidden unless ?studio=1. */
.sc-share {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--glass-rim); background: rgba(255,255,255,0.72); color: var(--plum);
  border-radius: var(--r-pill); padding: 9px 18px; font-size: 13.5px; font-weight: 700;
  min-height: 38px; transition: background .18s, color .18s, border-color .18s;
}
.sc-share:hover { background: #fff; }
.sc-share.done { background: var(--cta-ink); border-color: var(--cta-ink); color: #fff; }

.sc-fmts, .sc-dl { display: none; }
body.studio .sc-fmts { display: flex; gap: 5px; }
body.studio .sc-dl { display: inline-flex; }
.sc-fmt {
  border: 1px solid var(--glass-rim); background: rgba(255,255,255,0.6); color: var(--plum-soft);
  border-radius: var(--r-pill); padding: 6px 11px; font-size: 11.5px; font-weight: 800;
  min-height: 32px;
}
.sc-fmt[aria-pressed="true"] { background: var(--plum); color: #fff; border-color: var(--plum); }
.sc-dl {
  margin-left: auto; align-items: center;
  border: 1px solid var(--glass-rim); background: rgba(255,255,255,0.72); color: var(--plum);
  border-radius: var(--r-pill); padding: 7px 14px; font-size: 12.5px; font-weight: 700;
  min-height: 32px;
}

@media (max-width: 1080px) { .sc-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px)  { .sc-grid { grid-template-columns: 1fr; } }

.ins-strip { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 26px; padding: 24px 26px; }
.ins-strip .st-l { font-size: 11px; font-weight: 800; letter-spacing: .09em;
                   text-transform: uppercase; color: var(--plum-soft); }
.ins-strip .st-v { font-size: 34px; font-weight: 700; letter-spacing: -.04em; margin-top: 4px;
                   font-variant-numeric: tabular-nums; }
.ins-strip .st-v span { display: block; font-size: 12.5px; font-weight: 600; letter-spacing: 0;
                        color: var(--plum-soft); margin-top: 3px; }
.ins-strip .st-note { grid-column: 1 / -1; padding-top: 16px; margin-top: 2px;
  border-top: 1px solid rgba(59,48,104,.12); font-size: 12.5px; line-height: 1.55;
  color: var(--plum-soft); font-style: italic; }
@media (max-width: 720px) { .ins-strip { grid-template-columns: 1fr; gap: 18px; } }

/* The slider's visible track is 8px but its hit area was 8px too — nearly
   impossible to grab with a thumb. Pad the box, clip the paint to content. */
.at-slider { padding: 14px 0; background-clip: content-box; box-sizing: content-box; }
@media (max-width: 900px) {
  .ins-method-link { display: inline-block; padding: 9px 0; }
}
