:root {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif;
  color: #181818;
  background: #f7f7f7;
  font-synthesis: none;
  color-scheme: light;
  --chat-font-size: 14px;
  --action-gap: 10px;
  --action-space: 16px;
  --line: #e3e3e3;
  --muted: #747474;
  --ink: #181818;
  --tabs-dur: 250ms;
  --tabs-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --tabs-bar-bg: transparent;
  --tabs-pill-bg: #ececec;
  --tabs-text-muted: #777;
  --tabs-text-active: #181818;
  --stagger-dur: 350ms;
  --stagger-distance: 6px;
  --stagger-blur: 1px;
  --reveal-dur: 250ms;
  -webkit-font-smoothing: antialiased;
  accent-color: #181818;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
[hidden] {
  display: none !important;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: wait;
  opacity: 0.5;
}
button,
select {
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible,
summary:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid #777;
  outline-offset: 3px;
}
button {
  border: 1px solid #181818;
  background: #181818;
  color: #fff;
  padding: 11px 16px;
  font-size: 13px;
  border-radius: 4px;
  transition: background-color 150ms ease;
}
button:hover {
  background: #333;
}
.secondary {
  background: #fff;
  color: #181818;
  border-color: #ccc;
}
.secondary:hover {
  background: #eee;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h2 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.4px;
}
h3 {
  font-size: 15px;
  font-weight: 600;
}
p {
  font-size: 14px;
  line-height: 1.6;
}
small,
.eyebrow {
  font-size: 10px;
  letter-spacing: 0.8px;
  color: #777;
}
.muted {
  color: var(--muted);
  font-size: 12px;
}
main {
  margin-left: 216px;
  padding: 0 40px 32px;
}
.view {
  max-width: 1280px;
  margin: auto;
}
.masthead {
  position: fixed;
  inset: 0 auto 0 0;
  width: 216px;
  padding: 34px 20px 20px;
  background: #fff;
  border-right: 1px solid var(--line);
  z-index: 30;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand > svg {
  width: 26px;
  height: 26px;
  fill: #181818;
}
.brand h1 {
  font-size: 17px;
  letter-spacing: -0.7px;
  font-weight: 700;
}
.brand h1 span {
  font-weight: 400;
  margin-left: 3px;
}
.masthead .t-tabs {
  margin-top: 40px;
  display: grid;
  gap: 6px;
  padding: 0;
  background: transparent;
  border-radius: 4px;
  position: relative;
  isolation: isolate;
}
.masthead .t-tab {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  height: 46px;
  padding: 12px;
  text-align: left;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  color: #666;
  background: transparent;
}
.masthead .t-tab[aria-current="page"] {
  color: #181818;
}
.masthead .t-tab:not([aria-current="page"]):hover {
  color: #181818;
  background: #eee;
}
.masthead .t-tabs-pill {
  left: 0;
  top: 0;
  border-radius: 4px;
  background: #e7e7e7;
  border-radius: 9px;
  will-change: auto;
}
.t-tab svg,
.settings-button svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
  flex-shrink: 0;
}
.sidebar-bottom {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 9px;
}
.athlete-avatar {
  background: #eee;
  height: 32px;
  width: 32px;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 600;
}
.sidebar-bottom > div {
  display: grid;
  gap: 4px;
}
.sidebar-bottom strong {
  font-size: 11px;
  font-weight: 600;
}
.sidebar-bottom div span {
  font-size: 9px;
  color: #888;
}
.settings-button {
  padding: 7px;
  border: 0;
  background: transparent;
  color: #666;
  margin-left: auto;
}
.settings-button:hover {
  background: #eee;
}

.athlete-tag {
  font-size: 9px;
  border: 1px solid #ddd;
  padding: 8px 10px;
  letter-spacing: 0.8px;
  color: #666;
}
.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr);
  gap: 20px;
}
section {
  background: #fff;
  border: 0;
  border-radius: 6px;
  padding: 24px;
  min-width: 0;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.section-heading h2 {
  font-size: 15px;
}
.section-heading .eyebrow {
  font-size: 8px;
  letter-spacing: 0.7px;
  white-space: nowrap;
}
.training-overview {
  display: flex;
  flex-direction: column;
}
.week-total {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.week-total strong {
  font-size: 48px;
  line-height: 1;
  letter-spacing: -2px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.week-total > span {
  color: #888;
  font-size: 11px;
}
.week-chart {
  height: 146px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  margin: 20px 0 18px;
  flex: 1;
}
.week-day {
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 16px;
  gap: 10px;
  min-width: 0;
}
.week-bar-track {
  display: flex;
  align-items: end;
  border-bottom: 1px solid #eee;
  background: repeating-linear-gradient(
    to top,
    transparent 0,
    transparent 31px,
    #f5f5f5 31px,
    #f5f5f5 32px
  );
}
.week-bar {
  width: 100%;
  background: #d4d4d4;
  border-radius: 3px 3px 0 0;
  min-height: 3px;
}
.week-day.is-today .week-bar {
  background: #222;
}
.week-day span {
  text-align: center;
  color: #888;
  font-size: 10px;
}
.week-day.is-today span {
  color: #222;
  font-weight: 600;
}
.panel-foot {
  border-top: 0;
  padding-top: 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 10px;
  color: #888;
}
.recovery-overview {
  display: flex;
  flex-direction: column;
}
.insights {
  flex: 1;
  margin: 14px 0;
}
.signal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid #eee;
  gap: 20px;
}
.signal:last-child {
  border-bottom: 0;
}
.metric-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0;
  color: #666;
}
.metric-value {
  display: block;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -1px;
  margin: 7px 0 5px;
  line-height: 1;
}
.metric-baseline {
  font-size: 10px;
  color: #888;
}
.metric-visual {
  width: 96px;
  flex-shrink: 0;
  text-align: right;
}
.metric-date {
  color: #999;
  font-size: 9px;
  margin-bottom: 10px;
}
.metric-trend {
  height: 26px;
  color: #444;
}
.metric-trend svg {
  width: 100%;
  height: 26px;
}
.history-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 32px 0 14px;
}
.history-heading h2 {
  font-size: 17px;
}
select {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid #ddd;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='m2 4 4 4 4-4' fill='none' stroke='%23666' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 12px;
  color: #444;
  padding: 8px 36px 8px 10px;
  border-radius: 4px;
  font-size: 11px;
  max-width: 100%;
}
.history-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr);
  gap: 20px;
}
.data-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-bottom: 24px;
  gap: 12px;
}
.data-summary strong {
  display: block;
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -1px;
  margin-bottom: 7px;
  font-variant-numeric: tabular-nums;
}
.data-summary small {
  font-size: 9px;
  color: #999;
  letter-spacing: 0;
  text-transform: none;
}
.calendar-heading {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 9px;
  color: #888;
  margin-bottom: 14px;
}
.heat-legend {
  display: flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}
