[data-workout-day-physiology][hidden] { display: none !important }
[data-workout-day-physiology] { min-width: 0; margin: .75rem 0 }
[data-workout-day-physiology] table { width: 100%; border-collapse: collapse; margin: .5rem 0 }
[data-workout-day-physiology] th, [data-workout-day-physiology] td { padding: .4rem .2rem; text-align: end; font-variant-numeric: tabular-nums; border-bottom: 1px solid currentColor }
[data-workout-day-physiology] th:first-child { text-align: start }
[data-workout-day-physiology] th small { font-weight: 400; white-space: nowrap }
[data-workout-day-physiology] p { margin: .4rem 0; overflow-wrap: anywhere }
[data-workout-day-physiology] select { color: inherit; background: var(--surface, Canvas); max-width: 100%; font: inherit }

/* Current functional Today. The installed app retains its own header, navigation and local data overlays. */
[data-functional-today="v1"][data-state="owner"] {
  --ds-hairline: var(--sd-line, rgba(127,127,127,.28));
  --ds-secondary: var(--tl-muted, #aaa);
  --ds-accent: var(--tl-accent, #a8303a);
  font-family: var(--tl-font, "Geist Mono TRS", "Geist Mono", ui-monospace, monospace);
}
[data-functional-today="v1"] .ds-functional-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 4px;
  padding: 14px 0 8px;
  margin: 0;
  border-bottom: 1px solid var(--ds-hairline);
}
[data-functional-today="v1"] .ds-functional-metrics > .sd-ring {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
[data-functional-today="v1"] .ds-functional-metrics .sd-face {width: min(78px,100%); aspect-ratio: 1;}
[data-functional-today="v1"] .ds-functional-metrics .sd-ring-value {font: 300 24px/1.12 var(--tl-font,ui-monospace,monospace); font-variant-numeric: tabular-nums;}
[data-functional-today="v1"] .ds-functional-metrics .sd-ring-label {font-size:10px; letter-spacing:.14em; text-transform:uppercase;}
[data-functional-today="v1"] .ds-functional-metrics .sd-ring-detail {font-size:11px; min-height:1.35em; line-height:1.35; color:var(--ds-secondary);}
[data-functional-today="v1"] [data-sense-today-diary] {
  display: flex; align-items: center; justify-content: space-between; 
  min-height: 48px; padding: 0 6px; margin: 12px 0;
  border: 0; border-block: 1px solid var(--ds-hairline); border-radius: 0;
  background: transparent; font-size: 15px;
}
[data-functional-today="v1"] [data-sense-today-diary]::after {content: "›"; font-size:20px;}
[data-functional-today="v1"] .ds-calc-header {display:flex; align-items:center; justify-content:space-between; gap:10px; margin:24px 0 8px;}
[data-functional-today="v1"] .ds-calc-header h2,
[data-functional-today="v1"] [data-day-training] > .sd-label,
[data-functional-today="v1"] [data-sense-today-nutrition] > h2,
[data-functional-today="v1"] [data-sense-proxy-analytics-slot] > h2 {
  margin: 0; font-size: 10px; font-weight:500; letter-spacing:.14em;
  line-height:1.4; text-transform:uppercase; color:var(--ds-secondary);
}
[data-functional-today="v1"] .ds-calc-options {display:inline-flex; padding:2px; gap:0; border:1px solid var(--ds-hairline); border-radius:8px;}
[data-functional-today="v1"] .ds-calc-options button {
  position:relative; border:1px solid transparent; border-radius:6px; padding:0 8px;
  background:transparent; min-height:24px; font:inherit; font-size:10px;
  text-transform:uppercase; letter-spacing:.05em; color:inherit;
}
[data-functional-today="v1"] .ds-calc-options button[aria-pressed="true"] {
  border-color:var(--ds-accent); background:color-mix(in srgb, var(--ds-accent) 13%, transparent);
}
[data-functional-today="v1"] .ds-calc-options button:focus-visible {outline:2px solid currentColor; outline-offset:2px;}
[data-functional-today="v1"] :is([data-day-training],[data-sense-today-nutrition]) {
  border:0; border-top:1px solid var(--ds-hairline); border-radius:0; padding:12px 0; background:transparent; margin:8px 0 0;
}
[data-functional-today="v1"] .ds-calc-row {
  display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:baseline;
  gap:2px 8px; padding:8px 0; min-width:0;
}
[data-functional-today="v1"] .ds-calc-row > span {font-size:12px;}
[data-functional-today="v1"] .ds-calc-row > strong {font-size:20px; font-weight:300; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; text-align:end;}
[data-functional-today="v1"] .ds-calc-row > small {grid-column: 1 / -1; font-size:11px; color:var(--ds-secondary);}
[data-functional-today="v1"][data-calculation-mode="actual"] :is([data-calc-reading="plan"],[data-calc-reading="difference"]),
[data-functional-today="v1"][data-calculation-mode="plan"] :is([data-calc-reading="actual"],[data-calc-reading="difference"]),
[data-functional-today="v1"][data-calculation-mode="difference"] :is([data-calc-reading="actual"],[data-calc-reading="plan"]) {display:none!important;}
[data-functional-today="v1"] [data-basal-metabolism] {border-top:1px solid var(--ds-hairline);}
[data-functional-today="v1"] [data-basal-metabolism] summary {padding:12px 0; cursor:pointer; font-size:13px;}
[data-functional-today="v1"] [data-basal-metabolism] summary strong {margin-inline-start:12px; font:inherit;}
[data-functional-today="v1"] [data-basal-metabolism] p {font-size:12px; color:var(--ds-secondary);}
[data-functional-today="v1"] [data-sense-proxy-analytics-slot] .ds-workout-values {display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0; margin-top:7px; border-top:1px solid var(--ds-hairline);}
[data-functional-today="v1"] [data-sense-proxy-analytics-slot] .ds-workout-values[hidden] {display:none;}
[data-functional-today="v1"] .ds-workout-values > button {
  text-align:start; min-width:0; border:0; border-bottom:1px solid var(--ds-hairline);
  border-radius:0; padding:11px 12px; background:transparent;
}
[data-functional-today="v1"] .ds-workout-values > button:nth-child(odd) {border-right:1px solid var(--ds-hairline); padding-inline-start:0;}
[data-functional-today="v1"] .ds-workout-values button span {font-size:10px; line-height:1.45; letter-spacing:.08em; text-transform:uppercase;}
[data-functional-today="v1"] .ds-workout-values button strong {font-size:22px; line-height:1.2; font-weight:300;}
[data-functional-today="v1"] [data-sense-period-days] [role=group] {
  display:flex; align-items:stretch; gap:0; padding:2px; border:1px solid var(--ds-hairline); border-radius:8px;
}
[data-functional-today="v1"] [data-timeline-period] {flex:1; min-width:0; min-height:30px; padding:0 3px; font:inherit; font-size:10px; letter-spacing:.06em; text-transform:uppercase;}
@media (max-width:340px) {
  [data-functional-today="v1"] .ds-calc-options button {padding-inline:5px;}
  [data-functional-today="v1"] .ds-functional-metrics .sd-face {width:64px;}
}

[data-functional-today="v1"]:is([data-calculation-mode="plan"],[data-calculation-mode="difference"]) [data-sense-proxy-analytics-slot] {display:none;}
[data-functional-today="v1"] [data-sense-workout-nutrition-slot]:has(> p[role="status"]:only-of-type + a[href="/my/nutrition.html?sense=session"]:last-child) {display:none;}
/* Keep the sleep button and the measured native strip in the same DOM places. */
[data-functional-today="v1"] .ds-night-card > .sd-label {text-align:start; font-size:10px; letter-spacing:.12em; text-transform:uppercase; color:var(--ds-secondary);}
[data-functional-today="v1"] .ds-night-card > .sd-ring {display:flex; flex-direction:row; justify-content:flex-start; width:100%; max-width:none; min-height:64px; padding:0; margin:4px 0; gap:8px; text-align:start;}
[data-functional-today="v1"] .ds-night-card > .sd-ring .sd-face {height:50px; width:auto; min-width:72px; flex:0 0 auto; display:grid; place-items:center start;}
[data-functional-today="v1"] .ds-night-card > .sd-ring .sd-face > svg:not(:has([data-sleep-arc])) {display:none;}
[data-functional-today="v1"] .ds-night-card > .sd-ring .sd-face:has(svg [data-sleep-arc]) {height:auto; width:auto; display:flex; gap:8px; align-items:center;}
[data-functional-today="v1"] .ds-night-card > .sd-ring .sd-face > svg:has([data-sleep-arc]) {height:36px; width:36px; position:static;}
[data-functional-today="v1"] .ds-night-card > .sd-ring .sd-ring-mid {position:static; align-items:start; justify-content:start; transform:none;}
[data-functional-today="v1"] .ds-night-card > .sd-ring .sd-ring-value {font-size:24px; font-weight:300;}
[data-functional-today="v1"] .ds-night-card > .sd-ring .sd-ring-label {display:none;}
[data-functional-today="v1"] .ds-night-card > .sd-ring .sd-ring-detail {font-size:11px; color:var(--ds-secondary);}
[data-functional-today="v1"] [data-sense-day-timeline-slot] input[type="range"] {accent-color:var(--ds-accent);}
[data-functional-today="v1"] [data-basal-metabolism] summary {display:flex; align-items:center; justify-content:space-between;}

[data-sense-day-timeline-slot] .ds-chart-tools {display:flex;align-items:center;gap:3px;border-top:1px solid var(--ds-hairline);padding:8px 0 2px;color:inherit;}
[data-sense-day-timeline-slot] .ds-chart-tools h2 {flex:1;margin:0;font:inherit;font-size:14px;font-weight:500;line-height:1.35;}
[data-sense-day-timeline-slot] .ds-chart-tools button {min-width:36px;min-height:44px;padding:3px 4px;border:0;background:transparent;color:inherit;font:inherit;font-size:17px;cursor:pointer;}
[data-sense-day-timeline-slot] .ds-chart-tools [data-chart-action=list] {font-size:11px;}
[data-sense-day-timeline-slot] .ds-chart-tools button:disabled {opacity:.4;}
[data-sense-day-timeline-slot] .ds-chart-tools button:focus-visible {outline:2px solid currentColor;outline-offset:-2px;border-radius:5px;}
[data-sense-day-timeline-slot]:not([data-sense-history-open]) .ds-period-name,
[data-sense-day-timeline-slot][data-sense-history-open] :is(.ds-day-name,[data-chart-action=add]),
[data-sense-day-timeline-slot]:not([data-chart-expanded]) :is([data-chart-action=zoom-in],[data-chart-action=zoom-out]),
[data-sense-day-timeline-slot]:not(:has([data-day-time-cursor])) [data-chart-action=add],
[data-sense-day-timeline-slot]:not([data-chart-list]) [data-sense-period-results] > :is(ul,button),
[data-sense-day-timeline-slot]:has(.ds-chart-tools) [data-linked-day-timeline] > :is(h3,p),
[data-sense-day-timeline-slot]:has(.ds-chart-tools) [data-day-hourly] > summary {display:none;}
[data-sense-day-timeline-slot]:has(.ds-chart-tools) [data-day-hourly]:not([open]) {display:none;}
[data-sense-day-timeline-slot] .ds-day-ticks {display:flex;justify-content:space-between;color:var(--ds-secondary);font-size:9px;line-height:1.5;font-variant-numeric:tabular-nums;}
[data-sense-day-timeline-slot]:has(.ds-chart-tools) [data-linked-day-timeline] > label:has([data-day-time-cursor]) {font-size:0;display:block;margin:0;}
[data-sense-day-timeline-slot]:has(.ds-chart-tools) [data-day-time-cursor] {display:block;width:100%;min-height:28px;}
[data-sense-day-timeline-slot]:has(.ds-chart-tools) [data-day-time-value] {font-size:12px;}
[data-sense-day-timeline-slot][data-chart-expanded] {
  position:fixed;inset:0;box-sizing:border-box;margin:0;width:100%;max-width:none;height:100dvh;max-height:none;
  z-index:100000;overflow:auto;overscroll-behavior:contain;touch-action:pan-x pan-y;
  padding:max(14px,env(safe-area-inset-top)) 16px max(16px,env(safe-area-inset-bottom));
  background:var(--tl-bg,#100b0d);color:var(--tl-ink,inherit);border:0;
}
[data-sense-day-timeline-slot][data-chart-expanded] .ds-chart-tools {position:sticky;top:0;z-index:2;background:var(--tl-bg,#100b0d);border:0;}
[data-sense-day-timeline-slot] .ds-plot-scroll {width:100%;overflow-x:auto;overflow-y:hidden;}
[data-sense-day-timeline-slot][data-chart-expanded] [data-linked-day-timeline] .rv-chart {height:clamp(100px,30dvh,260px)!important;}
[data-sense-day-timeline-slot][data-chart-expanded] .ds-plot-scroll > :is(.rv-chart,.ds-day-ticks) {width:calc(100% * var(--ds-chart-zoom,1));max-width:none;}
[data-sense-day-timeline-slot][data-chart-expanded] [data-sense-period-chart] {overflow-x:auto;margin-block:20px;}
[data-sense-day-timeline-slot][data-chart-expanded] [data-sense-period-chart] > div {width:calc(100% * var(--ds-chart-zoom,1));min-height:42px;}

[data-functional-today="v1"] [data-sense-today-period-picker] [data-timeline-period] {
  display:flex;align-items:center;justify-content:center;height:30px;padding:0 2px;
  text-align:center;white-space:nowrap;border:1px solid transparent;border-radius:6px;
  color:var(--ds-secondary,currentColor);background:transparent;
}
[data-functional-today="v1"] [data-sense-today-period-picker] [data-timeline-period][aria-pressed=true] {
  border-color:var(--ds-hairline,currentColor);background:var(--tl-card,rgba(128,128,128,.12));
  color:inherit;box-shadow:none;
}
[data-sense-today-period-picker] [data-timeline-period]:focus-visible {outline:2px solid currentColor;outline-offset:2px}
[data-sense-period-results][hidden],
[data-sense-period-results] [hidden] {display:none!important}
[data-sense-period-results] {min-width:0;margin-block:.55rem .85rem}
[data-sense-period-results] [role=status] {margin:.45rem 0;font-size:.84rem}
[data-sense-period-results] ul {list-style:none;margin:0 0 .4rem;padding:0}
[data-sense-period-results] li + li {border-top:1px solid var(--ds-hairline,currentColor)}
[data-sense-period-results] a {display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:.2rem .65rem;box-sizing:border-box;min-height:44px;padding:.6rem .15rem;color:inherit;text-decoration:none}
[data-sense-period-results] time {font-weight:650;text-decoration:underline;text-underline-offset:.15em}
[data-sense-period-results] a span {font-size:.9rem;overflow-wrap:anywhere}
[data-sense-period-results] button {min-height:42px;padding:.45rem .65rem;color:inherit;background:transparent;border:1px solid var(--ds-hairline,currentColor);border-radius:.4rem;font:inherit;font-size:.85rem}
[data-sense-period-chart] {margin-block:.7rem}
[data-sense-period-chart] > div {display:grid;align-items:center;grid-template-columns:6.5em minmax(0,1fr);gap:.45rem;min-height:1.35rem;font-size:.76rem}
[data-sense-period-chart] svg {display:block;width:100%;height:12px;border-bottom:1px solid var(--ds-hairline,currentColor)}
