/* v190 sleep-health screens, built on css/minimal.css (see docs/design-system-v190.md). Scoped to this area only.
   .sl = Sleep, .hs = Health signals. .sl-analysis / .sl-fine / .sl-head also render inside Protocols
   (sleepAnalysisCard), so those rules are scoped to their own class, not to .sl. */

/* ============================================================
   Shared bits
   ============================================================ */
.sl-fine { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--tx-3); }
.sl-wide { width: 100%; margin-top: 16px; }

/* card head: title, quiet meta, optional value on the right */
.sl-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.sl-head b { font-size: 15px; font-weight: 500; color: var(--tx); }
.sl-head span { font-size: 12.5px; color: var(--tx-3); }
.sl-head strong {
  margin-left: auto; font-family: var(--font-display, inherit); font-size: 24px; font-weight: 400; line-height: 1;
  letter-spacing: -.01em; color: var(--tx); font-variant-numeric: tabular-nums;
}
.sl-head strong em { margin-left: 2px; font-family: inherit; font-size: 13px; font-style: normal; color: var(--tx-3); }
.sl-head strong.ahead { color: var(--accent); }
.sl-copy { margin: 10px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--tx-2); }
.sl-copy b { font-weight: 600; color: var(--tx); }

/* Apple Health, compact and flat on both screens */
.screen .sl .ah-card, .screen .hs .ah-card {
  margin: 0; padding: 16px; gap: 12px; border-radius: var(--m-radius); background: var(--m-surface);
  box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none;
}
.screen .sl .ah-logo, .screen .hs .ah-logo { width: 32px; height: 32px; border-radius: 10px; }
.screen .sl .ah-logo svg, .screen .hs .ah-logo svg { width: 18px; height: 18px; }
.screen .sl .ah-copy, .screen .hs .ah-copy { font-size: 12.5px; color: var(--tx-3); }
.screen .sl .ah-btn, .screen .hs .ah-btn { min-height: 44px; border-radius: 999px; }
.sl-ah { margin-top: var(--m-gap); }
/* the Related row right below already opens Health signals */
.screen .sl .ah-card .ah-btn[data-act="tab"] { display: none; }

/* ============================================================
   Sleep
   ============================================================ */
.sl { padding-bottom: 8px; }