.heat-legend i {
  width: 8px;
  height: 8px;
  background: #eee;
}
.heat-legend i:nth-child(2) {
  background: #ccc;
}
.heat-legend i:nth-child(3) {
  background: #999;
}
.heat-legend i:nth-child(4) {
  background: #666;
}
.calendar-body {
  display: flex;
  gap: 10px;
}
.weekday-labels {
  display: grid;
  grid-template-rows: repeat(7, 12px);
  gap: 4px;
  font-size: 8px;
  color: #aaa;
  padding-top: 2px;
}
.heatmap-wrap {
  overflow-x: auto;
  min-width: 0;
  flex: 1;
  padding: 2px;
}
.heatmap {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 12px);
  grid-auto-columns: 12px;
  gap: 4px;
  width: max-content;
}
.heat-cell {
  padding: 0;
  width: 12px;
  height: 12px;
  min-width: 0;
  border: 0;
  border-radius: 2px;
  margin: 0;
}
.level-0 {
  background: #eee;
}
.level-1 {
  background: #ccc;
}
.level-2 {
  background: #999;
}
.level-3 {
  background: #666;
}
.level-4 {
  background: #222;
}
.heat-cell:hover,
.heat-cell[aria-pressed="true"] {
  outline: 1px solid #222;
  outline-offset: 2px;
}
.chart-note {
  color: #999;
  font-size: 10px;
  line-height: 1.5;
  margin-top: 14px;
}
.recent-panel .section-heading {
  margin-bottom: 12px;
}
.activity-row {
  display: flex;
  gap: 12px;
  align-items: center;
  background: transparent;
  color: #222;
  border: 0;
  border-bottom: 1px solid #eee;
  border-radius: 0;
  width: 100%;
  padding: 14px 0;
  text-align: left;
}
.activity-row:last-child {
  border: 0;
}
.activity-row:hover {
  background: #fafafa;
}
.activity-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: #f5f5f5;
  border-radius: 4px;
  flex-shrink: 0;
}
.activity-icon svg {
  width: 20px;
  height: 20px;
  stroke: #555;
  fill: none;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.activity-body {
  min-width: 0;
  flex: 1;
}
.activity-body strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  font-weight: 500;
}
.activity-body small {
  display: block;
  font-size: 10px;
  margin-top: 5px;
  letter-spacing: 0;
  color: #999;
}
.activity-duration {
  font-size: 12px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.activity-chevron {
  color: #aaa;
  font-size: 18px;
}
#day-activities:not(:empty) {
  border-top: 1px solid #eee;
  margin-top: 14px;
  padding-top: 14px;
}
#day-activities h3 {
  font-size: 12px;
  margin-bottom: 8px;
}
#day-activities button {
  font-size: 11px;
  margin: 4px 4px 0 0;
  padding: 7px;
}
.trend-panel {
  margin-top: 20px;
}
.trend-panel .chart-note {
  margin-top: 5px;
}
#recovery-chart,
#stream-chart {
  padding: 18px 0 10px;
}
#recovery-chart > svg,
#stream-chart > svg {
  width: 100%;
  display: block;
}
.team-notes {
  padding: 20px 0;
  color: #888;
  font-size: 11px;
}
summary {
  cursor: pointer;
  font-size: 12px;
}
.team-notes p {
  font-size: 11px;
  margin-top: 10px;
}
dialog {
  width: min(780px, calc(100% - 32px));
  padding: 28px;
  border: 1px solid #ddd;
  border-radius: 8px;
  max-height: 85dvh;
  overflow: auto;
  color: #222;
}
dialog::backdrop {
  background: #0007;
  backdrop-filter: blur(3px);
}
.dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.dialog-heading h2 {
  margin-top: 8px;
  font-size: 24px;
}
.dialog-heading button {
  background: #f5f5f5;
  color: #222;
  border: 0;
  padding: 4px 12px;
  font-size: 24px;
}
.stream-controls {
  display: flex;
  gap: 12px;
}
.stream-controls label:first-child {
  flex: 1;
  min-width: 0;
}
.stream-controls select {
  width: 100%;
}
#comparison-section {
  margin-top: 20px;
}
.session-comparison {
  padding: 22px 0;
}
.session-comparison + .session-comparison {
  border-top: 1px solid var(--line);
}
.comparison-heading {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
}
.comparison-heading small {
  font-size: 12px;
  letter-spacing: 0;
  color: #777;
}
.comparison-heading h3 {
  margin-top: 6px;
  font-size: 16px;
  font-weight: 500;
}
.comparison-status {
  font-size: 11px;
  color: #666;
  background: #f2f2f2;
  border-radius: 6px;
  padding: 5px 8px;
  white-space: nowrap;
}
.comparison-totals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  max-width: 520px;
  margin: 22px 0 18px;
}
.comparison-metric small {
  display: block;
  letter-spacing: 0;
  font-size: 12px;
  color: #777;
}
.comparison-metric strong {
  display: block;
  font-size: 24px;
  font-weight: 500;
  margin: 5px 0 12px;
  font-variant-numeric: tabular-nums;
}
.comparison-track {
  height: 4px;
  border-radius: 4px;
  background: #eee;
  overflow: hidden;
}
.comparison-track span {
  display: block;
  height: 100%;
  background: #bdbdbd;
}
.comparison-metric + .comparison-metric .comparison-track span {
  background: #333;
}
.comparison-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.comparison-actions button {
  font-size: 12px;
  padding: 7px 10px;
}
@media (max-width: 760px) {
  .comparison-heading {
    flex-direction: column;
    gap: 10px;
  }
  .comparison-totals {
    gap: 20px;
  }
}
/* Chat: only the history scrolls; the composer occupies the last layout row. */
body.chat-open {
  overflow: hidden;
}
#view-chat {
  position: fixed;
  top: var(--viewport-top, 0px);
  left: 256px;
  right: 40px;
  height: var(--app-height, 100dvh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 24px;
}
.chat-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 0;
  flex-shrink: 0;
}
.team-mark {
  display: grid;
  place-items: center;
  background: #222;
  color: #fff;
  width: 40px;
  height: 40px;
  font-size: 19px;
  letter-spacing: -1px;
}
#chat-history {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  min-height: 0;
  padding: 28px max(0px, calc((100% - 720px) / 2));
  scrollbar-width: thin;
}
.chat-message {
  margin-bottom: 30px;
  max-width: 720px;
  padding: 0;
  border: 0;
}
.chat-message > small {
  font-size: 9px;
  letter-spacing: 0.8px;
  color: #888;
}
.chat-message p {
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.8;
  margin-top: 12px;
  color: #333;
}
.chat-message.user {
  background: #eaeaea;
  padding: 16px 20px;
  width: fit-content;
  max-width: 85%;
  margin-left: auto;
  border-radius: 6px;
}
.chat-message.user p {
  margin-top: 6px;
}
.chat-message details {
  background: #fff;
  border: 1px solid #ddd;
  padding: 16px;
  margin-top: 16px;
}
.chat-message details p {
  font-size: 12px;
}
.chat-message details button {
  margin-top: 14px;
}
.chat-composer {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
  background: #fff;
  border: 1px solid #d4d4d4;
  border-radius: 8px;
  padding: 10px;
  width: min(100%, 760px);
  margin: 0 auto;
}
.chat-composer textarea {
  display: block;
  resize: none;
  min-height: 44px;
  max-height: none;
  border: 0;
  outline: none;
  background: transparent;
  padding: 12px 8px;
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  overflow-y: hidden;
}
.chat-composer:focus-within {
  border-color: #888;
}
.chat-composer textarea:focus-visible {
  outline: none;
}
.chat-composer button {
  width: 38px;
  height: 38px;
  border: 0;
  padding: 9px;
  border-radius: 4px;
  margin-bottom: 3px;
}
.chat-composer button svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
}
#chat-status {
  flex: 1 1 100%;
  font-size: 11px;
  color: #777;
  padding: 0 8px;
}
#chat-status:empty {
  display: none;
}
#status:empty {
  display: none;
}
#status:not(:empty) {
  position: fixed;
  bottom: 20px;
  right: 24px;
  z-index: 60;
  max-width: min(500px, calc(100% - 40px));
  background: #222;
  color: #fff;
  padding: 12px 18px;
  border-radius: 4px;
  font-size: 12px;
}
body.chat-open #status {
  display: none;
}
/* Supporting screens and accessible loading states. */
#view-settings,
#view-checkin,
#view-outcomes,
#view-training {
  padding-top: 30px;
}
#view-settings section,
#view-checkin section,
#view-training section {
  margin-bottom: 20px;
}
#view-settings h2 {
  margin-bottom: 14px;
}
#view-settings p {
  color: #777;
  font-size: 12px;
  margin: 12px 0;
}
#view-settings button {
  margin: 0;
  font-size: 11px;
}
.settings-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.account-row #account-email {
  margin: 0;
}
@media (max-width: 600px) {
  .account-row {
    align-items: flex-start;
    flex-direction: column;
  }
}
form:not(.chat-composer) {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 16px;
  margin-top: 20px;
}
label {
  display: block;
  font-size: 12px;
}
form:not(.chat-composer) label {
  flex: 1 1 180px;
}
input:not([type="checkbox"]),
textarea:not(#chat-input) {
  display: block;
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-top: 7px;
}
details > form {
  margin-bottom: 16px;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.access {
  margin: 24px auto;
  max-width: 480px;
  padding: 24px;
  background: #fff;
  border: 1px solid #ddd;
}
.access-body {
  margin-top: 16px;
}
.access-body p {
  font-size: 11px;
  color: #777;
  margin-top: 10px;
}
.access-body button {
  margin-top: 10px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.t-stagger-line {
  will-change: auto;
}
.t-skel {
  display: grid;
  min-height: 190px;
}
.t-skel-skeleton,
.t-skel-content {
  position: relative;
  inset: auto;
  grid-area: 1 / 1;
}
.t-skel-skeleton {
  pointer-events: none;
}
.skeleton-chart {
  min-height: 190px;
  height: 100%;
  background: #f2f2f2;
  border-radius: 4px;
}
.t-skel.is-revealed .t-skel-skeleton {
  visibility: hidden;
}
::selection {
  background: #222;
  color: #fff;
}
@media (min-width: 1600px) {
  #view-chat {
    left: calc(216px + (100vw - 216px - 1280px) / 2);
    right: calc((100vw - 216px - 1280px) / 2);
  }
}
@media (max-width: 1100px) and (min-width: 761px) {
  main {
    margin-left: 180px;
    padding-inline: 24px;
  }
  .masthead {
    width: 180px;
    padding-inline: 14px;
  }
  .sidebar-bottom > div span {
    display: none;
  }
  .overview-grid,
  .history-grid {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
  section {
    padding: 18px;
  }
  .brand h1 {
    font-size: 15px;
  }
  #view-chat {
    left: 204px;
    right: 24px;
  }
  .eyebrow {
    display: none;
  }
}
@media (max-width: 760px) {
  :root {
    --mobile-nav-height: 56px;
  }
  main {
    margin: 0;
    padding: 62px 20px
      calc(var(--mobile-nav-height) + 24px + env(safe-area-inset-bottom, 0px));
  }
  .masthead {
    top: 0;
    bottom: auto;
    right: 0;
    width: 100%;
    height: 62px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand {
    gap: 8px;
  }
  .brand > svg {
    width: 22px;
    height: 22px;
  }
  .brand h1 {
    font-size: 16px;
  }
  .sidebar-bottom > div,
  .athlete-avatar {
    display: none;
  }
  .sidebar-bottom {
    margin: 0;
    padding: 0;
    border: 0;
  }
  .settings-button {
    padding: 10px;
  }
  .masthead .t-tabs {
    margin-top: 0;
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 5px 24px calc(6px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    border-radius: 0;
    height: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px));
  }
  .masthead .t-tab {
    height: 44px;
    justify-content: center;
    gap: 9px;
    font-size: 12px;
  }
  .masthead .t-tab svg {
    width: 18px;
    height: 18px;
  }

  .athlete-tag {
    display: none;
  }
  .overview-grid,
  .history-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  section {
    border-radius: 6px;
    padding: 20px;
  }
  .week-total {
    margin-top: 24px;
  }
  .week-total strong {
    font-size: 44px;
  }
  .week-chart {
    height: 114px;
    flex: none;
    margin: 24px 0 16px;
    gap: 10px;
  }
  .week-day {
    gap: 8px;
  }
  .panel-foot {
    font-size: 9px;
  }
  .signal {
    padding: 15px 0;
  }
  .metric-value {
    font-size: 28px;
  }
  .metric-visual {
    width: 110px;
  }
  .metric-label {
    font-size: 12px;
  }
  .metric-baseline {
    font-size: 11px;
  }
  .metric-date {
    font-size: 10px;
  }
  .metric-trend {
    height: 30px;
  }
  .metric-trend svg {
    height: 30px;
  }
  .history-heading {
    margin-top: 28px;
  }
  .history-heading h2 {
    font-size: 16px;
  }
  .data-summary {
    gap: 8px;
  }
  .data-summary strong {
    font-size: 27px;
  }
  .data-summary small {
    font-size: 9px;
  }
  .calendar-heading {
    flex-wrap: wrap;
    font-size: 9px;
  }
  .heat-legend {
    margin-left: auto;
  }
  .activity-row {
    padding: 14px 0;
  }
  .activity-body strong {
    font-size: 13px;
  }
  .activity-duration {
    font-size: 13px;
  }
  .trend-panel {
    margin-top: 16px;
  }
  .trend-panel .panel-foot {
    flex-wrap: wrap;
    gap: 4px;
  }
  #view-chat {
    top: calc(var(--viewport-top, 0px) + 62px);
    left: 20px;
    right: 20px;
    padding: 0 0 12px;
    height: calc(
      var(--app-height, 100dvh) - 62px - var(--mobile-nav-height) -
        env(safe-area-inset-bottom, 0px)
    );
  }
  .chat-toolbar {
    padding: 8px 0;
    gap: 10px;
  }
  .team-mark {
    width: 34px;
    height: 34px;
    font-size: 17px;
  }
  #chat-history {
    padding: 22px 0;
  }
  .chat-message p {
    font-size: 14px;
    line-height: 1.75;
  }
  .chat-message.user {
    padding: 12px 16px;
    max-width: 90%;
  }
  .chat-composer {
    padding: 7px;
    gap: 4px;
    border-radius: 6px;
  }
  .chat-composer textarea {
    font-size: 14px;
    min-height: 44px;
    padding: 10px 6px;
  }
  .chat-composer button {
    width: 38px;
    height: 38px;
    margin-bottom: 1px;
  }
  body.chat-open .masthead {
    top: var(--viewport-top, 0px);
  }
  body.keyboard-open .masthead .t-tabs {
    display: none;
  }
  body.keyboard-open #view-chat {
    height: calc(var(--app-height, 100dvh) - 62px);
    padding-bottom: 8px;
  }
  body.keyboard-open .chat-toolbar {
    padding: 10px 0;
  }
  #status:not(:empty) {
    bottom: calc(
      var(--mobile-nav-height) + 10px + env(safe-area-inset-bottom, 0px)
    );
    font-size: 11px;
  }
  dialog {
    width: calc(100% - 24px);
    padding: 20px;
  }
  .dialog-heading h2 {
    font-size: 21px;
  }
  .stream-controls {
    flex-wrap: wrap;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
.chat-composer {
  position: relative;
}
.chat-beam {
  position: absolute;
  inset: -1px;
  pointer-events: none;
  border-radius: inherit;
  overflow: hidden;
}
.chat-composer > :not(.chat-beam) {
  position: relative;
}

.heat-legend i:nth-child(5) {
  background: #222;
}

.readiness-panel {
  margin-bottom: 22px;
  padding: 24px;
  border: 0;
  border-radius: 6px;
  background: #fff;
}
.readiness-panel h3 {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.6px;
  margin: 20px 0 12px;
}
.readiness-panel > p {
  max-width: 850px;
  line-height: 1.6;
}
.readiness-status {
  font-size: 11px;
  font-weight: 600;
}
.readiness-panel[data-status="proceed"] .readiness-status {
  color: #167044;
}
.readiness-panel[data-status="adjust"] .readiness-status,
.readiness-panel[data-status="recover"] .readiness-status {
  color: #9a5b00;
}
.readiness-panel[data-status="review"] .readiness-status {
  color: #af2929;
}
#readiness-details {
  padding: 24px 0;
  background: transparent;
}
.recovery-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.readiness-panel .recovery-section-heading h3 {
  font-size: 18px;
  margin: 0;
}
.recovery-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
button.recovery-reading {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  min-width: 0;
  padding: 18px;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  background: #f4f5f3;
  color: var(--ink);
}
button.recovery-reading:hover {
  background: #e9ede8;
}
.recovery-reading-label {
  font-size: 12px;
}
.recovery-reading-number {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}
.recovery-reading-number strong {
  font-size: 32px;
  letter-spacing: -1px;
  font-weight: 600;
}
.recovery-reading-number > span,
.recovery-reading small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

@media (max-width: 600px) {
  .recovery-summary {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  button.recovery-reading {
    display: grid;
    grid-template-columns: 1fr auto;
    padding: 14px 16px;
    gap: 4px 12px;
  }
  .recovery-reading-number {
    grid-column: 2;
    grid-row: 1 / 3;
    justify-content: flex-end;
  }
  .recovery-reading-number strong {
    font-size: 28px;
  }
}
@media (max-width: 600px) {
  .readiness-panel {
    padding: 20px;
  }

  .readiness-panel h3 {
    font-size: 22px;
  }
}

.chat-toolbar .open-current-plan {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 12px;
  padding: 8px 10px;
}
/* The plan lives in the Data page, using the same quiet ruled layout. */
.inline-plan {
  scroll-margin-top: 88px;
  margin: 0 0 32px;
  padding: 24px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.inline-plan .section-heading {
  margin-bottom: 20px;
}
.plan-session-body .plan-comment {
  margin-top: 12px;
}
.plan-goal {
  margin-bottom: 24px;
}
.plan-goal > small {
  color: #777;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.plan-goal h3 {
  margin: 6px 0 0;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.04em;
}
#current-plan-content details {
  border: 0;
  border-radius: 0;
  background: none;
  padding: 0;
  margin: 0;
}
#current-plan-content .plan-session {
  border-top: 1px solid #d8d8d8;
}
.plan-session > summary {
  display: grid;
  grid-template-columns: 95px minmax(0, 1fr) 16px;
  align-items: start;
  gap: 16px;
  list-style: none;
  padding: 18px 0;
  cursor: pointer;
}
.plan-session > summary::-webkit-details-marker {
  display: none;
}
.plan-session time {
  font-size: 12px;
  line-height: 1.5;
  color: #666;
}
.plan-session-title strong {
  display: block;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}
.plan-session-title small {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  font-weight: 400;
  color: #777;
}
.plan-expand {
  font-size: 18px;
  line-height: 1.2;
  font-weight: 400;
}
.plan-session[open] > summary .plan-expand {
  transform: rotate(45deg);
}
.plan-session-body {
  padding: 0 32px 20px 111px;
}
#current-plan-content p {
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.7;
  margin: 0 0 12px;
}
.plan-session-body > small {
  display: block;
  color: #777;
  font-size: 11px;
}
#current-plan-content .plan-notes {
  margin-top: 12px;
}
.plan-notes > summary {
  font-size: 12px;
  color: #666;
  cursor: pointer;
  padding: 6px 0;
}
.plan-notes > p {
  margin-top: 8px !important;
}
@media (max-width: 600px) {
  .inline-plan {
    padding: 20px 0;
  }
  .plan-session > summary {
    grid-template-columns: 72px minmax(0, 1fr) 12px;
    gap: 12px;
  }
  .plan-session-body {
    padding-left: 84px;
    padding-right: 0;
  }
  .plan-session-title strong {
    font-size: 14px;
  }
}

.chat-markdown {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.7;
  color: #333;
  overflow-wrap: anywhere;
  min-width: 0;
}
.chat-message .chat-markdown p {
  white-space: normal;
  margin: 0 0 14px;
  line-height: inherit;
}
.chat-markdown :is(h1, h2, h3, h4, h5, h6) {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.2px;
  margin: 22px 0 10px;
}
.chat-markdown > :first-child {
  margin-top: 0;
}
.chat-markdown > :last-child {
  margin-bottom: 0;
}
.chat-markdown strong {
  font-weight: 650;
}
.chat-markdown :is(ul, ol) {
  margin: 10px 0 16px;
  padding-left: 22px;
}
.chat-markdown li {
  margin: 5px 0;
}
.chat-markdown li > p {
  margin-bottom: 6px;
}
.chat-markdown blockquote {
  margin: 16px 0;
  padding-left: 14px;
  border-left: 2px solid #ccc;
  color: #666;
}
.chat-markdown a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.chat-markdown pre {
  overflow-x: auto;
  padding: 12px;
  background: #eee;
  white-space: pre;
}
.chat-markdown code {
  font-family: monospace;
  font-size: 12px;
  background: #eee;
}
.chat-markdown hr {
  border: 0;
  border-top: 1px solid #ddd;
  margin: 20px 0;
}
.chat-table {
  overflow-x: auto;
  margin: 16px 0;
  max-width: 100%;
}
.chat-table table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
}
.chat-table :is(th, td) {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid #ddd;
  min-width: 100px;
}

