:root {
  font-family:'IBM Plex Sans',system-ui,sans-serif;
  color:#18211D;
  background:#F4F5F2;
  font-size:14px;
  font-synthesis:none
}
* {
  box-sizing:border-box
}
body {
  margin:0
}
a {
  color:#0B6B6B;
  text-decoration:none
}
a:hover {
  text-decoration:underline;
  color:#084F4F
}
button,input {
  font:inherit
}
button,a,input,summary {
  touch-action:manipulation
}
:focus-visible {
  outline:2px solid #0B6B6B;
  outline-offset:4px
}
button,summary {
  cursor:pointer
}
button {
  border:1px solid #DDE1DB;
  border-radius:8px;
  background:white;
  color:#18211D;
  padding:8px 12px
}
h1 {
  font-size:28px;
  letter-spacing:-.02em;
  font-weight:600;
  margin:0
}
h2 {
  font-size:15px;
  font-weight:600;
  margin:0
}
p {
  margin:0;
  line-height:1.5
}
.muted,small {
  color:#56625C
}
.notice {
  color:#8A4B00;
  line-height:1.45
}
.number,.y-label,.chart-tooltip,.x-axis {
  font-family:'IBM Plex Mono',monospace;
  font-variant-numeric:tabular-nums
}
.shell {
  display:grid;
  grid-template-columns:232px minmax(0,1fr);
  min-height:100vh
}
.sidebar {
  background:#ECEEEA;
  border-right:1px solid #DDE1DB;
  padding:20px 14px;
  display:flex;
  flex-direction:column;
  gap:22px
}
.brand {
  display:flex;
  align-items:center;
  gap:10px;
  padding:0 8px;
  font-weight:600;
  font-size:16px;
  color:#18211D;
  white-space:nowrap
}
.brand svg {
  fill:none;
  stroke:#0B6B6B;
  stroke-width:2
}
.future-nav {
  display:flex;
  flex-direction:column;
  gap:2px;
  color:#56625C
}
.future-nav span {
  padding:9px 10px;
  opacity:.7
}
.nav-group {
  display:flex;
  flex-direction:column;
  gap:2px
}
.nav-group small {
  padding:0 10px 6px;
  font-size:11px;
  font-weight:600;
  letter-spacing:.06em;
  text-transform:uppercase
}
.nav-group>a {
  padding:9px 10px;
  border-radius:8px;
  color:#18211D;
  font-weight:400;
  display:flex;
  gap:10px
}
.nav-group>a[aria-current=page] { color:#0B4F4F; background:#D7E8E5; font-weight:600; }
.account {
  margin-top:auto;
  border-top:1px solid #DDE1DB;
  padding:12px 10px;
  display:flex;
  flex-direction:column;
  gap:8px;
  font-size:13px;
  overflow-wrap:anywhere
}
.text-button {
  padding:0;
  border:0;
  background:transparent;
  color:#0B6B6B
}
.mobile-bar {
  display:none
}
main {
  padding:24px 32px 40px;
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:20px
}
.page-header {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:24px;
  flex-wrap:wrap
}
.heading {
  display:flex;
  flex-direction:column;
  gap:6px;
  max-width:640px
}
.heading p {
  font-size:14px
}
.back {
  font-size:13px
}
.header-options {
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:10px
}
.freshness {
  display:inline-flex;
  align-items:center;
  gap:8px;
  border:1px solid #DDE1DB;
  border-radius:999px;
  background:white;
  padding:6px 12px;
  font-size:13px;
  color:#3E4944
}
.sync-dot {
  display:inline-block;
  width:8px;
  height:8px;
  flex-shrink:0;
  border-radius:50%;
  background:#0B6B6B
}
.controls {
  display:flex;
  gap:10px;
  flex-wrap:wrap
}
.segments {
  display:flex;
  background:white;
  border:1px solid #DDE1DB;
  border-radius:10px;
  padding:3px
}
.segments a {
  padding:8px 12px;
  color:#3E4944;
  font-size:13px;
  border-radius:8px;
  white-space:nowrap
}
.segments .selected {
  background:#18211D;
  color:white
}
.zone-note {
  font-size:12px;
  margin-top:-8px
}
.card {
  background:white;
  border:1px solid #DDE1DB;
  border-radius:14px;
  padding:18px 20px;
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:12px
}
.trends-grid,.skeleton-grid {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:16px
}
.trend-card {
  padding:16px 16px 14px;
  gap:10px
}
.card-title {
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  gap:8px
}
.card-title h2 {
  font-size:14px
}
.card-title small {
  font-size:12px;
  text-align:right
}
.card-title>span {
  font-size:12px
}
.card-value {
  display:flex;
  align-items:baseline;
  gap:10px;
  flex-wrap:wrap
}
.card-value>.number {
  font-size:26px;
  font-weight:500;
  letter-spacing:-.02em
}
.card-value>.muted {
  font-size:12px
}
.card-foot {
  border-top:1px solid #ECEEEA;
  padding-top:8px;
  font-size:12px;
  line-height:1.45;
  display:flex;
  flex-direction:column;
  gap:4px;
  color:#3E4944
}
.chart {
  min-width:0
}
.plot {
  position:relative;
  height:300px;
  margin:18px 10px 0 46px
}
.compact-chart .plot {
  height:112px;
  margin:12px 5px 0
}
.plot svg {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  overflow:visible;
  pointer-events:none
}
.grid-line {
  fill:none;
  stroke:#ECEEEA;
  stroke-width:1;
  vector-effect:non-scaling-stroke
}
.median-line {
  fill:none;
  stroke:#0B6B6B;
  stroke-width:2;
  stroke-linejoin:round;
  vector-effect:non-scaling-stroke
}
.band {
  fill:rgba(11,107,107,.15)
}
.rolling-line {
  fill:none;
  stroke:#B85419;
  stroke-width:1.5;
  stroke-dasharray:6 4;
  vector-effect:non-scaling-stroke
}
.source-line {
  fill:none;
  stroke:#56625C;
  stroke-width:1;
  stroke-dasharray:4 4;
  vector-effect:non-scaling-stroke
}
.point {
  position:absolute;
  transform:translate(-50%,-50%);
  width:5px;
  height:5px;
  border:1px solid #0B6B6B;
  background:#0B6B6B;
  border-radius:50%;
  pointer-events:none
}
.point.partial {
  width:7px;
  height:7px;
  background:white;
  border:2px solid #0B6B6B
}
.point.uncertain {
  width:4px;
  height:4px;
  background:#87918B;
  border-color:#87918B
}
.y-label {
  position:absolute;
  right:calc(100% + 8px);
  transform:translateY(-50%);
  font-size:11px;
  color:#56625C;
  white-space:nowrap
}
.x-axis {
  display:flex;
  justify-content:space-between;
  font-size:10px;
  color:#56625C;
  margin:12px 0 0 46px
}
.compact-chart .x-axis {
  margin-left:0
}
.crosshair {
  position:absolute;
  top:0;
  bottom:0;
  border-left:1px solid #18211D;
  pointer-events:none
}
.cross-dot {
  position:absolute;
  width:9px;
  height:9px;
  border:2px solid #18211D;
  background:white;
  border-radius:50%;
  transform:translate(-50%,-50%);
  pointer-events:none
}
.chart-tooltip {
  position:absolute;
  top:20px;
  z-index:3;
  max-width:min(260px,100%);
  width:max-content;
  background:#18211D;
  color:white;
  border-radius:10px;
  padding:10px 12px;
  white-space:pre-line;
  font-size:11px;
  line-height:1.5;
  pointer-events:none;
  overflow-wrap:anywhere
}
.compact-chart .chart-tooltip {
  top:-14px;
  max-width:100%;
  padding:5px 7px;
  border-radius:5px;
  font-size:10px
}
.source-label {
  position:absolute;
  top:-24px;
  font-size:11px;
  color:#3E4944;
  background:white;
  max-width:45%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  transform:translateX(-50%)
}
.device-marker {
  position:absolute;
  bottom:-5px;
  width:9px;
  height:9px;
  background:#18211D;
  transform:translateX(-50%) rotate(45deg)
}
[hidden] {
  display:none!important
}
.legend {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px 12px;
  font-size:12px;
  color:#3E4944
}
.legend label,.legend>span {
  display:inline-flex;
  align-items:center;
  gap:6px
}
.legend input {
  accent-color:#0B6B6B
}
.line-key {
  display:inline-block;
  width:18px;
  height:2px;
  background:#0B6B6B;
  flex-shrink:0
}
.band-key {
  display:inline-block;
  width:18px;
  height:10px;
  background:rgba(11,107,107,.15);
  flex-shrink:0
}
.rolling-key {
  display:inline-block;
  width:18px;
  border-top:2px dashed #B85419
}
.detail-grid {
  display:grid;
  grid-template-columns:minmax(0,1fr) 320px;
  gap:16px;
  align-items:start
}
.main-chart {
  padding:20px
}
.main-chart .plot {
  height:360px
}
.main-chart p {
  font-size:12px
}
.right-rail {
  display:flex;
  flex-direction:column;
  gap:16px
}
.right-rail .card {
  padding:16px;
  font-size:13px;
  gap:10px
}
.source-era {
  display:flex;
  flex-direction:column;
  gap:6px
}
.era-track {
  height:8px;
  background:#ECEEEA;
  border-radius:4px;
  position:relative;
  overflow:hidden
}
.era-track>span {
  position:absolute;
  top:0;
  bottom:0;
  border-radius:4px;
  background:#0B6B6B
}
.source-era~.source-era .era-track>span {
  background:#7FA8A4
}
dl {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  font-size:12px;
  margin:0
}
dt {
  color:#56625C
}
dd {
  margin:0;
  text-align:right
}
.method summary {
  font-weight:600
}
.method p {
  margin-top:12px
}
.secondary-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:16px
}
.year-plot {
  height:200px;
  margin-left:10px
}
.year-plot+.x-axis {
  margin-left:0
}
.season-plot {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
  height:235px;
  margin-top:12px
}
.season-column {
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
  font-size:12px;
  text-align:center;
  min-width:0
}
.season-column .number {
  font-size:13px
}
.season-column small {
  font-size:11px
}
.season-bar-area {
  flex:1;
  width:100%;
  display:flex;
  align-items:flex-end;
  justify-content:center
}
.season-bar {
  width:44px;
  background:rgba(11,107,107,.18);
  border-top:2px solid #0B6B6B
}
.secondary-grid p {
  font-size:12px
}
.period-table table {
  width:100%;
  border-collapse:collapse;
  font-size:13px;
  table-layout:fixed
}
.period-table th,.period-table td {
  padding:8px 10px;
  border-bottom:1px solid #ECEEEA;
  text-align:left;
  overflow-wrap:anywhere
}
.period-table th {
  font-weight:500;
  color:#56625C;
  border-color:#DDE1DB;
  font-size:12px
}
.period-table .number {
  text-align:right
}
.period-table th:nth-child(2),.period-table th:nth-child(3),.period-table th:nth-child(4) {
  text-align:right
}
.empty {
  padding:36px 20px;
  text-align:center;
  color:#56625C
}
.loading {
  color:#56625C
}
.skeleton-grid {
  margin-top:20px
}
.skeleton {
  height:280px;
  background:linear-gradient(100deg,#fff 20%,#ECEEEA 50%,#fff 80%);
  background-size:200% 100%;
  animation:load 2s ease-in-out infinite
}
@keyframes load {
  to {
  background-position:-200% 0
}

}
.login {
  max-width:420px;
  width:100%;
  margin:60px auto;
  padding:28px
}
.login form {
  display:flex;
  flex-direction:column;
  gap:16px
}
.login label {
  display:flex;
  flex-direction:column;
  gap:6px
}
.login input {
  padding:10px 12px;
  border:1px solid #DDE1DB;
  border-radius:8px;
  width:100%
}
.primary {
  background:#18211D;
  color:white;
  padding:12px
}
.login small {
  letter-spacing:.06em;
  font-size:11px
}
.login p {
  font-size:13px
}
.sr-only {
  position:absolute;
  width:1px;
  height:1px;
  overflow:hidden;
  clip:rect(0,0,0,0)
}

@media(max-width:1199px) {
  .shell {
  grid-template-columns:64px minmax(0,1fr)
}
.sidebar {
  padding:20px 10px
}
.sidebar .brand span,.sidebar .brand svg,.sidebar .future-nav,.sidebar .nav-label,.sidebar small,.sidebar .account {
  display:none
}
.sidebar .brand {
  font-size:0;
  padding:0
}
.sidebar .brand:before {
  content:'PH';
  font-size:14px;
  color:#0B6B6B
}
.nav-group>a {
  justify-content:center;
  font-size:20px
}
main {
  padding:24px
}
.trends-grid,.skeleton-grid {
  grid-template-columns:repeat(3,minmax(0,1fr))
}
.detail-grid {
  grid-template-columns:minmax(0,1fr) 280px
}
.header-options {
  align-items:flex-start
}

}

@media(max-width:899px) {
  .shell {
  display:block
}
.sidebar {
  display:none
}
.mobile-bar {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:4px
}
.mobile-bar .brand {
  padding:0
}
.mobile-bar details {
  position:relative
}
.mobile-bar details[open] {
  background:white;
  border:1px solid #DDE1DB;
  border-radius:8px;
  padding:10px;
  z-index:5
}
.mobile-bar details a,.mobile-bar form {
  display:block;
  margin-top:12px
}
.trends-grid,.skeleton-grid {
  grid-template-columns:repeat(2,minmax(0,1fr))
}
.detail-grid {
  grid-template-columns:1fr
}
.right-rail {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  align-items:start
}
.page-header {
  gap:16px
}
.main-chart .plot {
  height:320px
}
.secondary-grid .card {
  padding:16px
}

}

@media(max-width:600px) {
  main {
  padding:16px;
  gap:16px
}
.trends-grid,.skeleton-grid,.right-rail,.secondary-grid {
  grid-template-columns:1fr
}
.controls {
  gap:8px
}
.segments a {
  padding:7px 9px;
  font-size:12px
}
.freshness {
  font-size:12px;
  border-radius:10px
}
.main-chart {
  padding:16px
}
.main-chart .plot {
  height:260px;
  margin-left:40px
}
.period-table thead {
  display:none
}
.period-table table,.period-table tbody,.period-table tr,.period-table td {
  display:block
}
.period-table tr {
  padding:10px 0;
  border-bottom:1px solid #DDE1DB
}
.period-table td {
  display:flex;
  justify-content:space-between;
  gap:12px;
  border:0;
  padding:4px 0;
  text-align:right
}
.period-table td:before {
  content:attr(data-label);
  color:#56625C;
  font-family:'IBM Plex Sans',sans-serif;
  text-align:left
}
.login {
  margin:20px auto
}
.source-label {
  font-size:10px
}

}

@media(prefers-reduced-motion:reduce) {
  .skeleton {
  animation:none
}

}

/* Overview: shared values, desktop information hierarchy. */
.overview-columns { display:grid; grid-template-columns:minmax(0,1.7fr) minmax(300px,1fr); gap:16px; align-items:start; }
.overview-main { display:flex; flex-direction:column; gap:16px; min-width:0; }
.overview-top { display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:16px; align-items:stretch; }
.overview-top-side { display:flex; flex-direction:column; gap:16px; min-width:0; }
.overview-panel { padding:18px; min-width:0; display:flex; flex-direction:column; gap:12px; }
.overview-panel h2,.overview-insights h2 { margin:0; font-size:16px; font-weight:600; }
.overview-panel h3 { margin:0; font-size:15px; font-weight:500; line-height:1.45; }
.overview-panel p { margin:0; line-height:1.5; font-size:13px; }
.overview-panel small { line-height:1.5; }
.overview-panel details { font-size:12px; overflow-wrap:anywhere; }
.overview-panel details p { margin-top:8px; }
.overview-panel summary,.today-summary summary { color:#0b6b6b; cursor:pointer; }
.today-summary { padding:18px 20px; display:flex; flex-direction:row; gap:16px; justify-content:space-between; align-items:center; }
.today-summary>p { margin:0; font-size:17px; line-height:1.5; }
.today-summary details { font-size:12px; max-width:400px; }
.overview-panel .night-value { font-size:30px; font-weight:500; }
.hypnogram { display:grid; grid-template-columns:60px minmax(0,1fr); gap:5px 8px; align-items:center; font-size:11px; color:#56625c; }
.stage-track { position:relative; height:14px; background:#f4f5f2; border-radius:3px; }
.stage-block { position:absolute; height:14px; background:#7fa8a4; border-radius:2px; }
.visually-hidden { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.stage-1,.stage-3,.stage-7 { background:#e08a3c; }.stage-6 { background:#7b5ea7; }.stage-4 { background:#6e9fc7; }.stage-5 { background:#315b8e; }
.night-totals { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }.night-totals b,.night-totals small { display:block; font-size:12px; }
.overnight-values p { border-top:1px solid #eceeea; padding:9px 0; display:flex; justify-content:space-between; flex-wrap:wrap; gap:5px; }
.overnight-values small { width:100%; color:#56625c; font-size:11px; }
.vital-row { display:grid; grid-template-columns:minmax(0,1fr) 115px; gap:10px; align-items:center; border-top:1px solid #eceeea; padding:12px 0; }
.vital-row.stale { opacity:.6; }.vital-row small { color:#56625c; font-size:11px; }.overview-panel .vital-value { font-size:22px; margin:4px 0; }.overview-panel .vital-change { font-size:12px; margin:4px 0; }
.daily-spark { width:100%; height:52px; overflow:hidden; }.daily-spark path { fill:none; stroke:#0b6b6b; stroke-width:1.5; vector-effect:non-scaling-stroke; }.daily-spark circle { fill:#0b6b6b; }.spark-band { fill:#0b6b6b; opacity:.12; }.daily-spark text { font-size:10px; fill:#56625c; }
.steps-today { border-top:1px solid #eceeea; padding-top:12px; }
.overview-insights { display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:12px; align-items:start; min-width:0; }.overview-insights>h2 { grid-column:1/-1; margin-top:6px; }.insight-category { text-transform:uppercase; letter-spacing:.06em; color:#56625c; font-size:11px; }
@media(max-width:1199px) { .overview-columns { grid-template-columns:minmax(0,1fr); } }
@media(max-width:650px) { .overview-top,.overview-insights { display:flex; flex-direction:column; }.overview-columns>*,.overview-insights>*,.overview-top>* { width:100%; }.today-summary { align-items:stretch; flex-direction:column; }.vital-row { grid-template-columns:minmax(0,1fr) 110px; }.overview-panel { box-sizing:border-box; } }

/* Settings → Data sources */
.source-provenance { margin-top: .25rem; font-size: .9rem; }
.source-provenance summary { cursor: pointer; color: var(--muted); }
.source-provenance dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .2rem .65rem; margin: .5rem 0 0; }
.source-provenance dl > div { display: contents; }
.source-provenance dt { color: var(--muted); }
.source-provenance dd { margin: 0; overflow-wrap: anywhere; }
.connected-services-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.connected-service { min-width:0; padding:20px; }
.connected-service h2 { margin:0 0 12px; font-size:20px; }
.history-import { margin-top:18px; padding-top:14px; border-top:1px solid #E6E9E4; }
.history-import h3,.connected-service details h3 { margin:0 0 8px; font-size:16px; }
.history-import progress { display:block; width:100%; height:10px; margin:10px 0; accent-color:#0B6B6B; }
.service-state { font-weight:600; margin:8px 0; }
.service-warning { color:#9B4B00; }
.service-facts { display:grid; gap:8px; margin:14px 0; }
.service-facts div { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:8px; }
.service-facts dt { color:#56625C; }
.service-facts dd { margin:0; text-align:right; overflow-wrap:anywhere; }
.service-actions { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0; }
.service-actions form,.connected-service-form { margin:8px 0; }
.service-actions button,.connected-service-form button { min-height:44px; min-width:100px; padding:8px 14px; border:1px solid #DDE1DB; border-radius:8px; background:white; color:#18211D; font:inherit; cursor:pointer; }
.connected-service details { margin-top:12px; }
.connected-service details summary { min-height:40px; display:flex; align-items:center; color:#0B6B6B; cursor:pointer; }
.connected-services-note { margin-top:18px; }
@media(max-width:700px) { .connected-services-grid { grid-template-columns:minmax(0,1fr); } .service-facts div { grid-template-columns:minmax(0,1fr); gap:2px; } .service-facts dd { text-align:left; } .service-actions form,.service-actions button,.connected-service-form button { width:100%; } }
.visually-hidden { position:absolute; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; }
.notice[role] { padding:10px 14px; border:1px solid #DDE1DB; border-radius:10px; background:#EAF3F1; }
.notice[role="alert"] { background:#FDF1EE; border-color:#EBC5BC; }
.overview-panel h3 { margin:6px 0 0; font-size:14px; font-weight:600; }
.source-group { border:1px solid #DDE1DB; border-radius:12px; padding:14px; display:flex; flex-direction:column; gap:12px; min-width:0; }
.source-group-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; flex-wrap:wrap; }
.source-group-head h3 { margin:0; font-size:16px; overflow-wrap:anywhere; }
.source-list,.metric-list { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px; }
.source-row,.metric-row { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:10px; padding:10px 12px; border:1px solid #E7EAE4; border-radius:10px; background:#FBFBF9; min-width:0; }
.metric-row,.source-list:not([data-reorder]) > .source-row { grid-template-columns:minmax(0,1fr) auto; }
.source-row[draggable="true"] { cursor:grab; }
.source-row.dragging { opacity:.5; }
.source-row.drop-target { outline:2px dashed #0B6B6B; outline-offset:2px; }
.drag-handle { color:#56625C; user-select:none; padding:4px; }
.source-text { display:flex; flex-direction:column; gap:2px; min-width:0; overflow-wrap:anywhere; }
.source-text .excluded { color:#A53A2B; font-weight:600; }
.row-actions { display:flex; gap:6px; flex-wrap:wrap; justify-content:flex-end; }
.op-form { margin:0; display:inline-flex; gap:8px; flex-wrap:wrap; align-items:center; }
.op-form button,.button-link { min-height:44px; min-width:44px; padding:8px 12px; border:1px solid #DDE1DB; border-radius:8px; background:white; color:#18211D; display:inline-flex; align-items:center; justify-content:center; text-decoration:none; }
.op-form button[disabled] { opacity:.45; cursor:not-allowed; }
.op-form input,.op-form select { min-height:44px; padding:8px 10px; border:1px solid #C9CFC7; border-radius:8px; font:inherit; max-width:100%; min-width:0; }
.inline-form,.rename-form { flex-wrap:wrap; }
.inline-form label { font-weight:600; }
.danger-zone summary { min-height:44px; display:flex; align-items:center; color:#A53A2B; }
.danger-zone .op-form button { color:#A53A2B; border-color:#EBC5BC; }
@media(max-width:700px) {
  .source-row,.metric-row,.source-list:not([data-reorder]) > .source-row { grid-template-columns:minmax(0,1fr); }
  .source-row[draggable="true"] { grid-template-columns:auto minmax(0,1fr); }
  .source-row[draggable="true"] .row-actions { grid-column:1/-1; justify-content:flex-start; }
  .metric-row .button-link,.source-row > .op-form { width:100%; }
  .row-actions .op-form { flex:1 1 30%; }
  .row-actions .op-form button { width:100%; padding:8px 6px; }
  .rename-form,.rename-form input,.inline-form select,.inline-form input { width:100%; }
}

.variant-list { list-style:none; margin:4px 0 0; padding:0; display:flex; flex-direction:column; gap:6px; }
.variant-list li { display:flex; justify-content:space-between; align-items:center; gap:8px; flex-wrap:wrap; font-size:12px; }
.variant-list .excluded { color:#A53A2B; font-weight:600; }
.day-nav {
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap
}
.day-step {
  border:1px solid #DDE1DB;
  border-radius:10px;
  background:white;
  padding:8px 12px;
  font-size:13px;
  color:#3E4944;
  white-space:nowrap
}
.day-step.disabled {
  color:#9AA39E
}
.day-pick {
  display:flex;
  align-items:center;
  gap:6px
}
.day-pick input[type=date] {
  border:1px solid #DDE1DB;
  border-radius:10px;
  padding:7px 10px;
  font:inherit;
  font-size:13px
}
.day-chart-card { padding:18px 18px 12px; }
.lane-toggles { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-bottom:12px; }
.lane-chip { display:inline-flex; align-items:center; gap:6px; border-radius:6px; padding:4px 10px; font-size:12px; color:white; background:var(--lane,#0B6B6B); cursor:pointer; }
.lane-chip input { accent-color:white; margin:0; }
.lane-chip:has(input:not(:checked)) { opacity:.45; }
.day-lanes { position:relative; display:flex; flex-direction:column; gap:4px; }
.day-lanes:focus-visible { outline-offset:6px; }
.lane[hidden] { display:none; }
.lane-head { display:flex; flex-wrap:wrap; align-items:baseline; gap:2px 14px; margin:6px 12px 0 52px; }
.lane-head h2 { font-size:13px; }
.lane-stats,.lane-head small { font-size:12px; }
.lane-plot { position:relative; height:84px; margin:6px 12px 8px 52px; background:white; border-radius:4px; }
.lane-hero .lane-plot { height:240px; }
.strip-plot { height:40px; }
.lane-plot svg { position:absolute; inset:0; width:100%; height:100%; overflow:visible; pointer-events:none; }
.source-change { fill:none; stroke:#8A5A00; stroke-width:1.2; stroke-dasharray:5 4; vector-effect:non-scaling-stroke; opacity:.75; }
.lane-line { fill:none; stroke:var(--lane,#0B6B6B); stroke-width:1.6; stroke-linejoin:round; vector-effect:non-scaling-stroke; }
.lane-dot { position:absolute; width:6px; height:6px; border-radius:50%; background:var(--lane,#0B6B6B); transform:translate(-50%,-50%); pointer-events:none; }
.lane-bar { position:absolute; background:var(--lane,#0B6B6B); opacity:.85; border-radius:2px 2px 0 0; min-height:1px; pointer-events:none; }
.shade { position:absolute; top:0; bottom:0; pointer-events:none; }
.shade-sleep { background:rgba(49,91,142,.10); }
.shade-workout { background:rgba(194,65,12,.13); }
.workout-block { background:#C2410C; }
.day-axis { margin:0 12px 0 52px; }
.day-axis-plot { position:relative; height:18px; }
.day-axis-plot span { position:absolute; transform:translateX(-50%); font-size:10px; color:#56625C; }
.lane-heart-rate { --lane:#B3361A; }
.lane-steps { --lane:#0B6B6B; }
.lane-spo2 { --lane:#1D4ED8; }
.lane-skin-temperature { --lane:#8A4B00; }
.lane-device-temperature { --lane:#56606A; }
.lane-skin-temperature-delta { --lane:#7A5200; }
.lane-hrv { --lane:#6D3FC0; }
.lane-respiratory-rate { --lane:#0B7285; }
.lane-active-calories { --lane:#B0214B; }
.lane-distance { --lane:#4D6F12; }
@media (max-width:640px) {
  .day-chart-card { padding:12px 8px; }
  .lane-head,.lane-plot,.day-axis { margin-left:40px; margin-right:6px; }
  .lane-hero .lane-plot { height:180px; }
}

/* ---- Data Explorer: a technical, read-only debugging view in the same visual language ---- */
.explorer-bar { gap:12px; padding:14px 16px; box-shadow:0 2px 0 rgba(24,33,29,.04); }
/* The bar stays in view while scrolling long tables, but only where there is height to spare for it. */
@media (min-width:901px) and (min-height:820px) { .explorer-bar { position:sticky; top:0; z-index:5; } .explorer-split.with-inspector .inspector { top:230px; max-height:calc(100vh - 250px); } }
.explorer-bar fieldset { border:0; margin:0; padding:0; min-width:0; display:flex; flex-direction:column; gap:8px; }
.explorer-bar legend { font-size:13px; font-weight:600; padding:0; margin-bottom:6px; }
.range-presets,.range-custom,.explorer-filters { display:flex; flex-wrap:wrap; gap:8px; align-items:flex-end; }
.range-presets button,.range-custom button,.explorer-bar .primary { padding:7px 12px; font-size:13px; }
.explorer-bar button.selected,.explorer-bar .primary { background:#18211D; color:#fff; border-color:#18211D; }
.explorer-bar label { display:flex; flex-direction:column; gap:3px; font-size:12px; color:#3E4944; min-width:0; }
.explorer-bar input,.explorer-bar select { font:inherit; font-size:13px; padding:6px 8px; border:1px solid #C9CFC8; border-radius:8px; background:#fff; color:#18211D; max-width:100%; min-height:34px; }
.explorer-bar select { min-width:150px; }
.explorer-filters label { flex:1 1 160px; }
.view-tabs { display:flex; flex-wrap:wrap; gap:6px 14px; align-items:center; border-bottom:1px solid #DDE1DB; padding-bottom:8px; }
.view-tabs>a { padding:6px 12px; border-radius:8px; color:#3E4944; font-size:14px; }
.view-tabs>a[aria-current="page"] { background:#18211D; color:#fff; }
.view-tabs .zone-note { margin:0 0 0 auto; }
.range-line { margin:0; font-size:13px; }
.mono { font-variant-numeric:tabular-nums; font-family:'IBM Plex Mono',ui-monospace,monospace; font-size:12.5px; }
.explorer-split { display:block; }
.explorer-split.with-inspector { display:grid; grid-template-columns:minmax(0,1fr) minmax(320px,440px); gap:16px; align-items:start; }
.explorer-split.with-inspector .inspector { order:2; position:sticky; top:12px; max-height:calc(100vh - 24px); overflow:auto; }
.explorer-main { min-width:0; }
.explorer-card { gap:10px; }
.explorer-options { display:flex; flex-wrap:wrap; gap:6px 12px; align-items:center; font-size:13px; }
.explorer-options a[aria-current="true"] { font-weight:600; color:#18211D; text-decoration:underline; }
.table-scroll { overflow-x:auto; border:1px solid #E6E9E3; border-radius:10px; }
.explorer-table { width:100%; border-collapse:collapse; font-size:13px; }
.explorer-table th,.explorer-table td { padding:7px 10px; text-align:left; vertical-align:top; border-bottom:1px solid #EEF0EB; }
.explorer-table thead th { position:sticky; top:0; background:#F4F5F2; font-size:12px; color:#3E4944; white-space:nowrap; }
.explorer-table tbody th { font-weight:500; white-space:nowrap; }
.explorer-table .num { text-align:right; white-space:nowrap; }
.explorer-table tbody tr:hover { background:#F8F9F6; }
.explorer-table tr.inspected { background:#EAF3F1; }
.chip { display:inline-block; padding:1px 8px; border-radius:999px; font-size:11.5px; border:1px solid #DDE1DB; background:#fff; color:#3E4944; white-space:nowrap; margin-right:4px; }
.layer-canonical { background:#E8F1EF; border-color:#BFD9D5; color:#0B5757; }
.layer-archive { background:#EFEAF8; border-color:#D5CBEB; color:#4A2F8A; }
.status-ok { background:#E8F4E5; border-color:#C5E0BF; color:#2E6B22; }
.status-warn { background:#FDF1E1; border-color:#F0D3A5; color:#8A4B00; }
.status-muted { background:#F1F2EF; color:#56625C; }
.flag { background:#FDF1EE; border-color:#EBC5BC; color:#8F2D1B; }
.flag-archived { background:#F1F2EF; border-color:#DDE1DB; color:#56625C; }
.explorer-pager { display:flex; flex-wrap:wrap; gap:8px 16px; align-items:center; justify-content:space-between; padding-top:4px; }
.explorer-pager .next { font-weight:600; }
.inspector { gap:10px; }
.inspector details { border-top:1px solid #EEF0EB; padding-top:8px; }
.inspector summary { font-weight:600; font-size:13px; }
.fields { margin:8px 0 0; display:flex; flex-direction:column; gap:6px; }
.fields>div { display:grid; grid-template-columns:minmax(110px,150px) minmax(0,1fr); gap:8px; }
.fields dt { color:#56625C; font-size:12px; }
.fields dd { margin:0; font-size:12.5px; overflow-wrap:anywhere; }
.raw-head { display:flex; justify-content:space-between; align-items:center; gap:8px; margin:8px 0 6px; }
pre.json { margin:0; padding:10px 12px; max-height:420px; overflow:auto; background:#18211D; color:#E8EDE9; border-radius:10px; font-size:12px; line-height:1.45; tab-size:2; white-space:pre; user-select:text; }
pre.json code { font-family:'IBM Plex Mono',ui-monospace,monospace; }
@media (max-width:1199px) {
  .explorer-split.with-inspector { grid-template-columns:minmax(0,1fr); }
  .explorer-split.with-inspector .inspector { position:static; max-height:none; order:-1; }
}
@media (max-width:700px) {
  .explorer-bar { padding:12px; }
  .range-custom label { flex:1 1 100%; }
  .explorer-filters label { flex:1 1 calc(50% - 8px); min-width:130px; }
  .explorer-bar select,.explorer-bar input { width:100%; min-width:0; }
  .explorer-bar { gap:8px; }
  .range-presets button { flex:1 1 calc(50% - 8px); }
  .explorer-bar .primary { flex:1 1 100%; }
  .view-tabs .zone-note { margin-left:0; flex-basis:100%; }
  .fields>div { grid-template-columns:minmax(0,1fr); gap:0; }
  .table-scroll { border:0; overflow:visible; }
  /* Tables become one card per row on a phone: no horizontal page scroll. */
  .explorer-table,.explorer-table tbody,.explorer-table tr,.explorer-table th,.explorer-table td { display:block; width:100%; }
  .explorer-table thead { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); }
  .explorer-table tr { border:1px solid #DDE1DB; border-radius:10px; margin-bottom:8px; padding:6px 10px; background:#fff; }
  .explorer-table th,.explorer-table td { border:0; padding:3px 0; text-align:left !important; white-space:normal !important; }
  .explorer-table td[data-label]:before { content:attr(data-label); display:block; font-size:11px; color:#56625C; }
  .explorer-table td:empty { display:none; }
}
.chart-controls { display:flex; flex-wrap:wrap; align-items:center; gap:10px 22px; margin:0 0 12px; }
.chart-step { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.chip-row { display:flex; flex-wrap:wrap; align-items:center; gap:6px; font-size:13px; }
.chip { border:1px solid #DDE1DB; border-radius:999px; padding:4px 11px; background:white; color:#3E4944; font-size:13px; white-space:nowrap; }
.chip:hover { text-decoration:none; border-color:#0B6B6B; }
.chip.selected { background:#0B6B6B; border-color:#0B6B6B; color:white; }
.band-toggle { display:inline-flex; align-items:center; gap:6px; font-size:13px; color:#3E4944; }
.smoothing-note { font-size:12px; margin:0 0 8px; }
.lane-band { fill:var(--lane,#0B6B6B); fill-opacity:.16; stroke:none; }
.bands-off .lane-band { display:none; }
.v-grid { stroke:#F1F3EF; }
.lane-dot.hollow { background:white; border:2px solid var(--lane,#0B6B6B); width:8px; height:8px; box-sizing:border-box; }
.night-bar { position:absolute; background:var(--lane,#315B8E); opacity:.8; border-radius:3px; pointer-events:none; min-height:2px; }
.timing-plot { height:150px; }
.lane-sleep-timing { --lane:#315B8E; }
.lane-time-asleep { --lane:#315B8E; }
.lane-blood-pressure { --lane:#9B2C5A; }
@media (max-width:640px) { .chart-controls { gap:8px 14px; } }
.lane-stem { position:absolute; width:2px; margin-left:-1px; background:var(--lane,#0B6B6B); opacity:.28; pointer-events:none; }
.lane-blood-pressure .lane-stem { width:5px; margin-left:-2.5px; opacity:.2; border-radius:3px; }
.lane-ref { position:absolute; left:0; right:0; border-top:1px dashed #87918B; pointer-events:none; }
.lane.sparse .lane-dot { width:9px; height:9px; }
.lane.sparse .lane-dot.hollow { width:9px; height:9px; }
.lane-hint { font-size:11px; flex-basis:100%; }
.hover-ring { position:absolute; width:17px; height:17px; border:2px solid #18211D; border-radius:50%; transform:translate(-50%,-50%); pointer-events:none; box-sizing:border-box; }
.hover-ring[hidden] { display:none; }
.lane-spo2-sleep { --lane:#3B7CE0; }
.lane-resting-heart-rate { --lane:#8F2D14; }
.lane-weight { --lane:#6B5B2E; }

/* ---- metric pages ---- */
.metric-nav { display:flex; flex-direction:column; gap:10px; margin-bottom:6px; }
.metric-tabs { display:flex; gap:2px; border-bottom:1px solid #DDE1DB; }
.metric-tab { padding:10px 18px; border-bottom:2px solid transparent; margin-bottom:-1px; color:#56625C; font-size:14px; }
.metric-tab:hover { text-decoration:none; color:#0B6B6B; }
.metric-tab.selected { color:#0B6B6B; border-color:#0B6B6B; font-weight:600; }
.metric-custom { display:flex; flex-wrap:wrap; align-items:end; gap:10px 16px; font-size:13px; color:#56625C; }
.metric-custom input { padding:6px; border:1px solid #DDE1DB; border-radius:6px; }
.metric-notice { border-radius:10px; padding:10px 14px; margin:0 0 12px; font-size:13.5px; border:1px solid transparent; }
.metric-notice.info { background:#E2F0EF; }
.metric-notice.warning { background:#FFF3D6; }
.stale-note { color:#8A5A00; font-weight:500; }
.metric-values { display:grid; grid-template-columns:repeat(auto-fit, minmax(200px, 1fr)); gap:12px; margin:0 0 14px; }
.metric-value { padding:12px 14px; margin:0; }
.metric-value.metric-main { box-shadow:inset 3px 0 0 #0B6B6B; }
.metric-value h2 { margin:0; font-size:13px; font-weight:500; color:#56625C; }
.metric-value-top { display:flex; justify-content:space-between; gap:6px; align-items:flex-start; flex-wrap:wrap; }
.metric-value .vital-value { font-size:26px; margin:2px 0; }
.metric-value.metric-main .vital-value { font-size:32px; }
.metric-value .vital-value small { font-size:12.5px; color:#56625C; }
.metric-value.muted-value .vital-value { font-size:18px; color:#56625C; }
.kind { display:inline-block; font-size:10.5px; line-height:1.55; padding:0 8px; border-radius:99px; background:#EEF0EC; color:#56625C; white-space:nowrap; cursor:help; border:1px solid transparent; }
.kind-Sample, .kind-Latest, .kind-Reading { background:transparent; border-color:#DDE1DB; color:#18211D; }
.kind-BucketMean, .kind-DayMean, .kind-DayMedian, .kind-NightMean, .kind-Total, .kind-Mean7, .kind-MeanOfDays, .kind-PersonalHealthSummary { background:#E2F0EF; color:#0B6B6B; }
.kind-SourceSummary, .kind-SourceDerived { background:#FFF0D4; color:#8A5A00; }
.metric-columns { display:grid; grid-template-columns:minmax(0, 1fr) 320px; gap:16px; align-items:start; margin-bottom:14px; }
.metric-columns.devices { grid-template-columns:minmax(0, 1.5fr) minmax(300px, 1fr); }
.metric-chart-card { padding:14px 16px; margin:0; }
.metric-aside { display:flex; flex-direction:column; gap:14px; }
.metric-aside .overview-panel { margin:0; }
@media (max-width:900px) { .metric-columns, .metric-columns.devices { grid-template-columns:minmax(0, 1fr); } }
.metric-legend { display:flex; flex-wrap:wrap; gap:4px 16px; list-style:none; margin:6px 0 0; padding:0; font-size:12.5px; color:#56625C; }
.metric-legend li { display:inline-flex; align-items:center; gap:6px; }
.metric-granularity { font-size:12px; margin:4px 0 0; }
.swatch { display:inline-block; width:10px; height:10px; border-radius:50%; background:var(--c, #18211D); flex:none; }
.swatch.band { background:#0B6B6B; opacity:.2; border-radius:2px; }
.src0 { --c:#C2410C; } .src1 { --c:#1D4ED8; } .src2 { --c:#7C3AED; } .src3 { --c:#9A6B00; } .src4 { --c:#0F766E; } .src5 { --c:#56625C; } .src-selected { --c:#18211D; }
.mchart { margin:0; position:relative; }
.mchart-unit { font-size:11.5px; color:#56625C; margin:0 0 10px 2px; }
.mchart-body { display:grid; grid-template-columns:44px minmax(0, 1fr); }
.mchart-y { position:relative; }
.mchart-y span { position:absolute; right:6px; transform:translateY(-50%); font:11px 'IBM Plex Mono', monospace; color:#56625C; }
.mchart-plot { position:relative; height:260px; border-bottom:1px solid #C9CFC7; touch-action:pan-y; }
.mchart-plot:focus-visible { outline:2px solid #0B6B6B; outline-offset:2px; }
.mchart-plot svg { position:absolute; inset:0; width:100%; height:100%; overflow:visible; }
.mgrid { stroke:#ECEEEA; stroke-width:1; vector-effect:non-scaling-stroke; fill:none; }
.mgrid.v { stroke-dasharray:2 4; }
.mline { fill:none; stroke:var(--c); stroke-width:1.9; stroke-linejoin:round; stroke-linecap:round; vector-effect:non-scaling-stroke; }
.mline.thin { stroke-width:1.4; }
.mband-area { fill:var(--c); opacity:.17; stroke:none; }
.mstem { fill:none; stroke:var(--c); stroke-width:2.4; opacity:.5; vector-effect:non-scaling-stroke; }
.mmark { stroke-width:1.2; vector-effect:non-scaling-stroke; fill:none; }
.mmark-SourceChange { stroke:#8A5A00; stroke-dasharray:5 4; }
.mmark-Now { stroke:#18211D; opacity:.4; stroke-dasharray:2 3; }
.mmark-Selected { stroke:#0B6B6B; opacity:.55; }
.mmark-Event { stroke:#8A5A00; opacity:.45; }
.mmark-label { position:absolute; top:3px; font-size:10.5px; color:#56625C; transform:translateX(4px); pointer-events:none; }
.mdot { position:absolute; width:8px; height:8px; border-radius:50%; background:var(--c); transform:translate(-50%, -50%); pointer-events:none; }
.mdot.small { width:5px; height:5px; }
.mdot.hollow { background:#fff; border:2px solid var(--c); box-sizing:border-box; }
.mbar { position:absolute; background:var(--c); opacity:.88; border-radius:2px 2px 0 0; min-height:1px; pointer-events:none; }
.mshade { position:absolute; top:0; bottom:0; pointer-events:none; }
.mshade-sleep { background:#E3EAF5; }
.mshade-workout { background:#F8E6D5; }
.mband { position:absolute; left:0; right:0; background:#0B6B6B; opacity:.08; pointer-events:none; }
.msummary { position:absolute; background:#0B6B6B; opacity:.25; border-radius:6px; pointer-events:none; }
.msummary-median { position:absolute; border-top:3px solid #0B6B6B; pointer-events:none; }
.mcross { position:absolute; top:0; bottom:0; width:1px; background:#18211D; opacity:.45; pointer-events:none; }
.mcross[hidden], .mtip[hidden] { display:none; }
.mtip { position:absolute; top:6px; z-index:5; min-width:150px; max-width:300px; background:#18211D; color:#fff; border-radius:8px; padding:6px 10px; font-size:12px; pointer-events:none; box-shadow:0 4px 14px #0004; }
.mtip .swatch { margin-right:2px; }
.mtip-time { font-weight:600; margin-bottom:2px; }
.mtip .none { opacity:.65; }
.mchart-x { position:relative; height:20px; margin-left:44px; }
.mchart-x span { position:absolute; transform:translateX(-50%); font:11px 'IBM Plex Mono', monospace; color:#56625C; top:4px; white-space:nowrap; }
.mchart-empty { text-align:center; color:#56625C; margin:6px 0 0; }
.source-chips { display:flex; flex-wrap:wrap; gap:6px; margin:0 0 10px; }
.source-chip { display:inline-flex; flex-wrap:wrap; align-items:center; gap:2px 8px; border:1px solid #DDE1DB; border-radius:12px; padding:6px 12px; color:#18211D; background:#fff; opacity:.75; }
.source-chip:hover { text-decoration:none; border-color:#0B6B6B; }
.source-chip.on { opacity:1; border-color:#0B6B6B; background:#E2F0EF; }
.source-chip.off { opacity:.5; }
.source-chip small { flex-basis:100%; margin-left:18px; color:#56625C; font-size:11px; }
.metric-stats { margin:8px 0 0; }
.metric-stats > div { padding:8px 0; border-top:1px solid #ECEEEA; display:grid; grid-template-columns:1fr auto; gap:2px 12px; }
.metric-stats dt { font-size:13px; }
.metric-stats dd { margin:0; font-weight:600; text-align:right; font-size:13px; }
.metric-stats dd.note { grid-column:1 / -1; font-weight:400; text-align:left; font-size:11.5px; }
.metric-gaps { margin:4px 0; padding-left:18px; font-size:12.5px; }
.metric-caveats { margin-top:12px; padding:10px 12px; background:#EEF0EC; border-radius:10px; font-size:12.5px; color:#56625C; }
.metric-caveats h3 { margin:0 0 4px; font-size:12.5px; color:#18211D; }
.metric-caveats p { margin:4px 0 0; }
.metric-pair { display:flex; flex-wrap:wrap; gap:8px 12px; align-items:end; margin:0 0 8px; font-size:13px; }
.metric-pair select, .metric-filters select { padding:6px 8px; border:1px solid #DDE1DB; border-radius:6px; background:#fff; }
.metric-filters { display:flex; flex-wrap:wrap; gap:8px 16px; align-items:end; margin:0 0 10px; font-size:12px; color:#56625C; }
.metric-filters label { display:flex; flex-direction:column; gap:2px; }
.metric-filters .fixed { padding:7px 0; font-size:13px; color:#18211D; }
.metric-table { width:100%; border-collapse:collapse; font-size:13px; }
.metric-table th { text-align:left; font-size:11.5px; font-weight:500; color:#56625C; padding:6px 8px; border-bottom:1px solid #DDE1DB; }
.metric-table td { padding:8px; border-bottom:1px solid #ECEEEA; vertical-align:top; }
.metric-table small { display:block; color:#56625C; font-size:11.5px; }
.metric-table .r { text-align:right; }
.metric-table tr.selected td { background:#F3F8F7; }
.metric-table tr.excluded { opacity:.7; }
.metric-table tr.source-detail td { padding-top:0; }
.metric-table.sources .swatch { margin-right:8px; }
.metric-table details summary { cursor:pointer; color:#0B6B6B; font-size:12.5px; }
.metric-table code { font:11.5px 'IBM Plex Mono', monospace; background:#EEF0EC; padding:1px 5px; border-radius:4px; margin-right:6px; word-break:break-all; }
.coverage-bar { height:6px; background:#ECEEEA; border-radius:4px; overflow:hidden; width:120px; }
.coverage-bar i { display:block; height:100%; background:#0B6B6B; }
.pill { display:inline-block; font-size:11px; padding:1px 8px; border-radius:99px; background:#EEF0EC; border:1px solid #DDE1DB; white-space:nowrap; }
.pill.ok { background:#E3F4EA; color:#1D7A45; border-color:transparent; }
.pill.warn { background:#FFF3D6; color:#8A5A00; border-color:transparent; }
.metric-links { display:flex; flex-direction:column; gap:8px; }
.metric-links a { display:block; padding:10px 12px; border:1px solid #DDE1DB; border-radius:10px; color:#18211D; }
.metric-links a:hover { text-decoration:none; border-color:#0B6B6B; }
.metric-links small { display:block; color:#56625C; font-size:12px; }
.metric-pager { display:flex; gap:16px; margin:10px 0; }
.explorer-link { font-weight:600; }
.metric-open { font-size:12.5px; margin-left:6px; }

/* Sleep, Recovery and Activity */
.day-page { display:flex; flex-direction:column; gap:16px; min-width:0; }
.day-columns { display:grid; grid-template-columns:minmax(0,1.4fr) minmax(280px,1fr); gap:16px; align-items:start; }
.day-main,.day-side { display:flex; flex-direction:column; gap:16px; min-width:0; }
.section-title { margin:8px 0 0; font-size:17px; font-weight:600; }
.empty-state h2 { font-size:16px; }
.headline-value { display:flex; justify-content:space-between; align-items:flex-end; gap:12px; }
.headline-value .night-value { margin:0; }
.headline-delta { display:flex; flex-direction:column; align-items:flex-end; margin:0 0 6px; }
.headline-delta b { font-size:14px; }.headline-delta small { color:#56625c; font-size:11px; }
.night-times { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin:0; }
.night-times>div { display:flex; flex-direction:column; }
.night-times dt { color:#56625c; font-size:11.5px; }.night-times dd { margin:0; text-align:left; font-size:18px; font-weight:600; }
.value-rows { display:flex; flex-direction:column; margin:0; }
.value-rows>div { display:flex; justify-content:space-between; align-items:baseline; gap:12px; border-top:1px solid #eceeea; padding:8px 0; font-size:13px; }
.value-rows dt { min-width:0; color:inherit; }.value-rows dd { margin:0; text-align:right; }
.day-details { gap:8px; }
.day-details>summary { color:#0b6b6b; font-weight:500; }
.day-details h3 { margin:10px 0 0; font-size:14px; font-weight:600; }
.stage-key { display:inline-block; width:9px; height:9px; border-radius:50%; margin-right:5px; }
.night-totals .stage-key { display:inline-block; }
.session-list { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px; font-size:13px; }
.session-list li { display:grid; grid-template-columns:120px minmax(0,1fr) auto; gap:4px 10px; align-items:center; }
.session-list small { grid-column:1/-1; }
.session-bar { display:block; height:8px; border-radius:4px; background:#0b6b6b; }
.recovery-summary { background:#E8F1EF; border-color:#BFD9D5; }
.recovery-summary>div { display:flex; flex-direction:column; gap:4px; }
.eyebrow { text-transform:uppercase; letter-spacing:.06em; color:#3E4944; font-size:11px; font-weight:600; }
.recovery-rows { gap:0; }
.recovery-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:12px; align-items:start; padding:10px 0; border-top:1px solid #eceeea; color:inherit; }
.recovery-row:first-child { border-top:0; }
.recovery-row:hover { text-decoration:none; background:#f8f9f7; }
.recovery-row>div { display:flex; flex-direction:column; gap:2px; min-width:0; }
.recovery-row b { font-weight:600; }
.recovery-value { margin:0; display:flex; flex-direction:column; align-items:flex-end; }
.recovery-value b { font-size:18px; }.recovery-value small { color:#56625c; font-size:11px; }
.range-bar { display:grid; grid-template-columns:minmax(0,1fr) 84px; gap:8px; align-items:center; margin-top:4px; }
.range-bar small { text-align:right; color:#56625c; font-size:11.5px; }
.range-bar.outside small { color:#0b6b6b; font-weight:600; }
.range-track { position:relative; height:6px; border-radius:3px; background:#DDE1DB; margin:0 6px; }
.range-usual { position:absolute; top:-1px; height:8px; border-radius:3px; background:#BFD9D5; }
.range-dot { position:absolute; top:50%; width:10px; height:10px; margin:-5px 0 0 -5px; border-radius:50%; background:#18211D; }
.range-bar.outside .range-dot { background:#0b6b6b; box-shadow:0 0 0 2px #fff; }
.activity-tiles { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:12px; }
.activity-tile { gap:4px; padding:14px 16px; color:inherit; }
.activity-tile:hover { text-decoration:none; border-color:#0b6b6b; }
.activity-tile b { font-size:19px; font-weight:600; }
.dchart { margin:0; display:flex; flex-direction:column; gap:4px; }
.dchart-body { display:grid; grid-template-columns:52px minmax(0,1fr); gap:6px; }
.dchart-y { position:relative; height:160px; font-size:11px; color:#56625c; }
.dchart-y span { position:absolute; right:0; transform:translateY(-50%); white-space:nowrap; }
.dchart-plot { position:relative; height:160px; }
.dchart-plot svg { position:absolute; inset:0; width:100%; height:100%; overflow:visible; }
.dgrid { stroke:#eceeea; stroke-width:1; vector-effect:non-scaling-stroke; }
.dband { fill:#0b6b6b; opacity:.12; }
.dbar { fill:#0b6b6b; opacity:.8; }.dbar:hover { opacity:1; }
.dline { fill:none; stroke:#0b6b6b; stroke-width:2; vector-effect:non-scaling-stroke; }
.dline.secondary { stroke:#9aa59f; stroke-width:1.2; }
.dref { stroke:#3E4944; stroke-width:1; stroke-dasharray:4 4; vector-effect:non-scaling-stroke; }
.ddot { position:absolute; width:6px; height:6px; margin:-3px 0 0 -3px; border-radius:50%; background:#0b6b6b; }
.dchart-x { display:flex; justify-content:space-between; margin-left:58px; font-size:11px; color:#56625c; }
@media(max-width:1199px) { .day-columns { grid-template-columns:minmax(0,1fr); } }
@media(max-width:650px) { .session-list li { grid-template-columns:minmax(0,1fr) auto; }.session-bar { grid-column:1/-1; grid-row:2; }.dchart-body { grid-template-columns:40px minmax(0,1fr); }.dchart-x { margin-left:46px; } }
.card-head { display:flex; justify-content:space-between; align-items:baseline; gap:12px; }
.body-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%,440px),1fr)); gap:16px; align-items:start; }
.training-list { gap:0; }
.training-list h2 { margin-bottom:8px; }
.explore-form { flex-direction:row; flex-wrap:wrap; align-items:flex-end; gap:12px 16px; }
.explore-form label { display:flex; flex-direction:column; gap:4px; font-size:12px; color:#56625c; }
.explore-form select,.explore-form input { font:inherit; font-size:13px; padding:6px 8px; border:1px solid #DDE1DB; border-radius:8px; background:#fff; color:#18211D; max-width:220px; }
.explore-form small { flex-basis:100%; }
.dchart-y.scatter,.dchart-plot.scatter { height:240px; }
.dchart-plot.scatter { border-left:1px solid #eceeea; border-bottom:1px solid #eceeea; }
.lag-bars { display:grid; grid-template-columns:repeat(15,minmax(0,1fr)); gap:4px; height:150px; margin-bottom:22px; }
.lag-bar { position:relative; border-bottom:1px solid #eceeea; background:linear-gradient(#eceeea,#eceeea) center/100% 1px no-repeat; }
.lag-bar small { position:absolute; bottom:-18px; left:0; right:0; text-align:center; font-size:10.5px; color:#56625c; }
.lag-fill { position:absolute; left:15%; right:15%; background:#0b6b6b; border-radius:2px; }
.lag-fill.negative { background:#9aa59f; }
.lag-bar.chosen .lag-fill { box-shadow:0 0 0 2px #fff, 0 0 0 3px #0b6b6b; }
.lag-bar.chosen small { color:#0b6b6b; font-weight:600; }
.timeline { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:12px; }
.timeline h2 { font-size:15px; }
.timeline ul { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px; }
.timeline-entry { display:grid; grid-template-columns:10px minmax(0,1fr); gap:10px; align-items:start; }
.timeline-entry>div { display:flex; flex-direction:column; gap:1px; font-size:13.5px; }
.timeline-dot { width:10px; height:10px; border-radius:50%; margin-top:5px; background:#0b6b6b; }
.timeline-sleep .timeline-dot { background:#9aa59f; }.timeline-weight .timeline-dot { background:#2f8a4f; }.timeline-userevent .timeline-dot { background:#e08a3c; }
.comparison-row { display:flex; flex-direction:column; gap:6px; border-top:1px solid #eceeea; padding-top:10px; }
.comparison-row:first-of-type { border-top:0; padding-top:0; }
.comparison-windows { display:grid; grid-template-columns:repeat(auto-fit,minmax(110px,1fr)); gap:8px; margin:0; }
.comparison-windows>div { display:flex; flex-direction:column; }
.comparison-windows dd { text-align:left; font-size:14px; }
.delta { color:#0b6b6b; }
/* A metric's page, as in the app: the headline, then the chart across the page, then the other values. */
.metric-headline { margin-bottom:14px; gap:6px; }
.metric-headline .headline-value .vital-value { font-size:40px; margin:0; }
.metric-headline .headline-delta b { font-size:16px; }
.usual-line { margin:0; font-size:13px; color:#3E4944; }
.metric-chart-wide { margin:0 0 14px; }
.metric-chart-wide h2 { margin:0; font-size:16px; }
.metric-chart-wide .mchart-plot { height:min(440px, 55vh); }
.metric-chart-block { display:flex; flex-direction:column; gap:6px; }
.metric-bottom { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr)); gap:14px; align-items:start; margin-bottom:14px; }
.metric-method .method { margin:0; }
.metric-index { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%,300px),1fr)); gap:16px; align-items:start; }
.metric-index ul { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; }
.metric-index li a { display:flex; flex-direction:column; gap:1px; padding:9px 0; border-top:1px solid #eceeea; color:inherit; }
.metric-index li:first-child a { border-top:0; }
.metric-index li a:hover { text-decoration:none; color:#0b6b6b; }
@media(max-width:650px) { .metric-chart-wide .mchart-plot { height:300px; }.metric-headline .headline-value .vital-value { font-size:32px; } }
.timeline-span { margin:0; }
.timeline-pager { display:flex; justify-content:center; }

/* What changed: the day-by-day grid of deviations, the anchor framed; warm above the usual level, cool below. */
.whatchanged .wc-choose-row { display:flex; gap:10px; align-items:end; flex-wrap:wrap; }
.whatchanged .wc-choose input[type=date] { margin-left:6px; }
.whatchanged .wc-episodes { list-style:none; padding:0; margin:0; display:flex; flex-wrap:wrap; gap:6px 14px; font-size:13px; }
.whatchanged .wc-episodes a[aria-current] { font-weight:600; text-decoration:underline; }
.whatchanged .wc-head h2 { font-size:20px; }
.whatchanged .wc-warn { color:#8A5A00; }
.whatchanged .wc-summary p { margin:0; font-size:15px; line-height:1.5; }
.whatchanged .wc-count { margin:0; }
.whatchanged .wc-table { width:100%; border-collapse:collapse; font-size:13px; font-variant-numeric:tabular-nums; }
.whatchanged .wc-table th,.whatchanged .wc-table td { padding:6px 4px; text-align:right; border-bottom:1px solid #E1E6E2; vertical-align:top; }
.whatchanged .wc-table thead th { font-size:11.5px; font-weight:600; color:#56625C; }
.whatchanged .wc-table th:first-child { text-align:left; }
.whatchanged .wc-table tbody th { font-weight:600; }
.whatchanged .wc-table tbody th small { display:block; font-weight:400; font-size:11.5px; color:#56625C; }
.whatchanged .wc-table td.up { color:#8A5A00; font-weight:600; }
.whatchanged .wc-table td.down { color:#2463D1; font-weight:600; }
.whatchanged .wc-table td.thin { color:#8A948F; }
.whatchanged .wc-unchanged { margin:4px 0 0; font-size:13px; }
.whatchanged .wc-more summary { font-size:13px; color:#0b6b6b; cursor:pointer; }
.whatchanged .wc-events { margin:0; padding-left:18px; display:flex; flex-direction:column; gap:6px; font-size:13px; line-height:1.5; }
.whatchanged .wc-grid { display:grid; gap:3px 2px; align-items:center; }
.whatchanged .wc-name { font-size:12px; color:#56625C; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.whatchanged .wc-name.changed { color:#18211D; font-weight:600; }
.whatchanged .wc-cell { height:11px; border-radius:2px; background:#EEF0EC; }
.whatchanged .wc-cell.none { background:transparent; outline:1px solid #E1E6E2; outline-offset:-1px; }
.whatchanged .wc-cell.other { background:repeating-linear-gradient(45deg,#D7DCD8 0 3px,transparent 3px 6px); }
.whatchanged .wc-frame { border:2px solid #18211D; border-radius:4px; margin:-3px -2px; pointer-events:none; align-self:stretch; z-index:1; }
.whatchanged .wc-axis { display:flex; justify-content:space-between; font-size:11px; color:#56625C; margin-top:2px; }
.whatchanged .wc-axis b { color:#18211D; }
.whatchanged .wc-changes { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:18px; }
.whatchanged .wc-change h3 { font-size:15px; margin:0; }
.whatchanged .wc-change { display:flex; flex-direction:column; gap:4px; min-width:0; }
.whatchanged .wc-windows { list-style:none; padding:0; margin:2px 0; font-size:13px; line-height:1.55; }
.whatchanged .wc-windows .changed { font-weight:600; }
@media(max-width:650px) { .whatchanged .wc-grid { grid-template-columns:76px repeat(var(--days,15),minmax(4px,1fr)) !important; } .whatchanged .wc-name { font-size:11px; } .whatchanged .wc-table { font-size:12px; } .whatchanged .wc-table th,.whatchanged .wc-table td { padding:5px 2px; } }