/* hero: the score, one flat surface */
.sl-hero { padding: 20px; }
.sl-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.sl-hero .m-hero strong em { margin-left: 6px; font-size: 15px; }
.sl-ring { flex: none; width: 76px; height: 76px; transform: rotate(-90deg); }
.sl-ring circle { fill: none; stroke-width: 7; }
.sl-ring-track { stroke: var(--line-2); }
.sl-ring-fill { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .8s cubic-bezier(.22, 1, .36, 1); }
.sl-factors { display: grid; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.sl-factor { display: grid; grid-template-columns: 72px minmax(0, 1fr) 100px; align-items: center; gap: 12px; font-size: 13px; }
.sl-factor span { color: var(--tx-3); }
.sl-factor i { height: 4px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.sl-factor s { display: block; height: 100%; border-radius: inherit; background: var(--accent); text-decoration: none; }
.sl-factor b { font-weight: 500; color: var(--tx); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Tonight: one list, each item a row plus its controls */
.sl-list > * + * { border-top: 1px solid var(--line); }
.sl-item > summary { list-style: none; }
.sl-item > summary::-webkit-details-marker { display: none; }
.sl-item > summary .m-row-go { transition: transform .2s; }
.sl-item[open] > summary .m-row-go { transform: rotate(90deg); }
.sl-static { cursor: default; }
.sl-static:active { background: transparent; }
.sl-item-body { display: grid; gap: 12px; padding: 0 14px 16px 48px; }
.sl-inline-lbl { flex: none; font-size: 13px; color: var(--tx-3); }
.sl-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sl-actions .m-btn { flex: 1 1 auto; }
.sl-pill {
  flex: none; min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent;
  color: var(--tx-2); font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer;
}
.sl-pill:active { background: var(--m-surface-2); }
.sl-now .m-row-ico { color: var(--blue-2, var(--accent)); }
/* night stack from Protocols (v201) */
.sl-stack-go { background: none; border: 0; padding: 0; margin: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.sl-stack .m-row-ico { color: var(--blue-2, var(--accent)); }
.sl-stack.is-done .m-row-ico, .sl-stack-ok { color: var(--accent); }

/* bedtime options: four quiet columns, the recommended one lifted */
.sl-slots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.sl-slot { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; border-radius: 12px; text-align: center; }
.sl-slot b { font-size: 14px; font-weight: 500; color: var(--tx); white-space: nowrap; font-variant-numeric: tabular-nums; }
.sl-slot b em { margin-left: 2px; font-size: 10px; font-style: normal; color: var(--tx-3); }
.sl-slot span { font-size: 11.5px; color: var(--tx-2); }
.sl-slot small { font-size: 11px; color: var(--tx-2); }
.sl-slot.best { background: var(--m-surface-2); }
.sl-slot.best small { color: var(--accent); }
.sl-slot.warn { opacity: .6; }

/* wind-down */
.sl-anchor { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; }
.sl-anchor span { color: var(--tx-3); }
.sl-anchor b { display: inline-flex; align-items: center; gap: 8px; min-width: 0; font-weight: 500; color: var(--tx); }
.sl-anchor b svg { flex: none; width: 16px; height: 16px; color: var(--tx-2); }
.sl-item-body > .sl-wide { margin-top: 0; }
.sl-goodnight { display: flex; gap: 10px; margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--tx-2); }
.sl-goodnight b { font-weight: 600; color: var(--tx); }
.sl-goodnight-ico { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--tx-2); }
.sl-goodnight-ico svg { width: 18px; height: 18px; }

/* morning */
.sl-q { margin: 0 0 12px; font-size: 15px; line-height: 1.35; color: var(--tx); }
.sl-morning .sl-fine { margin-top: 12px; }
.sl-wake { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.sl-wake .m-chip { min-width: 0; padding: 0 4px; }

/* section caption with a live marker */
.sl-cap { display: flex; align-items: center; gap: 10px; }
.sl-live { display: inline-flex; align-items: center; gap: 6px; color: var(--blue-2, var(--accent)); }
.sl-live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: slLive 2.4s ease-in-out infinite; }
.sl-sub { margin: 0 0 8px; font-size: 12.5px; color: var(--tx-3); }
.sl-dur { font-size: 13px; font-weight: 400; color: var(--tx-3); }
.sl-dur em { margin-left: 2px; font-size: 11px; font-style: normal; }
.sl-credits { margin-top: var(--m-gap); }
.sl-credits > summary { min-height: 48px; font-size: 14px; color: var(--tx-2); }
.sl-credits > p { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--tx-3); }
.sl-lastnight { margin-top: 12px; color: var(--tx-2); }

/* trends: sleep debt */
.sl-debt-strip { position: relative; display: flex; align-items: center; gap: 4px; height: 52px; }
.sl-debt-strip::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--line-2); }
.sl-db { position: relative; flex: 1; height: 100%; }
.sl-db::after { content: ''; position: absolute; left: 50%; width: 6px; margin-left: -3px; border-radius: 3px; height: var(--m, 2px); }
.sl-db.up::after { bottom: 50%; background: var(--accent); }
.sl-db.down::after { top: 50%; background: color-mix(in srgb, var(--tx-3) 60%, transparent); }
.sl-db.empty::after { top: calc(50% - 1.5px); width: 3px; height: 3px; margin-left: -1.5px; background: var(--line-2); }