.chart-readout {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 14px;
  min-height: 44px;
  padding: 12px 0;
  font-size: 12px;
  border-top: 1px solid #ddd;
  color: #666;
}
.chart-readout strong {
  color: #181818;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.chart-readout small {
  font-size: 11px;
}
.week-day[role="button"] {
  cursor: pointer;
}
.week-day[aria-pressed="true"] .week-bar {
  background: #181818;
}
.week-day[role="button"]:focus-visible {
  outline: 2px solid #181818;
  outline-offset: 3px;
}

.range-control {
  display: inline-flex;
  flex-shrink: 0;
  gap: 2px;
  padding: 3px;
  border: 0;
  border-radius: 4px;
}
.range-control button {
  min-width: 38px;
  min-height: 32px;
  padding: 6px 8px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.range-control button:hover {
  background: #e9e9e9;
  color: var(--ink);
}
.range-control button[aria-pressed="true"] {
  background: var(--ink);
  color: #fff;
}
@media (max-width: 760px) {
  .history-heading {
    flex-wrap: wrap;
    gap: 12px;
  }
  .range-control button {
    min-height: 40px;
  }
}

#previous-review {
  margin-top: 16px;
  font-size: 12px;
}
#previous-review p {
  margin-top: 10px;
}

.connection-row {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.connection-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.connection-row > strong {
  min-width: 64px;
}
.connection-row > div {
  display: grid;
  gap: 5px;
  flex: 1;
}
.connection-row small {
  font-size: 11px;
  letter-spacing: 0;
}

.week-day.is-future {
  opacity: 0.35;
}

.team-activity {
  flex-shrink: 0;
  padding: 12px 0;
}
.team-bot-roster {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  max-width: 360px;
  gap: 8px;
  margin: auto;
}
.team-bot {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}
.team-bot > span {
  font-size: 10px;
  color: #666;
  line-height: 1.4;
}
.team-bot-status {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
}
#chat-team-activity {
  border-bottom: 1px solid var(--line);
}
#review-team-activity {
  border-top: 1px solid var(--line);
  margin-top: 20px;
}
@media (max-width: 760px) {
  .team-bot-roster {
    gap: 2px;
  }
  .team-bot > span {
    font-size: 9px;
  }
  .team-activity {
    padding: 6px 0;
  }
  .team-bot-status {
    margin-top: 4px;
  }
  .keyboard-open #chat-team-activity {
    display: none;
  }
}

#view-settings {
  max-width: 840px;
  padding-top: 32px;
}
#import.file-upload {
  display: block;
  margin-top: 20px;
}
.upload-dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 180px;
  padding: 28px 20px;
  border: 1px dashed #c6c6c6;
  border-radius: 6px;
  background: #fafafa;
  text-align: center;
  cursor: pointer;
}
.upload-dropzone:hover,
.upload-dropzone.dragging {
  border-color: #181818;
  background: #f0f0f0;
}
.upload-dropzone:focus-within {
  outline: 2px solid #181818;
  outline-offset: 3px;
}
.upload-dropzone input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.upload-dropzone svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: #555;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.upload-dropzone strong {
  font-size: 13px;
  font-weight: 500;
}
.upload-dropzone > span {
  font-size: 11px;
  color: var(--muted);
}
#upload-status {
  font-size: 12px;
  overflow-wrap: anywhere;
}
#upload-status:not(:empty) {
  margin-top: 12px;
}
.connection-help {
  max-width: 360px;
  overflow-wrap: anywhere;
  line-height: 1.5;
}
@media (max-width: 760px) {
  #view-settings {
    padding-top: 24px;
  }
  .connection-row {
    gap: 12px;
  }
  .connection-row > strong {
    min-width: 52px;
  }
}

.specialist-heading {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 12px;
}
.specialist-avatar {
  display: block;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
}
.specialist-heading h3,
.specialist-heading h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
}
.specialist-assessment {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.specialist-assessment:last-of-type {
  border-bottom: 0;
}
.specialist-assessment p {
  font-size: 13px;
  line-height: 1.65;
  max-width: 85ch;
}
.specialist-assessment .specialist-takeaway {
  margin-top: 10px;
  font-weight: 500;
}

.chat-teammate {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 10px;
}
.chat-teammate-avatar {
  display: block;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
}
.chat-teammate small {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink, #181818);
}
.chat-contribution {
  margin-bottom: 26px;
  padding: 0;
  background: none;
  border: 0;
}
.consultation-step {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}
.consultation-step .chat-teammate {
  margin: 0;
}
.consultation-status {
  color: #777;
  font-size: 12px;
}
.chat-message .consultation-status {
  font-size: 12px;
}

.recovery-day-toolbar,
.recovery-trend-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
}
.recovery-day-toolbar label,
.recovery-trend-heading label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: #777;
}
.recovery-day-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  border-bottom: 1px solid #ddd;
  padding-bottom: 24px;
}
.recovery-cluster h3 {
  font-size: 15px;
  margin: 0 0 20px;
}
.sleep-quantities {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}
.recovery-value {
  color: #181818;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 8px 0;
  border-radius: 0;
}
.recovery-value:hover {
  background: #eee;
}
.recovery-value small,
.recovery-value strong,
.metric-reference {
  display: block;
}
.recovery-value small {
  color: #777;
  font-size: 11px;
  font-weight: 400;
}
.recovery-value strong {
  font-size: 20px;
  font-weight: 500;
  margin: 8px 0;
}
.metric-reference {
  color: #888;
  font-size: 10px;
  font-weight: 400;
}
.sleep-episode {
  display: block;
  border: 0;
  padding: 8px 0;
  background: transparent;
  color: #555;
  font-size: 12px;
  text-align: left;
}
.sleep-episode:hover {
  background: transparent;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.sleep-stages {
  display: flex;
  gap: 3px;
  margin-top: 16px;
}
.sleep-stages button {
  min-width: 0;
  flex-basis: 0;
  padding: 14px 2px;
  font-size: 10px;
  border: 0;
  border-radius: 0;
  background: #ddd;
  color: #333;
}
.sleep-stages [data-stage="1"] {
  background: #555;
  color: white;
}
.sleep-stages [data-stage="2"] {
  background: #999;
  color: white;
}
.physiology-values {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.chart-ask {
  margin-left: auto;
  background: none;
  border: 1px solid #ddd;
  padding: 6px 10px;
  color: #181818;
  font-size: 11px;
}
.signal[role="button"] {
  cursor: pointer;
}
.signal[role="button"]:focus-visible,
.recovery-value:focus-visible {
  outline: 2px solid #181818;
  outline-offset: 3px;
}
@media (max-width: 760px) {
  .recovery-day-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .recovery-day-toolbar {
    align-items: flex-start;
    gap: 8px;
  }
  .recovery-day-toolbar input {
    width: 140px;
  }
  .recovery-day-toolbar button {
    font-size: 11px;
    padding: 10px 8px;
  }
  .recovery-value strong {
    font-size: 18px;
  }
}

#recovery-detail {
  scroll-margin-top: 85px;
}

.overview-date {
  padding: 16px 0;
  font-size: 10px;
  color: #777;
  letter-spacing: 0.5px;
  text-align: right;
}

#readiness-author {
  margin: 12px 0 2px;
  gap: 2px;
}
#readiness-author h4 {
  font-size: 11px;
  font-weight: 500;
  color: #666;
}
#readiness-author .specialist-avatar {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
}
#readiness-author + #readiness-title {
  margin-top: 6px;
}

/* Quiet surfaces and readable hierarchy throughout Data and Chat. */
button,
select,
input {
  border-radius: 9px;
}
main {
  padding-left: 32px;
  padding-right: 32px;
}
.masthead {
  background: #f2f2f2;
}
.masthead .t-tab {
  border-radius: 9px;
}
section,
.readiness-panel {
  border-radius: 14px;
}
.section-heading h2,
.history-heading h2 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.2px;
}
.section-heading .eyebrow {
  font-size: 10px;
  letter-spacing: 0;
}
.metric-label,
.metric-baseline,
.panel-foot,
.data-summary small {
  font-size: 12px;
}
.metric-date {
  font-size: 11px;
}
.metric-value {
  letter-spacing: -0.5px;
}
.week-total strong {
  font-size: 40px;
  letter-spacing: -1.5px;
}
.week-bar-track {
  background: none;
  border-color: #e8e8e8;
}
.week-chart {
  gap: 18px;
}
.range-control {
  border-radius: 10px;
  padding: 4px;
  background: #eceeeb;
}
.range-control button {
  border-radius: 7px;
}
.chart-readout {
  border-color: #ededed;
  padding: 14px 0 4px;
}
.recovery-day-grid {
  gap: 24px;
  border-color: #ededed;
}
.recovery-cluster {
  background: #fafafa;
  border: 1px solid #ededed;
  border-radius: 12px;
  padding: 18px;
  min-width: 0;
}
.recovery-cluster h3 {
  font-size: 14px;
  margin-bottom: 12px;
}
.recovery-value {
  border-radius: 8px;
  padding: 8px 4px;
}
.sleep-stages {
  overflow: hidden;
  border-radius: 6px;
}
.chat-message {
  min-width: 0;
  overflow-wrap: anywhere;
}
.chat-message.user {
  background: #eeeeee;
  border-radius: 18px;
  padding: 14px 18px;
}
.chat-message.user > small {
  display: none;
}
.chat-message.user p {
  margin: 0;
  line-height: 1.65;
}
.chat-teammate small {
  letter-spacing: 0;
  font-size: 12px;
}
.chat-composer {
  border-radius: 20px;
  box-shadow: 0 2px 12px #00000005;
}
.chat-composer button {
  border-radius: 50%;
}
.chat-message .consultation-log {
  background: transparent;
  border: 0;
  padding: 0;
  margin: 12px 0;
  color: #777;
  font-size: 12px;
}
.consultation-log summary {
  cursor: pointer;
}
.consultation-log ol {
  padding-left: 18px;
  line-height: 1.8;
  margin: 10px 0;
}
.consultation-step {
  flex-wrap: wrap;
  gap: 6px 12px;
}
@media (max-width: 760px) {
  main {
    padding-left: 16px;
    padding-right: 16px;
  }
  .recovery-day-grid {
    gap: 12px;
  }
  .recovery-cluster {
    padding: 14px;
  }
  .week-chart {
    gap: 10px;
  }
  .chat-message.user {
    max-width: 92%;
  }
}
.recovery-value small,
.chart-readout small,
.readiness-panel small {
  letter-spacing: 0;
}
.inline-plan {
  padding: 24px;
  border: 0;
  border-radius: 14px;
  background: #fff;
}
@media (max-width: 760px) {
  .inline-plan {
    padding: 20px;
  }
}

.chat-composer {
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}
.chat-composer textarea {
  flex: none;
  width: 100%;
}
.chat-composer-footer {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 12px;
  width: 100%;
}
.chat-composer-footer #chat-status {
  flex: 1;
  min-width: 0;
  padding-bottom: 8px;
}
.chat-composer-footer button {
  flex: 0 0 38px;
  margin: 0;
}

/* Keep the draft and conversation body at the same readable scale. */
.chat-composer textarea,
.chat-message p,
.chat-markdown {
  font-size: var(--chat-font-size);
}

.weekly-volume-panel {
  margin-bottom: 20px;
}
#weekly-volume-days {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
#weekly-volume-days:empty {
  display: none;
}
#weekly-volume-days button {
  font-size: 12px;
  padding: 8px 10px;
}

#recovery-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}
.sleep-chart-key {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.sleep-chart-key i {
  width: 10px;
  height: 10px;
  border: 1px solid #00000012;
  border-radius: 2px;
}

.sleep-week-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.sleep-week-navigation span {
  font-size: 12px;
  color: #666;
  text-align: center;
}
.sleep-week-navigation button {
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 22px;
}
.sleep-week-navigation button:disabled {
  cursor: default;
  opacity: 0.3;
}

.chat-unread {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 12px;
  background: #222;
  color: white;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.masthead .t-tab .chat-unread {
  margin-left: auto;
}
.notification-settings p {
  margin: 12px 0;
  line-height: 1.6;
}
.notification-settings-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
}
#view-settings .notification-settings-heading h2 {
  margin: 0;
}
.notification-settings-heading > button {
  margin: 0 0 0 auto;
  max-width: 100%;
}
@media (max-width: 760px) {
  .masthead .t-tab .chat-unread {
    margin-left: 0;
  }
}

/* iOS zooms focused inputs below 16px. Keep composer and history matched. */
@media (max-width: 760px), (hover: none) and (pointer: coarse) {
  :root {
    --chat-font-size: 16px;
  }
}

.workout-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 18px 0;
}
.workout-stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--border, #ddd);
  border-radius: 10px;
}
.workout-stat small {
  opacity: 0.75;
}
.workout-lap-scroll {
  overflow-x: auto;
  margin-bottom: 18px;
}
.workout-lap-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.workout-lap-table th,
.workout-lap-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border, #ddd);
  white-space: nowrap;
}

