:root {
  color-scheme: dark;
  --font-sans: "SF Pro Display", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body.sage-daily-body {
  min-height: 100vh;
  font-family: var(--font-sans);
  color: #e7f1fb;
  background:
    radial-gradient(circle at 8% 8%, rgba(77, 212, 255, 0.12), transparent 40%),
    radial-gradient(circle at 92% 12%, rgba(255, 188, 87, 0.08), transparent 35%),
    #04070d;
  line-height: 1.4;
}

button, input {
  font: inherit;
}

p, h1, h2, h3, h4 {
  margin: 0;
}

main.sage-daily-page {
  width: min(1360px, calc(100% - 1.25rem));
  margin: 0.75rem auto 2rem;
  display: grid;
  gap: 0.85rem;
}

.section-edge {
  border-radius: 22px;
  border: 1px solid rgba(121, 176, 232, 0.2);
  background: linear-gradient(165deg, rgba(8, 14, 24, 0.95), rgba(4, 8, 14, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 18px 32px rgba(0, 0, 0, 0.22);
}

.eyebrow,
.panel-label {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.6rem;
  color: #7ed3ff;
}

.section-note {
  color: #b6cde2;
  font-size: 0.95rem;
  line-height: 1.45;
}

.sage-daily-shell-head {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 0.85rem;
  padding: clamp(0.9rem, 2vw, 1.1rem);
  background:
    radial-gradient(circle at 95% 0%, rgba(77, 212, 255, 0.08), transparent 52%),
    linear-gradient(165deg, rgba(8, 14, 24, 0.95), rgba(4, 8, 14, 0.96));
}

.sage-daily-shell-head h1 {
  margin: 0.2rem 0 0.35rem;
  color: #f4f8ff;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  line-height: 1.08;
}

.sage-daily-shell-head .section-note {
  max-width: 64ch;
}

.sage-daily-shell-head code,
.payload-foot code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: #b9e8ff;
  background: rgba(77, 212, 255, 0.08);
  border: 1px solid rgba(77, 212, 255, 0.18);
  border-radius: 6px;
  padding: 0.08rem 0.3rem;
}

.sage-daily-shell-meta {
  display: grid;
  align-content: start;
  gap: 0.55rem;
}

.sage-mini-status {
  border-radius: 12px;
  border: 1px solid rgba(117, 169, 220, 0.22);
  background: rgba(9, 15, 26, 0.72);
  padding: 0.55rem 0.65rem;
  display: grid;
  gap: 0.2rem;
}

.sage-mini-label {
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: #92b8d6;
}

#payloadSourceStatus,
#completionPostbackStatus {
  color: #d2e7fb;
  font-size: 0.76rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

#payloadSourceStatus.is-ok,
#completionPostbackStatus.is-ok {
  color: #bcffe6;
}

#payloadSourceStatus.is-warn,
#completionPostbackStatus.is-warn {
  color: #ffe0ae;
}

.training-section {
  padding: 0.95rem;
}

.training-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 0.95rem;
  align-items: start;
}

.training-board,
.training-sidebar {
  display: grid;
  gap: 0.8rem;
}

.training-board {
  border-radius: 18px;
  border: 1px solid rgba(145, 194, 255, 0.26);
  background:
    radial-gradient(circle at 95% 0%, rgba(77, 212, 255, 0.12), transparent 50%),
    linear-gradient(160deg, rgba(11, 20, 34, 0.9), rgba(8, 13, 22, 0.94));
  padding: 0.95rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 14px 34px rgba(0, 0, 0, 0.28);
}

.training-board-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  align-items: start;
}

.training-hero-copy {
  min-width: 0;
  display: grid;
  gap: 0.28rem;
}

.training-kicker {
  margin: 0 0 0.25rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.6rem;
  color: #7ed3ff;
}

.training-context-line {
  color: #d0e4f7;
  font-size: 0.78rem;
  line-height: 1.35;
  max-width: 62ch;
}