/* trends: last 7 nights (also shown in Protocols) */
.sl-analysis .sl-head span { margin-left: auto; }
.sl-avg { display: flex; align-items: baseline; gap: 10px; }
.sl-avg strong {
  font-family: var(--font-display, inherit); font-size: 40px; font-weight: 400; line-height: 1; letter-spacing: -.02em;
  color: var(--tx); font-variant-numeric: tabular-nums;
}
.sl-avg strong em { margin-left: 3px; font-size: 15px; font-style: normal; color: var(--tx-3); }
.sl-avg span { font-size: 12.5px; color: var(--tx-3); }
.sl-analysis .sl-copy { margin-top: 8px; }
.sl-bars { display: flex; gap: 8px; height: 116px; margin: 18px 0 0; }
.sl-bar {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 0;
  border: 0; background: none; color: inherit; font: inherit; cursor: pointer;
}
.sl-bar-h { min-height: 14px; font-size: 11px; color: var(--tx-3); font-variant-numeric: tabular-nums; }
.sl-bar-track { flex: 1; width: 100%; max-width: 22px; display: flex; align-items: flex-end; }
.sl-bar-track i { display: block; width: 100%; border-radius: 6px; background: var(--line-2); transition: height .5s cubic-bezier(.22, 1, .36, 1); }
.sl-bar.kept i { background: var(--accent); }
.sl-bar.low i { background: color-mix(in srgb, var(--tx-3) 45%, transparent); }
.sl-bar-d { font-size: 11px; color: var(--tx-3); }
.sl-bar.editing .sl-bar-d { font-weight: 600; color: var(--blue-2, var(--accent)); }
.sl-bar.editing i { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--blue, var(--accent)); }
.sl-stats { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 0 22px; margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
.sl-stats div { min-width: 0; }
.sl-stats dt { font-size: 11.5px; color: var(--tx-3); }
.sl-stats dd { margin: 2px 0 0; font-size: 14px; font-weight: 500; color: var(--tx); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sl-stats dd::first-letter { text-transform: uppercase; }
.sl-log { display: grid; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.sl-log-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--tx-3); }
.sl-log-head b { font-weight: 500; color: var(--tx); }
.sl-link { padding: 4px 0; border: 0; background: none; color: var(--blue-2, var(--accent)); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.sl-quality { gap: 6px; }
.sl-quality .m-chip { flex: 1; min-width: 0; padding: 0 8px; }
.sl-analysis > .sl-fine { margin-top: 14px; }

/* premium lock: line icon instead of emoji */
.sl-lock .ptl-icon { color: var(--accent); filter: none; }
.sl-lock .ptl-icon svg { width: 34px; height: 34px; }

/* ============================================================
   Sleep studio (v196): Tonight card, library, timer
   ============================================================ */
/* Tonight: a night scene behind one clear action. Always dark, in every theme. */
.sl-feature {
  position: relative; isolation: isolate; overflow: hidden; display: grid; gap: 16px; min-height: 176px;
  padding: 22px 20px 20px; border-radius: var(--m-radius); border: 1px solid rgba(125, 157, 255, .28);
  background: radial-gradient(130% 150% at 88% -10%, rgba(68, 115, 255, .38), rgba(10, 17, 34, 0) 58%), linear-gradient(180deg, #0d1733 0%, #070c1c 100%);
  color: #fff;
}
.sl-scene { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; }
.sl-scene-moon { fill: #e9efff; filter: drop-shadow(0 0 10px rgba(148, 177, 255, .85)); }
.sl-scene-stars circle { fill: #c9d6ff; opacity: .55; animation: slTwinkle 5s ease-in-out infinite; animation-delay: calc(var(--i) * -.7s); }
.sl-scene-arc { fill: none; stroke: rgba(125, 157, 255, .34); stroke-width: 1.2; }
.sl-scene-arc-2 { stroke: rgba(125, 157, 255, .16); }
.sl-feature.is-live .sl-scene-moon { animation: slMoon 7s ease-in-out infinite; transform-origin: 268px 46px; }
.sl-feature-txt { max-width: 80%; }
.sl-feature-txt small { font-size: 11.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #9fb6ff; }
.sl-feature-txt h2 { margin: 6px 0; font-family: var(--font-display, inherit); font-size: 25px; font-weight: 400; line-height: 1.15; letter-spacing: -.01em; color: #fff; }
.sl-feature-txt p { margin: 0; font-size: 13.5px; line-height: 1.45; color: rgba(225, 232, 255, .74); font-variant-numeric: tabular-nums; }
.sl-feature-go { justify-self: start; display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 24px; box-shadow: 0 8px 26px rgba(47, 93, 242, .5); }
.sl-feature-go svg, .sl-feature-acts svg { width: 16px; height: 16px; }
.sl-feature-acts { display: flex; gap: 8px; }
.sl-feature-acts .m-btn-ghost { display: grid; place-items: center; width: 48px; min-height: 48px; padding: 0; border-color: rgba(160, 185, 255, .24); background: rgba(160, 185, 255, .08); color: #fff; }

/* library: four panels behind one segmented control */
.sl-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; padding: 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--m-surface); }
.sl-tab {
  position: relative; min-width: 0; min-height: 38px; padding: 0 4px; border: 0; border-radius: 999px; background: transparent;
  color: var(--tx-2); font: inherit; font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: background .2s, color .2s;
}
.sl-tab[aria-selected="true"] { background: var(--blue-grad, var(--accent)); color: #fff; box-shadow: 0 4px 14px rgba(47, 93, 242, .32); }
.sl-tab-dot { position: absolute; top: 7px; right: 9px; width: 5px; height: 5px; border-radius: 50%; background: var(--blue-2, var(--accent)); }
.sl-tab[aria-selected="true"] .sl-tab-dot { background: #fff; }
.sl-panel { padding-top: 16px; animation: slPanelIn .35s cubic-bezier(.22, 1, .36, 1); }
.sl-panel .sl-sub { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.sl-panel .sl-sub span { font-size: 11.5px; opacity: .8; }
.sl-panel .sl-tiles + .sl-sub { margin-top: 18px; }
.sl-panel-note { margin-top: 12px; padding: 0 4px; }

/* sound and frequency tiles */
.sl-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sl-tile {
  --art: #5b8cff;
  position: relative; display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 64px; padding: 10px 26px 10px 10px;
  border-radius: 16px; border: 1px solid var(--line); background: var(--m-surface); color: var(--tx);
  font: inherit; text-align: left; cursor: pointer; transition: background .2s, border-color .2s, transform .15s;
}
.sl-tile:active { transform: scale(.97); }
.sl-tile.g-noise { --art: #7fa6d6; }
.sl-tile.g-binaural { --art: #9b8cff; }
.sl-tile.g-tone { --art: #94b1ff; }
.sl-tile-ico {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  background: radial-gradient(120% 120% at 30% 20%, color-mix(in srgb, var(--art) 42%, transparent), color-mix(in srgb, var(--art) 10%, transparent));
  color: color-mix(in srgb, var(--art) 62%, #fff);
}
.sl-tile-ico svg { width: 20px; height: 20px; }
.sl-tile-txt { display: grid; gap: 1px; min-width: 0; }
.sl-tile-txt b { font-size: 14px; font-weight: 600; color: var(--tx); }
.sl-tile-txt small { font-size: 11.5px; line-height: 1.3; color: var(--tx-3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sl-tile.on { border-color: var(--blue-line, var(--line-2)); background: var(--blue-soft, var(--m-surface-2)); }
.sl-tile.on .sl-tile-ico { box-shadow: 0 0 18px color-mix(in srgb, var(--art) 45%, transparent); }
.sl-tile .sl-eq { position: absolute; top: 11px; right: 10px; }

/* guided and breathing rows */
.sl-rows .sl-row { gap: 12px; }
.sl-rows .sl-row-art {
  width: 42px; height: 42px; border-radius: 13px; color: #e2e9ff;
  background: radial-gradient(120% 120% at 30% 20%, rgba(68, 115, 255, .5), rgba(44, 88, 238, .14));
}
.sl-rows .sl-row-art svg { width: 22px; height: 22px; }
.sl-row-state { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--m-surface-2); color: var(--tx-2); }
.sl-row-state svg { width: 12px; height: 12px; margin-left: 2px; }
.sl-row.on .sl-row-state { background: var(--blue-soft, var(--m-surface-2)); }
.sl-row.on .m-row-txt b { color: var(--blue-3, var(--tx)); }

/* light theme: ink the icons so they read on pale surfaces */
[data-theme="light"] .sl-tile-ico { color: color-mix(in srgb, var(--art) 70%, #1a1f2b); background: color-mix(in srgb, var(--art) 18%, #fff); }
[data-theme="light"] .sl-rows .sl-row-art { color: #2c4fcf; background: color-mix(in srgb, #4473ff 16%, #fff); }

/* the live equalizer on whatever is playing */
.sl-eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.sl-eq i { width: 2.5px; height: 100%; border-radius: 2px; background: var(--blue-2, var(--accent)); transform-origin: bottom; animation: slEq 1.1s ease-in-out infinite; }
.sl-eq i:nth-child(2) { animation-delay: -.4s; }
.sl-eq i:nth-child(3) { animation-delay: -.75s; }
.sl-studio.is-paused .sl-eq i { animation-play-state: paused; }

/* sleep timer, under the library and in the player */
.sl-timer-wrap { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.sl-timer { display: grid; gap: 10px; }
.sl-timer .m-chips { gap: 6px; }
.sl-timer .m-chip { min-width: 52px; min-height: 36px; padding: 0 13px; }
.sl-timer .sl-fine { font-variant-numeric: tabular-nums; }

/* trends: guided wind-downs this week */
.sl-sess-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-top: 4px; }
.sl-sess-days i { height: 8px; border-radius: 99px; background: var(--line-2); }
.sl-sess-days i.on { background: var(--accent); }
.sl-sess { margin-top: 10px; }

/* ============================================================
   Now playing: the dock (any screen) and the player sheet
   ============================================================ */
.sl-dock {
  position: fixed; z-index: 48; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  display: grid; grid-template-columns: minmax(0, 1fr) 44px 44px; align-items: center; gap: 2px;
  width: calc(100% - 28px); max-width: 440px; padding: 6px 6px 6px 8px; border-radius: 24px;
  border: 1px solid rgba(125, 157, 255, .32); background: rgba(11, 19, 42, .84); color: #fff;
  -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 14px 36px rgba(0, 0, 0, .42);
  animation: slDockIn .5s cubic-bezier(.22, 1, .36, 1);
}
.sl-dock.lift { bottom: calc(150px + env(safe-area-inset-bottom, 0px)); }
.sl-dock-open { display: flex; align-items: center; gap: 11px; min-width: 0; min-height: 44px; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.sl-dock-orb {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, #d6e0ff, #5f86ff 50%, #2140c4 80%);
  box-shadow: 0 0 16px rgba(68, 115, 255, .6); animation: slOrbBreath 6s ease-in-out infinite;
}
.sl-dock.is-paused .sl-dock-orb { animation: none; opacity: .55; box-shadow: none; }
.sl-dock-txt { display: grid; min-width: 0; }
.sl-dock-txt b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sl-dock-txt small { font-size: 12px; color: rgba(225, 232, 255, .7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.sl-dock-btn { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: #fff; cursor: pointer; }
.sl-dock-btn:active { background: rgba(255, 255, 255, .1); }
.sl-dock-btn svg { width: 18px; height: 18px; }
.sl-dock-space { height: 76px; }

/* the player: a dark room with one breathing light, in every theme */
.sheet[data-sheet-type="sleep"] {
  --tx: #eef2ff; --tx-2: rgba(225, 232, 255, .78); --tx-3: rgba(200, 212, 245, .56);
  --line: rgba(160, 185, 255, .1); --line-2: rgba(160, 185, 255, .2);
  --m-surface: rgba(175, 195, 255, .05); --m-surface-2: rgba(175, 195, 255, .1);
  color: var(--tx); border-color: rgba(125, 157, 255, .2);
  background: radial-gradient(120% 60% at 50% 0%, rgba(44, 88, 238, .3), transparent 62%), linear-gradient(180deg, #08090d 0%, #030303 100%);
}
.sheet[data-sheet-type="sleep"] .sheet-close { color: var(--tx-2); }
.slp { padding-bottom: 6px; }
.slp-stage { display: grid; justify-items: center; padding: 4px 0 0; text-align: center; }
.slp-orb { position: relative; display: grid; place-items: center; width: 184px; height: 184px; margin: 4px 0 18px; }
.slp-orb i { position: absolute; border-radius: 50%; }
.slp-orb i:nth-child(1) { inset: -6%; background: radial-gradient(circle, rgba(148, 177, 255, .42), rgba(68, 115, 255, .16) 45%, transparent 70%); filter: blur(8px); animation: slOrbBreath 10s ease-in-out infinite; }
.slp-orb i:nth-child(2) { inset: 25%; background: radial-gradient(circle at 38% 32%, #e2e9ff, #6f92ff 45%, #2c58ee 74%, #172a7e); box-shadow: 0 0 64px rgba(68, 115, 255, .55); animation: slOrbBreath 10s ease-in-out infinite; }
.slp-orb i:nth-child(3) { inset: 9%; border: 1px solid rgba(148, 177, 255, .24); animation: slOrbRing 10s ease-in-out infinite; }
.slp.is-paused .slp-orb i { animation-play-state: paused; }
.slp-orb b { position: relative; z-index: 1; font-family: var(--font-display, inherit); font-size: 34px; font-weight: 400; color: #fff; font-variant-numeric: tabular-nums; text-shadow: 0 2px 12px rgba(10, 20, 60, .6); }
/* a breathing pacer drives the orb: it fills on the inhale and empties on the exhale */
.slp-orb.is-breath i { animation: none; transition: transform var(--step, 4s) cubic-bezier(.45, 0, .55, 1); }
.slp-orb.is-breath:is([data-phase="in"], [data-phase="hold"]) i { transform: scale(1.18); }
.slp-orb.is-breath[data-phase="top"] i { transform: scale(1.27); }
.slp-orb.is-breath:is([data-phase="out"], [data-phase="rest"]) i { transform: scale(.8); }
.slp-kicker { margin: 0; font-size: 11.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #9fb6ff; }
.slp-title { margin: 6px 0 0; font-family: var(--font-display, inherit); font-size: 28px; font-weight: 400; letter-spacing: -.01em; color: #fff; }
.slp-line { min-height: 44px; max-width: 30ch; margin: 10px auto 0; font-size: 15px; line-height: 1.45; color: var(--tx-2); }
.slp-line.in { animation: slLineIn .9s ease both; }
.slp-bar { height: 4px; margin: 18px 4px 0; overflow: hidden; border-radius: 99px; background: rgba(160, 185, 255, .16); }
.slp-bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .5s linear; }
.slp-times { display: flex; justify-content: space-between; margin: 6px 4px 0; font-size: 12px; color: var(--tx-3); font-variant-numeric: tabular-nums; }
.slp-controls { display: flex; align-items: center; justify-content: center; gap: 28px; margin: 18px 0 6px; }
.slp-main { display: grid; place-items: center; width: 72px; height: 72px; border: 0; border-radius: 50%; background: var(--blue-grad, var(--accent)); color: #fff; box-shadow: 0 10px 30px rgba(47, 93, 242, .5); cursor: pointer; transition: transform .15s; }
.slp-main:active { transform: scale(.95); }
.slp-main svg { width: 26px; height: 26px; }
.slp-ctl { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid var(--line-2); border-radius: 50%; background: var(--m-surface); color: #fff; cursor: pointer; }
.slp-ctl svg { width: 20px; height: 20px; }
.slp-layers .sl-pill { color: var(--tx-2); }
.slp-chips { flex-wrap: nowrap; margin: 0 -22px; padding: 0 22px 2px; overflow-x: auto; scrollbar-width: none; }
.slp-chips::-webkit-scrollbar { display: none; }
.slp-chips .m-chip { flex: none; }
.slp-empty { display: grid; justify-items: center; gap: 12px; padding: 24px 0; text-align: center; }
.slp-empty h2 { margin: 0; font-family: var(--font-display, inherit); font-weight: 400; color: #fff; }

@keyframes slTwinkle { 0%, 100% { opacity: .2; } 50% { opacity: .8; } }
@keyframes slMoon { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes slLive { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes slPanelIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes slEq { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }
@keyframes slDockIn { from { opacity: 0; transform: translate(-50%, 18px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes slOrbBreath { 0%, 100% { transform: scale(.94); } 50% { transform: scale(1.05); } }
@keyframes slOrbRing { 0%, 100% { transform: scale(.96); opacity: .5; } 50% { transform: scale(1.1); opacity: .15; } }
@keyframes slLineIn { from { opacity: 0; transform: translateY(4px); filter: blur(2px); } to { opacity: 1; transform: none; filter: none; } }
@media (prefers-reduced-motion: reduce) {
  .sl-scene-stars circle, .sl-feature.is-live .sl-scene-moon, .sl-live::before, .sl-panel, .sl-eq i, .sl-dock, .sl-dock-orb, .slp-orb i, .slp-line.in { animation: none !important; }
  .slp-orb.is-breath i { transition: none; }
}
[data-motion="reduced"] :is(.sl-scene-stars circle, .sl-feature.is-live .sl-scene-moon, .sl-live::before, .sl-panel, .sl-eq i, .sl-dock, .sl-dock-orb, .slp-orb i, .slp-line.in) { animation: none !important; }

/* ============================================================
   Health signals
   ============================================================ */
.hs { padding-bottom: 8px; }
.hs > .ah-card + .m-cap { margin-top: var(--m-gap); }
.hs-list > .hs-metric + .hs-metric { border-top: 1px solid var(--line); }
.hs-metric > summary { list-style: none; }
.hs-metric > summary::-webkit-details-marker { display: none; }
.hs-metric[open] > summary .m-row-val { color: var(--tx-2); }
.hs-spark { flex: none; display: flex; align-items: flex-end; gap: 2px; width: 50px; height: 22px; }
.hs-spark .cv-spark-bar { flex: 1; min-width: 0; border-radius: 1.5px; background: color-mix(in srgb, var(--tx-3) 45%, transparent); }
.hs-spark .cv-spark-bar:last-child { background: var(--accent); }
.hs-spark .cv-spark-bar.empty { height: 2px !important; background: var(--line-2); }
.hs .m-row-val { min-width: 64px; text-align: right; }
.hs-add { font-size: 14px; font-weight: 500; color: var(--blue-2, var(--accent)); }
.hs-trend { color: var(--tx-2); }
.hs-trend.good { color: color-mix(in srgb, #6fdc9c 85%, var(--tx)); }
.hs-log { padding: 0 14px 14px; }
.hs-log-lbl { flex: none; font-size: 13px; color: var(--tx-3); }

/* ============================================================
   Narrow phones
   ============================================================ */
@media (max-width: 374px) {
  .sl-item-body { padding-left: 14px; }
  .sl-tab { font-size: 12px; }
  .sl-tiles { gap: 6px; }
  .sl-tile { gap: 8px; padding-left: 8px; }
  .sl-tile-ico { width: 34px; height: 34px; }
  .sl-feature-txt { max-width: 100%; }
  .slp-orb { width: 156px; height: 156px; }
  .sl-hero { padding: 16px; }
  .sl-factor { grid-template-columns: 64px minmax(0, 1fr) 88px; gap: 10px; }
  .sl-slot b { font-size: 13px; }
  .sl-wake { gap: 4px; }
  .sl-wake .m-chip, .sl-quality .m-chip { padding: 0 2px; font-size: 12.5px; }
  .sl-bars { gap: 5px; }
  .sl-stats { gap: 0 14px; }
  .hs-spark { width: 40px; }
  .hs .m-row-val { min-width: 52px; }
  .hs .m-row { gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .sl-ring-fill, .sl-bar-track i, .sl-item > summary .m-row-go, .slp-bar i { transition: none; }
}

/* Health context (2026-10-19): where a value came from, and the Health value kept beside a typed one. */
.hs-metric .m-row-val { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.hs-src { display: block; color: var(--tx-3); font-size: 10.5px; font-weight: 500; letter-spacing: .01em; }
.hs-use { display: block; width: calc(100% - 28px); margin: 2px 14px 6px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: color-mix(in srgb, var(--tx) 5%, transparent); color: var(--tx); font-size: 12.5px; font-weight: 600; text-align: left; }
.sl-src { margin: 2px 0 0; color: var(--tx-3); font-size: 11.5px; }

/* Meditation (v283, his ask): the Sleep library's rows and blocks, and one quiet safety line under power breathing */
.md-room .m-cap:first-child { margin-top: 8px; }
.md-room .md-block .m-chips { margin-top: 12px; }
.md-room .md-block .m-chip:disabled { opacity: .45; }
.md-safe { margin: 8px 6px 0; font-size: 12.5px; line-height: 1.4; color: var(--tx-3); }
.md-block .sl-row-art { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; color: #e2e9ff; background: radial-gradient(120% 120% at 30% 20%, rgba(68, 115, 255, .5), rgba(44, 88, 238, .14)); }
.md-block .sl-row-art svg { width: 22px; height: 22px; }
:root[data-palette] .md-block .sl-row-art { color: var(--tx); background: radial-gradient(120% 120% at 30% 20%, rgba(var(--p-act-hi), .42), rgba(var(--p-act), .14)); }
[data-theme="light"] .md-block .sl-row-art { color: #2c4fcf; background: color-mix(in srgb, #4473ff 16%, #fff); }