.daily-scores {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 8px;
  align-items: stretch;
}
button.score-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  padding: 16px;
  border: 0;
  background: #f2f4f1;
  border-radius: 12px;
  color: var(--ink);
  text-align: left;
}
button.score-card:hover {
  background: #e7ece5;
}
.score-card > span {
  font-size: 13px;
  font-weight: 500;
}
.score-card strong {
  font-size: 48px;
  font-weight: 600;
  letter-spacing: -1.5px;
  line-height: 1.1;
}
.score-card small {
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
  font-weight: 400;
}
#score-dialog {
  width: min(480px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  box-sizing: border-box;
  padding: 24px;
  border: 0;
  border-radius: 20px;
  overflow: auto;
}
#score-dialog::backdrop {
  background: rgba(0, 0, 0, 0.35);
}
.score-dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
#score-dialog .score-dialog-heading h2 {
  margin: 0;
  font-size: 20px;
}
.score-dialog-heading button {
  min-width: 44px;
  min-height: 44px;
  font-size: 24px;
  padding: 4px;
}
.score-detail-number {
  display: block;
  font-size: 56px;
  letter-spacing: -2px;
  line-height: 1.1;
  margin-top: 16px;
}
#score-dialog h3 {
  font-size: 14px;
  margin: 24px 0 10px;
}
#score-dialog p {
  font-size: 13px;
  line-height: 1.6;
  margin: 10px 0;
}
#score-dialog small {
  font-size: 12px;
}
#score-dialog > button {
  margin-top: 16px;
}
.score-components {
  margin: 0;
  display: grid;
  gap: 8px;
}
.score-components > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}
.score-components dt {
  text-transform: capitalize;
}
.score-components dd {
  margin: 0;
  font-weight: 600;
}
@media (max-width: 600px) {
  .daily-scores {
    gap: 6px;
  }
  button.score-card {
    padding: 14px 10px;
  }
  .score-card strong {
    font-size: clamp(32px, 9vw, 40px);
  }
  .score-card > span {
    font-size: 12px;
  }
}

/* Daily team guidance and visible reference sections. */
.daily-focus {
  padding: 24px;
  margin: 20px 0;
  border: 1px solid var(--line, #deded9);
  border-radius: 16px;
}
.daily-focus-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.daily-focus-heading h2 {
  margin: 6px 0 0;
  font-size: 22px;
  letter-spacing: -0.5px;
}
.daily-focus-heading > button {
  flex-shrink: 0;
}
.daily-focus > p {
  margin: 12px 0 0;
  color: var(--muted, #777);
  font-size: 14px;
}
.daily-focus > .muted {
  display: block;
  margin-top: 16px;
}
.daily-team-focus {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
}
.daily-team-focus article {
  min-width: 0;
  padding: 18px 20px;
  background: #f7f8f7;
  border: 0;
  border-radius: 14px;
}
#daily-focus .specialist-heading {
  gap: 9px;
  margin-bottom: 10px;
}
#daily-focus .specialist-heading h3 {
  font-size: 14px;
  line-height: 1.3;
  letter-spacing: -0.1px;
}
.daily-team-focus p {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  max-width: 65ch;
  color: #454743;
}
.daily-team-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 20px;
  border: 1px solid var(--line, #deded9);
  border-radius: 14px;
  margin: 0 0 20px;
}
.daily-question-content {
  min-width: 0;
}
.daily-question-content p {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  max-width: 70ch;
}
.daily-team-question > button {
  flex-shrink: 0;
}
#daily-focus > .muted {
  font-size: 12px;
  letter-spacing: 0;
}
.daily-reference {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 24px 0;
}
.daily-reference > summary {
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
}
.daily-reference[open] > summary {
  margin-bottom: 24px;
}
#calibration-values {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 24px;
}
#calibration-values article {
  min-width: 0;
  border: 0;
  background: #fff;
  border-radius: 14px;
  padding: 20px;
}
#calibration-values small {
  overflow-wrap: anywhere;
}
#calibration-values blockquote {
  margin: 12px 0;
  padding-left: 12px;
  border-left: 2px solid #ccc;
}
@media (max-width: 640px) {
  .daily-team-focus,
  #calibration-values {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .daily-focus {
    padding: 18px;
  }
}

.readiness-panel > .daily-focus {
  border: 0;
  border-top: 0;
  border-radius: 0;
  padding: 20px 0 0;
  margin: 24px 0 16px;
}

@media (max-width: 640px) {
  .daily-focus-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }
  .daily-focus-heading h2 {
    font-size: 20px;
  }
  .daily-team-focus article {
    padding: 16px;
  }
  .daily-team-question {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
    gap: 14px;
  }
}

/* Separate actions from their context and use gaps instead of button margins. */
.action-row,
.hero-actions,
.local-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--action-gap);
  margin-block: var(--action-space);
}
.action-row:last-child {
  margin-bottom: 0;
}
.action-row > button,
.hero-actions > button,
.local-actions > button {
  margin: 0;
  max-width: 100%;
  min-height: 40px;
  line-height: 1.4;
  white-space: normal;
}
.comparison-actions {
  gap: var(--action-gap);
}
:where(section, article, details) > :is(p, small) + button,
#team-review,
#workout-review {
  margin-top: var(--action-space);
}
#view-settings .notification-settings > button {
  margin-top: 4px;
}

.training-calendar {
  margin: 28px 0;
  padding: 24px 0;
  background: transparent;
  border: 0;
}
.calendar-toolbar,
.calendar-week-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.calendar-toolbar {
  justify-content: space-between;
  margin: 20px 0 12px;
}
.calendar-week-controls button {
  min-height: 40px;
}
#training-week-label {
  font-size: 12px;
  font-weight: 600;
}
.training-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}
.training-calendar-day {
  position: relative;
  justify-content: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 2px;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
}
.training-calendar-day:hover {
  background: #f0f1f0;
}
.calendar-day-heading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}
.calendar-day-heading strong {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 14px;
}
.training-calendar-day.is-today .calendar-day-heading strong {
  box-shadow: inset 0 0 0 1px #aaa;
}
.training-calendar-day[aria-pressed="true"] .calendar-day-heading strong {
  background: var(--ink);
  color: white;
  box-shadow: none;
}
.calendar-day-markers {
  position: absolute;
  bottom: 6px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 6px;
}
.calendar-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.calendar-dot.is-planned {
  border: 1px solid #666;
}
.calendar-dot.is-recorded {
  background: #52715e;
}
.calendar-dot.is-rest {
  height: 2px;
  background: #888;
  border-radius: 0;
}
.calendar-agenda {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-top: 24px;
}
.calendar-agenda h3 {
  font-size: 16px;
  margin: 0 0 12px;
}
.calendar-day-detail > p,
.calendar-upcoming-caption {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
.calendar-detail-session {
  padding: 16px;
  border-radius: 12px;
  background: #f5f5f4;
  margin: 12px 0;
}
.calendar-detail-session small {
  font-size: 10px;
  color: var(--muted);
}
.calendar-detail-session h4 {
  margin: 6px 0;
  font-size: 14px;
}
.calendar-detail-session p {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.5;
}
.upcoming-session {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 14px;
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--ink);
  padding: 16px 0;
}
.upcoming-session:hover {
  background: #f5f5f4;
}
.upcoming-session-date {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 68px;
  flex-shrink: 0;
  font-size: 12px;
}
.upcoming-session-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
}
.upcoming-session small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}
.upcoming-session-arrow {
  color: var(--muted);
}
.calendar-plan-gap {
  margin-top: 16px;
  font-size: 13px;
}
.calendar-plan-gap button {
  margin-top: 12px;
}
.calendar-history {
  padding: 0;
  margin: 20px 0;
  border: 0;
  background: transparent;
}
#view-history {
  padding-top: 24px;
}
@media (max-width: 640px) {
  .calendar-agenda {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .calendar-week-controls {
    gap: 6px;
  }
  .calendar-week-controls button {
    padding: 8px 10px;
  }
}

/* A visible teammate owns their question within the same card. */
.daily-team-focus .daily-team-question.is-inline {
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin: 16px 0 0;
  padding: 16px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
}
.daily-team-question.is-inline .daily-question-content p {
  color: var(--ink);
  font-weight: 500;
}

/* Primary content reads as a page, without section-level disclosure controls. */
.daily-reference > h2 {
  font-size: 18px;
  margin: 0 0 20px;
}
#readiness-details > h3,
.calendar-history > h3 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
  margin: 0 0 16px;
}
#readiness-details {
  margin-top: 24px;
}
.plan-session-heading {
  display: grid;
  grid-template-columns: 95px minmax(0, 1fr);
  gap: 16px;
  padding: 18px 0;
}
.plan-notes > h4 {
  margin: 16px 0 8px;
  font-size: 13px;
}
@media (max-width: 640px) {
  .plan-session-heading {
    grid-template-columns: 70px minmax(0, 1fr);
    gap: 12px;
  }
}

/* One readable card per teammate; the full report gets its own space. */
.daily-team-focus {
  align-items: start;
}
.daily-team-focus > article {
  padding: 20px;
}
.daily-team-focus > article > p {
  color: #353832;
  font-size: 15px;
  line-height: 1.65;
}
.teammate-card-actions {
  margin-top: 14px;
}
.teammate-assessment-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: #373b35;
  font-size: 13px;
  font-weight: 600;
}
.teammate-assessment-link:hover {
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.teammate-dialog {
  width: min(600px, calc(100% - 32px));
  max-height: calc(100dvh - 48px);
  padding: 28px;
  color: var(--ink);
  border-radius: 20px;
}
.teammate-dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.teammate-dialog-heading .specialist-heading {
  margin: 0;
  gap: 10px;
}
.teammate-dialog-heading .specialist-heading h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.2px;
}
.teammate-dialog-close {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  padding: 0;
  font-size: 24px;
}
.teammate-assessment-section {
  margin-top: 22px;
}
.teammate-assessment-section h4 {
  margin: 0 0 8px;
  font-size: 13px;
  color: #656a62;
}
.teammate-assessment-section p {
  font-size: 15px;
  line-height: 1.7;
  color: #282c25;
}
.teammate-dialog .action-row {
  margin-top: 24px;
}
@media (max-width: 640px) {
  .daily-team-focus > article {
    padding: 18px;
  }
  .teammate-dialog {
    padding: 22px;
  }
}

#view-calibration {
  padding-top: 30px;
}
#calibration-values article {
  scroll-margin-top: 82px;
}
@media (max-width: 760px) {
  .masthead .t-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding-inline: 16px;
  }
  .masthead .t-tab {
    flex-direction: row;
    gap: 8px;
    padding: 4px;
    font-size: 12px;
  }
}

#view-calibration .page-intro {
  padding: 8px 0 20px;
}
#view-calibration .page-intro h2 {
  font-size: 28px;
  margin: 6px 0 8px;
  letter-spacing: -0.7px;
}
#view-calibration .page-intro p {
  color: #62665f;
}
#calibration-values h3 {
  font-size: 16px;
  margin: 0 0 12px;
}
#calibration-values p {
  margin: 8px 0;
  font-size: 14px;
  line-height: 1.6;
}
#calibration-values small {
  display: block;
  line-height: 1.6;
}

button.chat-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  max-width: 100%;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  text-align: left;
  min-width: 44px;
  min-height: 44px;
  padding: 10px 14px;
  border: 0;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  flex-shrink: 1;
}
button.chat-icon-button:hover {
  background: #343a36;
}
button.chat-icon-button svg {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

button.chat-icon-button:active {
  transform: scale(0.95);
}
button.chat-icon-button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}
.calendar-day-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.calendar-day-title h3 {
  margin: 0;
}

.calendar-day-title {
  flex-wrap: wrap;
}
button.chat-icon-button span {
  white-space: normal;
  overflow-wrap: anywhere;
}

#calibration-values .calibration-value-block {
  margin: 20px 0;
}
#calibration-values .calibration-number {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  column-gap: 10px;
}
#calibration-values .calibration-number strong {
  font-size: clamp(48px, 5vw, 72px);
  line-height: 1.05;
  font-weight: 650;
  letter-spacing: -2.5px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
#calibration-values .calibration-number span {
  font-size: 18px;
  color: var(--muted);
}
#calibration-values .calibration-value-block > small {
  margin-top: 8px;
  font-size: 12px;
  letter-spacing: 0;
  color: var(--muted);
}
#calibration-values .calibration-dependency {
  font-size: 13px;
  color: var(--muted);
}
#calibration-body {
  display: flex;
  flex-wrap: wrap;
  align-content: start;
  gap: 0 32px;
}
#calibration-body h3 {
  width: 100%;
}
#calibration-body .calibration-value-block {
  min-width: 0;
}

#calibration-body .calibration-actions {
  width: 100%;
}

.calendar-weekday-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 8px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
}
.training-calendar-grid {
  gap: 4px;
}
button.training-calendar-day {
  min-height: 64px;
  padding: 8px 2px;
  border-radius: 8px;
  background: #f4f5f3;
}
button.training-calendar-day.is-outside-month {
  background: transparent;
  color: #90958f;
}
button.training-calendar-day[aria-pressed="true"] {
  background: #e4e8e2;
}
button.training-calendar-day:hover {
  background: #e9ede7;
}
@media (min-width: 761px) {
  button.training-calendar-day {
    min-height: 76px;
  }
}