.training-board-head h3 {
  color: #f3f8ff;
  font-size: 1.28rem;
  line-height: 1.08;
  margin-bottom: 0.05rem;
}

.training-sub {
  font-size: 0.86rem;
  color: #afc7df;
  max-width: 52ch;
}

.sage-capability-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.1rem;
}

.sage-capability-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(121, 176, 232, 0.22);
  background: rgba(11, 19, 31, 0.62);
  color: #cbe7fb;
  font-family: var(--font-mono);
  font-size: 0.54rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.readiness-hero-card {
  border-radius: 16px;
  border: 1px solid rgba(117, 169, 220, 0.26);
  background:
    radial-gradient(circle at 78% 18%, rgba(77, 212, 255, 0.12), transparent 58%),
    rgba(8, 14, 23, 0.84);
  padding: 0.55rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.6rem;
  min-width: 0;
  width: 100%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.readiness-hero-card.tone-green {
  border-color: rgba(53, 216, 166, 0.28);
}

.readiness-hero-card.tone-amber {
  border-color: rgba(255, 188, 87, 0.3);
}

.readiness-hero-card.tone-red {
  border-color: rgba(255, 111, 112, 0.28);
}

.readiness-dial {
  --readiness-score: 71;
  width: 84px;
  aspect-ratio: 1;
  border-radius: 50%;
  padding: 5px;
  background:
    radial-gradient(circle at 50% 50%, rgba(4, 7, 12, 1) 56%, transparent 58%),
    conic-gradient(
      from 220deg,
      rgba(121, 176, 232, 0.2) 0%,
      rgba(121, 176, 232, 0.2) calc((100 - var(--readiness-score)) * 1%),
      rgba(255, 188, 87, 0.94) calc((100 - var(--readiness-score)) * 1%),
      rgba(77, 212, 255, 0.92) 100%
    );
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 0 24px rgba(77, 212, 255, 0.14);
  display: grid;
  place-items: center;
}

.readiness-dial-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.05rem;
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 188, 87, 0.14), transparent 62%),
    linear-gradient(180deg, rgba(9, 16, 28, 0.95), rgba(5, 9, 15, 0.95));
  border: 1px solid rgba(121, 176, 232, 0.15);
}

.readiness-dial-value {
  color: #f8fcff;
  font-weight: 800;
  font-size: 1.45rem;
  line-height: 1;
}

.readiness-dial-caption {
  font-family: var(--font-mono);
  color: #b5d4f0;
  font-size: 0.48rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.readiness-hero-meta {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 0.32rem;
}

.readiness-hero-summary {
  color: #d3e6f8;
  font-size: 0.76rem;
  line-height: 1.35;
  max-width: 70ch;
}

.readiness-mini-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.readiness-mini-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.4rem;
  border-radius: 999px;
  border: 1px solid rgba(121, 176, 232, 0.2);
  background: rgba(12, 20, 34, 0.58);
  color: #cfe4f8;
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.readiness-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 188, 87, 0.38);
  background: rgba(255, 188, 87, 0.12);
  color: #ffd99e;
  white-space: nowrap;
}

.readiness-pill.readiness-green {
  border-color: rgba(53, 216, 166, 0.42);
  background: rgba(53, 216, 166, 0.13);
  color: #b6ffe8;
}

.readiness-pill.readiness-amber {
  border-color: rgba(255, 188, 87, 0.42);
  background: rgba(255, 188, 87, 0.12);
  color: #ffe0ae;
}

.readiness-pill.readiness-red {
  border-color: rgba(255, 111, 112, 0.44);
  background: rgba(255, 111, 112, 0.12);
  color: #ffc2c3;
}

.readiness-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
  opacity: 0.9;
}

.training-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
}

.training-meta-card {
  border-radius: 12px;
  border: 1px solid rgba(117, 169, 220, 0.28);
  background: rgba(7, 14, 24, 0.8);
  padding: 0.55rem;
  min-width: 0;
}

.meta-label {
  margin: 0 0 0.25rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.56rem;
  color: #8eb4d4;
}