#view-history #data-reference {
  padding-top: 8px;
}
#view-history .history-heading {
  margin: 20px 0;
}
#view-history .weekly-volume-panel,
#view-history #recovery-detail {
  margin: 20px 0;
  padding: 24px;
  border: 0;
  border-radius: 16px;
}
#view-history .week-total {
  margin: 16px 0 4px;
}
#view-history .week-total strong {
  font-size: 36px;
}
.trend-day-training {
  margin-top: 24px;
  padding-top: 8px;
}
.trend-day-training > button {
  margin: 8px 8px 8px 0;
}
.day-checkins,
.calendar-recovery-context {
  margin-top: 20px;
}
.day-checkins h4,
.calendar-recovery-context h4 {
  font-size: 13px;
  margin: 0 0 8px;
}
.day-checkins p,
.calendar-recovery-context p {
  font-size: 13px;
  line-height: 1.5;
  margin: 8px 0;
}
.day-checkin {
  margin-top: 12px;
}
.day-checkin small {
  font-size: 11px;
  color: var(--muted);
}
#view-plan {
  padding-top: 24px;
}
@media (max-width: 600px) {
  #view-history .weekly-volume-panel,
  #view-history #recovery-detail {
    padding: 20px 16px;
  }
}

/* Keep trends navigation quiet and the measurements close to their chart. */
#view-history > .local-actions {
  margin: 8px 0 4px;
}
#view-history > .local-actions .utility-link {
  background: transparent;
  color: var(--muted);
  padding: 8px 0;
  border: 0;
  border-radius: 0;
  font-size: 13px;
}
#view-history .history-heading {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 8px 0 20px;
}
#view-history .history-heading h2 {
  margin: 0;
  font-size: 24px;
}
#view-history .range-control {
  padding: 3px;
}
#view-history .range-control button {
  min-width: 38px;
  min-height: 40px;
  padding: 8px;
  font-size: 12px;
}
#view-history .weekly-volume-panel .section-heading {
  margin-bottom: 20px;
}
#view-history .volume-period {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
}
#view-history .week-total {
  margin: 0;
  gap: 6px;
}
#view-history .week-total strong {
  font-size: 40px;
  line-height: 1.15;
}
#view-history #week-sessions {
  font-size: 12px;
}
#view-history #week-comparison {
  margin: 8px 0 12px;
  color: #666;
  font-size: 12px;
}
#weekly-volume-chart .chart-readout.is-prompt {
  min-height: 0;
  padding: 4px 0;
  border: 0;
  font-size: 11px;
}
#view-history .weekly-volume-panel > .chart-note:last-child {
  margin: 10px 0 0;
}

/* Chart actions keep their own icon size and never compete with the readout. */
.chart-readout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 12px;
}
.chart-readout > small {
  grid-column: 1 / -1;
}
.chart-readout > .chart-ask {
  grid-column: 1 / -1;
  justify-self: start;
  margin: 4px 0 0;
  flex-shrink: 0;
}
.chart-readout > .chart-ask span {
  white-space: nowrap;
}
#recovery-day-detail {
  border: 0;
  padding-top: 24px;
}
#recovery-day-detail .recovery-cluster {
  background: transparent;
  border: 0;
  padding: 0;
}
.sleep-episode-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0;
}
.sleep-episode-info strong,
.sleep-episode-info span {
  display: block;
}
.sleep-episode-info strong {
  font-size: 13px;
  margin-bottom: 4px;
}
.sleep-episode-info span {
  color: var(--muted);
  font-size: 12px;
}
@media (max-width: 600px) {
  #recovery-day-detail .sleep-quantities,
  #recovery-day-detail .physiology-values {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  #recovery-day-detail .recovery-value {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 4px 12px;
    padding: 10px 0;
  }
  #recovery-day-detail .recovery-value strong {
    grid-column: 2;
    grid-row: 1 / 3;
    margin: 0;
    font-size: 22px;
  }
  #recovery-day-detail .metric-reference {
    grid-column: 1;
    line-height: 1.4;
  }
}

/* A month picker stays compact; session details use the adjacent space. */
.training-calendar {
  margin: 20px 0;
  padding: 8px 0;
}
.calendar-layout,
.calendar-month {
  min-width: 0;
}
.calendar-toolbar {
  gap: 12px;
  margin: 12px 0;
}
.calendar-week-controls {
  gap: 8px;
}
.calendar-week-controls button {
  padding: 8px 12px;
}
@media (min-width: 1000px) {
  .calendar-layout {
    display: grid;
    grid-template-columns: minmax(360px, 520px) minmax(0, 1fr);
    align-items: start;
    gap: 32px;
  }
  .calendar-agenda {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    margin-top: 12px;
  }
  button.training-calendar-day {
    min-height: 60px;
    padding: 6px 2px;
    gap: 4px;
  }
}

/* Fill and outline remain independent when a date has both kinds of session. */
button.training-calendar-day.has-recorded {
  background: #d5e7da;
  color: #203e2c;
}
button.training-calendar-day.has-planned {
  box-shadow: inset 0 0 0 2px #527b60;
}
button.training-calendar-day.has-recorded:hover {
  background: #c4dccb;
}

#view-settings .measurement-settings {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  padding: 20px 24px;
}
.measurement-settings > label {
  font-size: 15px;
  font-weight: 600;
}
.measurement-control {
  max-width: 100%;
}
#measurement-system {
  width: 100%;
  min-height: 44px;
}
#measurement-status {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
#measurement-status:empty {
  display: none;
}

/* ---------- Home: Today / Training / Recovery / Body ---------- */
.home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 0 16px;
}
.home-date {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.4px;
}
.home-pills {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 100%;
}
.home-pills::-webkit-scrollbar {
  display: none;
}
.home-pills button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #444;
  font-size: 13px;
  font-weight: 500;
}
.home-pills button[aria-selected="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.home-kicker {
  font-size: 13px;
  color: #444;
}
.readiness-panel .daily-scores {
  margin: 0 0 6px;
}
.score-card[data-status="proceed"] small {
  color: #167044;
  font-weight: 600;
}
.score-card[data-status="adjust"] small,
.score-card[data-status="recover"] small {
  color: #9a5b00;
  font-weight: 600;
}
.score-card[data-status="review"] small {
  color: #af2929;
  font-weight: 600;
}

/* Team row */
.readiness-panel > .daily-focus {
  margin: 20px 0 8px;
  padding: 20px 0 0;
  border-top: 1px solid var(--line);
}
.daily-focus-heading h2 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.2px;
  margin: 0;
}
.daily-focus-heading small {
  display: block;
  margin-top: 4px;
}
.daily-team-focus {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 4px;
}
.daily-team-focus article {
  display: flex;
  flex-direction: column;
  padding: 14px 14px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}
#daily-focus .specialist-heading {
  gap: 8px;
  margin-bottom: 8px;
}
#daily-focus .specialist-avatar {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
}
.daily-team-focus p {
  font-size: 13px;
  line-height: 1.5;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.teammate-card-actions {
  display: flex;
  gap: 14px;
  margin-top: 10px;
}
.teammate-card-actions .teammate-assessment-link {
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}
.daily-team-question {
  margin: 14px 0 4px;
  padding: 14px 16px;
}
.daily-team-question.is-inline {
  margin: 10px 0 0;
  padding: 10px 12px;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.daily-team-question.is-inline p {
  font-size: 12px;
}

/* Training block */
.home-training {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 0;
  margin: 20px 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
}
.home-training-main {
  min-width: 0;
  padding: 20px 24px 16px 0;
  border-right: 1px solid var(--line);
}
.home-training-rail {
  min-width: 0;
  padding: 20px 0 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.home-training-head .week-total {
  margin: 6px 0 0;
}
.home-training-head .week-total strong {
  font-size: 28px;
  letter-spacing: -0.8px;
}
.home-training-head .week-total > span {
  font-size: 14px;
  color: var(--muted);
}
.home-training-head .chart-note {
  margin: 4px 0 0;
}
#weekly-volume-chart {
  margin-top: 10px;
}
#weekly-volume-chart > svg {
  width: 100%;
  height: auto;
  display: block;
}
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 6px;
  font-size: 12px;
  color: #444;
}
.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chart-legend-item:not(.is-line) span {
  text-transform: capitalize;
}
.chart-legend-item i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: #999;
}
.chart-legend-item.is-line i {
  width: 14px;
  height: 0;
  border-top: 2px dashed #999;
  border-radius: 0;
  background: transparent;
}
.home-training-rail h3 {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
}
.home-session {
  display: block;
  width: 100%;
  margin: 0 0 10px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  color: var(--ink);
}
button.home-session:hover,
button.home-session:active {
  background: transparent;
}
button.home-session:hover .home-session-title strong {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.home-session-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
}
.home-session > small {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}
.home-session > p {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: #444;
}
.home-session-actions {
  display: flex;
  gap: 16px;
  margin-top: 4px;
}
.home-session-actions .utility-link,
.home-day .utility-link {
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}
.sport-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #8a8a86;
}
.sport-dot[data-sport="cycling"],
.home-chip[data-sport="cycling"] {
  --sport: #2a78d6;
}
.sport-dot[data-sport="running"],
.home-chip[data-sport="running"] {
  --sport: #eb6834;
}
.sport-dot[data-sport="swimming"],
.home-chip[data-sport="swimming"] {
  --sport: #1baf7a;
}
.sport-dot[data-sport="strength"],
.home-chip[data-sport="strength"] {
  --sport: #4a3aa7;
}
.sport-dot {
  background: var(--sport, #8a8a86);
}
.home-training-rail .calendar-upcoming {
  margin: 0;
}
.home-training-rail .upcoming-session {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.home-training-rail .upcoming-session:first-child {
  border-top: 0;
  padding-top: 0;
}
.home-training-rail .upcoming-session-body {
  font-size: 13px;
}
.home-training-rail .upcoming-session-date {
  width: 58px;
  font-size: 11px;
}

/* Week strip */
.home-week {
  margin: 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
}
.home-week .section-heading h2 {
  font-size: 15px;
}
.home-week-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin-top: 12px;
}
.home-day {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  min-width: 0;
  min-height: 104px;
  padding: 10px 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}
.home-day:hover {
  background: #fafaf9;
}
.home-day.is-today {
  border: 2px solid var(--ink);
  padding: 9px 9px 11px;
}
.home-day.is-rest {
  background: #f5f5f4;
  border-style: dashed;
}
.home-day-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 11px;
  color: var(--muted);
}
.home-day-head strong {
  font-size: 13px;
  color: var(--ink);
}
.home-day > .muted {
  font-size: 12px;
}
.home-chip {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  padding: 5px 8px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  color: #fff;
  background: var(--sport, #8a8a86);
}
.home-chip > span,
.home-chip > small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-chip > small {
  font-size: 11px;
  font-weight: 400;
  color: inherit;
  opacity: 0.9;
}
.home-chip.is-planned {
  background: #fff;
  color: var(--sport, #8a8a86);
  border: 1.5px solid var(--sport, #8a8a86);
  padding: 4px 7px;
}
.home-chip.is-planned > small {
  color: var(--muted);
  opacity: 1;
}
.home-chip.is-missed {
  background: #fff;
  color: #b23b3b;
  border: 1.5px dashed #d47c7c;
  padding: 4px 7px;
}

/* Recovery and Body panels */
.home-recovery {
  padding-top: 0;
}
.home-recovery #readiness-details {
  padding: 0 0 8px;
}
.home-recovery .history-heading {
  margin-top: 24px;
}
.home-body {
  padding: 24px;
}
.home-body-values {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
}
.home-body-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
  padding: 16px;
  border-radius: 12px;
  background: #f2f4f1;
}
.home-body-tile > span {
  font-size: 13px;
  font-weight: 500;
}
.home-body-tile strong {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.8px;
}
.home-body-tile small {
  font-size: 11px;
  color: var(--muted);
}
.home-body-values > button {
  align-self: center;
}

@media (max-width: 1100px) {
  .daily-team-focus {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .home-training {
    grid-template-columns: 1fr;
  }
  .home-training-main {
    padding-right: 0;
    border-right: 0;
  }
  .home-training-rail {
    padding: 18px 0 20px;
    border-top: 1px solid var(--line);
  }
}
@media (max-width: 760px) {
  .home-header {
    padding: 8px 0 12px;
  }
  .home-date {
    font-size: 20px;
  }
  .daily-team-focus {
    display: flex;
    gap: 10px;
    min-width: 0;
    max-width: 100%;
    margin: 14px 0 4px;
    padding: 0 0 6px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .daily-team-focus::-webkit-scrollbar {
    display: none;
  }
  .daily-team-focus article {
    flex: 0 0 100%;
    scroll-snap-align: start;
  }
  .home-week-strip {
    display: flex;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
    margin: 12px 0 0;
    padding: 0 0 6px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .home-week-strip::-webkit-scrollbar {
    display: none;
  }
  .home-week .section-heading {
    flex-wrap: wrap;
    gap: 8px 16px;
  }
  .home-day {
    flex: 0 0 132px;
    scroll-snap-align: start;
  }
  .home-body {
    padding: 18px;
  }
  .home-body-tile {
    flex: 1 1 140px;
    min-width: 0;
  }
}

/* ---------- Home: Training, Recovery, Body panels ---------- */
.training-calendar[data-home-panel] {
  margin: 0;
  padding: 24px;
  background: #fff;
  border-radius: 14px;
}
.training-calendar[data-home-panel] .section-heading h2 {
  font-size: 16px;
}
.training-calendar[data-home-panel] .calendar-toolbar {
  margin: 14px 0 10px;
}
.training-calendar[data-home-panel] .calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.training-calendar[data-home-panel] .calendar-agenda {
  grid-template-columns: 1fr;
  margin-top: 46px;
  padding-left: 28px;
  border-left: 1px solid var(--line);
}
.training-calendar[data-home-panel] button.training-calendar-day,
.training-calendar[data-home-panel] button.training-calendar-day.has-recorded,
.training-calendar[data-home-panel] button.training-calendar-day.has-planned {
  min-height: 72px;
  padding: 8px 4px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
}
.training-calendar[data-home-panel] button.training-calendar-day:hover {
  background: #fafaf9;
}
.training-calendar[data-home-panel]
  button.training-calendar-day.is-outside-month {
  border-color: transparent;
  background: transparent;
  color: #b0b3ae;
}
.training-calendar[data-home-panel] button.training-calendar-day.is-today {
  border: 2px solid var(--ink);
}
.training-calendar[data-home-panel] .calendar-day-heading strong {
  width: 28px;
  height: 28px;
  font-size: 13px;
  box-shadow: none;
}
.training-calendar[data-home-panel]
  button.training-calendar-day.is-today
  .calendar-day-heading
  strong {
  box-shadow: none;
}
.training-calendar[data-home-panel]
  button.training-calendar-day[aria-pressed="true"] {
  background: #f3f2ef;
}
.training-calendar[data-home-panel] .calendar-day-markers {
  bottom: 8px;
  gap: 4px;
  height: 8px;
}
.training-calendar[data-home-panel] .calendar-dot {
  width: 8px;
  height: 8px;
  border: 0;
  background: #8a8a86;
}
.training-calendar[data-home-panel] .calendar-dot[data-sport="cycling"] {
  --sport: #2a78d6;
}
.training-calendar[data-home-panel] .calendar-dot[data-sport="running"] {
  --sport: #eb6834;
}
.training-calendar[data-home-panel] .calendar-dot[data-sport="swimming"] {
  --sport: #1baf7a;
}
.training-calendar[data-home-panel] .calendar-dot[data-sport="strength"] {
  --sport: #4a3aa7;
}
.training-calendar[data-home-panel] .calendar-dot.is-recorded {
  background: var(--sport, #8a8a86);
}
.training-calendar[data-home-panel] .calendar-dot.is-planned {
  background: #fff;
  box-shadow: inset 0 0 0 1.5px var(--sport, #8a8a86);
}
.training-calendar[data-home-panel] .calendar-dot.is-rest {
  width: 10px;
  height: 2px;
  background: #b0b3ae;
}
.training-calendar[data-home-panel] .calendar-detail-session {
  background: #fff;
  border: 1px solid var(--line);
}
.training-calendar[data-home-panel] .calendar-day-title h3 {
  font-size: 16px;
}

.home-recovery {
  padding: 24px;
  background: #fff;
  border-radius: 14px;
}
.home-recovery #readiness-details {
  padding: 0;
}
.home-recovery #recovery-detail {
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
}
.home-recovery .history-heading {
  margin: 26px 0 12px;
}
.home-recovery .history-heading h2 {
  font-size: 16px;
  font-weight: 600;
}
.recovery-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: 0 0 12px;
}
.recovery-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}
.recovery-toolbar select,
.recovery-toolbar input {
  min-height: 36px;
  font-size: 13px;
}
.recovery-toolbar > button {
  margin-left: auto;
}
.home-recovery .recovery-trend-heading {
  margin: 4px 0 6px;
}
.home-recovery .recovery-trend-heading h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}
.home-recovery .panel-foot {
  font-size: 11px;
}

.home-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}
.home-body-link {
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

@media (max-width: 760px) {
  .training-calendar[data-home-panel] {
    padding: 18px;
  }
  .training-calendar[data-home-panel] .calendar-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .training-calendar[data-home-panel] .calendar-agenda {
    margin-top: 0;
    padding: 18px 0 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .training-calendar[data-home-panel] button.training-calendar-day,
  .training-calendar[data-home-panel] button.training-calendar-day.has-recorded,
  .training-calendar[data-home-panel] button.training-calendar-day.has-planned {
    min-height: 56px;
    padding: 6px 2px 14px;
    border-radius: 8px;
  }
  .training-calendar[data-home-panel] .section-heading {
    flex-wrap: wrap;
  }
  .home-recovery {
    padding: 18px;
  }
  .recovery-toolbar > button {
    margin-left: 0;
    width: 100%;
  }
}

/* Team cards share the height of the tallest card in the row. */
.readiness-panel .daily-team-focus {
  align-items: stretch;
}
.readiness-panel .daily-team-focus > article {
  height: 100%;
  padding: 14px 14px 12px;
}
.readiness-panel .daily-team-focus > article > p {
  font-size: 13px;
  line-height: 1.5;
}

/* Profile panel: calibration values under Home. */
.home-profile {
  padding: 24px;
  background: #fff;
  border-radius: 14px;
}
.home-profile-intro {
  margin: 0;
  font-size: 13px;
}
.home-profile #calibration-values {
  margin-top: 16px;
}
.home-profile #calibration-values article {
  border: 1px solid var(--line);
}
@media (max-width: 760px) {
  .home-profile {
    padding: 18px;
  }
}

/* ---------- Ask affordances: outlined pill, or a compact round icon ---------- */
button.chat-icon-button {
  min-height: 32px;
  min-width: 0;
  padding: 0 12px 0 10px;
  gap: 6px;
  border: 1px solid #d6d6d2;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}
button.chat-icon-button:hover {
  background: #f3f3f1;
  border-color: #bdbdb8;
  text-decoration: none;
}
button.chat-icon-button svg {
  width: 14px;
  height: 14px;
  stroke-width: 1.8;
}
button.chat-icon-button span::after {
  content: none;
}
button.chat-icon-button:active {
  transform: none;
}
button.chat-icon-button:focus-visible {
  outline-offset: 2px;
}
button.chat-icon-button.is-compact {
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  justify-content: center;
  flex-shrink: 0;
}
button.chat-icon-button.is-compact svg {
  width: 15px;
  height: 15px;
}
.chat-context {
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 6px 0;
}
.chat-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 5px 6px 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f3f3f1;
  font-size: 12px;
  color: var(--ink);
}
.chat-chip i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.chat-chip b {
  font-weight: 600;
  white-space: nowrap;
}
.chat-chip small {
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}
.chat-composer .chat-chip-remove {
  width: 20px;
  height: 20px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #888;
  font-size: 14px;
  line-height: 1;
}
.chat-composer .chat-chip-remove:hover {
  background: #e4e4e2;
  color: var(--ink);
}

/* Context chips sit on their own row above the draft. */
.chat-composer .chat-context {
  flex: none;
  width: 100%;
  align-items: center;
  padding: 2px 4px 0;
}
.chat-composer .chat-chip {
  height: auto;
  width: auto;
  flex: 0 1 auto;
}

/* Teammate cards: icon in the header, body opens the assessment. */
.readiness-panel .daily-team-focus > article {
  padding: 12px 12px 12px 14px;
}
#daily-focus .specialist-heading {
  justify-content: space-between;
  margin-bottom: 6px;
}
#daily-focus .specialist-heading h3 {
  flex: 1;
  min-width: 0;
}
.teammate-card-body {
  display: block;
  width: 100%;
  flex: 1;
  margin: 0;
  padding: 2px 2px 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  text-align: left;
}
.teammate-card-body:hover {
  background: transparent;
}
.teammate-card-body > p {
  margin: 0;
  color: #353832;
}
.readiness-panel .daily-team-focus > article > .teammate-card-body > p {
  font-size: 13px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.daily-team-question.is-inline {
  margin: 8px 0 0;
}
.daily-focus-heading > button.chat-icon-button {
  flex-shrink: 0;
}
/* Calibration cards: compact icon in the top-right corner. */
#calibration-values article {
  position: relative;
}
#calibration-values .calibration-actions,
#calibration-body .calibration-actions {
  position: absolute;
  top: 14px;
  right: 14px;
  margin: 0;
}
#calibration-values article h3 {
  padding-right: 40px;
}
/* Today's session and calendar day actions. */
.home-session-actions {
  gap: 8px;
  margin-top: 8px;
}
button.home-pill-button {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid #d6d6d2;
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}
button.home-pill-button:hover {
  background: #f3f3f1;
}
.calendar-day-title > button.chat-icon-button.secondary {
  background: #fff;
}
.chart-readout > .chart-ask {
  flex-shrink: 0;
}

.teammate-card-body {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
}
#calibration-values #calibration-body .calibration-actions {
  position: absolute;
  top: 14px;
  right: 14px;
  left: auto;
  bottom: auto;
  margin: 0;
  padding: 0;
  width: auto;
}

/* ---------- Recovery day breakdown: lighter, tighter ---------- */
.home-recovery .recovery-day-grid {
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 18px;
  padding: 0;
  border: 0;
}
.home-recovery .recovery-cluster {
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.home-recovery .recovery-cluster h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 10px;
}
.home-recovery .sleep-quantities {
  gap: 6px;
  margin-bottom: 8px;
}
.home-recovery .physiology-values {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.home-recovery .recovery-value {
  padding: 8px;
  border-radius: 8px;
}
.home-recovery .recovery-value strong {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.3px;
  margin: 3px 0;
}
.home-recovery .recovery-value small {
  font-size: 11px;
}
.home-recovery .metric-reference {
  font-size: 10px;
}
.home-recovery .sleep-episode-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.home-recovery .sleep-episode-info strong {
  font-size: 13px;
}
.home-recovery .sleep-episode-info span {
  font-size: 12px;
}
.home-recovery .sleep-stages {
  gap: 2px;
  margin-top: 10px;
  border-radius: 6px;
}
.home-recovery .sleep-stages button {
  padding: 6px 2px;
  font-size: 10px;
  font-weight: 600;
  color: #1f3328;
  background: #dfe8e2;
}
.home-recovery .sleep-stages [data-stage="1"] {
  background: #52715e;
  color: #fff;
}
.home-recovery .sleep-stages [data-stage="2"] {
  background: #9db8a7;
  color: #1f3328;
}
.home-recovery .recovery-cluster .chart-note {
  margin: 8px 0 0;
  font-size: 11px;
}
.home-recovery .sleep-week-navigation button {
  width: 32px;
  height: 32px;
  font-size: 16px;
}
.home-recovery .trend-day-training {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.home-recovery .trend-day-training h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 10px;
}
.home-recovery .panel-foot {
  margin-top: 6px;
}
@media (max-width: 760px) {
  .home-recovery .recovery-day-grid {
    grid-template-columns: 1fr;
  }
  .home-recovery .physiology-values {
    grid-template-columns: 1fr 1fr;
  }
  .home-recovery .recovery-value {
    display: flex;
    flex-direction: column;
    gap: 0;
  }
  .home-recovery .recovery-value strong {
    font-size: 17px;
  }
}

/* Mobile: the date and section pills stay pinned under the top bar. */
@media (max-width: 760px) {
  .home-header {
    position: sticky;
    top: 62px;
    z-index: 20;
    margin: 0 -16px 10px;
    padding: 18px 16px 12px;
    background: #f7f7f7;
    border-bottom: 1px solid var(--line);
    gap: 8px;
  }
  .home-date {
    font-size: 17px;
    line-height: 1.2;
  }
  .home-pills button {
    min-height: 32px;
    padding: 6px 12px;
    font-size: 12px;
  }
}

/* Context chips inside a sent message. */
.chat-message-context {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 8px;
}
.chat-message-context + p {
  margin-top: 0;
}
.chat-message-context:last-child {
  margin-bottom: 0;
}
.chat-chip.is-static {
  padding: 4px 10px;
  background: #fff;
  border-color: #dedede;
}

/* ---------- Composer: attach picker ---------- */
.chat-composer-footer .chat-add {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #d6d6d2;
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  margin-bottom: 2px;
}
.chat-composer-footer .chat-add:hover,
.chat-composer-footer .chat-add[aria-expanded="true"] {
  background: #f3f3f1;
  border-color: #bdbdb8;
}
.chat-composer-footer .chat-add svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
}
.chat-picker {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: calc(100% + 8px);
  max-height: min(60vh, 420px);
  overflow-y: auto;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 30px #00000014;
  z-index: 5;
}
.chat-picker h4 {
  margin: 8px 8px 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.chat-picker h4:first-child {
  margin-top: 2px;
}
.chat-picker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  text-align: left;
}
.chat-picker-item:hover,
.chat-picker-item:focus-visible {
  background: #f3f3f1;
}
.chat-picker-item i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.chat-picker-item b {
  font-weight: 600;
  white-space: nowrap;
}
.chat-picker-item small {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (min-width: 761px) {
  .chat-picker {
    left: 8px;
    right: auto;
    width: min(420px, calc(100% - 16px));
  }
}

/* The picker floats above the composer; it must not take part in its layout. */
.chat-composer > .chat-picker {
  position: absolute;
}
.chat-composer .chat-picker-item small {
  display: block;
  flex: 1;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}
.chat-composer .chat-picker-item {
  width: 100%;
  height: auto;
  padding: 8px 10px;
  border-radius: 8px;
}

/* Chart readout: the ask icon sits beside the detail line, not on its own row. */
.chart-readout > small {
  grid-column: 1;
  grid-row: 2;
  align-self: center;
}
.chart-readout > .chart-ask {
  grid-column: 2;
  grid-row: 2;
  justify-self: end;
  margin: 0;
}

/* Chart readout as one row: label and detail left, value and Ask together right. */
.chart-readout {
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 12px;
  row-gap: 2px;
}
.chart-readout > span:first-child {
  grid-column: 1;
  grid-row: 1;
}
.chart-readout > strong {
  grid-column: 2;
  grid-row: 1 / 3;
  font-size: 15px;
}
.chart-readout > small {
  grid-column: 1;
  grid-row: 2;
  align-self: start;
}
.chart-readout > .chart-ask {
  grid-column: 3;
  grid-row: 1 / 3;
  justify-self: end;
  margin: 0;
  min-height: 30px;
  padding: 0 11px 0 9px;
}
.chart-readout.is-prompt {
  display: block;
}

/* Circular sport shares with a centered, high-contrast date. */
.calendar-sport-fill {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(calc(100% - 6px), 56px);
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 50%;
  pointer-events: none;
}
.calendar-sport-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    135deg,
    #fff9 0 2px,
    transparent 2px 6px
  );
  mask-image: var(--planned-mask);
}
.training-calendar-day .calendar-day-heading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 1;
}
.training-calendar[data-home-panel] button.training-calendar-day {
  padding: 0;
}
.training-calendar[data-home-panel]
  .has-sport-fill
  .calendar-day-heading
  strong {
  width: 24px;
  height: 24px;
  background: #fff;
  color: var(--ink);
}
.training-calendar[data-home-panel]
  button.training-calendar-day[aria-pressed="true"] {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
  background: #fff;
}
.training-calendar[data-home-panel]
  button.training-calendar-day[aria-pressed="true"]
  .calendar-day-heading
  strong {
  background: var(--ink);
  color: #fff;
}