.meta-value {
  font-size: 0.78rem;
  color: #edf6ff;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.training-controls {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 0.6rem;
}

.control-cluster {
  border-radius: 12px;
  border: 1px solid rgba(117, 169, 220, 0.22);
  background: rgba(8, 14, 23, 0.72);
  padding: 0.55rem;
}

.control-label {
  margin: 0 0 0.38rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.56rem;
  color: #9cc0df;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
}

.segmented-btn,
.control-btn {
  border-radius: 10px;
  border: 1px solid rgba(121, 176, 232, 0.35);
  background: rgba(20, 35, 54, 0.58);
  color: #d5eaff;
  font-family: var(--font-mono);
  font-size: 0.63rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.55rem 0.5rem;
  cursor: pointer;
}

.segmented-btn:hover,
.segmented-btn:focus-visible,
.control-btn:hover,
.control-btn:focus-visible {
  border-color: rgba(255, 188, 87, 0.55);
  color: #ffe0aa;
}

.segmented-btn.is-active {
  border-color: rgba(77, 212, 255, 0.56);
  color: #9fe4ff;
  background: rgba(77, 212, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(77, 212, 255, 0.12);
}

.control-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}

.control-btn {
  font-weight: 600;
}

.control-btn.ghost {
  background: rgba(13, 22, 36, 0.65);
}

.control-btn.compact {
  padding: 0.4rem 0.55rem;
  font-size: 0.56rem;
}

.training-alert {
  border-radius: 10px;
  border: 1px solid rgba(77, 212, 255, 0.26);
  background: rgba(77, 212, 255, 0.08);
  color: #b8eafe;
  font-size: 0.78rem;
  padding: 0.55rem 0.65rem;
}

.training-alert.is-ok {
  border-color: rgba(53, 216, 166, 0.32);
  background: rgba(53, 216, 166, 0.1);
  color: #c8ffe8;
}

.training-alert.is-warn {
  border-color: rgba(255, 188, 87, 0.34);
  background: rgba(255, 188, 87, 0.09);
  color: #ffe0ae;
}

.mobile-progress-strip {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  border-radius: 12px;
  border: 1px solid rgba(121, 176, 232, 0.22);
  background: rgba(8, 14, 23, 0.8);
  padding: 0.55rem 0.65rem;
}

.mobile-progress-copy {
  min-width: 0;
}

.mobile-progress-label {
  margin: 0 0 0.12rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.54rem;
  color: #8eb4d4;
}

.mobile-progress-summary {
  color: #ecf6ff;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.mobile-progress-pill {
  flex-shrink: 0;
  border-radius: 999px;
  border: 1px solid rgba(121, 176, 232, 0.25);
  background: rgba(15, 26, 41, 0.62);
  color: #bfd9f3;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.24rem 0.45rem;
}

.mobile-progress-pill.is-progress {
  border-color: rgba(77, 212, 255, 0.32);
  color: #9fe4ff;
  background: rgba(77, 212, 255, 0.12);
}

.mobile-progress-pill.is-modified {
  border-color: rgba(255, 188, 87, 0.34);
  color: #ffe0ae;
  background: rgba(255, 188, 87, 0.1);
}

.mobile-progress-pill.is-done {
  border-color: rgba(53, 216, 166, 0.34);
  color: #baffea;
  background: rgba(53, 216, 166, 0.12);
}

.exercise-list {
  display: grid;
  gap: 0.7rem;
}

.exercise-card {
  border-radius: 14px;
  border: 1px solid rgba(123, 179, 231, 0.28);
  background:
    radial-gradient(circle at 92% 6%, rgba(77, 212, 255, 0.06), transparent 40%),
    linear-gradient(180deg, rgba(8, 15, 25, 0.94), rgba(6, 11, 19, 0.94));
  padding: 0.75rem;
  display: grid;
  gap: 0.6rem;
}

.exercise-card.is-complete {
  border-color: rgba(53, 216, 166, 0.4);
  box-shadow: inset 0 0 0 1px rgba(53, 216, 166, 0.14);
}

.exercise-card.is-skipped {
  border-color: rgba(255, 111, 112, 0.34);
  opacity: 0.85;
}

.exercise-top {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 0.65rem;
  align-items: start;
}

.exercise-top > div:nth-child(2) {
  min-width: 0;
}

.exercise-visual {
  height: 56px;
  border-radius: 12px;
  border: 1px solid rgba(125, 184, 236, 0.32);
  background:
    radial-gradient(circle at 28% 22%, rgba(255, 188, 87, 0.22), transparent 48%),
    radial-gradient(circle at 75% 78%, rgba(77, 212, 255, 0.22), transparent 56%),
    linear-gradient(145deg, rgba(23, 41, 62, 0.9), rgba(9, 18, 31, 0.95));
  display: grid;
  place-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.exercise-visual span {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: #d6ecff;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.exercise-name {
  margin: 0 0 0.18rem;
  color: #eef6ff;
  font-size: 0.95rem;
}

.exercise-notes {
  font-size: 0.75rem;
  color: #aac3db;
}

.exercise-mode {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.22rem 0.42rem;
  border-radius: 999px;
  border: 1px solid rgba(121, 176, 232, 0.32);
  font-family: var(--font-mono);
  font-size: 0.54rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #a3ddff;
  background: rgba(77, 212, 255, 0.08);
}

.exercise-status {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 999px;
  padding: 0.22rem 0.42rem;
  font-family: var(--font-mono);
  font-size: 0.54rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid rgba(121, 176, 232, 0.25);
  color: #b9d7f3;
  background: rgba(15, 26, 41, 0.62);
  white-space: nowrap;
}

.exercise-status.done {
  border-color: rgba(53, 216, 166, 0.34);
  color: #baffea;
  background: rgba(53, 216, 166, 0.12);
}

.exercise-status.skipped {
  border-color: rgba(255, 111, 112, 0.34);
  color: #ffd2d2;
  background: rgba(255, 111, 112, 0.1);
}

.set-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.42rem;
}