/* Compact avatar bookmarks with one open assessment. */
.daily-team-tabs {
  position: relative;
  display: flex;
  gap: 4px;
  margin-top: 18px;
  padding: 6px 0 0;
  overflow-x: auto;
  scrollbar-width: thin;
  border-bottom: 1px solid var(--line);
  max-width: 640px;
}
.daily-team-tab {
  position: relative;
  display: flex;
  flex: 1 0 58px;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 88px;
  padding: 4px 2px 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
}
.daily-team-tab:hover {
  background: #f8f8f6;
}
@media (max-width: 760px) {
  .daily-team-tab {
    max-width: none;
  }
}
.daily-team-tab[aria-selected="true"] {
  color: var(--ink);
}
.daily-team-tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  bottom: 0;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
}
.daily-team-tab:focus-visible {
  outline-offset: -3px;
}
.daily-team-tab-portrait {
  position: relative;
  display: flex;
  padding: 2px;
}
.daily-team-tab-badge {
  position: absolute;
  top: -4px;
  right: -5px;
  font-size: 10px;
  line-height: 1;
}
.daily-team-tab-label {
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
}
.daily-team-panels {
  min-width: 0;
  max-width: 640px;
  touch-action: pan-y pinch-zoom;
}
.daily-team-panels > article {
  padding: 16px 0 0;
  overflow-wrap: anywhere;
}
.daily-team-panels > article[hidden] {
  display: none;
}
.daily-team-panels .teammate-card-body {
  padding: 0;
}
.daily-team-panels .teammate-card-body:hover {
  background: transparent;
}
.daily-team-panels .teammate-card-body > p {
  font-size: 14px;
  line-height: 1.6;
}
.teammate-assessment-hint {
  display: inline-block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}
.teammate-card-body:hover .teammate-assessment-hint {
  color: var(--ink);
  text-decoration: underline;
}
.daily-team-panels .daily-team-question.is-inline {
  margin: 16px 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  gap: 10px;
}
.daily-team-panels .daily-question-content p {
  font-size: 13px;
  line-height: 1.6;
}
#daily-focus .daily-focus-heading > button.chat-icon-button {
  min-height: 32px;
  padding: 4px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}
#daily-focus .daily-focus-heading > button.chat-icon-button:hover {
  color: var(--ink);
  text-decoration: underline;
}

/* Chart readout without an action: label and detail left, value right. */
.chart-readout {
  grid-template-columns: minmax(0, 1fr) auto;
}
.chart-readout > strong {
  grid-column: 2;
}

/* Mobile Home: the brand bar folds into the pinned header; the gear moves beside the date. */
.home-settings {
  display: none;
}
@media (max-width: 760px) {
  body.home-open .masthead {
    height: 0;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    overflow: visible;
  }
  body.home-open .masthead .brand,
  body.home-open .masthead .sidebar-bottom {
    display: none;
  }
  body.home-open main {
    padding-top: 0;
  }
  body.home-open .home-header {
    top: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    row-gap: 10px;
    padding-top: calc(14px + env(safe-area-inset-top, 0px));
  }
  body.home-open .home-date {
    grid-column: 1;
    grid-row: 1;
    font-size: 20px;
  }
  body.home-open .home-settings {
    display: grid;
    place-items: center;
    grid-column: 2;
    grid-row: 1;
    overflow-wrap: anywhere;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #555;
  }
  body.home-open .home-settings svg {
    width: 20px;
    height: 20px;
  }
  body.home-open .home-pills {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

/* ---------- Team: one card per teammate (restored) ---------- */
.readiness-panel .daily-team-focus {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
  margin: 16px 0 4px;
}
.readiness-panel .daily-team-focus > article {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 12px 12px 12px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}
#daily-focus .specialist-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
#daily-focus .specialist-heading h3 {
  min-width: 0;
  font-size: 14px;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#daily-focus .specialist-heading .chat-icon-button {
  margin-left: auto;
}
.teammate-card-badge {
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transform: translateY(-1px);
}
/* Keep narrow teammate headings compact while preserving the inline status. */
.readiness-panel .daily-team-focus > article {
  container-type: inline-size;
}
@container (max-width: 260px) {
  #daily-focus .specialist-heading {
    gap: 5px;
  }
  #daily-focus .specialist-heading h3 {
    font-size: 13px;
  }
  #daily-focus .teammate-card-badge {
    padding-inline: 6px;
    font-size: 9px;
  }
}
.readiness-panel .daily-team-focus .teammate-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  width: 100%;
  margin: 0;
  padding: 2px 2px 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  text-align: left;
}
.readiness-panel .daily-team-focus .teammate-card-body:hover {
  background: transparent;
}
.readiness-panel .daily-team-focus .teammate-card-body > p {
  margin: 0;
  color: #353832;
  font-size: 13px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.readiness-panel .daily-team-focus .teammate-assessment-hint {
  margin-top: auto;
  padding-top: 8px;
}
.readiness-panel .daily-team-focus .daily-team-question.is-inline {
  margin: 10px 0 0;
  padding: 10px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.readiness-panel .daily-team-focus .daily-team-question.is-inline p {
  font-size: 12px;
}
#daily-focus .daily-focus-heading > button.chat-icon-button,
#daily-focus .daily-focus-heading > button.chat-icon-button:hover {
  min-height: 32px;
  padding: 0 12px 0 10px;
  border: 1px solid #d6d6d2;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}
#daily-focus .daily-focus-heading > button.chat-icon-button:hover {
  background: #f3f3f1;
  border-color: #bdbdb8;
}
@media (max-width: 1100px) {
  .readiness-panel .daily-team-focus {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .readiness-panel .daily-team-focus {
    display: flex;
    gap: 10px;
    margin: 14px -16px 4px;
    padding: 0 16px 6px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .readiness-panel .daily-team-focus::-webkit-scrollbar {
    display: none;
  }
  .readiness-panel .daily-team-focus > article {
    flex: 0 0 78%;
    scroll-snap-align: start;
  }
}
@media (max-width: 760px) {
  .readiness-panel .daily-team-focus {
    align-items: stretch;
  }
  .readiness-panel .daily-team-focus > article {
    height: auto;
    align-self: stretch;
  }
}

/* Keep calibration provenance available without crowding the values. */
#calibration-values .calibration-details > summary {
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}
#calibration-values .calibration-details[open] > summary {
  margin-bottom: 12px;
}
#calibration-values .calibration-details details {
  margin-top: 12px;
  font-size: 13px;
}
#calibration-body > .calibration-details {
  flex-basis: 100%;
}

/* ---------- Training: week-first log ---------- */
.training-week-panel {
  margin: 0;
  padding: 24px;
  background: #fff;
  border-radius: 14px;
}
.training-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.training-head h2 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 600;
}
.training-week-nav button {
  min-height: 34px;
}
.training-week-nav #training-week-label {
  min-width: 120px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
}
.training-week-stats {
  display: flex;
  gap: 22px;
}
.training-week-stat strong {
  display: block;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.4px;
}
.training-week-stat small {
  font-size: 11px;
  color: var(--muted);
}
.training-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 0 28px;
}
.training-week-log {
  padding-top: 4px;
}
.tlog-day {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.tlog-day:last-child {
  border-bottom: 0;
}
.tlog-day-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  margin: 0;
  padding: 6px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}