.set-btn {
  text-align: left;
  border-radius: 10px;
  border: 1px solid rgba(119, 172, 224, 0.28);
  background:
    linear-gradient(180deg, rgba(13, 23, 37, 0.96), rgba(8, 14, 24, 0.94));
  padding: 0.45rem 0.55rem;
  color: #d9ebff;
  cursor: pointer;
  display: grid;
  gap: 0.15rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.set-btn:hover,
.set-btn:focus-visible {
  border-color: rgba(255, 188, 87, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 0 1px rgba(255, 188, 87, 0.1);
}

.set-btn.is-done {
  border-color: rgba(53, 216, 166, 0.42);
  background:
    radial-gradient(circle at 88% 20%, rgba(53, 216, 166, 0.12), transparent 55%),
    linear-gradient(180deg, rgba(9, 30, 28, 0.92), rgba(7, 18, 20, 0.92));
}

.set-btn .set-line {
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.set-btn .set-reps {
  color: #f6fbff;
  font-size: 0.9rem;
  font-weight: 700;
}

.set-btn .set-rest {
  color: #9ec0df;
  font-size: 0.68rem;
}

.exercise-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.exercise-action-btn {
  border-radius: 999px;
  border: 1px solid rgba(121, 176, 232, 0.28);
  background: rgba(16, 27, 43, 0.62);
  color: #cfe5fb;
  font-family: var(--font-mono);
  font-size: 0.54rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.3rem 0.5rem;
  cursor: pointer;
}

.exercise-action-btn:hover,
.exercise-action-btn:focus-visible {
  border-color: rgba(255, 188, 87, 0.52);
  color: #ffe3b7;
}

.exercise-action-btn.is-selected {
  border-color: rgba(77, 212, 255, 0.55);
  color: #9fe4ff;
  background: rgba(77, 212, 255, 0.12);
}

.training-footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.earth-handoff-card {
  border-radius: 12px;
  border: 1px solid rgba(117, 169, 220, 0.24);
  background: rgba(8, 15, 25, 0.78);
  padding: 0.7rem;
}

.earth-handoff-card ul {
  margin: 0.35rem 0 0;
  padding-left: 1rem;
  display: grid;
  gap: 0.35rem;
  color: #c8dcef;
  font-size: 0.78rem;
}

.earth-handoff-card.warnings {
  border-color: rgba(255, 188, 87, 0.26);
  background: rgba(29, 21, 12, 0.44);
}

.training-sidebar {
  gap: 0.75rem;
}

.scoreboard-panel,
.payload-panel {
  border-radius: 16px;
  border: 1px solid rgba(121, 176, 232, 0.26);
  background: linear-gradient(180deg, rgba(10, 18, 31, 0.9), rgba(7, 11, 20, 0.93));
  padding: 0.85rem;
}

.scoreboard-head,
.payload-head {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: flex-start;
}

.scoreboard-head-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.scoreboard-toggle {
  display: none;
  border-radius: 999px;
  border: 1px solid rgba(121, 176, 232, 0.26);
  background: rgba(13, 22, 36, 0.62);
  color: #cde4fa;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.52rem;
  padding: 0.24rem 0.45rem;
  cursor: pointer;
}

.scoreboard-toggle:hover,
.scoreboard-toggle:focus-visible {
  border-color: rgba(255, 188, 87, 0.42);
  color: #ffe0aa;
}

.scoreboard-body {
  display: block;
}

.scoreboard-panel.is-collapsed .scoreboard-body {
  display: none;
}

.scoreboard-head h3,
.payload-head h3 {
  font-size: 0.98rem;
  color: #edf6ff;
}

.scoreboard-date {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #96b6d1;
}

.score-metric-grid {
  margin-top: 0.65rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.score-metric {
  border-radius: 12px;
  border: 1px solid rgba(117, 169, 220, 0.24);
  background: rgba(7, 13, 23, 0.78);
  padding: 0.55rem;
}

.score-label {
  margin: 0 0 0.3rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.54rem;
  color: #90b3d3;
}

.score-value {
  color: #f1f8ff;
  font-weight: 800;
  font-size: 1.1rem;
  line-height: 1;
}

.score-foot {
  margin-top: 0.2rem;
  font-size: 0.64rem;
  color: #9cb8d4;
}

.scoreboard-rails {
  margin-top: 0.7rem;
  display: grid;
  gap: 0.55rem;
}

.score-rail-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.7rem;
  color: #c5dbef;
  margin-bottom: 0.22rem;
}

.score-rail-head span {
  font-family: var(--font-mono);
  color: #9fe4ff;
  font-size: 0.62rem;
}

.rail-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(117, 169, 220, 0.2);
  overflow: hidden;
}

.rail-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(255, 188, 87, 0.85), rgba(77, 212, 255, 0.9));
  transition: width 220ms ease;
}

.rail-fill.ok {
  background: linear-gradient(90deg, rgba(53, 216, 166, 0.88), rgba(77, 212, 255, 0.9));
}

.trend-panel {
  margin-top: 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(117, 169, 220, 0.22);
  background: rgba(8, 14, 23, 0.72);
  padding: 0.6rem;
}

.trend-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: baseline;
  margin-bottom: 0.45rem;
}

.trend-head p {
  font-size: 0.74rem;
  color: #dbeafa;
}

.trend-head span {
  font-family: var(--font-mono);
  font-size: 0.54rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #93b5d4;
}

.trend-bars {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.28rem;
  align-items: end;
  min-height: 90px;
}

.trend-bar-wrap {
  display: grid;
  justify-items: center;
  gap: 0.3rem;
}

.trend-bar {
  width: 100%;
  min-height: 8px;
  border-radius: 999px;
  border: 1px solid rgba(117, 169, 220, 0.2);
  background: linear-gradient(180deg, rgba(77, 212, 255, 0.15), rgba(77, 212, 255, 0.42));
}

.trend-bar.is-rest {
  background: rgba(255, 255, 255, 0.06);
}

.trend-bar-label {
  font-family: var(--font-mono);
  font-size: 0.52rem;
  color: #8fb2d2;
  text-transform: uppercase;
}

.payload-panel {
  gap: 0.55rem;
  display: none;
}

.sage-debug .payload-panel {
  display: block;
}

.debug-only {
  display: none;
}

.sage-debug .debug-only {
  display: block;
}

.payload-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem;
}

.payload-foot {
  margin-top: 0.55rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
}

.payload-foot p {
  margin: 0;
  font-size: 0.66rem;
  color: #9db9d5;
  max-width: 38ch;
}

.payload-json {
  margin: 0.55rem 0 0;
  padding: 0.7rem;
  border-radius: 12px;
  border: 1px solid rgba(117, 169, 220, 0.24);
  background: rgba(4, 9, 16, 0.92);
  color: #cbe6ff;
  font-family: var(--font-mono);
  font-size: 0.63rem;
  line-height: 1.55;
  max-height: 380px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.sage-payload-foot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}

.sage-modal-backdrop[hidden] {
  display: none !important;
}

.sage-modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(2, 6, 12, 0.72);
  backdrop-filter: blur(8px);
  z-index: 50;
}

.sage-modal-card {
  width: min(640px, 100%);
  border-radius: 18px;
  border: 1px solid rgba(121, 176, 232, 0.28);
  background:
    radial-gradient(circle at 95% 0%, rgba(77, 212, 255, 0.1), transparent 55%),
    linear-gradient(165deg, rgba(9, 16, 28, 0.97), rgba(5, 9, 16, 0.98));
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  padding: 0.9rem;
  display: grid;
  gap: 0.75rem;
}

.sage-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.sage-modal-head h3 {
  color: #eef7ff;
  font-size: 1.02rem;
}

.sage-modal-sub {
  color: #abc4da;
  font-size: 0.78rem;
}

.sage-modal-close {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(121, 176, 232, 0.28);
  background: rgba(12, 20, 34, 0.68);
  color: #d5eaff;
  cursor: pointer;
}

.sage-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.sage-field {
  display: grid;
  gap: 0.3rem;
}

.sage-field > span {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #9cc0df;
}

.sage-field select,
.sage-field input[type="number"],
.sage-field textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(117, 169, 220, 0.28);
  background: rgba(8, 14, 23, 0.78);
  color: #e8f2fb;
  padding: 0.6rem 0.65rem;
}

.sage-field textarea {
  resize: vertical;
  min-height: 90px;
}

.sage-field-full {
  grid-column: 1 / -1;
}

.sage-check {
  align-content: center;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.5rem 0.6rem;
  border-radius: 10px;
  border: 1px solid rgba(117, 169, 220, 0.2);
  background: rgba(8, 14, 23, 0.52);
  padding: 0.55rem 0.65rem;
}

.sage-check > span {
  font-family: var(--font-sans);
  letter-spacing: 0;
  text-transform: none;
  font-size: 0.82rem;
  color: #d3e8fa;
}

.sage-check input {
  width: 16px;
  height: 16px;
}

.sage-modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

.reveal {
  opacity: 1;
  transform: none;
}

@media (max-width: 1100px) {
  .sage-daily-shell-head,
  .training-layout,
  .training-controls {
    grid-template-columns: 1fr;
  }

  .training-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .readiness-hero-card {
    min-width: 0;
  }
}