.tlog-day-head small {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
}
.tlog-day-head:hover,
.tlog-day-head[aria-pressed="true"] {
  background: #f3f2ef;
}
.tlog-day.is-today .tlog-day-head > span::after {
  content: " · Today";
  font-weight: 400;
  color: var(--muted);
}
.tlog-sessions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
  min-height: 36px;
}
.tlog-session {
  --sport: #8a8a86;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 150px;
  max-width: 260px;
  margin: 0;
  padding: 8px 12px;
  border: 0;
  border-radius: 10px;
  background: var(--sport);
  color: #fff;
  font-size: 13px;
  line-height: 1.3;
  text-align: left;
}
.tlog-session[data-sport="cycling"] {
  --sport: #2a78d6;
}
.tlog-session[data-sport="running"] {
  --sport: #eb6834;
}
.tlog-session[data-sport="swimming"] {
  --sport: #1baf7a;
}
.tlog-session[data-sport="strength"] {
  --sport: #4a3aa7;
}
.tlog-session strong {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tlog-session small {
  font-size: 11px;
  color: inherit;
  opacity: 0.9;
}
.tlog-session.is-recorded:hover {
  filter: brightness(0.94);
}
.tlog-session.is-planned {
  background: #fff;
  color: var(--sport);
  border: 1.5px solid var(--sport);
  padding: 7px 11px;
}
.tlog-session.is-planned small {
  color: var(--muted);
  opacity: 1;
}
.tlog-session.is-missed {
  background: #fff;
  color: #b23b3b;
  border: 1.5px dashed #d47c7c;
  padding: 7px 11px;
}
.tlog-session.is-missed small {
  color: #b23b3b;
  opacity: 1;
}
.tlog-rest {
  align-self: center;
  font-size: 12px;
  color: var(--muted);
}
.training-aside {
  padding-top: 4px;
}
.training-aside .calendar-toolbar {
  margin: 8px 0 8px;
}
.training-aside .calendar-week-controls button {
  min-height: 30px;
  width: 30px;
  padding: 0;
}
.training-aside #training-month-label {
  font-size: 12px;
  font-weight: 600;
  min-width: 110px;
  text-align: center;
}
.training-aside .calendar-weekday-row {
  gap: 2px;
  font-size: 10px;
  color: var(--muted);
  text-align: center;
}
.training-aside .training-calendar-grid {
  gap: 2px;
}
.training-aside button.training-calendar-day {
  min-height: 40px;
  padding: 4px 2px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
}
.training-aside button.training-calendar-day.is-selected-week {
  background: #f3f2ef;
}
.training-aside button.training-calendar-day:hover {
  background: #e9e9e6;
}
.training-aside button.training-calendar-day.is-outside-month {
  color: #b0b3ae;
}
.training-aside button.training-calendar-day.is-today {
  border-color: var(--ink);
}
.training-aside .calendar-day-heading strong {
  width: 24px;
  height: 24px;
  font-size: 12px;
  box-shadow: none;
}
.training-aside
  button.training-calendar-day[aria-pressed="true"]
  .calendar-day-heading
  strong {
  background: var(--ink);
  color: #fff;
}
.training-aside .calendar-day-markers {
  bottom: 5px;
  gap: 3px;
  height: 6px;
}
.training-aside .calendar-dot {
  width: 6px;
  height: 6px;
  border: 0;
  background: var(--sport, #8a8a86);
}
.training-aside .calendar-dot[data-sport="cycling"] {
  --sport: #2a78d6;
}
.training-aside .calendar-dot[data-sport="running"] {
  --sport: #eb6834;
}
.training-aside .calendar-dot[data-sport="swimming"] {
  --sport: #1baf7a;
}
.training-aside .calendar-dot[data-sport="strength"] {
  --sport: #4a3aa7;
}
.training-aside .calendar-dot.is-planned {
  background: #fff;
  box-shadow: inset 0 0 0 1.5px var(--sport, #8a8a86);
}
.training-aside .calendar-dot.is-rest {
  width: 8px;
  height: 2px;
  background: #b0b3ae;
}
.training-aside .calendar-day-detail {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.training-aside .calendar-day-title h3 {
  font-size: 14px;
}
.calendar-plan-note {
  margin: 8px 0;
  font-size: 13px;
  line-height: 1.5;
  color: #444;
}
@media (max-width: 1100px) {
  .training-layout {
    grid-template-columns: 1fr;
  }
  .training-aside {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
  }
}
@media (max-width: 760px) {
  .training-week-panel {
    padding: 18px;
  }
  .training-head {
    align-items: flex-start;
  }
  .training-week-stats {
    gap: 16px;
  }
  .training-week-stat strong {
    font-size: 17px;
  }
  .tlog-day {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .tlog-day-head {
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
    padding: 4px 6px;
  }
  .tlog-session {
    min-width: 0;
    max-width: none;
    flex: 1 1 140px;
  }
}

.training-head {
  align-items: flex-start;
}
.training-head-main .home-kicker {
  display: block;
}
.training-hero {
  margin: 6px 0 0;
}
.training-hero strong {
  font-size: 28px;
  letter-spacing: -0.8px;
}
.training-hero > span {
  font-size: 14px;
  color: var(--muted);
}
.training-head-main .chart-note {
  margin: 4px 0 0;
}
.training-week-nav {
  padding-top: 4px;
}

/* ---------- Recovery: match Today's section rhythm ---------- */
.home-recovery .history-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 22px 0 10px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.home-recovery .history-heading h2,
.home-recovery .section-heading h2 {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}
.recovery-trend-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.recovery-trend-controls select {
  min-height: 32px;
  font-size: 12px;
  padding-right: 28px;
}
.home-recovery .range-control {
  margin: 0;
}
.home-recovery .recovery-toolbar {
  margin: 0 0 8px;
}
.recovery-day-heading {
  margin: 22px 0 12px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.recovery-day-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.recovery-day-controls input {
  min-height: 32px;
  font-size: 12px;
}
.recovery-day-controls > button {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.home-recovery .recovery-day-grid {
  margin-top: 0;
}
.home-recovery .trend-day-training {
  margin-top: 22px;
  padding-top: 18px;
}
.home-recovery .trend-day-training h3 {
  font-size: 15px;
}
@media (max-width: 760px) {
  .recovery-day-controls {
    width: 100%;
  }
  .recovery-day-controls label {
    flex: 1;
  }
  .recovery-day-controls input {
    width: 100%;
  }
}
.tlog-sessions:empty {
  min-height: 0;
}
@media (max-width: 760px) {
  .tlog-day {
    padding: 8px 0;
  }
  .tlog-day:has(.tlog-sessions:empty) {
    padding: 2px 0;
  }
}
/* Mini-grid selection is a ring, so the sport dots stay visible. */
.training-aside
  button.training-calendar-day[aria-pressed="true"]
  .calendar-day-heading
  strong {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--ink);
}
.training-aside button.training-calendar-day {
  min-height: 44px;
  padding: 4px 2px 14px;
}
.training-aside .calendar-day-markers {
  bottom: 4px;
}

/* ---------- Recovery hero: sleep headline, HRV and RHR beside it ---------- */
.home-recovery #readiness-details {
  padding: 0 0 18px;
  border-bottom: 1px solid var(--line);
}
.home-recovery .recovery-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0 28px;
  align-items: end;
}
.home-recovery button.recovery-reading {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 6px 8px;
  margin: -6px -8px;
  border-radius: 10px;
  background: transparent;
}
.home-recovery button.recovery-reading:hover {
  background: #f3f2ef;
}
.home-recovery .recovery-reading-label {
  font-size: 13px;
  color: #444;
}
.home-recovery .recovery-reading.is-hero .recovery-reading-number strong {
  font-size: 28px;
  letter-spacing: -0.8px;
  font-weight: 600;
}
.home-recovery .recovery-reading.is-secondary .recovery-reading-label {
  font-size: 11px;
  color: var(--muted);
}
.home-recovery .recovery-reading.is-secondary .recovery-reading-number strong {
  font-size: 20px;
  letter-spacing: -0.4px;
  font-weight: 600;
}
.home-recovery .recovery-reading small {
  font-size: 11px;
}
.home-recovery .history-heading {
  border-top: 0;
  padding-top: 0;
  margin-top: 20px;
}
.day-session-blocks {
  margin: 10px 0 14px;
}
.home-recovery .trend-day-training .section-heading {
  margin-bottom: 4px;
}
.home-recovery .trend-day-training .section-heading h3 {
  margin: 0;
}
@media (max-width: 760px) {
  .home-recovery .recovery-summary {
    grid-template-columns: 1fr 1fr;
    gap: 10px 16px;
  }
  .home-recovery .recovery-reading.is-hero {
    grid-column: 1 / -1;
  }
  .home-recovery button.recovery-reading {
    display: flex;
    grid-template-columns: none;
    margin: 0;
    padding: 6px 8px;
  }
  .home-recovery .recovery-reading-number {
    grid-column: auto;
    grid-row: auto;
    justify-content: flex-start;
  }
}
/* Mini-grid: the selected day is a bordered square; today is a dashed square. */
.training-aside
  button.training-calendar-day[aria-pressed="true"]
  .calendar-day-heading
  strong {
  box-shadow: none;
}
.training-aside button.training-calendar-day.is-today {
  border: 1px dashed #9a9a96;
}
.training-aside button.training-calendar-day[aria-pressed="true"] {
  border: 2px solid var(--ink);
  padding: 3px 1px 13px;
}
/* Mini-grid: today is a filled darker square; the selected day has the border. */
.training-aside button.training-calendar-day.is-today {
  border: 1px solid transparent;
  background: #dededa;
}
.training-aside
  button.training-calendar-day.is-today
  .calendar-day-heading
  strong {
  font-weight: 700;
}
.training-aside button.training-calendar-day.is-today:hover {
  background: #d4d4cf;
}
.training-aside button.training-calendar-day[aria-pressed="true"] {
  border: 2px solid var(--ink);
}
.training-aside
  button.training-calendar-day.is-today
  .calendar-day-heading
  strong {
  box-shadow: none;
}
.training-aside button.training-calendar-day.is-selected-week {
  background: transparent;
}
.training-aside button.training-calendar-day.is-selected-week.is-today {
  background: #dededa;
}
/* Mini-grid: today is a colored date, the open week is tinted, the selected day is bordered. */
.training-aside button.training-calendar-day.is-today,
.training-aside button.training-calendar-day.is-today:hover,
.training-aside button.training-calendar-day.is-selected-week.is-today {
  background: transparent;
}
.training-aside button.training-calendar-day.is-today:hover {
  background: #e9e9e6;
}
.training-aside
  button.training-calendar-day.is-today
  .calendar-day-heading
  strong {
  color: #2f7a4f;
  font-weight: 700;
}
.training-aside button.training-calendar-day.is-selected-week,
.training-aside button.training-calendar-day.is-selected-week.is-today {
  background: #f3f2ef;
}
.training-aside button.training-calendar-day.is-selected-week:hover {
  background: #e9e9e6;
}
.training-aside
  button.training-calendar-day.is-today
  .calendar-day-heading
  strong {
  color: #16a34a;
  font-weight: 800;
}
.training-aside
  button.training-calendar-day.is-today
  .calendar-day-heading
  strong {
  color: #f97316;
}

/* ---------- Today chart: Training | Sleep toggle ---------- */
.home-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.home-chart-toggle {
  display: inline-flex;
  padding: 2px;
  border-radius: 999px;
  background: #ececea;
}
.home-chart-toggle button {
  min-height: 26px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #555;
  font-size: 12px;
  font-weight: 600;
}
.home-chart-toggle button[aria-pressed="true"] {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 2px #00000014;
}

/* ---------- Sections in the nav: Home, Calendar, Profile, Chat ---------- */
@media (max-width: 760px) {
  .masthead .t-tabs {
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    padding-left: 8px;
    padding-right: 8px;
  }
  .masthead .t-tab {
    gap: 6px;
    padding: 0 4px;
    font-size: 11px;
  }
  .masthead .t-tab svg {
    width: 17px;
    height: 17px;
  }
}
#view-calendar .home-header,
#view-profile .home-header {
  padding-bottom: 16px;
}
#open-night {
  margin: 10px 0 0;
  min-height: 28px;
  font-size: 12px;
}
.night-dialog {
  width: min(1040px, calc(100% - 32px));
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  max-height: 90dvh;
}
.night-dialog .night-heading {
  margin-bottom: 8px;
}
.night-dialog .night-heading h2 {
  margin: 4px 0 0;
  font-size: 20px;
}
.night-dialog .home-recovery {
  padding: 0;
  background: transparent;
  border-radius: 0;
}
@media (max-width: 760px) {
  .night-dialog {
    width: calc(100% - 16px);
    padding: 16px;
    max-height: 94dvh;
    border-radius: 14px;
  }
}

.home-chart-head {
  justify-content: flex-end;
  margin-bottom: 4px;
}
/* Chart head: the toggle sits on the headline row. */
.home-training-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 12px;
}
.home-training-head .home-chart-head {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  align-self: center;
}
.home-training-head .week-total {
  grid-column: 1;
  grid-row: 1;
  margin: 0;
}
.home-training-head .chart-note,
.home-training-head #open-night {
  grid-column: 1;
  justify-self: start;
}
.home-training-head {
  align-items: start;
}
.home-training-head .home-chart-head {
  align-self: start;
  margin-top: 4px;
}

/* ---------- Activity detail ---------- */
.workout-dialog {
  width: min(960px, calc(100% - 32px));
  padding: 22px 26px 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  max-height: 92dvh;
}
.workout-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.workout-head-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}
.workout-sport {
  width: 12px;
  height: 12px;
  margin-top: 9px;
  flex-shrink: 0;
}
.workout-head h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.4px;
  line-height: 1.25;
}
#workout-meta {
  margin: 4px 0 0;
  font-size: 13px;
}
.workout-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.workout-head-actions #workout-review {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid #d6d6d2;
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
}
.workout-head-actions #close-workout {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid #d6d6d2;
  border-radius: 50%;
  background: #fff;
  font-size: 18px;
  line-height: 1;
  color: #444;
}
.workout-dialog .workout-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 6px 18px;
  margin: 0 0 6px;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--line);
}
.workout-dialog .workout-stat {
  gap: 2px;
  padding: 6px 0;
  border: 0;
}
.workout-dialog .workout-stat strong {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.5px;
  line-height: 1.2;
}
.workout-dialog .workout-stat small {
  font-size: 11px;
  color: var(--muted);
  opacity: 1;
}
.workout-section {
  margin: 0;
  padding: 16px 0 0;
  border-radius: 0;
}
.workout-section .section-heading h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}
.workout-readout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  font-size: 12px;
  color: #444;
  min-height: 20px;
}
.workout-readout strong {
  font-variant-numeric: tabular-nums;
}
.workout-readout-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-variant-numeric: tabular-nums;
}
.workout-readout-item i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.workout-panels {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.workout-panel {
  position: relative;
}
.workout-panel-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 2px;
}
.workout-panel-label i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}
.workout-panel svg {
  display: block;
  width: 100%;
  height: auto;
  touch-action: pan-y;
  cursor: crosshair;
}
.workout-axis {
  font-size: 10px;
  fill: #888;
}
.workout-baseline {
  stroke: #e3e3e3;
}
.workout-guide {
  stroke: #181818;
  stroke-width: 1;
  stroke-dasharray: 3 3;
}
.workout-zones {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}
.workout-zone {
  display: grid;
  grid-template-columns: 110px 92px minmax(0, 1fr) 90px;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}
.workout-zone-name {
  font-weight: 600;
}
.workout-zone-range {
  color: var(--muted);
  font-size: 11px;
}
.workout-zone-bar {
  height: 10px;
  border-radius: 5px;
  background: #f0f0ed;
  overflow: hidden;
}
.workout-zone-bar i {
  display: block;
  height: 100%;
  border-radius: 5px;
}
.workout-zone-time {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #444;
}
.workout-dialog .workout-lap-table {
  margin-top: 8px;
  font-size: 12px;
}
.workout-dialog .workout-lap-table th {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}
.workout-dialog .workout-lap-table th,
.workout-dialog .workout-lap-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #eee;
  white-space: nowrap;
}
#workout-note {
  margin: 18px 0 0;
  font-size: 11px;
}
@media (max-width: 760px) {
  .workout-dialog {
    width: calc(100% - 16px);
    padding: 18px 16px 20px;
    max-height: 94dvh;
  }
  .workout-head h2 {
    font-size: 19px;
  }
  .workout-head-actions #workout-review span {
    display: none;
  }
  .workout-dialog .workout-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .workout-dialog .workout-stat strong {
    font-size: 19px;
  }
  .workout-zone {
    grid-template-columns: 86px minmax(0, 1fr) 84px;
  }
  .workout-zone-range {
    display: none;
  }
}

.workout-analysis-title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.workout-overlay-legend {
  flex-wrap: wrap;
  gap: 4px 14px;
}
.workout-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.workout-legend-item i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}
.workout-overlay-note {
  margin: 6px 0 0;
  font-size: 11px;
}
@media (max-width: 760px) {
  .workout-analysis-head {
    flex-wrap: wrap;
  }
}

/* Header actions: same height, centered, no mouse focus ring. */
.workout-head-actions {
  align-items: center;
  margin-top: 2px;
}
.workout-head-actions #workout-review,
.workout-head-actions #close-workout {
  height: 32px;
  min-height: 32px;
  box-sizing: border-box;
  margin: 0;
}
.workout-head-actions button:focus:not(:focus-visible) {
  outline: none;
}

#workout-title:focus {
  outline: none;
}

.workout-cursor-box {
  fill: #fff;
  stroke: #d6d6d2;
}
.workout-cursor-text {
  font-size: 11px;
  font-weight: 600;
  fill: #181818;
  font-variant-numeric: tabular-nums;
}
.workout-readout {
  display: none;
}

.workout-readout {
  display: inline-flex;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  min-width: 56px;
  justify-content: flex-end;
}

/* Day-over-day change beside each score. */
.score-number {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.score-delta {
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 2px 7px;
  border-radius: 999px;
  background: #ececea;
  color: #555;
}
.score-delta[data-trend="up"] {
  background: #e3f1e8;
  color: #1f6b3f;
}
.score-delta[data-trend="down"] {
  background: #f7e5e2;
  color: #a33a2a;
}

/* Composer media and centered icon controls. */
.chat-composer-footer .chat-add,
.chat-composer-footer #chat-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}
.chat-composer-footer .chat-add svg,
.chat-composer-footer #chat-send svg {
  display: block;
  flex: none;
}
#chat-send:disabled {
  opacity: 0.3;
  cursor: default;
}
.chat-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}
.chat-attachment {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.chat-attachment > div {
  min-width: 0;
}
.chat-attachment b,
.chat-attachment small {
  display: block;
  overflow-wrap: anywhere;
  font-size: 12px;
}
.chat-attachment small {
  margin-top: 3px;
  color: var(--muted);
}
.chat-composer .chat-attachment button {
  width: auto;
  min-width: 32px;
  height: 32px;
  margin: 0;
  padding: 4px;
  background: transparent;
  color: var(--ink);
  flex: none;
}
#chat-attachment-status {
  width: 100%;
  color: var(--muted);
  font-size: 12px;
}
#chat-attachment-status:empty,
.chat-message-media:empty {
  display: none;
}
.chat-media-preview {
  margin-top: 10px;
}
.chat-media-preview summary {
  font-size: 13px;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.chat-media-preview img,
.chat-media-preview video {
  display: block;
  max-width: 100%;
  max-height: 400px;
  margin-top: 10px;
  border-radius: 10px;
}

.chat-composer.is-file-drop {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

body.auth-pending { visibility: hidden; }