@media (max-width: 880px) {
  .training-footer-grid,
  .segmented {
    grid-template-columns: 1fr;
  }

  .training-controls {
    position: sticky;
    top: 0.45rem;
    z-index: 8;
    padding: 0.35rem;
    border-radius: 12px;
    background: rgba(4, 8, 14, 0.82);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(117, 169, 220, 0.16);
  }

  .training-board-head {
    grid-template-columns: 1fr;
  }

  .mobile-progress-strip {
    display: flex;
    position: sticky;
    top: 5.6rem;
    z-index: 7;
    backdrop-filter: blur(8px);
  }

  .scoreboard-panel.is-collapsed .scoreboard-head {
    margin-bottom: 0;
  }

  .scoreboard-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 520px) {
  main.sage-daily-page {
    width: calc(100% - 0.7rem);
    margin-top: 0.35rem;
    gap: 0.55rem;
  }

  .sage-daily-shell-head,
  .training-section {
    border-radius: 18px;
    padding: 0.75rem;
  }

  .training-board-head,
  .scoreboard-head,
  .payload-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .scoreboard-head-actions {
    width: 100%;
    justify-content: space-between;
  }

  .readiness-hero-card {
    grid-template-columns: 76px 1fr;
    padding: 0.5rem;
  }

  .readiness-dial {
    width: 76px;
  }

  .readiness-dial-value {
    font-size: 1.25rem;
  }

  .training-context-line {
    font-size: 0.74rem;
  }

  .training-board-head h3 {
    font-size: 1.1rem;
  }

  .training-sub {
    font-size: 0.8rem;
  }

  .sage-capability-chip {
    font-size: 0.5rem;
    padding: 0.18rem 0.38rem;
  }

  .exercise-top {
    grid-template-columns: 52px 1fr;
  }

  .exercise-top > :last-child {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .control-actions,
  .score-metric-grid,
  .sage-payload-foot-actions {
    grid-template-columns: 1fr;
    width: 100%;
    display: grid;
  }

  .control-btn {
    min-height: 46px;
    font-size: 0.68rem;
    padding: 0.65rem 0.75rem;
  }

  .set-grid {
    grid-template-columns: 1fr;
  }

  .set-btn {
    min-height: 84px;
    padding: 0.65rem 0.75rem;
    gap: 0.22rem;
  }

  .set-btn .set-line {
    font-size: 0.68rem;
  }

  .set-btn .set-reps {
    font-size: 1.05rem;
  }

  .set-btn .set-rest {
    font-size: 0.74rem;
  }

  .exercise-action-btn {
    min-height: 38px;
    padding: 0.42rem 0.65rem;
    font-size: 0.6rem;
  }

  .trend-panel {
    display: none;
  }

  .sage-form-grid {
    grid-template-columns: 1fr;
  }

  .sage-modal-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .sage-modal-close {
    width: 40px;
    height: 40px;
  }
}

/* Exercise Help Modal */
.exercise-help-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.exercise-help-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

.exercise-help-content {
  position: relative;
  background: linear-gradient(165deg, rgba(8, 14, 24, 0.98), rgba(4, 8, 14, 0.99));
  border: 1px solid rgba(121, 176, 232, 0.3);
  border-radius: 16px;
  padding: 1.5rem;
  max-width: 480px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
}

.exercise-help-content h3 {
  color: #7dd3fc;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(121, 176, 232, 0.2);
}

.help-section {
  margin-bottom: 1rem;
}

.help-section h4 {
  color: #fbbf24;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.35rem;
}

.help-section p {
  color: #e7f1fb;
  font-size: 0.9rem;
  line-height: 1.5;
  opacity: 0.95;
}

.close-help-btn {
  width: 100%;
  padding: 0.75rem 1rem;
  margin-top: 0.5rem;
  background: rgba(125, 211, 252, 0.15);
  border: 1px solid rgba(125, 211, 252, 0.3);
  border-radius: 10px;
  color: #7dd3fc;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.close-help-btn:hover {
  background: rgba(125, 211, 252, 0.25);
}

/* How To Button */
.how-to-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 8px;
  color: #fbbf24;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: 0.5rem;
}

.how-to-btn:hover {
  background: rgba(251, 191, 36, 0.2);
}

.how-to-btn::before {
  content: "?";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: rgba(251, 191, 36, 0.25);
  border-radius: 50%;
  font-size: 0.65rem;
  font-weight: 700;
}
