/* ===== DS7 DESIGN TOKENS — single source for colour, depth, type, spacing and motion (see DESIGN_SYSTEM.md) ===== */
:root {
  /* colour */
  --ds7-bg-0: #010509;
  --ds7-bg-1: #041019;
  --ds7-bg-2: #061722;
  --ds7-panel: #06161f;
  --ds7-panel-2: #0a2430;
  --ds7-panel-hi: #0e3140;
  --ds7-cyan: var(--accent);
  --ds7-teal: #1bb5b8;
  --ds7-silver: #dfe7ea;
  --ds7-silver-dim: #9fb2ba;
  --ds7-text: #eaf7fc;
  --ds7-muted: #9db7c3;
  --ds7-protein: #4aa8ff;
  --ds7-carbs: #ffb347;
  --ds7-fat: #e88bff;
  --ds7-fiber: #7be08c;
  --ds7-ok: #6ce7b5;
  --ds7-warn: #ffcd94;
  --ds7-danger: #ff9d9d;
  /* depth & glow */
  --ds7-line: rgba(var(--accent-rgb), 0.42);
  --ds7-line-soft: rgba(var(--accent-rgb), 0.18);
  --ds7-glow-sm: 0 0 10px rgba(var(--accent-rgb), 0.22);
  --ds7-glow: 0 0 22px rgba(var(--accent-rgb), 0.22), inset 0 0 18px rgba(var(--accent-rgb), 0.05);
  --ds7-glow-strong: 0 0 30px rgba(var(--accent-rgb), 0.45);
  --ds7-shadow: 0 14px 40px #0008;
  --ds7-glow-scale: 1; /* animation/effect intensity: 1 full, .5 subtle, 0 off */
  /* shape */
  --ds7-radius-lg: 24px;
  --ds7-radius: 18px;
  --ds7-radius-sm: 12px;
  --ds7-radius-pill: 999px;
  /* type */
  --ds7-font-display: 'Bahnschrift', 'Segoe UI Variable Display', 'Segoe UI', system-ui, sans-serif;
  --ds7-font-body: 'Segoe UI Variable Text', 'Segoe UI', Inter, system-ui, sans-serif;
  --ds7-silver-text: linear-gradient(180deg, #fff 0%, #dfe8ec 45%, #8fa3ac 100%);
  /* spacing */
  --ds7-s1: 4px;
  --ds7-s2: 8px;
  --ds7-s3: 12px;
  --ds7-s4: 16px;
  --ds7-s5: 24px;
  --ds7-s6: 32px;
  /* motion */
  --ds7-fast: 0.15s;
  --ds7-med: 0.3s;
  --ds7-slow: 0.8s;
  --ds7-ease: cubic-bezier(0.22, 1, 0.36, 1);
  /* charts */
  --ds7-chart-grid: rgba(var(--accent-rgb), 0.14);
  --ds7-chart-line: var(--accent);
  --ds7-chart-alt: #b9c7ff;
}
body.fx-subtle {
  --ds7-glow-scale: 0.5;
}
body.fx-off {
  --ds7-glow-scale: 0;
}
body.fx-off * {
  animation-duration: 0.001s !important;
  transition-duration: 0.001s !important;
}

:root {
  --accent: #49e9f5;
  --accent-rgb: 73, 233, 245;
  --glow: 0.12;
  --bg: #071117;
  --panel: #0d1b24;
  --panel-2: #10232e;
  --border: #203540;
  --text: #eaf5f8;
  --muted: #8fa7b4;
  --green: #6ce7b5;
  --radius: 20px;
  color-scheme: dark;
  font-family: Inter, 'Segoe UI', Arial, sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: radial-gradient(ellipse at 95% 5%, rgba(var(--accent-rgb), var(--glow)), transparent 38%), var(--bg);
  min-height: 100vh;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.45;
}
button,
a,
input,
select {
  outline-offset: 5px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
}
button {
  color: inherit;
}
a {
  color: var(--accent);
  text-decoration: none;
}
button {
  border: 0;
}
button:active {
  transform: scale(0.97);
}
button {
  transition:
    background 0.18s,
    transform 0.18s,
    border-color 0.18s;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 34px;
  letter-spacing: -1.1px;
  margin-bottom: 9px;
  font-weight: 650;
}
h2 {
  font-size: 20px;
  letter-spacing: -0.5px;
  font-weight: 600;
  margin-bottom: 6px;
}
h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
}
p {
  line-height: 1.6;
}
svg {
  display: block;
}
small {
  font-size: 11px;
}
input,
select {
  width: 100%;
  background: #08151d;
  color: var(--text);
  border: 1px solid #35505f;
  border-radius: 10px;
  padding: 12px;
  min-height: 45px;
}
input[type='color'] {
  padding: 4px;
  width: 70px;
}
input[type='range'] {
  padding: 0;
  accent-color: var(--accent);
  background: none;
  border: 0;
}
input[type='checkbox'] {
  width: 18px;
  min-height: 18px;
  accent-color: var(--accent);
}
label {
  font-size: 13px;
  color: var(--muted);
}
label input,
label select {
  margin-top: 8px;
}
form label {
  display: block;
  margin-bottom: 16px;
}
form button[type='submit'] {
  margin-top: 8px;
  width: 100%;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 225px;
  background: #081219e8;
  border-right: 1px solid #1a2c36;
  padding: 34px 22px;
  display: flex;
  flex-direction: column;
  z-index: 10;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-family: Georgia, serif;
  font-size: 31px;
  letter-spacing: 2px;
}
.brand small {
  display: block;
  font-family: 'Segoe UI', sans-serif;
  letter-spacing: 1.6px;
  font-size: 8px;
  color: var(--muted);
  margin-top: 4px;
}
.brand-mark {
  font-family: Arial;
  font-size: 38px;
  color: var(--accent);
  text-shadow: 0 0 26px rgba(var(--accent-rgb), 0.5);
}
.nav-caption {
  font-size: 9px;
  letter-spacing: 1.7px;
  color: #617e8f;
  margin: 48px 0 16px 10px;
}
nav {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 13px;
  color: #91a7b4;
  padding: 13px 14px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 13px;
}
.nav-link svg {
  width: 19px;
  height: 19px;
}
.nav-link:hover {
  background: #11232d;
}
.nav-link.active {
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.075);
  border-color: rgba(var(--accent-rgb), 0.16);
}
.sidebar-bottom {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-top: 22px;
  text-align: center;
}
.sidebar-bottom p {
  font-family: Georgia, serif;
  font-size: 15px;
  line-height: 1.7;
  color: #8aa2af;
}
.sidebar-bottom strong {
  color: #c1d6df;
  font-weight: 400;
}
.dragon-sigil {
  font-size: 36px;
  color: var(--accent);
  margin-bottom: 10px;
}
.workspace {
  margin-left: 225px;
}
.topbar {
  height: 82px;
  padding: 0 40px;
  border-bottom: 1px solid #1c303b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}
.breadcrumb {
  font-size: 11px;
  letter-spacing: 1px;
  color: #a5b8c2;
}
.breadcrumb > span:first-child {
  margin: 0 13px;
  color: #4d6878;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}
.mode-pill {
  font-size: 11px;
  padding: 8px 13px;
  border: 1px solid #2d4956;
  border-radius: 20px;
  background: #11232c;
  color: #c1d6df;
}
.avatar {
  height: 34px;
  width: 34px;
  border-radius: 50%;
  background: #183540;
  color: var(--accent);
  border: 1px solid #38616e;
}
main {
  max-width: 1410px;
  margin: auto;
  padding: 30px 40px;
  min-height: calc(100vh - 145px);
}
footer {
  max-width: 1410px;
  margin: auto;
  display: flex;
  justify-content: space-between;
  padding: 12px 40px 25px;
  align-items: center;
  color: #5e7b8b;
  font-size: 9px;
  letter-spacing: 2px;
}
.quiet {
  padding: 8px 4px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
}
.quiet:hover {
  color: var(--accent);
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 13px;
}
.subtle {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 0;
  line-height: 1.6;
}
.small {
  font-size: 11px;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 20px;
}
.button-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.primary,
.secondary {
  border-radius: 9px;
  min-height: 41px;
  padding: 11px 17px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.primary {
  background: var(--accent);
  color: #06232c;
  box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.08);
}
.primary:hover {
  filter: brightness(1.1);
}
.secondary {
  border: 1px solid #35525f;
  background: #122731;
  color: #d4e8ef;
}
.secondary:hover {
  border-color: var(--accent);
}
.danger {
  color: #ffb1b1;
}
.file-label {
  cursor: pointer;
  margin: 0;
  color: var(--text);
}
.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  min-height: 252px;
  padding: 36px;
  border: 1px solid #294653;
  border-radius: var(--radius);
  background: radial-gradient(ellipse at 80% 40%, #17404d 0%, #0a1821 65%);
  margin-bottom: 23px;
}
.hero-art {
  position: absolute;
  z-index: -2;
  width: 76%;
  right: -8px;
  top: 0;
  aspect-ratio: 3.03;
  overflow: hidden;
  opacity: 0.8;
  mask-image:
    linear-gradient(to right, transparent 0%, black 23%), linear-gradient(to bottom, black 68%, transparent 100%);
  mask-composite: intersect;
}
.hero-art img {
  width: 100%;
  height: auto;
  display: block;
}
.hero:after {
  position: absolute;
  inset: 0;
  content: '';
  background: linear-gradient(90deg, #0b1b25 1%, #0b1b25d9 25%, transparent 75%);
  z-index: -1;
}
.hero .eyebrow {
  margin-bottom: 18px;
}
.hero h1 {
  font-size: 40px;
  line-height: 1.15;
  max-width: 460px;
  margin-bottom: 14px;
}
.hero p.subtle {
  max-width: 390px;
}
.hero .button-row {
  margin-top: 23px;
}
.hero-tag {
  position: absolute;
  bottom: 25px;
  right: 24px;
  border: 1px solid #5091a24f;
  border-radius: 6px;
  padding: 6px 9px;
  font-size: 8px;
  letter-spacing: 2px;
  color: #9fcbd8;
  background: #0b20299c;
}
.status-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 6px;
  box-shadow: 0 0 10px var(--accent);
}
.preview-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  background: #10242e;
  border: 1px solid #243f4e;
  border-radius: 10px;
  padding: 10px 15px;
  font-size: 11px;
  color: #a7c0ce;
  margin-bottom: 22px;
}
.preview-banner button {
  white-space: nowrap;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 17px;
  margin-bottom: 23px;
}
.stat-card,
.panel {
  background: linear-gradient(135deg, #10212b, #0c1a23);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.stat-card {
  padding: 20px 23px;
  position: relative;
}
.stat-icon {
  position: absolute;
  right: 20px;
  top: 20px;
  color: #577584;
  border: 1px solid #294552;
  border-radius: 10px;
  padding: 8px;
}
.stat-icon svg {
  width: 16px;
  height: 16px;
}
.stat-label {
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 13px;
}
.stat-value {
  font-size: 29px;
  letter-spacing: -1px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.stat-value span {
  color: #7797a7;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
}
.stat-note {
  font-size: 10px;
  color: #8aa7b6;
  margin-top: 9px;
}
.positive {
  color: var(--green);
}
.accent {
  color: var(--accent);
}
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(270px, 1fr);
  gap: 22px;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.panel {
  padding: 24px;
  min-width: 0;
}
.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}
.panel-heading h2 {
  font-size: 17px;
  margin-bottom: 6px;
}
.panel-heading .subtle {
  font-size: 11px;
}
.pill {
  border: 1px solid #33505d;
  border-radius: 7px;
  padding: 6px 8px;
  font-size: 9px;
  letter-spacing: 0.8px;
  color: #adccd8;
  white-space: nowrap;
}
.pill.cyan {
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.06);
  border-color: rgba(var(--accent-rgb), 0.25);
}
.segmented {
  display: flex;
  gap: 3px;
  padding: 4px;
  background: #07151d;
  border: 1px solid #1c3441;
  border-radius: 9px;
  max-width: 100%;
}
.segmented button {
  background: transparent;
  border-radius: 6px;
  color: #8da6b3;
  font-size: 10px;
  padding: 7px 12px;
  min-height: 30px;
}
.segmented button.active {
  color: var(--accent);
  background: #19343e;
}
.weight-summary {
  display: flex;
  align-items: end;
  gap: 16px;
  margin-bottom: 16px;
  min-height: 50px;
}
.weight-summary strong {
  font-size: 34px;
  font-weight: 500;
  letter-spacing: -1px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.weight-summary strong small {
  font-size: 14px;
  color: #91b4c5;
}
.weight-summary > span {
  color: #9db5c2;
  font-size: 11px;
  padding-bottom: 5px;
}
.chart-wrap {
  position: relative;
  min-height: 205px;
}
.chart {
  width: 100%;
  height: auto;
  overflow: visible;
  touch-action: pan-y;
  user-select: none;
}
.chart text {
  font-family: 'Segoe UI', sans-serif;
  fill: #7192a4;
  font-size: 10px;
}
.chart .gridline {
  stroke: #233d4b;
  stroke-dasharray: 3 5;
}
.chart .curve {
  stroke: var(--accent);
  stroke-width: 3;
  fill: none;
  filter: drop-shadow(0 0 5px rgba(var(--accent-rgb), 0.5));
}
.chart .dot {
  fill: #0c202b;
  stroke: var(--accent);
  stroke-width: 2;
}
.chart .selected {
  fill: var(--accent);
  stroke: #dbfdff;
  stroke-width: 2;
}
.chart .hit {
  fill: transparent;
  cursor: pointer;
}
.chart .guide {
  stroke: var(--accent);
  stroke-dasharray: 3 4;
  opacity: 0.4;
}
.chart-caption {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  font-size: 10px;
  color: #6c8b9d;
  padding-top: 8px;
}
.chart-empty {
  height: 210px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px dashed #294553;
  border-radius: 12px;
  color: var(--muted);
  gap: 12px;
}
.chart-empty strong {
  font-size: 16px;
  color: #d4e7f0;
}
.protocol-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-bottom: 17px;
}
.protocol-option {
  border: 1px solid #2c4553;
  border-radius: 11px;
  background: #0a1921;
  text-align: left;
  padding: 14px 12px;
  min-height: 72px;
}
.protocol-option b {
  display: block;
  font-size: 12px;
  margin-bottom: 5px;
}
.protocol-option small {
  font-size: 10px;
  color: #88a9b9;
}
.protocol-option.active {
  border-color: rgba(var(--accent-rgb), 0.65);
  background: rgba(var(--accent-rgb), 0.07);
}
.protocol-option.active b {
  color: var(--accent);
}
.protocol-meta {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #8ba7b6;
  margin-bottom: 13px;
}
.progress-track {
  height: 4px;
  border-radius: 5px;
  background: #213943;
  overflow: hidden;
}
.progress-fill {
  background: var(--accent);
  height: 100%;
  border-radius: 5px;
  transition: width 0.4s;
}
.protocol-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 16px;
}
.text-link {
  background: none;
  color: var(--accent);
  padding: 8px 0;
  font-size: 11px;
}
.nutrition-content {
  display: flex;
  align-items: center;
  gap: 22px;
}
.macro-ring {
  height: 112px;
  width: 112px;
  flex-shrink: 0;
  position: relative;
}
.macro-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.macro-ring .ring-bg {
  fill: none;
  stroke: #203843;
  stroke-width: 7;
}
.macro-ring .ring-value {
  fill: none;
  stroke: var(--accent);
  stroke-width: 7;
  stroke-linecap: round;
  transition: stroke-dasharray 0.5s;
}
.ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.ring-label strong {
  font-size: 22px;
  font-weight: 600;
}
.ring-label small {
  font-size: 9px;
  color: var(--muted);
  margin-top: 4px;
}
.macro-bars {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.macro-line {
  font-size: 10px;
  display: flex;
  justify-content: space-between;
  color: #9cb8c8;
  margin-bottom: 5px;
}
.macro-line strong {
  font-weight: 400;
  color: #d5e7f1;
}
.macro-bars .progress-track {
  height: 3px;
}
.macro-bars .carbs {
  background: #b0c6fb;
}
.macro-bars .fat {
  background: #dfbd83;
}
.empty-note {
  border: 1px dashed #2a4553;
  padding: 22px;
  border-radius: 12px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}
.section-gap {
  margin-top: 22px;
}
.full-width {
  width: 100%;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.data-table th {
  font-size: 10px;
  font-weight: 400;
  color: #7393a4;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.data-table td {
  padding: 15px 10px;
  border-bottom: 1px solid #1b303c;
  font-size: 12px;
}
.data-table tr:last-child td {
  border: 0;
}
.data-table .quiet {
  padding: 6px;
}
.table-scroll {
  overflow-x: auto;
}
.metric-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.measure-value {
  font-size: 30px;
  font-weight: 500;
  color: var(--accent);
  margin: 14px 0 5px;
  letter-spacing: -0.8px;
}
.measure-value small {
  font-size: 13px;
  color: #8dacbc;
}
.date-picker {
  width: 180px;
  padding: 8px;
  font-size: 12px;
  min-height: 38px;
}
.nutrition-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 22px;
}
.goal-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 18px 0;
}
.goal {
  padding: 15px 8px;
  background: #091820;
  border: 1px solid var(--border);
  border-radius: 11px;
  text-align: center;
}
.goal strong {
  display: block;
  font-size: 20px;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 7px;
}
.goal span {
  color: var(--muted);
  font-size: 10px;
}
.routine-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 20px;
}
.exercise-row {
  padding: 16px 0;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}
.exercise-row h3 {
  margin-bottom: 5px;
}
.exercise-num {
  color: #4f7588;
  font-size: 12px;
  margin-right: 15px;
}
.set-chips {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.set-chip {
  border: 1px solid #35515e;
  min-width: 43px;
  min-height: 38px;
  border-radius: 8px;
  background: #0a1922;
  color: #91aebd;
  font-size: 11px;
  padding: 8px;
}
.set-chip.done {
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--accent);
  border-color: var(--accent);
}
.history-item {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 0;
  border-top: 1px solid var(--border);
  font-size: 12px;
}
.history-item small {
  color: var(--muted);
}
.divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}
.studio-controls {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 25px;
}
.studio-controls > label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 25px;
}
.studio-controls input[type='range'] {
  width: 160px;
}
.studio-controls label input {
  margin: 0;
}
.check-row {
  justify-content: flex-start !important;
  gap: 12px !important;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}
.form-error {
  color: #ffb1b1;
  font-size: 12px;
  min-height: 18px;
  margin: 6px 0;
}
.form-help {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 20px;
}
dialog {
  background: #0e202b;
  border: 1px solid #335462;
  color: var(--text);
  border-radius: 21px;
  padding: 28px;
  width: min(470px, calc(100% - 28px));
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 30px 100px #0008;
}
dialog::backdrop {
  background: #020b13b8;
  backdrop-filter: blur(8px);
}
.dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 20px;
  margin-bottom: 22px;
}
.dialog-heading h2 {
  font-size: 25px;
}
.dialog-heading .eyebrow {
  margin-bottom: 8px;
}
.icon-button {
  background: #1d3542;
  color: #c2d8e3;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 22px;
  flex-shrink: 0;
}
.toast {
  position: fixed;
  bottom: 30px;
  left: calc(50% + 100px);
  transform: translate(-50%, 20px);
  padding: 13px 22px;
  border: 1px solid #386472;
  border-radius: 12px;
  background: #16323f;
  color: #d9f8fc;
  font-size: 12px;
  box-shadow: 0 8px 25px #0004;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
  z-index: 100;
  max-width: 90vw;
  text-align: center;
}
.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
.page-enter {
  animation: arrive 0.25s ease-out;
}
@keyframes arrive {
  from {
    opacity: 0.3;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.reduced-motion *,
.reduced-motion *:before,
.reduced-motion *:after {
  transition: none !important;
  animation: none !important;
  scroll-behavior: auto !important;
}
.art-hidden .hero-art {
  display: none;
}
.mobile-brand {
  display: none;
}
.save-warning {
  color: #ffcd94;
}
@media (min-width: 1500px) {
  main {
    padding-top: 38px;
  }
  .hero {
    min-height: 285px;
  }
  .hero h1 {
    font-size: 45px;
  }
  .hero-art {
    width: 72%;
    max-width: 850px;
  }
  .stat-card {
    padding: 24px;
  }
  .chart-wrap {
    min-height: 240px;
  }
}
@media (max-width: 1150px) {
  .sidebar {
    width: 190px;
    padding: 28px 15px;
  }
  .workspace {
    margin-left: 190px;
  }
  .brand {
    font-size: 27px;
  }
  .brand small {
    font-size: 7px;
  }
  .topbar {
    padding: 0 26px;
  }
  main {
    padding: 25px 26px;
  }
  .panel {
    padding: 20px;
  }
  .dashboard-grid {
    grid-template-columns: minmax(0, 1.4fr) minmax(250px, 1fr);
    gap: 16px;
  }
  .panel-heading {
    flex-wrap: wrap;
  }
  .stat-card {
    padding: 18px;
  }
  .stat-icon {
    display: none;
  }
  .nutrition-content {
    gap: 14px;
  }
  .macro-ring {
    width: 93px;
    height: 93px;
  }
  .hero h1 {
    font-size: 35px;
  }
  .hero-art {
    width: 82%;
    right: -70px;
  }
  .metric-list {
    grid-template-columns: repeat(2, 1fr);
  }
  footer {
    padding-left: 26px;
    padding-right: 26px;
  }
}
@media (max-width: 850px) {
  .sidebar {
    width: 76px;
    padding: 28px 12px;
  }
  .workspace {
    margin-left: 76px;
  }
  .brand {
    justify-content: center;
  }
  .brand > span:last-child,
  .nav-caption,
  .nav-link span,
  .sidebar-bottom p,
  .sidebar-bottom .quiet {
    display: none;
  }
  .brand-mark {
    font-size: 34px;
  }
  .nav-link {
    padding: 14px;
    justify-content: center;
  }
  nav {
    margin-top: 40px;
  }
  .sidebar-bottom {
    padding-top: 18px;
  }
  .dragon-sigil {
    font-size: 28px;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .nutrition-grid {
    grid-template-columns: 1fr;
  }
  .hero-art {
    width: 80%;
    right: -20px;
  }
  .hero {
    padding: 28px;
  }
  .stats-grid {
    gap: 12px;
  }
  .stat-card {
    padding: 18px 15px;
  }
  .stat-value {
    font-size: 26px;
  }
  .toast {
    left: calc(50% + 35px);
  }
  .stack {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .stack .panel {
    height: 100%;
  }
  .nutrition-content {
    flex-wrap: wrap;
  }
  .macro-bars {
    min-width: 90px;
  }
  .protocol-option {
    padding: 12px 9px;
  }
  .protocol-option b {
    font-size: 11px;
  }
}
@media (max-width: 600px) {
  .sidebar {
    position: fixed;
    inset: auto 0 0 0;
    width: 100%;
    height: 72px;
    padding: 8px 12px max(8px, env(safe-area-inset-bottom));
    border-right: 0;
    border-top: 1px solid #2b424e;
    background: #0c1b24f5;
    backdrop-filter: blur(18px);
  }
  .sidebar .brand,
  .sidebar-bottom {
    display: none;
  }
  .sidebar nav {
    flex-direction: row;
    margin: 0;
    justify-content: space-around;
    gap: 2px;
  }
  .nav-link {
    flex-direction: column;
    gap: 5px;
    padding: 7px 9px;
    border-radius: 9px;
    flex: 1;
  }
  .nav-link span {
    display: block;
    font-size: 9px;
  }
  .nav-link svg {
    width: 18px;
    height: 18px;
  }
  .workspace {
    margin-left: 0;
    padding-bottom: 75px;
  }
  .topbar {
    height: 65px;
    padding: 0 19px;
  }
  .top-actions {
    gap: 10px;
  }
  .breadcrumb {
    font-size: 10px;
  }
  .breadcrumb > span:first-child {
    margin: 0 8px;
  }
  .mode-pill {
    font-size: 10px;
    padding: 7px 10px;
  }
  .avatar {
    height: 29px;
    width: 29px;
    font-size: 11px;
  }
  main {
    padding: 20px 17px;
  }
  .hero {
    min-height: 310px;
    padding: 24px 23px;
    display: flex;
    justify-content: flex-end;
    flex-direction: column;
  }
  .hero-art {
    width: 100%;
    right: 0;
    top: 0;
    opacity: 0.85;
    mask-image: linear-gradient(to bottom, black 65%, transparent 100%);
  }
  .hero:after {
    background: linear-gradient(to top, #0b1b25 32%, transparent 100%);
  }
  .hero h1 {
    font-size: 32px;
    max-width: 300px;
  }
  .hero .eyebrow {
    font-size: 9px;
    margin-bottom: 10px;
  }
  .hero p.subtle {
    font-size: 12px;
    max-width: 270px;
  }
  .hero .button-row {
    margin-top: 17px;
  }
  .hero-tag {
    display: none;
  }
  .stats-grid {
    gap: 8px;
    margin-bottom: 18px;
  }
  .stat-card {
    padding: 16px 11px;
    border-radius: 13px;
  }
  .stat-label {
    font-size: 9px;
    line-height: 1.4;
    min-height: 24px;
    margin-bottom: 6px;
  }
  .stat-value {
    font-size: 23px;
  }
  .stat-value span {
    font-size: 10px;
  }
  .stat-note {
    font-size: 9px;
    line-height: 1.4;
    min-height: 25px;
  }
  .stack {
    display: flex;
  }
  .panel {
    padding: 20px 17px;
    border-radius: 16px;
  }
  .panel-heading {
    gap: 12px;
    margin-bottom: 18px;
  }
  .panel-heading h2 {
    font-size: 17px;
  }
  .panel-heading .segmented {
    margin-left: auto;
  }
  .segmented button {
    padding: 6px 10px;
  }
  .preview-banner {
    align-items: start;
    padding: 10px 12px;
    font-size: 10px;
    line-height: 1.6;
  }
  .preview-banner button {
    font-size: 10px;
    padding: 0;
  }
  .weight-summary strong {
    font-size: 32px;
  }
  .chart-wrap {
    min-height: 180px;
  }
  .chart-caption {
    font-size: 9px;
  }
  .nutrition-content {
    flex-wrap: nowrap;
    gap: 25px;
  }
  .macro-ring {
    height: 110px;
    width: 110px;
  }
  .page-heading {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
  }
  h1 {
    font-size: 29px;
  }
  .page-heading .primary {
    min-height: 38px;
    padding: 9px 13px;
  }
  .metric-list {
    gap: 12px;
  }
  .metric-list .panel {
    padding: 17px;
  }
  .measure-value {
    font-size: 27px;
  }
  .goal-list {
    gap: 6px;
  }
  .goal {
    padding: 13px 5px;
  }
  .goal strong {
    font-size: 17px;
  }
  .goal span {
    font-size: 9px;
  }
  .exercise-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
  .exercise-row .set-chips {
    margin-left: 27px;
  }
  .routine-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .toast {
    left: 50%;
    bottom: 88px;
    min-width: 200px;
  }
  .data-table td {
    font-size: 11px;
    padding: 13px 7px;
  }
  .data-table th {
    font-size: 9px;
    padding: 10px 7px;
  }
  footer {
    padding: 10px 18px 20px;
    font-size: 7px;
    letter-spacing: 1px;
  }
  .date-picker {
    width: 150px;
  }
  .chart-empty {
    height: 190px;
  }
  .topbar .breadcrumb {
    max-width: 50%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
/* Supplied DEADLYSIN_SEVEN identity and full-art opening screen. */
.brand img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 205px;
  border-radius: 3px;
}
.opening-screen {
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #02090e;
  overflow: auto;
  box-shadow: none;
}
.opening-screen::backdrop {
  background: #02090e;
}
.opening-content {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 22px 24px max(24px, env(safe-area-inset-bottom));
  background: radial-gradient(ellipse at center, #10394780, transparent 70%);
}
.opening-dragon {
  display: block;
  width: auto;
  height: auto;
  max-width: min(100%, 1440px);
  max-height: calc(100dvh - 115px);
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 0 70px #13c8ed12;
}
.opening-enter {
  min-height: 48px;
  padding: 14px 27px;
  letter-spacing: 1px;
  flex-shrink: 0;
  box-shadow: 0 0 30px rgba(var(--accent-rgb), 0.2);
  animation: arrive 0.5s ease-out;
}
@media (max-width: 850px) {
  .sidebar .brand {
    display: none;
  }
  .breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .breadcrumb:before {
    content: '';
    display: block;
    width: 145px;
    height: 28px;
    flex-shrink: 0;
    background: url('assets/deadlysin-seven-logo.png') center/contain no-repeat;
  }
  .breadcrumb {
    font-size: 0;
  }
  .breadcrumb > span {
    display: none;
  }
}
@media (max-width: 600px) {
  .topbar .breadcrumb {
    overflow: visible;
    max-width: 48%;
  }
  .breadcrumb:before {
    width: 145px;
    height: 28px;
  }
  .opening-content {
    padding: 12px;
    gap: 25px;
  }
  .opening-dragon {
    max-height: calc(100dvh - 110px);
    border-radius: 3px;
  }
  .opening-enter {
    font-size: 11px;
  }
}
/* Slow, low-intensity storm illumination; no rapid flashing. */
.opening-content {
  position: relative;
  isolation: isolate;
}
.opening-dragon {
  position: relative;
  z-index: 1;
  animation: dragon-storm 7.5s ease-in-out infinite;
}
.storm-lightning {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(ellipse at 55% 40%, #63eaff30, transparent 58%),
    linear-gradient(112deg, transparent 20%, #69eaff12 40%, transparent 65%);
  mix-blend-mode: screen;
  animation: storm-light 7.5s ease-in-out infinite;
}
.opening-enter {
  position: relative;
  z-index: 3;
}
.opening-screen::backdrop {
  background: transparent;
  backdrop-filter: none;
}
.opening-screen.departing {
  pointer-events: none;
}
.opening-screen.departing .opening-enter {
  opacity: 0;
  transition: opacity 0.2s;
}
@keyframes dragon-storm {
  0%,
  100% {
    filter: brightness(1) saturate(1);
  }
  35% {
    filter: brightness(1.04) saturate(1.03);
  }
  48% {
    filter: brightness(1.16) saturate(1.1);
  }
  65% {
    filter: brightness(1.01) saturate(1.02);
  }
}
@keyframes storm-light {
  0%,
  20%,
  100% {
    opacity: 0;
  }
  46% {
    opacity: 0.85;
  }
  65% {
    opacity: 0.12;
  }
  80% {
    opacity: 0;
  }
}
.reduced-motion .storm-lightning {
  display: none;
}
@media (prefers-reduced-motion: reduce) {
  .storm-lightning {
    display: none;
  }
}
/* Shared DEADLYSIN_SEVEN storm system — every dashboard, journal and form. */
:root {
  --bg: #030b10;
  --panel: #081922;
  --panel-2: #0b2530;
  --border: #244b59;
  --text: #eaf7fc;
  --muted: #a0bac6;
  --radius: 15px;
}
body {
  background:
    radial-gradient(ellipse at 85% 8%, rgba(var(--accent-rgb), var(--glow)), transparent 45%),
    linear-gradient(155deg, #071720, #02080d 80%);
  isolation: isolate;
}
.dashboard-atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background: radial-gradient(ellipse at 95% 45%, rgba(var(--accent-rgb), 0.035), transparent 65%);
}
.dashboard-atmosphere svg {
  width: 100%;
  height: 100%;
  opacity: 0.18;
  filter: drop-shadow(0 0 9px rgba(var(--accent-rgb), 0.55));
}
.ambient-bolts {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.45;
  animation: ambient-storm 14s ease-in-out infinite;
}
@keyframes ambient-storm {
  0%,
  100% {
    opacity: 0.25;
  }
  42% {
    opacity: 0.45;
  }
  50% {
    opacity: 0.9;
  }
  65% {
    opacity: 0.3;
  }
}
.sidebar {
  background: linear-gradient(180deg, #06131bf2, #020a10f5);
  border-right-color: rgba(var(--accent-rgb), 0.25);
  box-shadow: 3px 0 28px #0004;
}
.brand {
  margin-left: -10px;
  margin-right: -10px;
  padding: 10px 0 15px;
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.22);
}
.brand img {
  max-width: none;
  filter: drop-shadow(0 0 8px rgba(var(--accent-rgb), 0.12));
}
.nav-link.active {
  background: linear-gradient(100deg, rgba(var(--accent-rgb), 0.13), rgba(var(--accent-rgb), 0.025));
  box-shadow:
    inset 2px 0 var(--accent),
    0 0 18px rgba(var(--accent-rgb), 0.04);
}
.nav-caption {
  color: #8db3c2;
}
.sidebar-bottom {
  border-color: rgba(var(--accent-rgb), 0.2);
}
.topbar {
  background: #041019b8;
  backdrop-filter: blur(16px);
  border-bottom-color: rgba(var(--accent-rgb), 0.19);
}
.hero,
.storm-page-heading {
  border: 1px solid rgba(var(--accent-rgb), 0.4);
  box-shadow:
    0 0 26px rgba(var(--accent-rgb), 0.065),
    inset 0 1px 0 rgba(var(--accent-rgb), 0.2);
  background: linear-gradient(110deg, #081c28, #041019);
  border-radius: 15px;
}
.hero-art {
  width: 73%;
  right: 0;
  opacity: 0.88;
  aspect-ratio: 3.03;
  mask-image: linear-gradient(to right, transparent, black 35%), linear-gradient(to bottom, black 55%, transparent);
  mask-composite: intersect;
}
.hero:after {
  background: linear-gradient(90deg, #061722 5%, #061722d9 28%, #06172210 76%);
}
.hero h1,
.storm-page-heading h1 {
  color: #eaf8ff;
  text-shadow:
    0 2px 1px #000,
    0 0 28px rgba(var(--accent-rgb), 0.17);
  letter-spacing: -0.6px;
}
.hero .eyebrow,
.storm-page-heading .eyebrow {
  letter-spacing: 2.5px;
  color: var(--accent);
}
.hero-tag {
  border-color: rgba(var(--accent-rgb), 0.33);
  background: #04131bd9;
  color: #bbe5f0;
}
.storm-page-heading {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 170px;
  padding: 28px;
  margin-bottom: 25px;
}
.storm-page-heading > div:not(.page-dragon-art),
.storm-page-heading > button {
  z-index: 1;
  position: relative;
}
.storm-page-heading > div:not(.page-dragon-art) {
  max-width: 70%;
}
.page-dragon-art {
  position: absolute;
  right: 0;
  top: 0;
  width: 62%;
  aspect-ratio: 3.03;
  z-index: -1;
  overflow: hidden;
  opacity: 0.48;
  mask-image: linear-gradient(90deg, transparent, black 55%), linear-gradient(180deg, black 40%, transparent);
  mask-composite: intersect;
}
.page-dragon-art img {
  width: 100%;
  display: block;
  height: auto;
}
.panel,
.stat-card {
  position: relative;
  background: linear-gradient(145deg, #0c222eea, #04121af7);
  border: 1px solid rgba(var(--accent-rgb), 0.25);
  box-shadow:
    inset 0 1px 0 #a7f5ff09,
    0 8px 30px #0003,
    0 0 22px rgba(var(--accent-rgb), 0.025);
  border-radius: 14px;
}
.panel:before,
.stat-card:before {
  content: '';
  pointer-events: none;
  position: absolute;
  top: -1px;
  left: 18px;
  width: 55px;
  height: 1px;
  background: var(--accent);
  box-shadow: 0 0 9px rgba(var(--accent-rgb), 0.6);
}
.panel:after,
.stat-card:after {
  content: '';
  pointer-events: none;
  position: absolute;
  top: 14px;
  right: -1px;
  width: 1px;
  height: 24px;
  background: linear-gradient(transparent, var(--accent), transparent);
  opacity: 0.65;
}
.panel-heading h2 {
  font-weight: 600;
  color: #dcf2fb;
  letter-spacing: 0.2px;
}
.stat-value.accent,
.measure-value,
.weight-summary strong {
  text-shadow: 0 0 18px rgba(var(--accent-rgb), 0.2);
}
.stat-icon {
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.04);
  border-color: rgba(var(--accent-rgb), 0.2);
}
.primary {
  background: linear-gradient(135deg, #c6ffff, var(--accent) 45%, var(--accent));
  border: 1px solid #c5ffff80;
  color: #03212a;
  box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.12);
  letter-spacing: 0.3px;
}
.primary:hover {
  box-shadow: 0 0 27px rgba(var(--accent-rgb), 0.28);
}
.secondary {
  background: linear-gradient(135deg, #123341, #081a25);
  border-color: rgba(var(--accent-rgb), 0.3);
  color: #d6f0fa;
}
.protocol-option {
  background: #061620;
  border-color: rgba(var(--accent-rgb), 0.2);
}
.protocol-option.active {
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.15), #071a23);
  box-shadow: inset 0 0 20px rgba(var(--accent-rgb), 0.035);
  border-color: rgba(var(--accent-rgb), 0.7);
}
.segmented {
  background: #020f17;
  border-color: rgba(var(--accent-rgb), 0.2);
}
.segmented button.active {
  background: rgba(var(--accent-rgb), 0.14);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.14);
}
.chart .gridline {
  stroke: rgba(var(--accent-rgb), 0.15);
}
.chart .curve {
  filter: drop-shadow(0 0 6px rgba(var(--accent-rgb), 0.65));
}
.chart text {
  fill: #96bacb;
}
.preview-banner {
  background: #071e2be8;
  border-color: rgba(var(--accent-rgb), 0.23);
  color: #b2cedb;
}
.progress-track {
  background: #16313e;
}
.progress-fill {
  box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.25);
}
.goal {
  background: #04141e;
  border-color: rgba(var(--accent-rgb), 0.19);
}
.data-table th {
  color: #98bdcf;
  border-bottom-color: rgba(var(--accent-rgb), 0.24);
}
.data-table td {
  border-bottom-color: rgba(var(--accent-rgb), 0.1);
}
.data-table tbody tr:hover {
  background: rgba(var(--accent-rgb), 0.035);
}
input,
select {
  background: #04121b;
  border-color: #315564;
}
input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 14px rgba(var(--accent-rgb), 0.1);
}
dialog:not(.opening-screen) {
  background: linear-gradient(145deg, #0b2633, #04121c);
  border-color: rgba(var(--accent-rgb), 0.45);
  box-shadow:
    0 25px 100px #0009,
    0 0 35px rgba(var(--accent-rgb), 0.08);
}
footer {
  color: #98c2d1;
  border-top: 1px solid rgba(var(--accent-rgb), 0.12);
  margin-top: 15px;
}
footer > span {
  letter-spacing: 2px;
  text-shadow: 0 0 15px rgba(var(--accent-rgb), 0.25);
}
.art-hidden .page-dragon-art {
  display: none;
}
.reduced-motion .ambient-bolts {
  animation: none;
}
@media (max-width: 1150px) {
  .hero-art {
    width: 80%;
    right: -10px;
  }
}
@media (max-width: 850px) {
  .storm-page-heading {
    min-height: 160px;
    padding: 23px;
  }
  .storm-page-heading > div:not(.page-dragon-art) {
    max-width: 100%;
  }
  .page-dragon-art {
    width: 80%;
    opacity: 0.3;
  }
  .sidebar {
    border-right-color: rgba(var(--accent-rgb), 0.25);
  }
}
@media (max-width: 600px) {
  .hero-art {
    width: 100%;
    right: 0;
    opacity: 0.9;
  }
  .hero:after {
    background: linear-gradient(to top, #061722 30%, #06172290 58%, transparent);
  }
  .storm-page-heading {
    min-height: 190px;
    padding: 23px 20px;
    align-content: flex-end;
    gap: 17px;
  }
  .storm-page-heading .eyebrow {
    font-size: 8px;
    letter-spacing: 1.7px;
  }
  .storm-page-heading h1 {
    font-size: 29px;
  }
  .page-dragon-art {
    width: 100%;
    opacity: 0.4;
  }
  .sidebar {
    background: #03131bf2;
    border-top-color: rgba(var(--accent-rgb), 0.35);
  }
  .nav-link.active {
    box-shadow: inset 0 -2px var(--accent);
  }
  .dashboard-atmosphere svg {
    opacity: 0.1;
  }
  .hero-tag {
    display: none;
  }
  .panel,
  .stat-card {
    border-radius: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ambient-bolts {
    animation: none;
  }
}

/* Nutrition catalogue: one dialog scroll, compact source rows. */
#catalogue-results.food-results {
  max-height: none;
  overflow: visible;
}
#catalogue-results .food-result {
  padding: 8px 10px;
}
@media (max-width: 600px) {
  body:has(#journal-day) .toast {
    top: calc(76px + env(safe-area-inset-top));
    bottom: auto;
    max-width: calc(100vw - 32px);
    min-width: 0;
    padding: 8px 12px;
  }
}

/* ===== DS7 v2 components — built on the existing storm tokens (--accent, panels, borders). ===== */
[hidden] {
  display: none !important;
}
:root {
  --warn: #ffcd94;
  --danger: #ff9d9d;
  --series-b: #b9c7ff;
  --series-c: #e6c27f;
  --ok: #6ce7b5;
}
textarea {
  width: 100%;
  background: #04121b;
  color: var(--text);
  border: 1px solid #315564;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  resize: vertical;
  margin-top: 8px;
}
textarea:focus {
  border-color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
[aria-invalid='true'] {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 1px var(--danger);
}
.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 200;
  background: var(--accent);
  color: #03212a;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 600;
}
.skip-link:focus {
  top: 12px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.field-hint {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
}
.check-row.warn {
  color: var(--warn);
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.warn-text {
  color: var(--warn);
}
.down {
  color: var(--ok);
}
.up {
  color: #ffcf9a;
}
.heading-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  z-index: 1;
  position: relative;
}
.small-btn {
  min-height: 34px;
  padding: 7px 13px;
  font-size: 11px;
}
.danger-button {
  background: linear-gradient(135deg, #ffd0d0, #ff8f8f) !important;
  border-color: #ffc4c4 !important;
  color: #3a0909 !important;
}
.tab-row {
  margin: 0 0 20px;
  overflow-x: auto;
}
.tab-row .segmented {
  display: inline-flex;
}
.form-grid.three {
  grid-template-columns: repeat(3, 1fr);
}
.form-grid.four {
  grid-template-columns: 2fr 1fr 1fr 1fr;
}
.measure-grid {
  grid-template-columns: repeat(3, 1fr);
}
dialog.wide {
  width: min(760px, calc(100% - 28px));
}
.confirm-dialog {
  width: min(430px, calc(100% - 28px));
}
.confirm-dialog h2 {
  font-size: 21px;
}
.confirm-actions {
  justify-content: flex-end;
  margin-top: 22px;
}
.summary-list {
  margin: 8px 0 14px;
  padding-left: 18px;
  line-height: 1.8;
}
.inline-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  white-space: nowrap;
}
.inline-label select,
.inline-label input {
  margin: 0;
  min-height: 36px;
  padding: 6px 10px;
  width: auto;
}

/* Top bar quick add */
.quick-add {
  font-size: 11px;
  padding: 8px 13px;
  border: 1px solid rgba(var(--accent-rgb), 0.45);
  border-radius: 20px;
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--accent);
}
.quick-menu {
  position: fixed;
  top: 70px;
  right: 110px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  min-width: 190px;
  padding: 6px;
  background: linear-gradient(145deg, #0b2633, #04121c);
  border: 1px solid rgba(var(--accent-rgb), 0.45);
  border-radius: 12px;
  box-shadow: 0 18px 50px #000a;
}
.quick-menu button {
  background: none;
  text-align: left;
  padding: 11px 12px;
  border-radius: 8px;
  font-size: 12px;
  color: #d6f0fa;
}
.quick-menu button:hover,
.quick-menu button:focus-visible {
  background: rgba(var(--accent-rgb), 0.12);
}
.footer-links {
  display: flex;
  gap: 14px;
  align-items: center;
}

/* Toast with undo, error state */
.toast {
  display: flex;
  align-items: center;
  gap: 16px;
  pointer-events: none;
}
.toast.visible {
  pointer-events: auto;
}
.toast.error {
  border-color: #8a4b4b;
  background: #3a1b1f;
  color: #ffe1e1;
}
.toast-action {
  background: none;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 4px 2px;
  font-size: 12px;
  text-transform: uppercase;
}

/* Rest timer */
.rest-timer {
  position: fixed;
  right: 22px;
  bottom: 24px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #0b2a37, #041620);
  border: 1px solid rgba(var(--accent-rgb), 0.55);
  box-shadow:
    0 10px 40px #000a,
    0 0 24px rgba(var(--accent-rgb), 0.15);
}
.rest-timer strong {
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  min-width: 62px;
}
.rest-label {
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--muted);
}
.rest-name {
  font-size: 11px;
  color: #bcd6e1;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body:has(#rest-timer:not([hidden])) .toast {
  bottom: 96px;
}
.rest-timer.finished {
  animation: pulse 1s ease-in-out 3;
}
.rest-timer.finished strong {
  color: var(--ok);
}
@keyframes pulse {
  50% {
    box-shadow:
      0 0 0 6px rgba(var(--accent-rgb), 0.25),
      0 0 40px rgba(var(--accent-rgb), 0.4);
  }
}

/* Charts */
.chart-tip {
  position: fixed;
  z-index: 120;
  pointer-events: none;
  background: #06202b;
  border: 1px solid rgba(var(--accent-rgb), 0.6);
  color: #e9fbff;
  font-size: 11px;
  padding: 7px 10px;
  border-radius: 8px;
  box-shadow: 0 8px 24px #000a;
  max-width: 280px;
}
.chart .curve.series-b {
  stroke: var(--series-b);
  filter: none;
  stroke-width: 2;
}
.chart .curve.series-c {
  stroke: var(--series-c);
  filter: none;
  stroke-width: 2;
}
.chart .curve.dashed {
  stroke-dasharray: 5 5;
}
.chart .dot {
  r: 3.5;
}
.chart .dot.series-b {
  stroke: var(--series-b);
}
.chart .dot.series-c {
  stroke: var(--series-c);
}
.chart .tip-active {
  fill: var(--accent);
  stroke: #dbfdff;
}
.chart .hit:focus-visible,
.chart .hit-bar:focus-visible {
  outline: none;
  stroke: var(--accent);
  stroke-width: 2;
  fill: rgba(var(--accent-rgb), 0.12);
}
.chart .hit-bar {
  fill: transparent;
  cursor: pointer;
}
.chart .hit-bar:hover {
  fill: rgba(var(--accent-rgb), 0.05);
}
.chart .goal-line {
  stroke: var(--ok);
  stroke-dasharray: 6 6;
  opacity: 0.75;
}
.chart .goal-text {
  fill: var(--ok) !important;
  font-size: 10px;
}
.chart .bar {
  fill: var(--accent);
  opacity: 0.85;
}
.chart .bar-protein {
  fill: var(--accent);
}
.chart .bar-carbs {
  fill: #b0c6fb;
}
.chart .bar-fat {
  fill: #dfbd83;
}
.chart-anim .curve:not(.dashed) {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.chart-anim .area {
  opacity: 0;
  animation: fade 0.7s 0.25s ease-out forwards;
}
.chart-anim .bar {
  transform-box: fill-box;
  transform-origin: bottom;
  animation: grow 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes fade {
  to {
    opacity: 1;
  }
}
@keyframes grow {
  from {
    transform: scaleY(0);
  }
}
.reduced-motion .chart-anim .curve {
  stroke-dashoffset: 0;
  animation: none;
}
.reduced-motion .chart-anim .area {
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  .chart-anim .curve {
    stroke-dashoffset: 0 !important;
  }
  .chart-anim .area {
    opacity: 1 !important;
  }
}
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 10px;
  color: #9cbac8;
  margin-top: 8px;
}
.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.swatch {
  display: inline-block;
  width: 14px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
}
.swatch.series-b {
  background: var(--series-b);
}
.swatch.series-c {
  background: var(--series-c);
}
.swatch.dashed {
  background: repeating-linear-gradient(90deg, currentColor 0 4px, transparent 4px 7px);
  color: var(--series-b);
}
.swatch.series-c.dashed {
  color: var(--series-c);
}
.swatch.goal {
  background: var(--ok);
}
.swatch.bar-protein {
  background: var(--accent);
  height: 9px;
}
.swatch.bar-carbs {
  background: #b0c6fb;
  height: 9px;
}
.swatch.bar-fat {
  background: #dfbd83;
  height: 9px;
}
.swatch.cal-completed {
  background: var(--accent);
  height: 9px;
}
.swatch.cal-partial {
  background: #7fb6c4;
  height: 9px;
}
.swatch.cal-in-progress {
  background: #e6c27f;
  height: 9px;
}
.swatch.cal-skipped {
  background: #6c7f89;
  height: 9px;
}
.swatch.cal-planned {
  background: #b9c7ff;
  height: 9px;
}
.swatch.cal-upcoming {
  background: transparent;
  border: 1px dashed var(--accent);
  height: 9px;
}
.swatch.cal-missed {
  background: #3a4c56;
  height: 9px;
}

/* Dashboard */
.stats-grid.four {
  grid-template-columns: repeat(4, 1fr);
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 17px;
  margin-bottom: 23px;
}
.link-card {
  display: block;
  color: var(--text);
  transition:
    transform 0.18s,
    border-color 0.18s,
    box-shadow 0.18s;
}
.link-card:hover {
  transform: translateY(-2px);
  border-color: rgba(var(--accent-rgb), 0.6);
  box-shadow:
    0 12px 34px #0005,
    0 0 24px rgba(var(--accent-rgb), 0.08);
}
.link-card .eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
}
.link-card .eyebrow svg {
  width: 14px;
  height: 14px;
}
.link-card h3 {
  font-size: 17px;
  margin-bottom: 6px;
}
.link-card .progress-track {
  margin-top: 14px;
}
.kv-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 14px;
}
.kv-list span {
  display: flex;
  flex-direction: column;
  font-size: 10px;
  color: var(--muted);
}
.kv-list b {
  font-size: 16px;
  color: var(--accent);
  font-weight: 500;
}
.pr-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 10px;
  padding: 6px 0;
  border-top: 1px solid rgba(var(--accent-rgb), 0.1);
  font-size: 12px;
}
.pr-line:first-of-type {
  border: 0;
}
.pr-line b {
  color: var(--accent);
  font-weight: 500;
}
.pr-line small {
  grid-column: 1/-1;
  color: var(--muted);
}
.live-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 18px;
  border-radius: 10px;
  border: 1px solid rgba(var(--accent-rgb), 0.55);
  background: rgba(var(--accent-rgb), 0.08);
  font-size: 12px;
  letter-spacing: 0.5px;
}

/* Training */
.program-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 6px 0 16px;
}
.program-meta div {
  background: #04141e;
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  border-radius: 10px;
  padding: 12px;
}
.program-meta span {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 6px;
}
.program-meta strong {
  font-size: 15px;
  font-weight: 600;
}
.program-track {
  height: 5px;
}
.week-nav {
  align-items: center;
}
.week-title {
  flex: 1;
  text-align: center;
}
.week-title h2 {
  margin-bottom: 4px;
}
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.icon-button:disabled {
  opacity: 0.3;
}
.day-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}
.day-card {
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  border-radius: 12px;
  padding: 16px;
  background: #051620;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.day-card.next {
  border-color: rgba(var(--accent-rgb), 0.75);
  box-shadow: inset 0 0 26px rgba(var(--accent-rgb), 0.06);
}
.day-card.status-completed {
  border-color: rgba(108, 231, 181, 0.4);
}
.day-card.status-skipped {
  opacity: 0.65;
}
.day-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}
.day-head h3 {
  margin: 0;
  font-size: 15px;
}
.day-head .eyebrow {
  margin-bottom: 4px;
}
.status-pill {
  font-size: 8px;
}
.rx-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12px;
}
.rx-list li span {
  display: block;
}
.rx-list small {
  color: var(--muted);
}
.ss {
  font-size: 9px;
  color: #03212a;
  background: var(--series-c);
  border-radius: 4px;
  padding: 1px 5px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.day-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: auto;
}
.row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.calendar {
  overflow-x: auto;
}
.cal-head,
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(84px, 1fr));
  gap: 4px;
}
.cal-head span {
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  padding: 6px 0;
}
.cal-cell {
  min-height: 86px;
  border: 1px solid rgba(var(--accent-rgb), 0.12);
  border-radius: 8px;
  padding: 6px;
  background: #04131b;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cal-cell.muted {
  opacity: 0.4;
}
.cal-cell.today {
  border-color: var(--accent);
}
.cal-date {
  font-size: 10px;
  color: var(--muted);
}
.cal-chip {
  font-size: 9px;
  padding: 3px 6px;
  border-radius: 5px;
  background: #1a3440;
  color: #d8eef6;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.cal-chip.completed {
  background: rgba(var(--accent-rgb), 0.25);
  color: #e6fdff;
}
.cal-chip.partial {
  background: #2c5562;
}
.cal-chip.in-progress {
  background: #5a4a24;
  color: #ffe9bb;
}
.cal-chip.skipped {
  background: #26343b;
  color: #8ea2ad;
  text-decoration: line-through;
}
.cal-chip.planned {
  background: #2d3560;
  color: #dfe4ff;
}
.cal-chip.upcoming {
  background: transparent;
  border: 1px dashed rgba(var(--accent-rgb), 0.5);
  color: var(--accent);
}
.library-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: 22px;
}
.filter-row {
  display: grid;
  grid-template-columns: 1fr 170px;
  gap: 10px;
  margin-bottom: 12px;
}
.exercise-list {
  max-height: 620px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: 4px;
}
.exercise-item {
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 9px;
  border: 1px solid transparent;
}
.exercise-item.active {
  border-color: rgba(var(--accent-rgb), 0.5);
  background: rgba(var(--accent-rgb), 0.06);
}
.exercise-open {
  flex: 1;
  background: none;
  text-align: left;
  padding: 9px 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.exercise-open b {
  font-weight: 500;
  font-size: 13px;
}
.exercise-open small {
  color: var(--muted);
}
.star {
  background: none;
  color: #3b5866;
  font-size: 17px;
  padding: 6px;
}
.star.on {
  color: var(--series-c);
  text-shadow: 0 0 10px #e6c27f80;
}
.mini-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.mini-stats > div {
  background: #04141e;
  border: 1px solid rgba(var(--accent-rgb), 0.16);
  border-radius: 10px;
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mini-stats span {
  font-size: 10px;
  color: var(--muted);
}
.mini-stats strong {
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.mini-stats small {
  font-size: 10px;
  color: var(--muted);
  font-weight: 400;
}
.observation {
  margin-top: 12px;
  padding: 10px 12px;
  border-left: 2px solid var(--series-c);
  background: #e6c27f0d;
  color: #f1dcb1;
  font-size: 12px;
  border-radius: 0 8px 8px 0;
}
.exercise-notes {
  white-space: pre-wrap;
  font-size: 12px;
  color: #c4dbe4;
  background: #04141e;
  padding: 10px 12px;
  border-radius: 8px;
  margin-top: 12px;
}
.builder-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.6fr);
  gap: 22px;
  align-items: start;
}
.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0;
}
.facts dt {
  font-size: 10px;
  color: var(--muted);
}
.facts dd {
  margin: 3px 0 0;
  font-size: 13px;
}
.day-name-row {
  display: grid;
  grid-template-columns: 22px 1fr 120px 30px 30px;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}
.day-name-row input,
.day-name-row select {
  margin: 0;
  min-height: 38px;
  padding: 7px 9px;
  font-size: 12px;
}
.phase-row {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(var(--accent-rgb), 0.15);
  border-radius: 10px;
  margin-bottom: 6px;
  padding-right: 6px;
}
.phase-row.active {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.07);
}
.phase-select {
  flex: 1;
  background: none;
  text-align: left;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.phase-select small {
  color: var(--muted);
}
.builder-day {
  border-top: 1px solid rgba(var(--accent-rgb), 0.15);
  padding: 14px 0;
}
.builder-day-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.builder-day-head h3 {
  margin: 0;
}
.rx-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  background: #04131b;
  margin-bottom: 6px;
}
.rx-main {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 12px;
}
.rx-main small {
  color: var(--muted);
}
.rx-actions {
  display: flex;
  gap: 2px;
  align-items: center;
  flex-shrink: 0;
}
.rx-actions .icon-button {
  width: 26px;
  height: 26px;
  font-size: 13px;
}

/* Workout execution */
.workout-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 14px 18px;
  margin-bottom: 18px;
  border-radius: 12px;
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  background: #041620ee;
  backdrop-filter: blur(12px);
}
.workout-bar .eyebrow {
  margin-bottom: 3px;
}
.workout-bar strong {
  font-size: 18px;
}
.workout-bar .progress-track {
  height: 6px;
}
.exercise-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 16px;
}
.exercise-card {
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  border-radius: 14px;
  padding: 18px;
  background: linear-gradient(145deg, #0c222eea, #04121af7);
}
.exercise-card.complete {
  border-color: rgba(108, 231, 181, 0.5);
}
.exercise-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}
.exercise-card-head h3 {
  font-size: 16px;
}
.exercise-card-head p {
  margin: 2px 0;
}
.exercise-status {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-end;
}
.pr-pill {
  color: #ffe6a6;
  border-color: #a58a45;
  background: #3a2f1155;
}
.recommendation {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 10px 0;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 11px;
  background: #0a2a36;
  border: 1px solid rgba(var(--accent-rgb), 0.3);
}
.recommendation.increase {
  border-color: rgba(108, 231, 181, 0.5);
  background: #0b2e2a;
}
.set-table {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.set-row {
  display: grid;
  grid-template-columns: 34px 1fr 1fr 0.8fr 46px;
  gap: 8px;
  align-items: center;
}
.set-row input {
  margin: 0;
  min-height: 42px;
  padding: 8px 10px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: 15px;
}
.set-row input:disabled {
  opacity: 0.7;
}
.set-head {
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  text-align: center;
}
.set-label {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}
.set-row.warmup .set-label {
  color: var(--series-c);
}
.set-row.done input {
  border-color: rgba(var(--accent-rgb), 0.6);
  background: rgba(var(--accent-rgb), 0.07);
}
.set-check {
  height: 42px;
  border-radius: 10px;
  border: 1px solid #35515e;
  background: #0a1922;
  color: #03212a;
  font-size: 18px;
  font-weight: 800;
}
.set-check.on {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 14px rgba(var(--accent-rgb), 0.35);
}
.set-check.skipped {
  border-style: dashed;
  border-color: #8b9da5;
  color: #d4dde0;
  background: #152027;
  box-shadow: none;
}
.set-row.skipped input {
  opacity: 0.65;
}
.set-skip-label {
  grid-column: 1/-1;
  font-size: 11px;
  letter-spacing: 0.09em;
  color: #a9bdc8;
  text-align: right;
}
.notes-label {
  display: block;
  margin-top: 12px;
}
.notes-label textarea {
  min-height: 38px;
}
.exercise-foot {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
  border-top: 1px solid rgba(var(--accent-rgb), 0.12);
  padding-top: 6px;
}
.dismissed-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px dashed #33505d;
  border-radius: 12px;
  color: var(--muted);
  font-size: 12px;
}

/* Nutrition */
.date-nav {
  display: flex;
  gap: 6px;
  align-items: center;
}
.date-nav .date-picker {
  margin: 0;
}
.journal-tools {
  margin: -6px 0 8px;
}
.meal-block {
  border-top: 1px solid rgba(var(--accent-rgb), 0.15);
  padding: 12px 0;
}
.meal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.meal-head h3 {
  margin: 0;
  font-size: 14px;
}
.meal-head .row-actions {
  margin-left: auto;
}
.food-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  font-size: 12px;
}
.food-row small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}
.food-row b {
  font-weight: 500;
}
.progress-fill.water {
  background: #6fb8ff;
}
.recipe-row label {
  margin-bottom: 8px;
}

/* Body */
.metric-card {
  text-align: left;
  color: var(--text);
  cursor: pointer;
}
.metric-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 26px rgba(var(--accent-rgb), 0.12);
}
.history-day {
  padding: 6px 0;
}
.history-day h3 {
  margin: 14px 0 2px;
  font-size: 13px;
  color: var(--accent);
}
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 150px;
  border: 1.5px dashed rgba(var(--accent-rgb), 0.5);
  border-radius: 14px;
  cursor: pointer;
  color: var(--muted);
  text-align: center;
  background: rgba(var(--accent-rgb), 0.03);
  transition:
    background 0.2s,
    border-color 0.2s;
}
.dropzone strong {
  color: var(--text);
  font-size: 16px;
}
.dropzone:hover,
.dropzone.over {
  background: rgba(var(--accent-rgb), 0.09);
  border-color: var(--accent);
}
.dropzone:focus-within {
  outline: 2px solid var(--accent);
}
.import-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.import-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.import-meta h3 {
  margin: 0;
}
.import-thumb {
  width: 120px;
  max-height: 220px;
  object-fit: contain;
  object-position: top;
  border-radius: 8px;
  border: 1px solid #2b4655;
  background: #000;
}
.import-thumb-btn {
  background: none;
  padding: 0;
}
.import-table td {
  vertical-align: top;
}
.import-table input,
.import-table select {
  margin: 0;
  min-height: 36px;
  padding: 6px 8px;
  font-size: 12px;
}
.import-table td:nth-child(3) {
  width: 96px;
}
.import-table td:nth-child(4) {
  width: 90px;
}
.import-notes small {
  display: block;
  line-height: 1.5;
}
.import-table tr.uncertain td {
  background: #e6c27f0a;
}
.import-table tr.dup-duplicate td {
  opacity: 0.7;
}
.ocr-text summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 11px;
}
.ocr-text pre {
  white-space: pre-wrap;
  font-size: 11px;
  max-height: 220px;
  overflow: auto;
  background: #04131b;
  padding: 10px;
  border-radius: 8px;
}
.zoom-image {
  width: 100%;
  border-radius: 8px;
}
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.photo-tile {
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  border-radius: 12px;
  overflow: hidden;
  background: #04131b;
}
.photo-tile.selected {
  border-color: var(--accent);
  box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.25);
}
.photo-select {
  display: block;
  width: 100%;
  padding: 0;
  background: #000;
  aspect-ratio: 3/4;
}
.photo-select img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  font-size: 11px;
}
.photo-meta small {
  color: var(--muted);
}
.photo-meta .quiet {
  align-self: flex-start;
  padding: 4px 0;
}
.compare-view {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
}
.compare-view figure {
  margin: 0;
}
.compare-view img {
  width: 100%;
  border-radius: 10px;
  background: #000;
  min-height: 120px;
}
.compare-view figcaption {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
}
.compare-view > button {
  grid-column: 1/-1;
  justify-self: start;
}
.tag-set {
  border: 0;
  padding: 0;
  margin: 0 0 14px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.tag-set legend {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}
.tag-set .check-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

/* Analytics */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.analytics-grid .span-2 {
  grid-column: span 2;
}
.chip-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.chip {
  font-size: 10px;
  padding: 6px 10px;
  border-radius: 20px;
  background: #061b25;
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  color: #a9c4d0;
}
.chip.active {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.1);
}
.change-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 11px;
  color: #bfd6e0;
  margin-top: 10px;
}
.change-list b {
  font-weight: 500;
  color: var(--muted);
  margin-right: 4px;
}
.muscle-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.muscle-bars > div {
  display: grid;
  grid-template-columns: 110px 1fr 30px;
  gap: 10px;
  align-items: center;
  font-size: 11px;
}
.muscle-bars b {
  text-align: right;
  font-weight: 500;
}
.adherence-bar {
  display: flex;
  height: 14px;
  border-radius: 7px;
  overflow: hidden;
  background: #16313e;
  gap: 2px;
}
.adherence-bar .seg.completed {
  background: var(--accent);
}
.adherence-bar .seg.partial {
  background: #7fb6c4;
}
.adherence-bar .seg.skipped {
  background: #6c7f89;
}
.adherence-bar .seg.missed {
  background: #3a4c56;
}
.adherence-bar .seg.pending {
  background: #3a4c56;
}
.goal-meter {
  display: flex;
  align-items: center;
  gap: 20px;
}
.macro-ring.big {
  width: 130px;
  height: 130px;
}

/* Polish */
.panel,
.stat-card {
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.stat-value {
  font-variant-numeric: tabular-nums;
}
.history-item a {
  color: var(--text);
}
.history-item a:hover {
  color: var(--accent);
}
.note-cell {
  max-width: 220px;
  color: #b6cfda;
}
.empty-note,
.chart-empty {
  min-height: 150px;
  height: auto;
  padding: 24px;
}
.data-table .row-actions {
  justify-content: flex-start;
}
@media (max-width: 1150px) {
  .stats-grid.four {
    grid-template-columns: repeat(2, 1fr);
  }
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .builder-grid,
  .library-grid {
    grid-template-columns: 1fr;
  }
  .program-meta {
    grid-template-columns: repeat(2, 1fr);
  }
  .exercise-cards {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 850px) {
  .analytics-grid {
    grid-template-columns: 1fr;
  }
  .analytics-grid .span-2 {
    grid-column: auto;
  }
  .quick-menu {
    right: 16px;
  }
  .measure-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 600px) {
  .nav-data {
    display: none !important;
  }
  .quick-add {
    padding: 7px 10px;
    font-size: 10px;
  }
  .top-actions {
    gap: 8px;
  }
  .quick-menu {
    top: 62px;
    right: 10px;
  }
  .stats-grid.four {
    grid-template-columns: 1fr 1fr;
  }
  .card-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .form-grid.three,
  .form-grid.four,
  .measure-grid {
    grid-template-columns: 1fr 1fr;
  }
  .day-grid {
    grid-template-columns: 1fr;
  }
  .program-meta {
    grid-template-columns: 1fr 1fr;
  }
  .workout-bar {
    grid-template-columns: 1fr;
    gap: 10px;
    top: 0;
  }
  .workout-bar .button-row {
    justify-content: space-between;
  }
  .exercise-card {
    padding: 14px;
  }
  .exercise-card-head {
    flex-direction: column;
  }
  .exercise-status {
    flex-direction: row;
    align-items: center;
  }
  .set-row {
    grid-template-columns: 28px 1fr 1fr 0.8fr 44px;
    gap: 6px;
  }
  .set-row input {
    font-size: 16px;
    padding: 6px;
  }
  .rest-timer {
    left: 12px;
    right: 12px;
    bottom: 84px;
    justify-content: space-between;
  }
  .food-row {
    grid-template-columns: 1fr auto;
  }
  .food-row .row-actions {
    grid-column: 1/-1;
    justify-content: flex-start;
  }
  .meal-head {
    flex-wrap: wrap;
  }
  .meal-head .row-actions {
    margin-left: 0;
  }
  .rx-row {
    flex-direction: column;
    align-items: stretch;
  }
  .rx-actions {
    justify-content: flex-end;
  }
  .day-name-row {
    grid-template-columns: 22px 1fr 96px 28px 28px;
  }
  .filter-row {
    grid-template-columns: 1fr;
  }
  .compare-view {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .import-head {
    flex-direction: column;
  }
  .import-thumb {
    width: 100%;
    max-height: 260px;
  }
  .heading-actions {
    width: 100%;
  }
  .heading-actions > * {
    flex: 1;
  }
  .history-item {
    flex-wrap: wrap;
  }
  .row-actions {
    justify-content: flex-start;
  }
  .cal-head,
  .cal-grid {
    grid-template-columns: repeat(7, minmax(44px, 1fr));
  }
  .cal-cell {
    min-height: 60px;
    padding: 3px;
  }
  .cal-chip {
    font-size: 8px;
    padding: 2px 3px;
  }
  .muscle-bars > div {
    grid-template-columns: 90px 1fr 26px;
  }
  .toast {
    bottom: 150px;
  }
}

.quick-add,
.mode-pill {
  white-space: nowrap;
}
@media (max-width: 600px) {
  .qa-label {
    display: none;
  }
  .quick-add {
    width: 32px;
    height: 32px;
    padding: 0;
    font-size: 16px;
  }
}
.count {
  font-weight: inherit;
  font-variant-numeric: tabular-nums;
}

/* [PATCH 003] Screenshot import: preview beside the review table + full-screen viewer */
.import-review {
  display: grid;
  grid-template-columns: minmax(200px, 300px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.import-shot {
  position: sticky;
  top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}
.import-shot-btn {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  background: none;
  border: 0;
  cursor: zoom-in;
}
.import-shot-img {
  display: block;
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
  object-position: top;
  border-radius: 10px;
  border: 1px solid #2b4655;
  background: #000;
}
.import-shot-hint {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(5, 16, 22, 0.82);
  color: #7ff3ff;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(127, 243, 255, 0.4);
}
.import-shot-btn:hover .import-shot-img,
.import-shot-btn:focus-visible .import-shot-img {
  border-color: #22d3ee;
}
.import-main {
  min-width: 0;
}
.image-viewer {
  width: min(96vw, 1400px);
  height: 94vh;
  max-width: none;
  max-height: none;
  padding: 0;
  flex-direction: column;
}
.image-viewer[open] {
  display: flex;
}
.viewer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #1d3442;
}
.viewer-bar h2 {
  font-size: 16px;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.viewer-bar .button-row {
  margin: 0;
  flex-wrap: nowrap;
}
.viewer-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}
.viewer-body img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: zoom-in;
}
.image-viewer.actual .viewer-body {
  display: block;
}
.image-viewer.actual .viewer-body img {
  max-width: none;
  max-height: none;
  cursor: zoom-out;
}
@media (max-width: 760px) {
  .import-review {
    grid-template-columns: 1fr;
  }
  .import-shot {
    position: static;
  }
  .import-shot-img {
    max-height: 60vh;
  }
  .image-viewer {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }
}
/* [PATCH 004] Photo category tabs: counts; quick category assignment for old-tag photos */
.tab-count {
  display: inline-block;
  min-width: 18px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(127, 243, 255, 0.14);
  color: #9ff6ff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}
.assign-row {
  gap: 6px;
  margin: 6px 0;
}
.assign-row .small-btn {
  padding: 4px 10px;
  font-size: 12px;
}
/* PATCH 005: compact approved DS7 corner; appearance control retained. */
.ds7-corner {
  padding-top: 14px;
  text-align: center;
  border-color: rgba(var(--accent-rgb), 0.25);
}
.ds7-corner > img {
  display: block;
  width: 100%;
  max-height: 225px;
  object-fit: contain;
  border-radius: 7px;
  filter: drop-shadow(0 0 7px rgba(var(--accent-rgb), 0.1));
}
.ds7-corner #studio-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
  font-size: 10px;
  color: #b9d7e4;
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  padding: 9px 10px;
  border-radius: 6px;
  background: #06131b;
}
.import-source-label {
  display: block;
  color: #e5f6fc;
  font-size: 13px;
  margin-bottom: 6px;
  font-weight: 600;
}
.import-target-label {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin: 0 0 4px;
}
@media (max-width: 850px) {
  .ds7-corner {
    display: none;
  }
}

/* Nutrition food discovery: scoped, scrollable and keyboard accessible. */
.food-discovery-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow-x: auto;
}
.food-discovery-tabs button {
  flex: 1;
  white-space: nowrap;
  min-height: 44px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: inherit;
  padding: 8px 12px;
}
.food-discovery-tabs [aria-selected='true'] {
  background: rgba(73, 233, 245, 0.16);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
#entry-form [role='tabpanel'][hidden] {
  display: none;
}

/* Nutrition-only compact dashboard: journal precedes supporting panels in DOM order. */
.nutrition-page .app-header {
  min-height: 60px;
  margin-bottom: 12px;
}
.nutrition-page .week-strip {
  padding: 8px;
  margin-bottom: 4px;
}
.nutrition-page .week-strip button {
  min-height: 48px;
  padding: 5px;
}
.nutrition-page .week-nav-mini {
  margin-bottom: 10px;
}
.nutrition-page .fuel-grid {
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 20px;
  margin-bottom: 12px;
}
.nutrition-page .cal-ring {
  width: 180px;
}
.nutrition-page .cal-ring .label strong {
  font-size: 28px;
}
.nutrition-page .cal-ring .label span {
  font-size: 12px;
}
.nutrition-page .macro-rows {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.nutrition-page .macro-row {
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 8px;
  min-width: 0;
}
.nutrition-page .macro-icon {
  width: 36px;
  height: 36px;
  font-size: 18px;
  border-radius: 10px;
}
.nutrition-page .macro-row b {
  font-size: 16px;
}
.nutrition-page .macro-row small {
  font-size: 13px;
  overflow-wrap: anywhere;
}
.nutrition-page .action-row {
  margin-bottom: 12px;
  gap: 8px;
}
.nutrition-page .action-btn {
  min-height: 44px;
  padding: 8px;
}
.nutrition-page .action-btn svg {
  width: 20px;
  height: 20px;
}
.nutrition-page .tab-row.section-gap {
  margin-top: 12px;
  margin-bottom: 12px;
}
.nutrition-page .nutrition-journal-grid {
  grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr);
  align-items: start;
}
.nutrition-page .journal-panel,
.nutrition-page .nutrition-support {
  min-width: 0;
}
.nutrition-page .meal-head {
  flex-wrap: wrap;
  gap: 8px;
}
.nutrition-page .meal-head .row-actions {
  margin-left: auto;
}
.nutrition-page .food-row {
  gap: 10px;
}
.nutrition-page .food-row > div {
  min-width: 0;
  overflow-wrap: anywhere;
}
.nutrition-page .food-row small {
  font-size: 13px;
  line-height: 1.5;
}
.nutrition-page .food-row .quiet,
.nutrition-page .meal-head .quiet {
  min-height: 44px;
  min-width: 44px;
}
@media (max-width: 850px) {
  .nutrition-page .nutrition-journal-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 500px) {
  .nutrition-page .app-header {
    margin-bottom: 8px;
    min-height: 52px;
  }
  .nutrition-page .fuel-grid {
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 8px;
  }
  .nutrition-page .cal-ring {
    width: 112px;
  }
  .nutrition-page .cal-ring .label strong {
    font-size: 17px;
  }
  .nutrition-page .cal-ring .label span {
    font-size: 9px;
  }
  .nutrition-page .macro-rows {
    grid-template-columns: 1fr;
    gap: 5px;
  }
  .nutrition-page .macro-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px;
    min-height: 44px;
  }
  .nutrition-page .macro-icon {
    display: none;
  }
  .nutrition-page .macro-row .track {
    grid-column: 1/3;
    height: 4px;
    margin-top: 0;
  }
  .nutrition-page .macro-row b {
    font-size: 12px;
  }
  .nutrition-page .macro-row small {
    font-size: 11px;
  }
  .nutrition-page .journal-panel {
    padding: 14px;
  }
  .nutrition-page .panel-heading {
    flex-wrap: wrap;
    gap: 10px;
  }
  .nutrition-page .food-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .nutrition-page .food-row .row-actions {
    grid-column: 1/-1;
    justify-content: flex-end;
  }
  .food-discovery-tabs button {
    flex: 0 0 auto;
    font-size: 12px;
  }
}

.nutrition-page .action-row .action-btn.stack {
  flex-direction: row;
  gap: 8px;
  min-height: 44px;
  height: auto;
}
@media (min-width: 501px) {
  .nutrition-page .fuel-grid {
    grid-template-columns: 140px minmax(0, 1fr);
  }
  .nutrition-page .cal-ring {
    width: 140px;
  }
  .nutrition-page .cal-ring .label strong {
    font-size: 23px;
  }
  .nutrition-page .cal-ring .label span {
    font-size: 10px;
  }
}

.nutrition-goal-values {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 8px;
  font-size: 12px;
}
.nutrition-goal-values strong {
  display: block;
  color: var(--accent);
  font-size: 18px;
}
.nutrition-goal-schedule {
  border: 1px solid var(--ds7-line);
  border-radius: 12px;
  padding: 14px;
  margin: 12px 0;
}
.nutrition-goal-schedule input {
  min-height: 44px;
  max-width: 100%;
}
.nutrition-goal-history {
  margin: 14px 0;
}
.nutrition-goal-history summary {
  cursor: pointer;
  min-height: 44px;
  padding: 10px 0;
}
#entry-form [data-activate-goal],
#entry-form [data-goal-weeks] {
  min-height: 44px;
}

/* Exercise picker (program editor, workout swaps, restore mapping): clean labels, IDs stay in hidden fields. */
.exercise-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 14px;
  min-width: 0;
}
.xp-label {
  margin: 0;
  font-size: 12px;
  color: var(--ds7-muted);
}
.xp-selected {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  padding: 9px 12px;
  border: 1px solid rgba(var(--accent-rgb), 0.25);
  border-radius: 10px;
  background: rgba(var(--accent-rgb), 0.05);
  font-size: 13px;
}
.xp-selected small {
  color: var(--ds7-muted);
}
.xp-selected-label {
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
}
.xp-search {
  margin: 0;
}
.xp-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
}
.xp-tabs {
  flex-wrap: wrap;
}
.xp-tabs button {
  min-height: 36px;
}
.xp-tabs button:focus-visible,
.xp-option.active {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.xp-muscle {
  flex: 1;
  min-width: 170px;
  margin: 0;
}
.xp-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: min(52vh, 440px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 6px 2px 2px 0;
  border-top: 1px solid var(--ds7-line-soft);
}
.exercise-picker.compact .xp-list {
  max-height: 240px;
}
.xp-heading {
  position: sticky;
  top: -6px;
  z-index: 1;
  margin: 8px 0 2px;
  padding: 6px 0 4px;
  background: var(--ds7-bg-1);
}
.xp-option {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--ds7-line-soft);
  border-radius: 10px;
  background: var(--ds7-panel);
  cursor: pointer;
}
.xp-option small {
  color: var(--ds7-muted);
  font-size: 11px;
}
.xp-option:hover {
  border-color: var(--accent);
}
.xp-option[aria-selected='true'] {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.08);
}
.xp-option[aria-selected='true'] .xp-name::after {
  content: ' ✓';
  color: var(--accent);
}
.xp-extra,
.xp-new {
  border-style: dashed;
}
.xp-detail {
  color: var(--ds7-muted);
  font-size: 12px;
}
.xp-custom {
  margin-left: 6px;
  padding: 2px 6px;
  vertical-align: middle;
}
.xp-count {
  margin: 0;
}
@media (max-width: 480px) {
  .xp-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    max-width: 100%;
  }
  .xp-tabs button {
    white-space: nowrap;
  }
  .xp-muscle {
    min-width: 100%;
  }
  .xp-list {
    max-height: 46vh;
  }
}

/* Scoped to label review; existing Nutrition Tracker layout stays unchanged. */
.label-scan-review {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 20px;
  align-items: start;
}
.label-scan-review > div {
  min-width: 0;
}
.label-photo-wrap {
  max-height: 65vh;
  overflow: auto;
}
.label-photo-wrap img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}
.label-photo-wrap img.enlarged {
  width: 180%;
  max-width: none;
}
.label-reading .missing {
  display: block;
  font-size: 0.75rem;
  line-height: 1.4;
  margin-bottom: 4px;
}
.label-unit-suggestion {
  border: 1px solid #e8b65e;
  border-radius: 8px;
  padding: 10px;
  background: rgba(232, 182, 94, 0.09);
}
@media (max-width: 650px) {
  .label-scan-review {
    grid-template-columns: minmax(0, 1fr);
  }
  .label-photo-wrap {
    max-height: 32vh;
  }
}
.label-basis-warning {
  color: #f3c179;
  border-color: #e8b65e;
  background: rgba(232, 182, 94, 0.09);
}
.label-review-photo-pane img {
  cursor: zoom-in;
}
.label-review-photo-pane img.enlarged {
  cursor: zoom-out;
}
@media (max-width: 650px) {
  .label-scan-review {
    display: block;
  }
  .label-review-photo-pane {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: #081f29;
    border-bottom: 1px solid #247080;
    margin-bottom: 12px;
  }
  .label-review-photo-pane > button {
    flex: 0 0 auto;
    min-height: 44px;
  }
  .label-review-photo-pane .label-photo-wrap {
    flex: 1;
    min-width: 0;
    max-height: 84px;
  }
  .label-review-photo-pane img:not(.enlarged) {
    width: 100%;
    height: 80px;
    object-fit: contain;
  }
  .label-review-photo-pane:has(img.enlarged) {
    display: block;
  }
  .label-review-photo-pane:has(img.enlarged) .label-photo-wrap {
    max-height: 55vh;
  }
  .label-scan-review input,
  .label-scan-review select {
    scroll-margin-top: 130px;
  }
}
/* Speed step 6: table crop outline on the review photo (labels only) */
.label-photo-frame {
  position: relative;
  display: block;
  width: 100%;
}
.label-photo-frame:has(img.enlarged) {
  width: 180%;
}
.label-photo-wrap .label-photo-frame img,
.label-photo-wrap .label-photo-frame img.enlarged {
  display: block;
  width: 100%;
  max-width: none;
}
.label-crop-outline {
  position: absolute;
  border: 2px dashed #49e9f5;
  border-radius: 4px;
  pointer-events: none;
}
.label-crop-note {
  margin: 6px 0 0;
  font-size: 0.8rem;
}
@media (max-width: 650px) {
  .label-review-photo-pane .label-photo-frame:not(:has(img.enlarged)) .label-crop-outline {
    display: none;
  }
}
/* Speed step 7: review photo stays readable while checking fields */
.label-zoom {
  display: none;
}
@media (min-width: 651px) {
  .label-scan-review > div:first-child {
    position: sticky;
    top: 0;
    align-self: start;
    max-height: calc(100vh - 140px);
    overflow: auto;
  }
  .label-photo-wrap {
    max-height: none;
  }
}
@media (max-width: 650px) {
  /* The review dialog scrolls with 28px top padding: stick over that band so nothing shows above the pane. */
  .label-review-photo-pane {
    top: -28px;
    padding-top: 36px;
    flex-wrap: wrap;
  }
  .label-zoom {
    display: block;
    flex: 1;
    min-width: 0;
    height: 112px;
    background-color: #fff;
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    border: 1px solid #247080;
    border-radius: 6px;
  }
  .label-review-photo-pane .label-photo-wrap {
    display: none;
  }
  .label-review-photo-pane:has(img.enlarged) .label-photo-wrap {
    display: block;
  }
  .label-review-photo-pane:has(img.enlarged) .label-zoom {
    display: none;
  }
  .label-review-photo-pane .label-crop-note {
    display: block;
    flex-basis: 100%;
    margin: 0;
    font-size: 0.75rem;
  }
  .label-scan-review input,
  .label-scan-review select {
    scroll-margin-top: 160px;
  }
}

/* ===== DS7 v3 components (reference: Home, Nutrition, Body Stats dashboards). Uses tokens only. ===== */
body {
  font-family: var(--ds7-font-body);
  background:
    radial-gradient(ellipse at 50% -10%, rgba(var(--accent-rgb), calc(0.16 * var(--ds7-glow-scale))), transparent 55%),
    radial-gradient(ellipse at 100% 60%, rgba(var(--accent-rgb), calc(0.06 * var(--ds7-glow-scale))), transparent 50%),
    linear-gradient(180deg, var(--ds7-bg-1), var(--ds7-bg-0) 70%);
}
.ds7-title,
.panel-heading h2,
.page-heading h1,
.stat-label,
.eyebrow {
  font-family: var(--ds7-font-display);
}
.ds7-title {
  font-style: italic;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.panel,
.stat-card {
  border-radius: var(--ds7-radius);
  border-color: var(--ds7-line);
  box-shadow: var(--ds7-glow), var(--ds7-shadow);
}
.panel:focus-within {
  border-color: rgba(var(--accent-rgb), 0.6);
}
button:disabled,
.is-disabled {
  opacity: 0.42;
  cursor: not-allowed;
  filter: grayscale(0.4);
}
.is-loading {
  position: relative;
  color: transparent !important;
}
.is-loading:after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* --- Shared page header: avatar · centered DS7 wordmark · chat --- */
.app-header {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 58px;
  align-items: center;
  gap: clamp(12px, 2vw, 24px);
  min-height: 86px;
  margin: -6px 0 var(--ds7-s5);
}
.app-header > .chat-btn {
  justify-self: end;
}
.avatar-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  padding: 0;
  border: 2px solid var(--ds7-line);
  box-shadow: var(--ds7-glow-sm);
  background: var(--ds7-panel-2) center/cover no-repeat;
  color: var(--accent);
  font: 700 20px var(--ds7-font-display);
  overflow: hidden;
}
.avatar-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.brand-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}
.brand-word {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font: italic 800 clamp(22px, 3.5vw, 42px)/1.05 var(--ds7-font-display);
  letter-spacing: 1.5px;
  white-space: nowrap;
}
.brand-word span {
  background: var(--ds7-silver-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-word b {
  color: var(--accent);
  font-weight: 800;
  text-shadow: 0 0 14px rgba(var(--accent-rgb), 0.6);
}
.brand-word:before,
.brand-word:after {
  content: '';
  width: clamp(16px, 4vw, 64px);
  height: 2px;
  flex-shrink: 1;
  background: linear-gradient(90deg, transparent, var(--accent));
  box-shadow: var(--ds7-glow-sm);
}
.brand-word:after {
  transform: scaleX(-1);
}
.brand-tag {
  font: 600 clamp(9px, 0.9vw, 11px) var(--ds7-font-display);
  letter-spacing: 4px;
  color: var(--ds7-muted);
  white-space: nowrap;
}
.chat-btn {
  width: 52px;
  height: 44px;
  border-radius: 16px;
  border: 1.5px solid var(--ds7-line);
  background: var(--ds7-panel);
  color: var(--ds7-silver);
  box-shadow: var(--ds7-glow-sm);
  display: grid;
  place-items: center;
  position: relative;
}
.chat-btn svg {
  width: 24px;
  height: 24px;
}
.chat-btn .badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: var(--accent);
  color: #032;
  font: 700 10px/18px var(--ds7-font-display);
  padding: 0 5px;
}

/* --- Week strip --- */
.week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  padding: 10px 12px;
  border: 1.5px solid var(--ds7-line);
  border-radius: var(--ds7-radius-lg);
  background: linear-gradient(180deg, var(--ds7-panel-2), var(--ds7-panel));
  box-shadow: var(--ds7-glow);
  margin-bottom: var(--ds7-s4);
}
.week-strip button {
  background: none;
  border-radius: 14px;
  padding: 6px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--ds7-silver-dim);
  font-family: var(--ds7-font-display);
  position: relative;
}
.week-strip small {
  font-size: 12px;
  letter-spacing: 1px;
}
.week-strip b {
  font: italic 700 24px/1.1 var(--ds7-font-display);
  color: var(--ds7-silver);
}
.week-strip button.sel b {
  color: #fff;
  background: rgba(var(--accent-rgb), 0.22);
  border: 1.5px solid var(--accent);
  border-radius: 12px;
  padding: 2px 12px;
  box-shadow: var(--ds7-glow-sm);
}
.week-strip button.sel small {
  color: var(--accent);
}
.week-strip button.today:after {
  content: '';
  position: absolute;
  bottom: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}
.week-strip .dot-row {
  display: flex;
  gap: 3px;
  height: 5px;
}
.week-strip .dot-row i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ds7-teal);
}
.week-strip .dot-row i.w {
  background: var(--accent);
}
.week-strip .dot-row i.f {
  background: var(--ds7-carbs);
}

/* --- Countdown banner --- */
.countdown {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border: 1.5px solid var(--ds7-line);
  border-radius: var(--ds7-radius-lg);
  background: linear-gradient(
    100deg,
    var(--ds7-panel-2),
    var(--ds7-panel) 60%,
    rgba(255, 90, 40, calc(0.12 * var(--ds7-glow-scale)))
  );
  box-shadow: var(--ds7-glow);
  margin-bottom: var(--ds7-s3);
  overflow: hidden;
}
.countdown .slash {
  width: 4px;
  height: 24px;
  background: var(--accent);
  transform: skewX(-18deg);
  box-shadow: var(--ds7-glow-sm);
}
.countdown strong {
  font: italic 700 clamp(16px, 2.2vw, 22px) var(--ds7-font-display);
}
.countdown span {
  color: var(--ds7-muted);
  font-style: italic;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.icon-square {
  width: 44px;
  height: 38px;
  border-radius: 12px;
  border: 1.5px solid var(--accent);
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--accent);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.icon-square svg {
  width: 20px;
  height: 20px;
}

/* --- Program carousel --- */
.carousel {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px 2px 8px;
  scrollbar-width: none;
}
.carousel::-webkit-scrollbar {
  display: none;
}
.program-card {
  flex: 0 0 min(100%, 640px);
  scroll-snap-align: start;
  position: relative;
  min-height: 220px;
  border-radius: var(--ds7-radius-lg);
  border: 1.5px solid var(--ds7-line);
  box-shadow: var(--ds7-glow), var(--ds7-shadow);
  overflow: hidden;
  isolation: isolate;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: var(--text);
}
.program-card .art {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-size: cover;
  background-position: 70% 30%;
  opacity: 0.55;
}
.program-card:after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, #020a10f2 15%, #020a10a0 55%, #020a1020);
}
.program-card .kicker {
  display: flex;
  gap: 10px;
  align-items: center;
  font: italic 800 13px var(--ds7-font-display);
  letter-spacing: 3px;
  color: var(--ds7-silver-dim);
}
.program-card .kicker b {
  color: var(--ds7-silver);
  font-size: 18px;
  letter-spacing: 1px;
}
.program-card h3 {
  font: italic 800 clamp(22px, 3.4vw, 34px)/1.1 var(--ds7-font-display);
  margin: 8px 0 6px;
}
.program-card p {
  color: var(--ds7-silver-dim);
  font-style: italic;
  margin: 0;
}
.up-next {
  position: absolute;
  right: 20px;
  bottom: 22px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 22px;
  border-radius: 14px;
  border: 1.5px solid var(--accent);
  background: rgba(2, 16, 22, 0.75);
  color: var(--accent);
  font: italic 800 15px var(--ds7-font-display);
  letter-spacing: 2px;
  box-shadow: var(--ds7-glow-sm);
}
.up-next:hover {
  background: rgba(var(--accent-rgb), 0.15);
}
.dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 4px 0 var(--ds7-s4);
}
.dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2c4651;
}
.dots i.on {
  background: var(--accent);
  box-shadow: var(--ds7-glow-sm);
}

/* --- Level / points bar --- */
.level-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  margin-bottom: var(--ds7-s4);
  background: none;
  width: 100%;
  text-align: left;
  color: inherit;
  padding: 0;
}
.level-bar .trophy {
  font-size: 30px;
  filter: drop-shadow(0 0 8px rgba(var(--accent-rgb), 0.4));
}
.level-bar .lv {
  font: italic 700 20px var(--ds7-font-display);
  text-align: center;
}
.level-bar .lv em {
  color: var(--accent);
  font-style: italic;
}
.level-track {
  grid-column: 1/-1;
  height: 12px;
  border-radius: 8px;
  border: 1px solid var(--ds7-line);
  background: #071a22;
  overflow: hidden;
}
.level-track i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--ds7-teal), var(--accent));
  box-shadow: var(--ds7-glow-sm);
  transition: width var(--ds7-slow) var(--ds7-ease);
}

/* --- Habit ring --- */
.habit-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 8px 0 var(--ds7-s5);
}
.habit-ring {
  position: relative;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, #0b1e27 58%, transparent 60%);
  display: grid;
  place-items: center;
  text-align: center;
  color: inherit;
}
.habit-ring svg {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
}
.habit-ring circle {
  fill: none;
  stroke-width: 9;
}
.habit-ring .bg {
  stroke: #12313d;
}
.habit-ring .val {
  stroke: var(--accent);
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(var(--accent-rgb), 0.6));
  transition: stroke-dasharray var(--ds7-slow) var(--ds7-ease);
}
.habit-ring strong {
  font: italic 800 46px/1 var(--ds7-font-display);
}
.habit-ring span {
  font: italic 700 16px var(--ds7-font-display);
}
.habit-meta {
  color: var(--ds7-muted);
  font-size: 13px;
}
.habit-switch {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

/* --- Action buttons (3-up) and template tiles --- */
.action-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: var(--ds7-s4);
}
.action-btn {
  min-height: 58px;
  border-radius: 16px;
  border: 1.5px solid var(--ds7-line);
  background: linear-gradient(180deg, var(--ds7-panel-2), var(--ds7-panel));
  box-shadow: var(--ds7-glow);
  color: var(--ds7-silver);
  font: italic 700 15px var(--ds7-font-display);
  letter-spacing: 1px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 10px;
  text-align: center;
  transition:
    transform var(--ds7-fast),
    border-color var(--ds7-fast),
    box-shadow var(--ds7-fast);
}
.action-btn svg {
  width: 24px;
  height: 24px;
  color: var(--accent);
  flex-shrink: 0;
}
.action-btn.stack {
  flex-direction: column;
  gap: 6px;
  min-height: 96px;
}
.action-btn:hover {
  border-color: var(--accent);
  box-shadow: var(--ds7-glow-strong);
}
.action-btn:active {
  transform: scale(0.97);
}
.tile-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: var(--ds7-s5);
}
.tile {
  position: relative;
  min-height: 84px;
  border-radius: 16px;
  border: 1.5px solid var(--ds7-line-soft);
  overflow: hidden;
  isolation: isolate;
  display: grid;
  place-items: center;
  font: italic 800 16px var(--ds7-font-display);
  letter-spacing: 1.5px;
  color: var(--ds7-silver);
  background: var(--ds7-panel);
  box-shadow: var(--ds7-glow);
}
.tile:before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--tile-art, none) center/cover;
  opacity: 0.35;
  filter: grayscale(0.4);
}
.tile.on {
  border-color: var(--accent);
}

/* --- Nutrition: dotted calorie ring + macro rows --- */
.fuel-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 1.1fr;
  gap: var(--ds7-s5);
  align-items: center;
  margin-bottom: var(--ds7-s4);
}
.cal-ring {
  position: relative;
  width: min(100%, 340px);
  aspect-ratio: 1;
  margin: auto;
  background: none;
  padding: 0;
  color: inherit;
}
.cal-ring svg {
  width: 100%;
  height: 100%;
  display: block;
}
.cal-ring .tick {
  stroke: rgba(var(--accent-rgb), 0.25);
  stroke-width: 2.2;
  stroke-linecap: round;
}
.cal-ring .tick.on {
  stroke: var(--accent);
  filter: drop-shadow(0 0 3px rgba(var(--accent-rgb), 0.8));
}
.cal-ring .tick.over {
  stroke: var(--ds7-warn);
}
.cal-ring .core {
  fill: #06161f;
  stroke: rgba(var(--accent-rgb), 0.5);
  stroke-width: 1.5;
}
.cal-ring .label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.cal-ring .label strong {
  font: italic 800 clamp(44px, 7vw, 64px)/1 var(--ds7-font-display);
}
.cal-ring .label span {
  font: italic 600 17px var(--ds7-font-display);
  color: var(--ds7-silver-dim);
  margin-top: 6px;
}
.cal-ring.anim .tick.on {
  animation: tickIn 0.6s var(--ds7-ease) both;
}
@keyframes tickIn {
  from {
    opacity: 0;
  }
}
.macro-rows {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.macro-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 14px;
  align-items: center;
  background: none;
  color: inherit;
  text-align: left;
  padding: 0;
}
.macro-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  border: 1.5px solid var(--ds7-line);
  background: var(--ds7-panel);
  display: grid;
  place-items: center;
  font-size: 24px;
  box-shadow: var(--ds7-glow-sm);
}
.macro-row b {
  font: italic 700 19px var(--ds7-font-display);
}
.macro-row small {
  display: block;
  color: var(--ds7-silver-dim);
  font-size: 14px;
  font-style: italic;
}
.macro-row .track {
  grid-column: 2/4;
  height: 9px;
  border-radius: 6px;
  background: #1a3540;
  overflow: hidden;
  margin-top: -4px;
}
.macro-row .track i {
  display: block;
  height: 100%;
  border-radius: 6px;
  transition: width var(--ds7-slow) var(--ds7-ease);
}
.mr-protein .track i {
  background: var(--ds7-protein);
}
.mr-carbs .track i {
  background: var(--ds7-carbs);
}
.mr-fat .track i {
  background: var(--ds7-fat);
}
.mr-fiber .track i {
  background: var(--ds7-fiber);
}
.section-title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: var(--ds7-s5) 0 var(--ds7-s3);
  font: italic 800 clamp(18px, 2.4vw, 24px) var(--ds7-font-display);
  letter-spacing: 1px;
  text-transform: uppercase;
}
.section-title:before {
  content: '';
  width: 5px;
  height: 24px;
  background: var(--accent);
  transform: skewX(-18deg);
  box-shadow: var(--ds7-glow-sm);
}
.section-title:after {
  content: '';
  flex: 1;
  height: 1.5px;
  background: linear-gradient(90deg, var(--ds7-line), transparent);
}
.section-title .tools {
  order: 3;
  display: flex;
  gap: 8px;
}
.meal-card {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 18px 20px;
  border-radius: var(--ds7-radius);
  border: 1.5px solid var(--ds7-line);
  background: linear-gradient(180deg, var(--ds7-panel-2), var(--ds7-panel));
  box-shadow: var(--ds7-glow);
  margin-bottom: 12px;
}
.meal-card h3 {
  font: italic 700 clamp(17px, 2.2vw, 22px) var(--ds7-font-display);
  margin: 0 0 4px;
}
.meal-card p {
  margin: 0;
  color: var(--ds7-silver-dim);
  font-style: italic;
}
.meal-card.logged {
  opacity: 0.6;
}
.meal-card .round {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  background: none;
  color: var(--accent);
  font-size: 26px;
  box-shadow: var(--ds7-glow-sm);
}
.meal-card .chev {
  background: none;
  color: var(--ds7-silver);
  border-left: 1px solid var(--ds7-line-soft);
  padding: 8px 4px 8px 14px;
  font-size: 18px;
}
.meal-card .items {
  grid-column: 1/-1;
  font-size: 12px;
  color: var(--ds7-muted);
  border-top: 1px solid var(--ds7-line-soft);
  padding-top: 8px;
}
.food-results {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 340px;
  overflow: auto;
  margin: 10px 0;
}
.food-result {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--ds7-line-soft);
  background: var(--ds7-panel);
  color: inherit;
}
.food-result:hover {
  border-color: var(--accent);
}
.food-result small {
  display: block;
  color: var(--ds7-muted);
}
.missing {
  color: var(--ds7-warn);
}
.attribution {
  font-size: 10px;
  color: var(--ds7-muted);
  margin-top: 8px;
}
.scanner {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 4/3;
  margin: 8px 0;
}
.scanner video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.scanner:after {
  content: '';
  position: absolute;
  left: 10%;
  right: 10%;
  top: 50%;
  height: 2px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  animation: scanline 1.8s ease-in-out infinite alternate;
}
@keyframes scanline {
  from {
    transform: translateY(-60px);
  }
  to {
    transform: translateY(60px);
  }
}

/* --- Progress / Body stats --- */
.stats-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 5px;
  border-radius: var(--ds7-radius-pill);
  border: 1.5px solid var(--ds7-line);
  background: var(--ds7-panel);
  box-shadow: var(--ds7-glow);
  margin-bottom: var(--ds7-s4);
}
.stats-tabs button {
  background: none;
  border-radius: var(--ds7-radius-pill);
  padding: 12px;
  font: italic 700 18px var(--ds7-font-display);
  color: var(--ds7-silver-dim);
}
.stats-tabs button.active {
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.55), rgba(var(--accent-rgb), 0.25));
  color: #fff;
  box-shadow: var(--ds7-glow-strong);
}
.stats-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--ds7-s3);
}
.weight-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: 22px 24px 14px;
}
.weight-hero .art {
  position: absolute;
  right: -30px;
  top: -20px;
  width: 58%;
  aspect-ratio: 1.4;
  z-index: -1;
  background-size: 250%;
  background-position: 72% 35%;
  opacity: 0.55;
  -webkit-mask-image: radial-gradient(ellipse at 60% 40%, #000 30%, transparent 70%);
  mask-image: radial-gradient(ellipse at 60% 40%, #000 30%, transparent 70%);
}
.weight-hero .big {
  font: italic 800 clamp(44px, 7vw, 64px)/1 var(--ds7-font-display);
  background: var(--ds7-silver-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.weight-hero .big small {
  font-size: 0.45em;
  -webkit-text-fill-color: var(--ds7-silver-dim);
}
.weight-hero .sub {
  font: italic 600 16px var(--ds7-font-display);
  color: var(--ds7-silver-dim);
}
.weight-hero .sub b {
  color: var(--ds7-ok);
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: var(--ds7-s4);
}
.mcard {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  min-height: 150px;
  padding: 16px;
  border-radius: var(--ds7-radius);
  border: 1.5px solid var(--ds7-line);
  background: linear-gradient(180deg, var(--ds7-panel-2), var(--ds7-panel));
  box-shadow: var(--ds7-glow);
  text-align: left;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
}
.mcard:before {
  content: '';
  position: absolute;
  right: -20%;
  top: -10%;
  width: 80%;
  height: 120%;
  z-index: -1;
  background: var(--mcard-art, none) 60% 30%/260% no-repeat;
  opacity: 0.25;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 60%);
  mask-image: linear-gradient(90deg, transparent, #000 60%);
}
.mcard h3 {
  font: italic 700 16px/1.2 var(--ds7-font-display);
  margin: 0;
  display: flex;
  gap: 8px;
}
.mcard h3:before {
  content: '/';
  color: var(--accent);
}
.mcard .v {
  font: italic 800 32px/1.1 var(--ds7-font-display);
  margin-top: auto;
}
.mcard .v small {
  font-size: 15px;
  color: var(--ds7-silver-dim);
}
.mcard .d {
  font: italic 600 15px var(--ds7-font-display);
}
.d.good {
  color: var(--ds7-ok);
}
.d.bad {
  color: #ffb38a;
}
.d.flat {
  color: var(--ds7-muted);
}
.mcard.empty .v {
  color: var(--ds7-silver-dim);
}
.mcard.empty .d {
  color: var(--ds7-ok);
}
.mcard.dragging {
  opacity: 0.4;
}
.mcard.drop-target {
  outline: 2px dashed var(--accent);
}
.reorder-handle {
  display: none;
}
.reordering .reorder-handle {
  display: flex;
  gap: 4px;
  position: absolute;
  top: 8px;
  right: 8px;
}
.reordering .mcard {
  cursor: grab;
}

/* --- Photos: slider, ghost overlay, framing guide --- */
.ba-slider {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 3/4;
  max-height: 70vh;
  margin: auto;
  user-select: none;
}
.ba-slider img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.ba-slider .after {
  clip-path: inset(0 0 0 var(--split, 50%));
}
.ba-slider .handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--split, 50%);
  width: 2px;
  background: var(--accent);
  box-shadow: var(--ds7-glow-strong);
  pointer-events: none;
}
.ba-slider.ghost .after {
  clip-path: none;
  opacity: var(--ghost, 0.5);
}
.ba-slider.ghost .handle {
  display: none;
}
.frame-guide {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(
      transparent 33%,
      rgba(var(--accent-rgb), 0.35) 33.2%,
      transparent 33.5%,
      transparent 66.5%,
      rgba(var(--accent-rgb), 0.35) 66.7%,
      transparent 67%
    ),
    linear-gradient(90deg, transparent 49.8%, rgba(var(--accent-rgb), 0.5) 50%, transparent 50.2%);
}
.compare-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin: 10px 0;
}
.compare-controls input[type='range'] {
  flex: 1;
  min-width: 160px;
  accent-color: var(--accent);
  padding: 0;
  background: none;
  border: 0;
  min-height: 30px;
}

/* --- Workout v3 --- */
.timer-dock {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 95;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 22px;
  background: linear-gradient(135deg, #0b2a37, #031218);
  border: 1.5px solid var(--ds7-line);
  box-shadow: var(--ds7-shadow), var(--ds7-glow);
}
.timer-ring {
  position: relative;
  width: 64px;
  height: 64px;
}
.timer-ring svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}
.timer-ring circle {
  fill: none;
  stroke-width: 6;
}
.timer-ring .bg {
  stroke: #17323d;
}
.timer-ring .val {
  stroke: var(--accent);
  stroke-linecap: round;
  transition: stroke-dasharray 0.25s linear;
}
.timer-ring strong {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 700 15px var(--ds7-font-display);
  font-variant-numeric: tabular-nums;
}
.timer-dock.paused .val {
  stroke: var(--ds7-warn);
}
.timer-dock.done .val {
  stroke: var(--ds7-ok);
}
.timer-dock.done {
  animation: pulse 1s ease-in-out 3;
}
.timer-btns {
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: 4px;
}
.timer-btns button {
  background: #0f2a35;
  border: 1px solid var(--ds7-line-soft);
  border-radius: 9px;
  padding: 6px 8px;
  font-size: 11px;
  color: var(--ds7-silver);
}
.timer-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 84px;
}
.timer-meta small {
  color: var(--ds7-muted);
  font-size: 10px;
  letter-spacing: 1px;
}
.timer-meta b {
  font-size: 12px;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.session-clock {
  font: italic 700 15px var(--ds7-font-display);
  color: var(--ds7-silver-dim);
  font-variant-numeric: tabular-nums;
}
.set-row.v3 {
  grid-template-columns: 40px minmax(92px, 1.3fr) minmax(70px, 1fr) 56px 46px;
  align-items: center;
}
.stepper {
  display: grid;
  grid-template-columns: 30px 1fr 30px;
  align-items: center;
  gap: 2px;
}
.stepper button {
  height: 42px;
  border-radius: 9px;
  background: #0d2631;
  border: 1px solid var(--ds7-line-soft);
  color: var(--accent);
  font-size: 18px;
  padding: 0;
}
.stepper input {
  min-width: 0;
}
.tech-chip {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-size: 10px;
  letter-spacing: 0.6px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(var(--accent-rgb), 0.45);
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.07);
  text-transform: uppercase;
}
.tech-chip.drop,
.tech-chip.mechdrop {
  color: #ffb38a;
  border-color: #ffb38a66;
}
.tech-chip.restpause,
.tech-chip.myo,
.tech-chip.cluster {
  color: var(--ds7-fat);
  border-color: #e88bff66;
}
.tech-chip.amrap,
.tech-chip.failure {
  color: var(--ds7-warn);
  border-color: #ffcd9466;
}
.segments {
  grid-column: 1/-1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 2px 0 6px 40px;
  padding-left: 12px;
  border-left: 2px dashed var(--ds7-line-soft);
}
.segment {
  display: grid;
  grid-template-columns: 70px 1fr 1fr;
  gap: 6px;
  align-items: center;
  font-size: 11px;
  color: var(--ds7-muted);
}
.segment input {
  min-height: 36px;
  padding: 6px;
  text-align: center;
}
.set-extra {
  grid-column: 1/-1;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 6px 40px;
  font-size: 11px;
  color: var(--ds7-muted);
  align-items: center;
}
.set-extra input,
.set-extra select {
  width: auto;
  min-height: 32px;
  padding: 4px 8px;
  margin: 0;
  font-size: 12px;
}
.quick-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.superset-nav {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px dashed var(--ds7-carbs);
  background: #ffb3470d;
  margin-bottom: 12px;
  font-size: 12px;
}
.superset-group {
  border-left: 3px solid var(--ds7-carbs);
  padding-left: 12px;
}
.plate-view {
  display: flex;
  align-items: center;
  gap: 3px;
  justify-content: center;
  margin: 12px 0;
  min-height: 110px;
}
.plate-view .bar {
  width: 90px;
  height: 10px;
  background: #9aa;
  border-radius: 3px;
}
.plate-view .pl {
  width: 16px;
  border-radius: 3px;
  background: var(--accent);
  box-shadow: var(--ds7-glow-sm);
  display: grid;
  place-items: center;
  font-size: 8px;
  color: #032;
  writing-mode: vertical-rl;
}
.rx-tech {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.drag-handle {
  cursor: grab;
  color: var(--ds7-muted);
  background: none;
  padding: 4px 6px;
  font-size: 16px;
  line-height: 1;
}
.dragging {
  opacity: 0.45;
}
.drop-before {
  box-shadow: 0 -3px 0 var(--accent);
}

/* --- More hub --- */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.hub-card {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 18px;
  border-radius: var(--ds7-radius);
  border: 1.5px solid var(--ds7-line);
  background: linear-gradient(180deg, var(--ds7-panel-2), var(--ds7-panel));
  box-shadow: var(--ds7-glow);
  color: var(--text);
}
.hub-card svg {
  width: 28px;
  height: 28px;
  color: var(--accent);
  flex-shrink: 0;
}
.hub-card b {
  font: italic 700 17px var(--ds7-font-display);
  display: block;
}
.hub-card small {
  color: var(--ds7-muted);
}
.hub-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.scale-input {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.scale-input label {
  margin: 0;
}
.scale-input input {
  display: none;
}
.scale-input span {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--ds7-line-soft);
  background: var(--ds7-panel);
  cursor: pointer;
  color: var(--ds7-silver);
}
.scale-input input:checked + span {
  background: rgba(var(--accent-rgb), 0.25);
  border-color: var(--accent);
  color: #fff;
}
.scale-input input:focus-visible + span {
  outline: 2px solid var(--accent);
}
.rule-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rule {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--ds7-line-soft);
  background: var(--ds7-panel);
}
.rule.flag {
  border-color: var(--ds7-warn);
  background: #ffcd940a;
}
.rule small {
  display: block;
  color: var(--ds7-muted);
  margin-top: 4px;
}
.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}
.badge-tile {
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--ds7-line-soft);
  background: var(--ds7-panel);
  text-align: center;
  opacity: 0.5;
}
.badge-tile.got {
  opacity: 1;
  border-color: var(--accent);
  box-shadow: var(--ds7-glow);
}
.badge-tile .ico {
  font-size: 30px;
}
.badge-tile b {
  display: block;
  font: italic 700 14px var(--ds7-font-display);
  margin: 6px 0 2px;
}
.badge-tile small {
  color: var(--ds7-muted);
}
.badge-tile .badge-progress {
  display: block;
  margin-top: 4px;
}

/* --- Navigation: floating pill bar on phones (reference) --- */
@media (max-width: 600px) {
  .sidebar {
    left: 12px;
    right: 12px;
    bottom: max(10px, env(safe-area-inset-bottom));
    width: auto;
    height: 70px;
    border-radius: 30px;
    border: 1.5px solid var(--ds7-line) !important;
    box-shadow:
      var(--ds7-glow),
      0 10px 30px #000c;
    padding: 6px 10px;
  }
  .nav-link {
    border-radius: 18px;
  }
  .nav-link span {
    font-size: 9px;
  }
  .nav-link.active {
    box-shadow: inset 0 -3px var(--accent) !important;
    background: rgba(var(--accent-rgb), 0.1);
  }
  .workspace {
    padding-bottom: 96px;
  }
  .app-header {
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    gap: 8px;
    min-height: 64px;
  }
  .avatar-btn {
    width: 48px;
    height: 48px;
  }
  .chat-btn {
    width: 46px;
    height: 40px;
  }
  .brand-center {
    gap: 6px;
  }
  .brand-word {
    font-size: clamp(13px, 4.3vw, 23px);
    gap: 5px;
    letter-spacing: 0.5px;
  }
  .brand-word:before,
  .brand-word:after {
    display: none;
  }
  .brand-tag {
    font-size: 7px;
    letter-spacing: 1.8px;
  }
  .week-strip b {
    font-size: 20px;
  }
  .week-strip small {
    font-size: 10px;
  }
  .program-card {
    min-height: 200px;
    padding: 18px;
  }
  .up-next {
    right: 14px;
    bottom: 16px;
    padding: 9px 14px;
    font-size: 13px;
  }
  .action-btn {
    font-size: 12px;
    min-height: 50px;
    padding: 6px;
  }
  .action-btn.stack {
    min-height: 84px;
  }
  .tile {
    min-height: 70px;
    font-size: 13px;
  }
  .fuel-grid {
    grid-template-columns: 1fr;
  }
  .cal-ring {
    width: min(78vw, 300px);
  }
  .meal-card {
    padding: 14px;
  }
  .metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .mcard {
    min-height: 128px;
  }
  .mcard .v {
    font-size: 26px;
  }
  .timer-dock {
    left: 12px;
    right: 12px;
    bottom: 92px;
    justify-content: space-between;
    flex-wrap: wrap;
  }
  .set-row.v3 {
    grid-template-columns: 30px minmax(96px, 1.4fr) minmax(56px, 1fr) 46px 42px;
    gap: 4px;
  }
  .segments,
  .set-extra {
    margin-left: 12px;
  }
  .stats-tabs button {
    font-size: 15px;
    padding: 10px;
  }
}
@media (max-width: 380px) {
  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }
  .action-row {
    gap: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .scanner:after {
    animation: none;
  }
  .cal-ring.anim .tick.on {
    animation: none;
  }
}
.reduced-motion .scanner:after,
.reduced-motion .cal-ring .tick {
  animation: none !important;
}

.chart .end-label rect {
  fill: #0a3a3a;
  stroke: var(--ds7-ok);
  stroke-width: 1.5;
  filter: drop-shadow(0 0 6px rgba(108, 231, 181, 0.35));
}
.chart .end-label text {
  fill: #eafff6 !important;
  font-size: 12px !important;
  font-weight: 700;
}
.weight-hero .chart .curve {
  stroke: var(--ds7-ok);
}
.weight-hero .chart .dot {
  stroke: var(--ds7-ok);
}
.weight-hero .chart .area {
  fill: url(#fill-200);
  opacity: 0.6;
}
.week-nav-mini {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: -8px 0 14px;
}
.stats-tabs a {
  border-radius: var(--ds7-radius-pill);
  padding: 12px;
  font: italic 700 18px var(--ds7-font-display);
  color: var(--ds7-silver-dim);
  text-align: center;
}
.stats-tabs a.active {
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.55), rgba(var(--accent-rgb), 0.25));
  color: #fff;
  box-shadow: var(--ds7-glow-strong);
}
@media (max-width: 600px) {
  .stats-tabs a {
    font-size: 15px;
    padding: 10px;
  }
}
.stats-tabs {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  overflow-x: auto;
  max-width: 100%;
  margin-top: 16px;
  scrollbar-width: thin;
}
.stats-tabs a {
  white-space: nowrap;
}
.stats-tabs a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -3px;
}
/* fixes after visual check */
.countdown span {
  flex: initial;
}
.countdown > span:not(.slash):not(.icon-square) {
  flex: 1;
  min-width: 0;
}
.program-card .art {
  background-size: 175%;
  background-position: 38% 12%;
}
@media (max-width: 600px) {
  body.has-app-header .topbar {
    display: none;
  }
  body.has-app-header main {
    padding-top: 14px;
  }
}
@media (max-width: 600px) {
  .tile {
    font-size: 12px;
    letter-spacing: 0.3px;
    padding: 0 4px;
  }
}
.mcard:before {
  background-position: 30% 8%;
}
.weight-hero .art {
  background-position: 38% 10%;
}
@media (max-width: 600px) {
  .chart text {
    font-size: 17px;
  }
  .chart .end-label text {
    font-size: 13px !important;
  }
}

/* U4: after today's workout, the next day and a free workout stay one tap away on Home's program card */
.program-card .up-next-more {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 56px;
}
.program-card .up-next-more .small-btn {
  min-height: 44px;
}
/* U10: the load unit is stated on every live workout */
.workout-bar .unit-note {
  margin: 6px 0 0;
  color: var(--muted, #9fb3c8);
}

/* BETA-058 / U8 / U9: touch targets of at least 44 px, and the rest timer never covers the set you are on */
.timer-btns button {
  min-width: 44px;
  min-height: 44px;
  font-size: 13px;
}
body.timer-on main {
  padding-bottom: calc(var(--timer-space, 0px) + 96px);
}
html:has(body.timer-on) {
  scroll-padding-bottom: calc(var(--timer-space, 0px) + 96px);
}
.set-check {
  min-height: 44px;
  min-width: 44px;
}
@media (max-width: 600px) {
  .quick-add {
    width: 44px;
    height: 44px;
  }
  .timer-dock {
    flex-wrap: nowrap;
    gap: 8px;
    padding: 10px;
    align-items: center;
  }
  .timer-dock .timer-ring {
    width: 56px;
    height: 56px;
    flex: none;
  }
  .timer-dock .timer-meta {
    min-width: 0;
    flex: 1 1 auto;
  }
  .timer-dock .timer-btns {
    grid-template-columns: repeat(4, 44px);
    gap: 4px;
    flex: none;
  }
  .timer-dock .timer-btns button {
    padding: 0;
  }
  .rx-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .rx-actions > button {
    min-height: 44px;
    min-width: 44px;
    flex: 1 1 0;
    padding: 0 4px;
  }
  /* stacked rows: flex sizes would become heights here */
  .ds7-programs .rx-row > .rx-main,
  .ds7-programs .rx-row > .rx-actions {
    flex: 0 0 auto;
  }
  .rx-actions > button.danger {
    flex: 0 0 44px;
    margin-left: auto;
  } /* remove sits apart, at the end */
}

/* Program builder: collapsible sections, superset switch and left/right option (DS7 tokens only) */
#entry-form :is(.rx-advanced, .day-rest) {
  border: 1px solid var(--ds7-line-soft, #24414d);
  border-radius: 12px;
  padding: 0 14px;
  margin: 12px 0;
  background: #04131b;
}
#entry-form :is(.rx-advanced, .day-rest)[open] {
  padding-bottom: 12px;
}
#entry-form :is(.rx-advanced, .day-rest) > summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #c6dfe9;
  font-size: 13px;
}
#entry-form :is(.rx-advanced, .day-rest) > summary b {
  color: var(--accent);
}
#entry-form .rx-sides {
  margin: 6px 0 4px;
}
#entry-form .rx-sides .check-row,
#entry-form .rx-switch {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
}
#entry-form .rx-switch input {
  appearance: none;
  width: 42px;
  height: 24px;
  border-radius: 12px;
  background: #17323d;
  border: 1px solid var(--ds7-line-soft, #24414d);
  position: relative;
  margin-right: 8px;
  cursor: pointer;
  flex: none;
}
#entry-form .rx-switch input::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #9fb3c8;
  transition: left 0.15s;
}
#entry-form .rx-switch input:checked {
  background: rgba(var(--accent-rgb), 0.35);
  border-color: var(--accent);
}
#entry-form .rx-switch input:checked::after {
  left: 20px;
  background: var(--accent);
}
#entry-form .rx-switch input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Workout plan CSV import preview */
#entry-form .csv-errors {
  border: 1px solid var(--ds7-warn, #e0a63a);
  border-radius: 12px;
  padding: 10px 14px;
  background: #1d1408;
  margin: 10px 0;
}
#entry-form .csv-errors ul,
#entry-form .csv-warnings ul {
  margin: 6px 0 0;
  padding-left: 18px;
  font-size: 12px;
  line-height: 1.6;
}
#entry-form .csv-review {
  border: 1px solid var(--ds7-line-soft, #24414d);
  border-radius: 12px;
  padding: 8px 14px;
  background: #04131b;
  margin: 12px 0;
}
#entry-form .csv-review-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
#entry-form .csv-confirms {
  border: 1px solid var(--ds7-warn, #e0a63a);
  border-radius: 12px;
  padding: 8px 14px;
  background: #1d1408;
  margin: 12px 0;
}
#entry-form .csv-confirms .check-row {
  align-items: flex-start;
  gap: 8px;
  min-height: 44px;
  font-size: 13px;
}
#entry-form .csv-review-item {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid rgba(var(--accent-rgb), 0.12);
}
#entry-form .csv-review-item .row-actions button {
  min-height: 44px;
}
#entry-form .csv-block {
  margin: 12px 0;
}
#entry-form .csv-day {
  margin: 6px 0 10px;
}
#entry-form .csv-day ol {
  margin: 4px 0 0;
  padding-left: 20px;
  font-size: 13px;
  line-height: 1.5;
}
#entry-form .csv-superset {
  border-inline-start: 2px solid var(--accent);
  margin-block: 6px;
  padding-inline-start: 8px;
}
#entry-form .csv-skipped {
  opacity: 0.55;
  text-decoration: line-through;
}
.program-file-actions {
  flex-wrap: wrap;
  gap: 10px 16px;
}
.program-file-actions .text-link,
.program-file-actions .file-label {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
/* BETA-066: long unbroken text (names, notes, file names) wraps inside the import and export dialogs */
#entry-form
  :is(
    .csv-file,
    .csv-errors,
    .csv-warnings,
    .csv-review,
    .csv-confirms,
    .csv-block,
    .csv-day,
    .csv-day li,
    .warn-text
  ) {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}
#entry-form .csv-review-item > div:first-child {
  min-width: 0;
  flex: 1 1 180px;
  overflow-wrap: anywhere;
}
#entry-form .csv-confirms .check-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}
#entry-form .csv-omissions {
  margin: 4px 0 10px;
  padding-left: 18px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
#entry-form .csv-length {
  font-size: 18px;
  margin: 10px 0 4px;
  color: var(--accent);
}
/* BETA-067: tempo badge (compact, cyan) by the set table; small inline version in program lists */
.tempo-badge-row {
  position: sticky;
  top: calc(var(--workout-bar-h, 0px) + 6px);
  z-index: 3;
  align-self: flex-start;
  max-width: 100%;
  pointer-events: none;
}
.tempo-badge-row .tempo-badge-wrap {
  pointer-events: auto;
}
.tempo-badge-row.is-stuck .tempo-badge-wrap {
  pointer-events: none;
}
.tempo-badge-row.is-stuck .tempo-help {
  display: none;
}
.tempo-badge-wrap {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  vertical-align: middle;
}
.tempo-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: #062330;
  color: var(--accent);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  cursor: help;
  box-shadow: 0 2px 10px #0008;
}
.tempo-badge::before {
  content: '';
  position: absolute;
  inset: -6px -2px;
}
.tempo-badge .tempo-badge-label {
  color: #d5ecf4;
  font-weight: 500;
}
.tempo-badge b {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.4px;
}
.tempo-badge:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.tempo-help {
  display: none;
  max-width: min(320px, 100%);
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--ds7-line-soft, #24414d);
  background: #071a22;
  color: #e2f3f9;
  font-size: 13px;
  line-height: 1.35;
  box-shadow: 0 2px 10px #0008;
}
.tempo-badge:hover + .tempo-help,
.tempo-badge:focus + .tempo-help,
.tempo-badge[aria-expanded='true'] + .tempo-help {
  display: inline-block;
}
.tempo-badge-wrap.compact .tempo-badge {
  min-height: 0;
  padding: 2px 9px;
  font-size: 13px;
  box-shadow: none;
}
.tempo-badge-wrap.compact .tempo-badge::before {
  inset: -12px -2px;
}

/* DS7 superset day-partner dropdown (guided new-exercise flow). */
#entry-form .rx-superset-partner {
  display: block;
  width: 100%;
  min-width: 0;
  margin: 8px 0 12px;
}
#entry-form .rx-superset-partner > label {
  display: block;
  width: 100%;
}
#entry-form .rx-superset-partner select {
  display: block;
  width: 100%;
  max-width: 100%;
}
#entry-form .rx-superset-partner .form-help {
  margin-top: 9px;
  margin-bottom: 8px;
  line-height: 1.6;
}
#entry-form .rx-superset-partner[hidden] {
  display: none;
}
.ds7-training-premium .ds7-how-to {
  min-height: 44px;
  padding: 8px 10px;
  color: var(--accent);
  font-size: 12px;
}
.ds7-training-premium .exercise-item .ds7-how-to {
  flex: none;
}
.ds7-training-premium .exercise-card-head .ds7-how-to {
  margin-top: 8px;
}
#exercise-instructions {
  width: min(425px, calc(100% - 24px));
  max-height: 78dvh;
  padding: 0;
  overflow-wrap: anywhere;
}
#exercise-instructions .dialog-heading {
  position: sticky;
  top: 0;
  gap: 12px;
  margin: 0;
  padding: 16px 18px;
  background: #0e202b;
  border-bottom: 1px solid var(--border);
}
#exercise-instructions .dialog-heading h2 {
  font-size: 20px;
}
#exercise-instructions [data-close] {
  min-height: 44px;
}
#exercise-instructions-body {
  padding: 16px 18px;
  line-height: 1.55;
}
#exercise-instructions-body ol {
  margin: 0;
  padding-inline-start: 20px;
}
#exercise-instructions-body li + li,
#exercise-instructions-body ol + p {
  margin-top: 8px;
}

/* Programs only. No global theme, dashboard, history, nutrition or quick-workout selectors. */
.ds7-programs {
  --program-edge: rgba(var(--accent-rgb), 0.48);
  --program-silver: #dbe6ea;
  min-width: 0;
  isolation: isolate;
}
.ds7-programs :where(h1, h2, h3, p) {
  overflow-wrap: anywhere;
}
.ds7-programs :where(button, a, input, select, textarea):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.ds7-programs :where(button, .primary, .secondary, .quiet, .icon-button) {
  min-height: 44px;
}
.ds7-programs .icon-button {
  width: 44px;
  height: 44px;
}
.ds7-programs :where(.primary, .secondary) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-decoration: none;
}
.ds7-programs .ds7-program-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.ds7-programs .ds7-program-topline h2 {
  margin: 0;
  font-size: 22px;
  color: var(--program-silver);
}
.ds7-programs .ds7-program-topline .eyebrow {
  margin: 0 0 5px;
  font-size: 10px;
  letter-spacing: 3px;
}
.ds7-programs .tab-row {
  margin: 16px 0 24px;
}
.ds7-programs .tab-row .segmented {
  max-width: 100%;
  flex-wrap: wrap;
}
.ds7-programs .tab-row button {
  min-height: 44px;
  padding-inline: 18px;
}
.ds7-programs .ds7-program-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 270px;
  border: 1px solid var(--program-edge);
  border-radius: 24px 6px 24px 6px;
  box-shadow:
    0 16px 40px #0006,
    0 0 18px rgba(var(--accent-rgb), 0.1);
  display: flex;
  align-items: center;
  background: #030d13;
}
.ds7-programs .ds7-program-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 22%;
  z-index: -2;
  opacity: 0.72;
}
.ds7-programs .ds7-program-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, #020b12f5 5%, #031019e6 33%, #03101942 77%),
    linear-gradient(0deg, #020b12ba, transparent 80%);
}
.ds7-programs .ds7-program-hero::after {
  content: '';
  position: absolute;
  width: 90px;
  height: 2px;
  left: 30px;
  bottom: 0;
  background: var(--accent);
  box-shadow: 0 0 18px var(--accent);
}
.ds7-programs .ds7-program-hero-content {
  width: 100%;
  padding: 30px 36px;
  max-width: 870px;
}
.ds7-programs .ds7-program-brand {
  margin: 0 0 30px;
  color: var(--program-silver);
  font: 800 14px var(--ds7-font-display);
  letter-spacing: 3px;
}
.ds7-programs .ds7-program-brand b {
  color: var(--accent);
}
.ds7-programs .ds7-program-brand span {
  display: block;
  font-size: 8px;
  letter-spacing: 5px;
  color: var(--accent);
  margin-top: 6px;
}
.ds7-programs .ds7-program-kicker {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 2.5px;
  font-size: 10px;
  font-weight: 700;
  margin: 0 0 8px;
}
.ds7-programs .ds7-program-hero h1 {
  font: 800 clamp(26px, 3.5vw, 42px)/1.13 var(--ds7-font-display);
  color: var(--program-silver);
  text-shadow: 0 2px 4px #000;
  letter-spacing: -0.6px;
  margin: 0 0 12px;
  max-width: 700px;
}
.ds7-programs .ds7-program-subtitle {
  color: #b1c6d0;
  margin: 0 0 22px;
  max-width: 530px;
  line-height: 1.6;
}
.ds7-programs .ds7-program-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.ds7-programs .ds7-program-cta {
  border-radius: 12px 3px 12px 3px;
  box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.25);
  font-weight: 800;
  min-width: 200px;
}
.ds7-programs .ds7-program-tabs {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  border-bottom: 1px solid var(--program-edge);
  gap: 26px;
  margin: 0 0 26px;
  padding: 0 12px;
}
.ds7-programs .ds7-program-tabs > a {
  position: relative;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9cb0bb;
  font: 700 13px var(--ds7-font-display);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0 16px;
}
.ds7-programs .ds7-program-tabs > a[aria-current] {
  color: var(--program-silver);
}
.ds7-programs .ds7-program-tabs > a[aria-current]::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}
.ds7-programs .ds7-program-tabs .ds7-program-library-link {
  margin-left: auto;
  text-transform: none;
  font-size: 11px;
  letter-spacing: 0;
  gap: 8px;
  padding-inline: 4px;
}
.ds7-programs .ds7-program-library-link svg {
  width: 18px;
  height: 18px;
}
.ds7-programs .panel {
  border-radius: 18px 5px 18px 5px;
  background: linear-gradient(130deg, #0b2029e8, #030d14f5);
  border-color: rgba(var(--accent-rgb), 0.3);
  box-shadow:
    inset 0 1px 0 #cdeaff0d,
    0 8px 26px #0004;
}
.ds7-programs .ds7-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.ds7-programs .ds7-program-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid var(--program-edge);
  padding-bottom: 22px;
  margin-bottom: 24px;
  gap: 12px;
}
.ds7-programs .ds7-program-facts > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-right: 1px solid #7ed9ed26;
  padding-left: 12px;
}
.ds7-programs .ds7-program-facts > div:last-child {
  border: 0;
}
.ds7-programs .ds7-program-facts strong {
  font: 800 34px/1 var(--ds7-font-display);
  color: var(--program-silver);
}
.ds7-programs .ds7-program-facts span {
  color: #8da8b6;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.8px;
}
.ds7-programs .ds7-program-description {
  color: #c6d7df;
  line-height: 1.7;
  white-space: pre-line;
  margin: 0 0 24px;
}
.ds7-programs .program-meta {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 16px;
}
.ds7-programs .program-meta strong {
  font-size: 15px;
  color: #cee2eb;
}
.ds7-programs .program-meta span {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
}
.ds7-programs .ds7-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
}
.ds7-programs .ds7-section-heading h2 {
  font: 700 21px var(--ds7-font-display);
  color: var(--program-silver);
  margin: 4px 0 0;
}
.ds7-programs .ds7-section-heading .eyebrow {
  font-size: 9px;
  letter-spacing: 2px;
  margin: 0;
  color: var(--accent);
}
.ds7-programs .ds7-equipment .ds7-section-heading {
  display: block;
}
.ds7-programs .ds7-equipment-review {
  margin-top: 14px;
  color: #ffcd94;
  overflow-wrap: anywhere;
}
.ds7-programs .ds7-equipment-review ul {
  margin: 4px 0 0;
  padding-inline-start: 20px;
}
.ds7-programs .ds7-equipment-grid {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 10px;
}
.ds7-programs .ds7-equipment-grid li {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 100px;
  padding: 14px 8px;
  border: 1px solid rgba(var(--accent-rgb), 0.25);
  border-radius: 12px 3px 12px 3px;
  background: linear-gradient(150deg, #133d494a, #031018);
  box-shadow: inset 0 1px 10px #6feeff0a;
  text-align: center;
}
.ds7-programs .ds7-equipment-grid svg {
  height: 32px;
  width: 32px;
  color: var(--accent);
}
.ds7-programs .ds7-equipment-grid span {
  font-size: 10px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #c9dde6;
  font-weight: 700;
}
.ds7-programs .ds7-program-roadmap {
  grid-column: 1/-1;
}
.ds7-programs .ds7-phase-preview {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 78px;
  border-top: 1px solid #61b6d122;
  color: #dbe9ef;
  text-decoration: none;
  padding: 12px 8px;
}
.ds7-programs .ds7-phase-preview > span:nth-child(2) {
  flex: 1;
}
.ds7-programs .ds7-phase-preview small {
  display: block;
  color: #8daab9;
  font-size: 11px;
  margin-top: 4px;
}
.ds7-programs .ds7-phase-number {
  font: 700 20px var(--ds7-font-display);
  color: var(--accent);
  border: 1px solid #59e4ee44;
  min-width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 10px 2px 10px 2px;
}
.ds7-programs .ds7-program-notes {
  margin-top: 14px;
  border-top: 1px solid #7bc9df30;
  padding-top: 16px;
}
.ds7-programs summary {
  cursor: pointer;
  min-height: 44px;
  padding-block: 12px;
  color: #c6dfe9;
  font-size: 13px;
}
.ds7-programs .ds7-program-notes p {
  white-space: pre-line;
  line-height: 1.7;
  color: #a8c0ce;
}
.ds7-programs .ds7-weeks-heading {
  margin-top: 26px;
}
.ds7-programs .ds7-week-picker {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #9fb9c7;
  font-size: 11px;
}
.ds7-programs .ds7-week-picker select {
  width: auto;
  min-width: 95px;
  min-height: 44px;
}
.ds7-programs .ds7-phase-group {
  border-top: 1px solid #5bb9ce38;
  margin-bottom: 18px;
}
.ds7-programs .ds7-phase-group > summary {
  font: 700 12px var(--ds7-font-display);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 18px 4px;
  color: var(--accent);
}
.ds7-programs .ds7-phase-group > summary small {
  font-size: 10px;
  text-transform: none;
  color: #91afbd;
  letter-spacing: 0;
  float: right;
  margin: 0 8px;
}
.ds7-programs .ds7-week-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  padding: 4px;
  max-height: 580px;
  overflow-y: auto;
  scrollbar-color: #277e89 #06151e;
}
.ds7-programs .ds7-week-card {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 100px;
  border: 1px solid #8caeb344;
  border-radius: 16px 3px 16px 3px;
  padding: 18px 20px;
  background: linear-gradient(130deg, #102631, #030c13);
  text-decoration: none;
  color: #dce9ed;
  box-shadow: inset 0 1px 0 #fff1;
}
.ds7-programs .ds7-week-card > span:nth-child(2) {
  flex: 1;
  min-width: 0;
}
.ds7-programs .ds7-week-card strong {
  font: 700 18px var(--ds7-font-display);
}
.ds7-programs .ds7-week-card small {
  display: block;
  font-size: 10px;
  line-height: 1.6;
  color: #93b1c0;
  margin-top: 2px;
}
.ds7-programs .ds7-week-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: #80a7b0;
  font-weight: 800;
}
.ds7-programs .ds7-week-icon svg {
  width: 25px;
  height: 25px;
}
.ds7-programs .ds7-week-arrow {
  font-size: 28px;
  color: var(--accent);
}
.ds7-programs .ds7-week-card:is(.is-current, .is-live) {
  border-color: var(--accent);
  box-shadow:
    inset 3px 0 var(--accent),
    0 0 14px #38d2df18;
  background: linear-gradient(130deg, #123945, #04121a);
}
.ds7-programs .ds7-week-card.is-complete {
  border-color: #48dfb6a6;
}
.ds7-programs .is-complete .ds7-week-icon {
  color: #65efd0;
}
.ds7-programs .ds7-week-card.is-upcoming {
  background: linear-gradient(130deg, #0c1b26, #030c13);
}
.ds7-programs .ds7-week-detail {
  padding: 24px;
}
.ds7-programs .ds7-week-detail > .week-nav {
  margin: 14px 0 28px;
  align-items: center;
}
.ds7-programs .ds7-week-detail .week-title {
  min-width: 0;
  text-align: center;
  flex: 1;
}
.ds7-programs .ds7-week-detail .week-title h2 {
  margin: 4px 0 8px;
  font-size: 26px;
}
.ds7-programs .ds7-week-detail .week-title p {
  font-size: 11px;
  line-height: 1.5;
}
.ds7-programs .day-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr));
  gap: 16px;
}
.ds7-programs .ds7-workout-day {
  position: relative;
  background: linear-gradient(140deg, #0c1e28, #020b12);
  border: 1px solid #829da744;
  border-radius: 18px 4px 18px 4px;
  min-width: 0;
  padding: 20px;
  box-shadow: inset 0 1px 0 #e2fcff0d;
}
.ds7-programs .ds7-workout-day .day-head {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px 14px;
  margin: 0 0 18px;
  align-items: center;
}
.ds7-programs .ds7-workout-day .day-head h3 {
  font: 700 19px/1.3 var(--ds7-font-display);
  margin: 3px 0;
  color: var(--program-silver);
}
.ds7-programs .ds7-workout-day .day-head .eyebrow {
  font-size: 9px;
  margin: 0;
  color: #86aab9;
  letter-spacing: 2px;
}
.ds7-programs .ds7-day-symbol {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid #4bf6ee55;
  border-radius: 11px 3px 11px 3px;
  color: var(--accent);
  background: #11333e66;
  font-size: 24px;
}
.ds7-programs .ds7-day-symbol svg {
  width: 27px;
  height: 27px;
}
.ds7-programs .ds7-workout-day .status-pill {
  grid-column: 1/-1;
  justify-self: start;
  color: #b6cbd4;
  font-size: 9px;
  letter-spacing: 1px;
  padding: 6px 10px;
}
.ds7-programs .ds7-workout-day:is(.next, .status-in-progress) {
  border-color: var(--accent);
  box-shadow:
    inset 0 0 25px #1bcdd611,
    0 0 16px #27e7eb15;
}
.ds7-programs .ds7-workout-day.status-completed {
  border-color: #3cddb49e;
}
.ds7-programs .status-completed .ds7-day-symbol {
  color: #64efcc;
  border-color: #43edc2;
  box-shadow: 0 0 12px #3acbac22;
}
.ds7-programs .ds7-day-exercises {
  border-block: 1px solid #4a95a32b;
  margin-bottom: 14px;
}
.ds7-programs .ds7-day-exercises summary {
  font-size: 12px;
}
.ds7-programs .ds7-day-exercises summary span {
  float: right;
  color: var(--accent);
}
.ds7-programs .rx-list li {
  gap: 10px;
  flex-wrap: wrap;
  align-items: baseline;
}
.ds7-programs .rx-list small {
  color: #94b1bd;
  white-space: normal;
}
.ds7-programs .day-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ds7-programs .day-actions > .primary,
.ds7-programs .day-actions > .secondary {
  width: 100%;
}
.ds7-programs .ds7-program-library {
  grid-column: 1/-1;
  margin-top: 16px;
  scroll-margin-top: 24px;
  padding-top: 28px;
  border-top: 1px solid #4598aa33;
}
.ds7-programs .ds7-library-group {
  font: 700 11px var(--ds7-font-display);
  color: #9cb9c7;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin: 28px 0 14px;
}
.ds7-programs .ds7-program-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 18px;
}
.ds7-programs .ds7-program-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid var(--program-edge);
  border-radius: 20px 4px 20px 4px;
  box-shadow: 0 8px 25px #0004;
  background: #04111a;
}
.ds7-programs .ds7-card-art {
  height: 110px;
  overflow: hidden;
  border-bottom: 1px solid #38d7e53b;
}
.ds7-programs .ds7-card-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 22%;
  opacity: 0.65;
  display: block;
}
.ds7-programs .ds7-card-body {
  padding: 22px;
  background: linear-gradient(140deg, #0c2029, #020a10);
}
.ds7-programs .ds7-card-body .eyebrow {
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--accent);
  margin: 0 0 8px;
}
.ds7-programs .ds7-card-body h3 {
  font: 700 22px/1.2 var(--ds7-font-display);
  margin: 0 0 12px;
  color: var(--program-silver);
  overflow-wrap: anywhere;
}
.ds7-programs [data-program-card] {
  cursor: pointer;
  touch-action: manipulation;
}
.ds7-programs
  :is(.ds7-program-card, .ds7-starter-card):has(:is([data-view-program], [data-view-master]):focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.ds7-programs .ds7-card-objective {
  font-size: 12px;
  color: #acc4d0;
}
.ds7-programs .ds7-card-description {
  font-size: 12px;
  color: #91acb8;
  line-height: 1.6;
  max-height: 7.8em;
  overflow-y: auto;
  white-space: pre-line;
}
.ds7-programs .ds7-card-history {
  font-size: 10px;
  color: #b5d0dc;
  letter-spacing: 1px;
  margin: 18px 0;
}
.ds7-programs .ds7-card-management {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  border-top: 1px solid #6af0ff1f;
  padding-top: 10px;
  margin-top: 18px;
}
.ds7-programs .ds7-card-management button {
  font-size: 10px;
}
.ds7-programs .ds7-program-empty {
  min-height: 220px;
  display: grid;
  align-items: center;
  background: radial-gradient(ellipse at top right, #113f4b66, transparent 70%), #04121b;
}
.ds7-programs .ds7-editor-heading .page-dragon-art {
  display: none;
}
.ds7-programs .ds7-editor-heading .storm-page-heading {
  min-height: 0;
  margin: 20px 0;
  padding: 16px 20px;
  background: #061820;
  border-radius: 12px;
  border: 1px solid #5ce1f82b;
}
.ds7-programs .ds7-editor-heading h1 {
  font-size: 21px;
}
.ds7-programs .ds7-editor-heading .eyebrow {
  display: none;
}
.ds7-programs .is-compact {
  min-height: 190px;
}
.ds7-programs .is-compact .ds7-program-brand {
  margin-bottom: 18px;
}
.ds7-programs .is-compact h1 {
  font-size: 28px;
}
.ds7-programs .builder-grid {
  gap: 22px;
}
.ds7-programs .builder-day {
  border: 1px solid #63b5c43b;
  border-radius: 14px 4px 14px 4px;
  background: #030f17;
  padding: 16px;
  margin-bottom: 18px;
}
.ds7-programs .builder-day-head {
  flex-wrap: wrap;
  gap: 8px;
}
.ds7-programs .rx-row {
  min-width: 0;
  border-color: #5aa3b32b;
  flex-wrap: wrap;
}
.ds7-programs .rx-main {
  min-width: 0;
  flex: 1 1 240px;
}
.ds7-programs .rx-main > div {
  min-width: 0;
  overflow-wrap: anywhere;
}
.ds7-programs .rx-actions {
  flex-wrap: wrap;
  max-width: 100%;
  flex: 1 1 240px;
}
.ds7-programs .day-name-row {
  display: flex;
  flex-wrap: wrap;
}
.ds7-programs .day-name-row input {
  min-width: 0;
  flex: 1 1 120px;
}
.ds7-programs .day-name-row select {
  min-width: 0;
  max-width: 140px;
  flex: 1 1 110px;
}
.ds7-programs .day-name-row .icon-button {
  flex: 0 0 44px;
}
.ds7-programs .phase-row {
  border-color: #6adcec30;
}
.ds7-programs .phase-row.active {
  background: #0e3544;
  border-color: var(--accent);
}
.ds7-programs.ds7-program-workout .workout-bar {
  border-radius: 16px 4px 16px 4px;
  border: 1px solid var(--program-edge);
  background: linear-gradient(130deg, #12313c, #04111a);
}
.ds7-programs.ds7-program-workout .storm-page-heading {
  min-height: 190px;
  border-radius: 18px 4px 18px 4px;
  margin-top: 18px;
}
.ds7-programs.ds7-program-workout .storm-page-heading h1 {
  font-size: clamp(24px, 3vw, 34px);
}
.ds7-programs.ds7-program-workout .exercise-card {
  border-radius: 18px 4px 18px 4px;
  border-color: #6bc4d64a;
  background: linear-gradient(140deg, #0a202b, #030d15);
}
.ds7-programs.ds7-program-workout .exercise-card.complete {
  border-color: #4eeac1a1;
}
.ds7-programs.ds7-program-workout .exercise-card-head {
  border-bottom: 1px solid #7cb2c32b;
  padding-bottom: 16px;
}
.ds7-programs.ds7-program-workout .exercise-card h3 {
  color: var(--program-silver);
}
.ds7-programs.ds7-program-workout .set-check.on {
  box-shadow: 0 0 12px #53e8d32b;
}
.ds7-programs :is(.ds7-program-card, .ds7-week-card, .ds7-phase-preview, .ds7-workout-day) {
  transition:
    border-color 0.18s,
    box-shadow 0.18s,
    transform 0.18s;
}
@media (hover: hover) {
  .ds7-programs :is(.ds7-program-card, .ds7-week-card, .ds7-phase-preview):hover {
    border-color: var(--accent);
    box-shadow: 0 0 20px #39dae51a;
    transform: translateY(-2px);
  }
}
@media (max-width: 900px) {
  .ds7-programs .ds7-overview-grid {
    grid-template-columns: 1fr;
  }
  .ds7-programs .ds7-program-hero-content {
    padding: 28px;
  }
  .ds7-programs .ds7-equipment-grid {
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  }
}
@media (max-width: 600px) {
  .ds7-programs .ds7-program-topline {
    align-items: flex-start;
    flex-direction: column;
  }
  .ds7-programs .ds7-program-topline .button-row {
    width: 100%;
  }
  .ds7-programs .ds7-program-topline .button-row > * {
    flex: 1;
  }
  .ds7-programs .ds7-program-hero {
    min-height: 265px;
  }
  .ds7-programs .ds7-program-hero-content {
    padding: 24px 20px;
  }
  .ds7-programs .ds7-program-art {
    object-position: 56% 10%;
    opacity: 0.55;
  }
  .ds7-programs .ds7-program-hero::before {
    background: linear-gradient(90deg, #020b12e6, #03101999), linear-gradient(0deg, #020b12de, transparent);
  }
  .ds7-programs .ds7-program-brand {
    font-size: 11px;
    letter-spacing: 2px;
    margin-bottom: 26px;
  }
  .ds7-programs .ds7-program-brand span {
    font-size: 7px;
    letter-spacing: 4px;
  }
  .ds7-programs .ds7-program-hero h1 {
    font-size: 28px;
  }
  .ds7-programs .ds7-program-subtitle {
    font-size: 12px;
  }
  .ds7-programs .ds7-program-actions {
    gap: 8px;
  }
  .ds7-programs .ds7-program-actions > .primary {
    flex: 1;
  }
  .ds7-programs .ds7-program-actions > .secondary {
    min-width: 110px;
  }
  .ds7-programs .ds7-program-cta {
    min-width: 160px;
  }
  .ds7-programs .ds7-program-tabs {
    gap: 12px;
    padding: 0;
  }
  .ds7-programs .ds7-program-tabs > a {
    font-size: 11px;
    padding-inline: 12px;
    min-height: 56px;
    letter-spacing: 1px;
  }
  .ds7-programs .ds7-program-tabs .ds7-program-library-link {
    font-size: 10px;
    letter-spacing: 0;
    padding-inline: 0;
  }
  .ds7-programs .ds7-program-library-link svg {
    display: none;
  }
  .ds7-programs .ds7-week-grid {
    grid-template-columns: minmax(0, 1fr);
    max-height: 510px;
  }
  .ds7-programs .ds7-week-card {
    padding: 16px;
    min-height: 96px;
    gap: 12px;
  }
  .ds7-programs .ds7-week-detail {
    padding: 18px 14px;
  }
  .ds7-programs .ds7-workout-day {
    padding: 18px 14px;
  }
  .ds7-programs .ds7-week-detail .week-title h2 {
    font-size: 22px;
  }
  .ds7-programs .ds7-weeks-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .ds7-programs .ds7-week-picker {
    width: 100%;
    justify-content: space-between;
  }
  .ds7-programs .ds7-equipment-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .ds7-programs .ds7-equipment-grid li {
    padding: 12px 4px;
    min-height: 92px;
  }
  .ds7-programs .ds7-program-facts strong {
    font-size: 30px;
  }
  .ds7-programs .ds7-program-facts span {
    font-size: 8px;
    letter-spacing: 1px;
  }
  .ds7-programs .ds7-section-heading {
    flex-wrap: wrap;
  }
  .ds7-programs .ds7-section-heading h2 {
    font-size: 20px;
  }
  .ds7-programs .ds7-card-management {
    gap: 4px;
  }
  .ds7-programs .ds7-phase-group > summary {
    letter-spacing: 0.6px;
  }
  .ds7-programs .ds7-phase-group > summary small {
    float: none;
    margin-left: 10px;
  }
  .ds7-programs .builder-day {
    padding: 12px;
  }
  .ds7-programs .rx-row {
    flex-wrap: wrap;
  }
  .ds7-programs .rx-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .ds7-programs .day-name-row select {
    width: 100%;
    min-width: 0;
  }
  .ds7-programs .is-compact {
    min-height: 200px;
  }
  .ds7-programs .is-compact .ds7-program-brand {
    margin-bottom: 16px;
  }
  .ds7-programs.ds7-program-workout .workout-bar .button-row {
    flex-wrap: wrap;
  }
  .ds7-programs.ds7-program-workout .exercise-card-head {
    flex-wrap: wrap;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ds7-programs * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
.reduced-motion .ds7-programs * {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}
.art-hidden .ds7-programs :is(.ds7-program-art, .ds7-card-art) {
  display: none;
}
/* Spreadsheet plan controls near the top of the Programs area */
.ds7-programs .ds7-program-file-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
  margin: -12px 0 22px;
  padding: 6px 14px;
  border: 1px solid var(--program-edge);
  border-radius: 14px 4px 14px 4px;
  background: #04131bcc;
}
.ds7-programs .ds7-program-file-bar .ds7-file-bar-label {
  font: 700 10px var(--ds7-font-display);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #91afbd;
  margin-right: auto;
}
.ds7-programs .ds7-program-file-bar .text-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
@media (max-width: 600px) {
  .ds7-programs .ds7-program-file-bar {
    margin: -8px 0 18px;
  }
  .ds7-programs .ds7-program-file-bar .ds7-file-bar-label {
    flex-basis: 100%;
  }
}

/* Reinstated level starters: confined to Training > Programs, not Dashboard. */
.ds7-programs .ds7-starter-programs {
  margin: 1rem 0 1.35rem;
  padding: 1rem;
  border: 1px solid rgba(52, 223, 244, 0.26);
  border-radius: 14px;
  background: rgba(7, 25, 32, 0.52);
}
.ds7-programs .ds7-starter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 0.75rem;
}
.ds7-programs .ds7-starter-card {
  min-width: 0;
  padding: 0.8rem;
  border: 1px solid rgba(55, 215, 246, 0.25);
  border-radius: 10px;
  background: rgba(5, 19, 26, 0.7);
}
.ds7-programs .ds7-starter-card h3 {
  overflow-wrap: anywhere;
  margin: 0.25rem 0;
  font-size: 1rem;
}
.ds7-programs .ds7-starter-card button {
  margin-top: 0.55rem;
  min-height: 44px;
}
@media (max-width: 700px) {
  .ds7-programs .ds7-starter-grid {
    grid-template-columns: 1fr;
  }
}

/* DS7 visual baseline v1: page chrome & readability only.
   Preserve Zeus artwork, color tokens, graph transitions and all interaction behavior.
   Final layer deliberately follows the program stylesheet. */

/* The exact owner-approved banner is shared by the sidebar and page header. */
.app-header .brand-center {
  min-width: 0;
  width: 100%;
  align-self: center;
}
.app-header .brand-image {
  display: block;
  width: min(100%, 550px);
  height: auto;
  max-height: 78px;
  object-fit: contain;
  object-position: center;
}

/* Make titles and descriptive copy readable without increasing visual noise. */
.page-heading h1,
.panel-heading h2 {
  text-wrap: balance;
}
.panel-heading h2 {
  line-height: 1.25;
}
.panel-heading .subtle,
.stat-note,
.history-item small {
  color: #b2c8d2;
}
.eyebrow {
  letter-spacing: 0.13em;
}

/* Maintain the existing storm treatment but establish consistent panel depth. */
.panel,
.stat-card {
  border-color: rgba(var(--accent-rgb), 0.3);
  box-shadow:
    inset 0 1px 0 rgba(220, 251, 255, 0.045),
    0 9px 28px rgba(0, 0, 0, 0.25),
    0 0 16px rgba(var(--accent-rgb), 0.045);
}
.panel:focus-within,
.stat-card:focus-within {
  border-color: rgba(var(--accent-rgb), 0.55);
}
.panel-heading,
.page-heading {
  min-width: 0;
}
.stat-label {
  color: #b7ccd5;
  font-size: 12px;
}
.stat-value {
  font-variant-numeric: tabular-nums;
}

/* Clear selected state and larger readable labels for shared section controls. */
.tab-row .segmented button,
.segmented button {
  font-size: 12px;
  min-height: 36px;
  padding: 8px 12px;
}
.tab-row .segmented button.active,
.segmented button.active {
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.2);
}
.nav-link.active {
  box-shadow:
    inset 3px 0 0 var(--accent),
    0 0 14px rgba(var(--accent-rgb), 0.04);
}
.nav-link:focus-visible,
.segmented button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* History and tables: no microscopic labels or unbounded action text. */
.history-item {
  min-height: 56px;
  padding-block: 12px;
  gap: 14px;
  line-height: 1.5;
}
.history-item > div:first-child,
.history-item > span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}
.history-item small {
  font-size: 12px;
  line-height: 1.45;
}
.data-table th {
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: 0.035em;
  color: #b5d8e6;
}
.data-table td {
  font-size: 13px;
  line-height: 1.5;
  vertical-align: middle;
}
.data-table td.accent,
.history-item .accent {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.data-table tbody tr:hover {
  background: rgba(var(--accent-rgb), 0.055);
}
.data-table tbody tr:focus-within {
  background: rgba(var(--accent-rgb), 0.065);
}

/* Accessible action hierarchy: edit is neutral; destructive actions remain distinct. */
.row-actions {
  gap: 6px 8px;
}
.row-actions .quiet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid rgba(var(--accent-rgb), 0.19);
  border-radius: 8px;
  background: rgba(5, 23, 32, 0.65);
  color: #d5e8f0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
}
.row-actions .quiet:hover {
  background: rgba(var(--accent-rgb), 0.09);
  border-color: rgba(var(--accent-rgb), 0.5);
}
.row-actions .quiet.danger {
  color: #ffc1c1;
  border-color: rgba(255, 145, 145, 0.28);
  background: rgba(65, 18, 22, 0.24);
}
.row-actions .quiet.danger:hover {
  background: rgba(135, 31, 40, 0.28);
  border-color: rgba(255, 145, 145, 0.58);
}
.row-actions .quiet:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Import review: separate factual OCR evidence from warnings visually. */
.import-review {
  column-gap: clamp(16px, 2.1vw, 26px);
}
.import-main {
  min-width: 0;
}
.import-main .import-meta h3 {
  font-size: 17px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.import-table th {
  white-space: nowrap;
}
.import-table td {
  vertical-align: top;
}
.import-table .import-notes {
  min-width: 168px;
  max-width: 360px;
}
.import-notes small {
  display: block;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  color: #aec8d4;
  margin-bottom: 5px;
}
.import-notes small:first-child {
  color: #e2f5fb;
  font-weight: 650;
}
.import-notes .warn-text {
  color: #ffce94;
  border-left: 2px solid #e1ae60;
  padding: 4px 8px;
  background: rgba(138, 91, 34, 0.12);
  border-radius: 0 6px 6px 0;
}
.import-table input,
.import-table select {
  font-size: 13px;
  min-height: 40px;
}
.import-source-label {
  font-size: 14px;
  line-height: 1.4;
}
.import-target-label {
  font-size: 11px;
}
.import-shot-img {
  border-color: rgba(var(--accent-rgb), 0.38);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
}

/* Small screens: keep the wordmark and buttons visible without collisions. */
@media (max-width: 850px) {
  .app-header .brand-image {
    max-height: 66px;
  }
  .history-item {
    gap: 10px;
  }
}
@media (max-width: 600px) {
  .app-header {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    gap: 6px;
    min-height: 68px;
  }
  .app-header .avatar-btn {
    width: 44px;
    height: 44px;
  }
  .app-header .chat-btn {
    width: 44px;
    height: 44px;
  }
  .app-header .brand-image {
    width: 100%;
    max-height: 54px;
  }
  .data-table td {
    font-size: 12px;
  }
  .data-table th {
    font-size: 10px;
  }
  .row-actions .quiet {
    min-width: 44px;
    min-height: 44px;
    padding: 9px 10px;
  }
  .history-item {
    min-height: 60px;
  }
  .import-review {
    row-gap: 16px;
  }
  .import-table .import-notes {
    min-width: 150px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .panel,
  .stat-card,
  .row-actions .quiet {
    transition-duration: 0.001s;
  }
}

/* DS7 Settings → Sources & Licenses — owner-provided stacked-card layout reference. */
.settings-source-entry {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.settings-source-entry .panel-heading,
.settings-source-entry p {
  margin-bottom: 0;
}
.settings-source-entry > a {
  align-self: flex-start;
  margin-top: 6px;
}
.sources-page {
  max-width: 940px;
  margin-inline: auto;
}
.sources-intro {
  font-size: 14px;
  line-height: 1.7;
  color: #b9ced9;
  padding: 0 3px 10px;
}
.source-group {
  margin: 24px 0 30px;
}
.source-section-title {
  margin: 0 0 15px 2px;
}
.source-section-title h2 {
  font-size: 20px;
  letter-spacing: 0.15px;
  margin-bottom: 5px;
}
.source-section-title p {
  color: #a8bfcd;
  font-size: 13px;
  line-height: 1.6;
  margin: 0;
}
.source-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.source-card {
  min-width: 0;
  padding: 21px 24px;
  background: linear-gradient(145deg, rgba(15, 30, 39, 0.96), rgba(8, 20, 29, 0.98));
  border: 1px solid rgba(var(--accent-rgb), 0.48);
  border-radius: 13px;
  box-shadow:
    inset 0 1px 0 rgba(210, 251, 255, 0.06),
    0 10px 24px rgba(0, 0, 0, 0.2);
}
.source-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 9px 16px;
  margin-bottom: 9px;
}
.source-card h3 {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: 0.1px;
  line-height: 1.38;
  color: #effaff;
  margin: 0;
}
.source-license {
  display: inline-flex;
  flex-shrink: 0;
  max-width: 100%;
  border: 1px solid rgba(var(--accent-rgb), 0.29);
  background: rgba(var(--accent-rgb), 0.065);
  border-radius: 7px;
  color: #bcebf1;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  padding: 5px 8px;
}
.source-card p {
  color: #bdd1da;
  font-size: 13px;
  line-height: 1.65;
  margin: 0 0 13px;
}
.source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 20px;
}
.source-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 40px;
  max-width: 100%;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-decoration-color: rgba(var(--accent-rgb), 0.25);
  text-underline-offset: 4px;
}
.source-link:hover {
  text-decoration-color: var(--accent);
}
.sources-disclaimer {
  color: #a9beca;
  border-top: 1px solid rgba(var(--accent-rgb), 0.2);
  padding: 18px 4px;
  font-size: 12px;
  line-height: 1.7;
}
@media (max-width: 600px) {
  .settings-source-entry > a {
    align-self: stretch;
  }
  .source-group {
    margin: 20px 0 24px;
  }
  .source-card {
    padding: 18px 17px;
  }
  .source-card h3 {
    font-size: 16px;
  }
  .source-link {
    min-height: 44px;
    font-size: 13px;
  }
  .sources-intro {
    font-size: 13px;
  }
}

/* Food Tracking — owner-approved storm/cyan graphics, applied to live controls.
   Scoped to Nutrition and existing scanner dialogs. No bitmap screenshots used as UI. */
.ds7-food-approved {
  max-width: 1120px;
  margin-inline: auto;
  --food-glow: 0 0 18px rgba(var(--accent-rgb), 0.17), inset 0 1px 0 rgba(225, 255, 255, 0.12);
}
.ds7-food-approved .app-header {
  margin-bottom: 2px;
}
.ds7-food-approved .food-brand-title {
  text-align: center;
  position: relative;
  padding: 7px 10px 15px;
  margin-bottom: 4px;
}
.ds7-food-approved .food-brand-title h1 {
  font-family: var(--ds7-font-display);
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.21em;
  font-size: clamp(23px, 4.3vw, 42px);
  line-height: 1.2;
  margin: 0;
  background: linear-gradient(#faffff 10%, #b0bbc5 50%, #f0f8fa 66%, #697f8a);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  text-shadow: 0 3px 17px rgba(0, 0, 0, 0.55);
}
.ds7-food-approved .food-brand-title p {
  color: var(--accent);
  font-size: clamp(11px, 1.75vw, 15px);
  font-weight: 800;
  letter-spacing: 0.35em;
  margin: 8px 0 0;
  text-shadow: 0 0 11px rgba(var(--accent-rgb), 0.42);
}
.ds7-food-approved .food-primary-tabs {
  margin: 4px 0 16px;
  overflow: visible;
}
.ds7-food-approved .food-primary-tabs .segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  border: 1px solid rgba(var(--accent-rgb), 0.48);
  padding: 2px;
  background: linear-gradient(180deg, rgba(12, 35, 44, 0.96), rgba(3, 17, 26, 0.96));
  border-radius: 10px;
  box-shadow: var(--food-glow);
}
.ds7-food-approved .food-primary-tabs .segmented button {
  min-height: 48px;
  font-family: var(--ds7-font-display);
  font-style: normal;
  font-size: clamp(12px, 2.7vw, 17px);
  color: #c7d6db;
  border: 1px solid transparent;
  border-radius: 7px;
}
.ds7-food-approved .food-primary-tabs .segmented button.active {
  background: linear-gradient(145deg, rgba(var(--accent-rgb), 0.3), rgba(var(--accent-rgb), 0.065));
  border-color: var(--accent);
  color: #f0fdff;
  box-shadow:
    inset 0 0 10px rgba(var(--accent-rgb), 0.12),
    0 0 15px rgba(var(--accent-rgb), 0.25);
}
.ds7-food-approved .week-strip {
  background: rgba(4, 20, 29, 0.53);
  border-radius: 10px;
}
.ds7-food-approved .food-today-panel {
  border: 1px solid rgba(var(--accent-rgb), 0.75);
  border-radius: 14px;
  padding: 20px clamp(10px, 2.5vw, 24px) 14px;
  background: linear-gradient(145deg, rgba(7, 31, 42, 0.97), rgba(2, 12, 21, 0.97));
  box-shadow: var(--food-glow);
  margin: 14px 0 12px;
}
.ds7-food-approved .food-today-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(130px, 0.72fr);
  gap: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.2);
}
.ds7-food-approved .food-today-head h2,
.ds7-food-approved .food-trend-mini h3 {
  font-size: clamp(11px, 1.4vw, 15px);
  font-weight: 800;
  letter-spacing: 0.16em;
  margin: 0 0 10px;
  color: #c5dae6;
}
.ds7-food-approved .food-big-calories {
  font-size: clamp(24px, 4vw, 40px);
  font-weight: 850;
  margin: 0 0 10px;
  line-height: 1.2;
  color: #f3fbff;
  font-variant-numeric: tabular-nums;
}
.ds7-food-approved .food-big-calories small {
  font-size: 0.58em;
  color: #b7ccd6;
  white-space: nowrap;
}
.ds7-food-approved .food-linear-track {
  height: 11px;
  border-radius: 99px;
  background: #17313a;
  box-shadow: inset 0 0 4px #0007;
  border: 1px solid rgba(179, 228, 231, 0.28);
  overflow: hidden;
  min-width: 0;
}
.ds7-food-approved .food-linear-track i {
  height: 100%;
  background: linear-gradient(90deg, #159fa8, #23f7f3);
  box-shadow: 0 0 15px #1feef0;
  display: block;
  border-radius: 99px;
  transition: width 0.3s ease;
}
.ds7-food-approved .food-week-trend {
  width: 100%;
  max-height: 90px;
  overflow: visible;
  color: var(--accent);
  filter: drop-shadow(0 0 4px rgba(var(--accent-rgb), 0.5));
}
.ds7-food-approved .food-trend-mini {
  min-width: 0;
}
.ds7-food-approved .food-gauges {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(6px, 1.4vw, 16px);
  margin-top: 12px;
}
.ds7-food-approved .food-gauge {
  background: transparent;
  padding: 2px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: inherit;
  min-width: 0;
}
.ds7-food-approved .food-gauge-ring {
  width: clamp(63px, 12vw, 135px);
  max-width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  padding: clamp(5px, 1vw, 11px);
  display: flex;
  position: relative;
  background: conic-gradient(var(--accent) var(--food-progress), rgba(98, 123, 132, 0.5) 0);
  box-shadow:
    0 0 14px rgba(var(--accent-rgb), 0.18),
    inset 0 0 2px #fff6;
  transform: rotate(-90deg);
}
.ds7-food-approved .food-gauge-inner {
  transform: rotate(90deg);
  background: #061b25;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1px;
  line-height: 1.12;
}
.ds7-food-approved .food-gauge-icon {
  color: var(--accent);
  font-size: clamp(10px, 1.7vw, 18px);
}
.ds7-food-approved .food-gauge-label {
  font-size: clamp(9px, 1.5vw, 13px);
  font-weight: 650;
}
.ds7-food-approved .food-gauge-inner strong {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-size: clamp(11px, 1.8vw, 21px);
}
.ds7-food-approved .food-gauge-inner small {
  font-size: clamp(8px, 1.25vw, 12px);
  white-space: nowrap;
  color: #abbac5;
}
.ds7-food-approved .food-gauge-percent {
  font-weight: 800;
  color: #c9f9fa;
  font-size: clamp(12px, 1.6vw, 16px);
}
.ds7-food-approved .food-water-card {
  border: 1px solid rgba(var(--accent-rgb), 0.6);
  border-radius: 12px;
  background: linear-gradient(160deg, #0a2e39, #051923);
  padding: 12px 15px;
  display: grid;
  grid-template-columns: auto minmax(95px, 1fr) minmax(50px, 2fr) auto auto;
  gap: 12px;
  align-items: center;
  box-shadow: var(--food-glow);
  margin-bottom: 15px;
}
.ds7-food-approved .food-water-icon {
  font-size: 23px;
  color: var(--accent);
}
.ds7-food-approved .food-water-card div:nth-child(2) {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ds7-food-approved .food-water-card div:nth-child(2) span {
  font-size: 12px;
  color: #afc3ce;
}
.ds7-food-approved .food-water-percent {
  color: var(--accent);
}
.ds7-food-approved .food-quick-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 16px;
}
.ds7-food-approved .food-quick {
  border: 1px solid rgba(var(--accent-rgb), 0.7);
  border-radius: 11px;
  background: linear-gradient(150deg, #092936, #04131d);
  padding: 14px 5px;
  min-height: 85px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  color: #f0faff;
  font-weight: 750;
  font-size: clamp(11px, 1.8vw, 16px);
  box-shadow: var(--food-glow);
}
.ds7-food-approved .food-quick span {
  font-size: clamp(23px, 3.8vw, 34px);
  color: #d9fbff;
}
.ds7-food-approved .food-quick:hover,
.ds7-food-approved .food-quick:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 23px rgba(var(--accent-rgb), 0.32);
}
.ds7-food-approved .food-view-title {
  text-align: center;
  letter-spacing: 0.15em;
  font-family: var(--ds7-font-display);
  font-size: clamp(18px, 3vw, 26px);
  margin: 18px 0;
  color: #edfaff;
}
.ds7-food-approved .food-view-body .panel {
  border: 1px solid rgba(var(--accent-rgb), 0.55);
  background: linear-gradient(150deg, rgba(8, 33, 43, 0.97), rgba(4, 18, 28, 0.97));
  box-shadow: var(--food-glow);
}
.ds7-food-approved .food-view-body .food-row {
  background: rgba(2, 18, 27, 0.54);
  border-radius: 7px;
  border-bottom-color: rgba(var(--accent-rgb), 0.28);
}
/* Modal workflows retain the current data handlers and scanners. */
.food-scan-chooser {
  margin: 8px 0 10px;
}
.food-scan-chooser > p {
  text-align: center;
  font-size: 14px;
  margin: 0 0 18px;
}
.food-scan-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.food-scan-option {
  min-height: 130px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 12px;
  border: 1.5px solid rgba(var(--accent-rgb), 0.85);
  border-radius: 12px;
  background: linear-gradient(155deg, #0a3340, #051a26);
  color: #f1fcff;
  padding: 18px 12px;
  box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.18);
}
.food-scan-option strong {
  font-size: 17px;
  color: var(--accent);
}
.food-scan-option span {
  font-size: 12px;
  color: #c0d3dd;
  line-height: 1.5;
}
.food-scan-option:hover,
.food-scan-option:focus-visible {
  box-shadow: 0 0 24px rgba(var(--accent-rgb), 0.38);
  border-color: var(--accent);
}
#entry-form .food-manual-title {
  margin: 20px 0 8px;
  font-size: 15px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
#entry-form .food-portion-panel {
  margin: 18px 0;
  padding: 16px;
  border: 1px solid rgba(var(--accent-rgb), 0.7);
  border-radius: 11px;
  background: linear-gradient(145deg, #092b37, #04141d);
  box-shadow: 0 0 16px rgba(var(--accent-rgb), 0.12);
}
#entry-form .food-portion-panel h3 {
  font-size: 16px;
  letter-spacing: 0.17em;
  color: var(--accent);
  margin: 0 0 9px;
}
#entry-form .food-portion-panel .food-portion-fields {
  grid-template-columns: minmax(0, 2fr) minmax(120px, 1fr);
}
#entry-form .food-portion-panel .accent {
  padding: 10px 3px 0;
  font-variant-numeric: tabular-nums;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
#entry-form .food-portion-panel input,
#entry-form .food-portion-panel select {
  border-color: rgba(var(--accent-rgb), 0.5);
  min-height: 44px;
}
@media (max-width: 680px) {
  .ds7-food-approved .food-today-panel {
    padding: 12px 10px;
  }
  .ds7-food-approved .food-today-head {
    gap: 9px;
    grid-template-columns: minmax(0, 1fr) minmax(92px, 0.68fr);
  }
  .ds7-food-approved .food-water-card {
    grid-template-columns: auto minmax(86px, 1fr) minmax(40px, 1.1fr) auto;
    gap: 8px;
    padding: 10px;
  }
  .ds7-food-approved .food-water-card .quiet {
    grid-column: 1/-1;
    justify-self: end;
  }
  .ds7-food-approved .food-gauge-ring {
    width: clamp(60px, 19vw, 95px);
  }
  .ds7-food-approved .food-quick-actions {
    gap: 6px;
  }
  .ds7-food-approved .food-quick {
    min-height: 76px;
  }
  .food-scan-options {
    grid-template-columns: 1fr;
  }
  .food-scan-option {
    min-height: 95px;
  }
}
@media (max-width: 360px) {
  .ds7-food-approved .food-gauge-ring {
    width: 58px;
  }
  .ds7-food-approved .food-gauge-inner strong {
    font-size: 10px;
  }
  .ds7-food-approved .food-water-percent {
    font-size: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ds7-food-approved .food-linear-track i {
    transition: none;
  }
}

.ds7-food-approved .food-storm-hero {
  position: relative;
  isolation: isolate;
  padding: 7px 12px 3px;
  margin-bottom: 6px;
  overflow: hidden;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(5, 24, 32, 0.72), rgba(3, 14, 24, 0.95));
}
.ds7-food-approved .food-storm-hero::before {
  content: '';
  position: absolute;
  inset: -20% 0;
  z-index: -1;
  background-image: var(--food-hero-image);
  background-size: cover;
  background-position: 50% 36%;
  opacity: 0.25;
  mask-image: linear-gradient(#000 30%, transparent 95%);
  pointer-events: none;
}

/* Progress Photos desktop/mobile graphics refinement — approved owner concept.
   Presentation only: keep original category, comparison, IndexedDB, backup and permanent-delete behavior. */
.ds7-photo-panel {
  overflow: hidden;
  padding: 0 0 22px;
  border: 1px solid rgba(var(--accent-rgb), 0.52);
  box-shadow:
    0 0 30px rgba(var(--accent-rgb), 0.09),
    inset 0 1px 0 rgba(225, 255, 255, 0.08);
}
.ds7-photo-panel::before,
.ds7-photo-panel::after {
  display: none;
}
.ds7-photo-storm-header {
  isolation: isolate;
  position: relative;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 36px clamp(18px, 4vw, 38px) 30px;
  overflow: hidden;
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.48);
  background: linear-gradient(115deg, #03111de8, #071f2be3 72%, #052432);
}
.ds7-photo-storm-header::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  background-image: var(--ds7-photo-art);
  background-size: cover;
  background-position: center 35%;
  opacity: 0.31;
  mask-image: linear-gradient(90deg, transparent 8%, black 55%);
}
.ds7-photo-storm-header::after {
  content: '';
  pointer-events: none;
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  box-shadow: 0 0 13px var(--accent);
}
.ds7-photo-kicker {
  display: block;
  font-size: 11px;
  letter-spacing: 0.28em;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 12px;
}
.ds7-photo-storm-heading h2 {
  font-family: var(--ds7-font-display);
  font-size: clamp(25px, 4vw, 42px);
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.12em;
  line-height: 1.14;
  color: #e4f0f5;
  text-shadow: 0 0 24px rgba(var(--accent-rgb), 0.25);
  margin: 0 0 9px;
}
.ds7-photo-storm-heading p {
  font-size: 13px;
  letter-spacing: 0.055em;
  color: #bddee9;
  margin: 0;
  line-height: 1.5;
}
.ds7-photo-count {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 125px;
  min-height: 96px;
  gap: 5px;
  padding: 12px 16px;
  background: #061b28db;
  border: 1px solid rgba(var(--accent-rgb), 0.6);
  clip-path: polygon(12% 0, 100% 0, 100% 84%, 88% 100%, 0 100%, 0 16%);
  box-shadow: inset 0 0 18px rgba(var(--accent-rgb), 0.06);
}
.ds7-photo-count strong {
  font-size: 35px;
  font-weight: 750;
  color: #ecffff;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.ds7-photo-count span {
  font-size: 10px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.12em;
  white-space: nowrap;
}
.ds7-photo-toolbar,
.ds7-photo-filter-label,
.ds7-photo-filters,
.ds7-photo-gallery-heading,
.ds7-photo-panel > .photo-grid,
.ds7-photo-panel > .button-row,
.ds7-photo-panel > .chart-empty,
.ds7-photo-panel > .preview-banner,
.ds7-photo-panel > .ds7-photo-privacy,
.ds7-photo-panel > .ds7-photo-compare-panel {
  margin-left: clamp(16px, 3vw, 30px);
  margin-right: clamp(16px, 3vw, 30px);
}
.ds7-photo-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 24px 0 18px;
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.19);
}
.ds7-photo-toolbar strong {
  display: block;
  color: #e9faff;
  font-weight: 750;
  font-size: 18px;
  letter-spacing: 0.04em;
  margin-bottom: 7px;
}
.ds7-photo-toolbar .subtle {
  max-width: 690px;
  line-height: 1.6;
  color: #adc9d6;
  font-size: 12px;
}
.ds7-photo-toolbar .primary {
  flex: 0 0 auto;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  min-height: 46px;
}
.ds7-photo-filter-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-top: 20px;
  margin-bottom: 10px;
}
.ds7-photo-filter-label strong,
.ds7-photo-section-heading h3 {
  font-family: var(--ds7-font-display);
  font-size: 13px;
  color: #e0eff4;
  letter-spacing: 0.18em;
  font-weight: 800;
  margin: 0;
}
.ds7-photo-filter-label span,
.ds7-photo-section-heading small {
  font-size: 11px;
  color: #9fc5d4;
}
.ds7-photo-filters {
  align-items: center;
  gap: 12px 18px;
}
.ds7-photo-filters .segmented {
  flex-wrap: wrap;
  border: 1px solid rgba(var(--accent-rgb), 0.36);
  padding: 4px;
  background: #061925;
}
.ds7-photo-filters .segmented button {
  min-height: 44px;
  border-radius: 7px;
  padding: 10px 14px;
  color: #c4dce6;
}
.ds7-photo-filters .segmented button.active {
  background: rgba(var(--accent-rgb), 0.15);
  color: #e7fcff;
  box-shadow:
    inset 0 0 0 1px var(--accent),
    0 0 16px rgba(var(--accent-rgb), 0.1);
}
.ds7-photo-compare-panel {
  margin-top: 22px;
  border: 1px solid rgba(var(--accent-rgb), 0.45);
  border-radius: 13px;
  background: linear-gradient(155deg, #082331ee, #041018);
  padding: 17px 18px 21px;
  box-shadow: 0 0 24px rgba(var(--accent-rgb), 0.08);
}
.ds7-photo-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 13px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.2);
}
.ds7-photo-section-heading h3 {
  font-size: 16px;
}
.ds7-photo-section-heading h3 span {
  color: var(--accent);
}
.ds7-photo-gallery-heading {
  margin-top: 26px;
  margin-bottom: 0;
  padding-bottom: 12px;
}
.ds7-photo-panel .photo-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr));
  gap: 14px;
  margin-top: 16px;
}
.ds7-photo-panel .photo-tile {
  border: 1px solid rgba(var(--accent-rgb), 0.33);
  background: linear-gradient(180deg, #071b27, #041018);
  border-radius: 10px;
  box-shadow: 0 8px 20px #0004;
  transition:
    border-color 0.22s,
    box-shadow 0.22s,
    transform 0.22s;
}
.ds7-photo-panel .photo-tile:hover {
  border-color: rgba(var(--accent-rgb), 0.7);
  transform: translateY(-2px);
}
.ds7-photo-panel .photo-tile.selected {
  border-color: var(--accent);
  box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.27);
}
.ds7-photo-panel .photo-select {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4/5;
}
.ds7-photo-panel .photo-select img {
  transition: transform 0.3s ease;
}
.ds7-photo-panel .photo-select:hover img {
  transform: scale(1.025);
}
.ds7-photo-select-hint {
  position: absolute;
  inset: auto 0 0;
  padding: 8px 6px;
  text-align: center;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.09em;
  background: linear-gradient(transparent, #021118e8);
  color: #f0fcff;
  pointer-events: none;
}
.ds7-photo-panel .photo-tile.selected .ds7-photo-select-hint {
  color: #70fcff;
}
.ds7-photo-panel .photo-meta {
  padding: 11px 12px 12px;
  gap: 6px;
}
.ds7-photo-panel .photo-meta > span {
  font-weight: 750;
  color: #edfbff;
}
.ds7-photo-panel .photo-meta small {
  min-height: 18px;
  color: #a9c9d4;
}
.ds7-photo-tile-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 4px;
}
.ds7-photo-panel .photo-meta .quiet {
  margin: 0;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid rgba(var(--accent-rgb), 0.32);
  border-radius: 7px;
  background: #092331;
  color: #d2e9f1;
}
.ds7-photo-panel .photo-meta .quiet.danger {
  color: #ffbdbd;
  border-color: rgba(255, 166, 166, 0.4);
  background: rgba(70, 24, 29, 0.24);
}
.ds7-photo-panel .compare-controls {
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.ds7-photo-panel .compare-controls .segmented {
  flex-wrap: wrap;
}
.ds7-photo-panel .compare-controls .segmented button {
  min-height: 40px;
}
.ds7-photo-panel .compare-view {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.ds7-photo-compare-frame {
  overflow: hidden;
  border: 1px solid rgba(var(--accent-rgb), 0.45);
  border-radius: 9px;
  background: #01090e;
  padding: 7px;
}
.ds7-photo-compare-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin: 5px 7px 8px;
}
.ds7-photo-compare-frame img {
  display: block;
  aspect-ratio: 3/4;
  object-fit: contain;
  min-height: 0;
  background: #020b0f;
}
.ds7-photo-compare-frame figcaption {
  padding: 6px 7px 8px;
  font-size: 12px;
  color: #c6dce7;
}
.ds7-photo-privacy {
  border-top: 1px solid rgba(var(--accent-rgb), 0.18);
  padding-top: 15px;
  margin-top: 20px;
  margin-bottom: 0;
  font-size: 11px;
  color: #a5c1cd;
  line-height: 1.6;
}
@media (max-width: 650px) {
  .ds7-photo-storm-header {
    padding: 25px 18px 23px;
  }
  .ds7-photo-storm-heading h2 {
    font-size: 26px;
    letter-spacing: 0.07em;
  }
  .ds7-photo-count {
    min-width: 78px;
    min-height: 76px;
    padding: 8px;
  }
  .ds7-photo-count strong {
    font-size: 26px;
  }
  .ds7-photo-count span {
    font-size: 8px;
    letter-spacing: 0;
  }
  .ds7-photo-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .ds7-photo-toolbar .primary {
    align-self: flex-start;
  }
  .ds7-photo-panel .photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .ds7-photo-panel .compare-view {
    gap: 8px;
  }
  .ds7-photo-compare-panel {
    padding: 12px;
  }
  .ds7-photo-filter-label {
    align-items: flex-start;
    flex-direction: column;
  }
  .ds7-photo-filters .segmented button {
    padding: 9px;
  }
}
@media (max-width: 360px) {
  .ds7-photo-panel .photo-grid {
    grid-template-columns: 1fr;
  }
  .ds7-photo-count {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ds7-photo-panel .photo-tile,
  .ds7-photo-panel .photo-select img {
    transition: none;
  }
}

/* Reconciled owner-approved Dashboard, Habits, Education, Training presentation layers */
/* ===== DS7 Dashboard Mobile Refinement — isolated visual pass =====
   Scope: Home dashboard only. The Home page uniquely renders a direct-child
   .countdown element. No program, session, or other page logic changes. */
@media (max-width: 600px) {
  /* Keep controls comfortable on phones without changing approved branding. */
  main:has(> .countdown) {
    padding-inline: clamp(12px, 4vw, 19px);
  }
  main:has(> .countdown) .app-header {
    margin-bottom: 14px;
  }
  main:has(> .countdown) .countdown {
    min-height: 58px;
    gap: 9px;
    padding: 10px 12px;
    border-radius: 15px;
  }
  main:has(> .countdown) .countdown strong {
    font-size: clamp(15px, 4.2vw, 19px);
    line-height: 1.2;
    overflow-wrap: anywhere;
  }
  main:has(> .countdown) .countdown > span:not(.slash):not(.icon-square) {
    font-size: 12px;
    line-height: 1.35;
  }
  main:has(> .countdown) .countdown .icon-square {
    width: 44px;
    height: 44px;
    flex: none;
  }
  main:has(> .countdown) .week-strip {
    gap: 2px;
    padding: 9px 5px;
    border-radius: 16px;
    margin-bottom: 12px;
  }
  main:has(> .countdown) .week-strip button {
    min-width: 0;
    min-height: 55px;
    padding: 5px 0;
    justify-content: center;
  }
  main:has(> .countdown) .week-strip button.sel b {
    padding: 2px clamp(4px, 1.5vw, 8px);
  }
  main:has(> .countdown) .week-strip small {
    font-size: 10px;
    letter-spacing: 0;
  }
  main:has(> .countdown) .week-nav-mini a,
  main:has(> .countdown) .week-nav-mini button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /* Clear exercise-day call-to-action; long workout names may wrap safely. */
  main:has(> .countdown) .program-card {
    min-height: 250px;
    padding: 18px 17px 82px;
    border-radius: 18px;
  }
  main:has(> .countdown) .program-card h3 {
    font-size: clamp(22px, 6vw, 29px);
    line-height: 1.12;
    overflow-wrap: anywhere;
  }
  main:has(> .countdown) .program-card p {
    font-size: 13px;
    line-height: 1.45;
    max-width: 100%;
  }
  main:has(> .countdown) .program-card .up-next {
    left: 17px;
    right: auto;
    bottom: 16px;
    min-height: 46px;
    max-width: calc(100% - 34px);
    justify-content: center;
    font-size: 13px;
    letter-spacing: 1px;
    white-space: normal;
  }
  main:has(> .countdown) .program-card .up-next-more {
    margin-bottom: 58px;
  }
  main:has(> .countdown) .carousel {
    scroll-padding-inline: 3px;
  }

  /* Readable home actions: preserve exact order and destinations. */
  main:has(> .countdown) .action-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin-bottom: 15px;
  }
  main:has(> .countdown) .action-row > :last-child {
    grid-column: 1 / -1;
  }
  main:has(> .countdown) .action-row .action-btn {
    min-width: 0;
    min-height: 52px;
    padding: 10px 9px;
    font-size: clamp(11px, 3.1vw, 13px);
    line-height: 1.3;
    letter-spacing: 0.3px;
    border-radius: 13px;
  }
  main:has(> .countdown) .action-row > :last-child {
    border-color: rgba(var(--accent-rgb), 0.7);
  }
  main:has(> .countdown) .action-row .action-btn svg {
    width: 19px;
    height: 19px;
  }
  main:has(> .countdown) .tile-row {
    gap: 8px;
    margin-bottom: 18px;
  }
  main:has(> .countdown) .tile {
    min-width: 0;
    min-height: 72px;
    padding: 8px 3px;
    font-size: clamp(10px, 2.8vw, 12px);
    line-height: 1.3;
    letter-spacing: 0.2px;
    overflow-wrap: anywhere;
    border-radius: 12px;
  }
  main:has(> .countdown) .habit-hero {
    margin: 10px 0 20px;
    gap: 9px;
  }
  main:has(> .countdown) .habit-ring {
    width: clamp(152px, 43vw, 184px);
    height: clamp(152px, 43vw, 184px);
  }
  main:has(> .countdown) .habit-meta {
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
  }
  main:has(> .countdown) .habit-switch button {
    min-height: 44px;
  }
  main:has(> .countdown) .level-bar {
    gap: 9px;
    margin-bottom: 14px;
  }
  main:has(> .countdown) .level-bar .lv {
    font-size: clamp(15px, 4vw, 18px);
  }
  main:has(> .countdown) .level-bar .level-track {
    height: 9px;
  }
  main:has(> .countdown) .card-grid {
    gap: 11px;
  }
  main:has(> .countdown) .card-grid > .panel {
    min-width: 0;
    padding: 17px 15px;
    border-radius: 14px;
  }
  main:has(> .countdown) .card-grid .link-card h3 {
    font-size: clamp(17px, 5vw, 22px);
    line-height: 1.25;
  }
  main:has(> .countdown) .card-grid .subtle {
    font-size: 12px;
    line-height: 1.55;
    overflow-wrap: anywhere;
  }
  main:has(> .countdown) .kv-list {
    gap: 12px;
  }
  main:has(> .countdown) .kv-list span {
    font-size: 12px;
  }
  main:has(> .countdown) .kv-list b {
    font-size: 18px;
  }
  main:has(> .countdown) .history-item {
    min-height: 54px;
  }
}
/* Even the smallest supported phones keep seven readable date cells. */
@media (max-width: 360px) {
  main:has(> .countdown) .week-strip b {
    font-size: 18px;
  }
  main:has(> .countdown) .week-strip small {
    font-size: 9px;
  }
  main:has(> .countdown) .program-card {
    min-height: 264px;
  }
}

/* DS7 Dashboard Habits + Education: owner-directed mobile refinement */
.ds7-home-habits {
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  border-radius: 20px;
  padding: clamp(14px, 3vw, 24px);
  background: linear-gradient(140deg, rgba(5, 22, 31, 0.9), rgba(5, 14, 21, 0.85));
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  margin: 15px 0 18px;
}
.ds7-home-sectionhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.ds7-home-sectionhead h2 {
  margin: 2px 0 0;
  font-size: clamp(19px, 4vw, 25px);
  font-family: var(--ds7-font-display);
}
.ds7-home-sectionhead .subtle {
  margin: 3px 0;
}
.ds7-home-sectionhead button {
  min-height: 44px;
}
.ds7-home-quicklinks {
  margin: 4px 0 20px;
}
.ds7-home-quicklinks .action-btn {
  min-height: 54px;
}
.ds7-habit-empty .habit-ring {
  border: 0;
  cursor: pointer;
}
.habit-ring .val {
  stroke: var(--habit-accent, var(--accent));
}
.ds7-habit-presets {
  margin: 16px 0 24px;
}
.ds7-preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.ds7-preset {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 7px;
  min-height: 144px;
  padding: 16px;
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  border-radius: 16px;
  color: var(--ds7-silver);
  background: linear-gradient(155deg, #081d26, #07121a);
}
.ds7-preset:hover,
.ds7-preset:focus-visible {
  border-color: var(--accent);
}
.ds7-preset span:last-child {
  color: var(--accent);
  font-weight: 800;
  margin-top: auto;
}
.ds7-preset small {
  color: var(--ds7-muted);
}
.ds7-preset-wheel {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 4px dashed var(--accent);
}
.ds7-habit-list {
  margin: 22px 0;
}
.ds7-habit-list .section-heading {
  margin-bottom: 14px;
}
.ds7-habit-card .progress-fill {
  background: var(--habit-accent, var(--accent));
}
.ds7-habit-form {
  display: grid;
  gap: 16px;
}
.ds7-habit-wheel-preview {
  margin: 0 auto 6px;
  min-height: 146px;
  width: min(100%, 230px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 13px;
  background: rgba(3, 18, 26, 0.9);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  border-radius: 20px;
}
.ds7-habit-wheel-preview strong {
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ds7-silver);
}
.ds7-habit-wheel {
  height: 67px;
  width: 67px;
  border-radius: 50%;
  border: 9px dashed var(--habit-accent, var(--accent));
  filter: drop-shadow(0 0 8px rgba(var(--accent-rgb), 0.4));
}
.ds7-habit-modes,
.ds7-habit-palette {
  margin: 0;
  padding: 0;
  border: 0;
}
.ds7-habit-modes legend,
.ds7-habit-palette legend {
  font-weight: 750;
  margin-bottom: 10px;
}
.ds7-habit-modes-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.ds7-habit-modes-grid label {
  cursor: pointer;
  display: block;
  position: relative;
}
.ds7-habit-modes-grid input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.ds7-habit-modes-grid span {
  display: grid;
  place-items: center;
  min-height: 49px;
  padding: 8px;
  text-align: center;
  font-size: 13px;
  border-radius: 13px;
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  background: #081820;
  color: var(--ds7-silver);
}
.ds7-habit-modes-grid input:checked + span {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.18);
  color: var(--accent);
}
.ds7-habit-modes-grid input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.ds7-habit-numeric {
  display: grid;
  gap: 12px;
}
.ds7-habit-numeric[hidden] {
  display: none;
}
.ds7-habit-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 12px;
}
.ds7-habit-swatch {
  width: 37px;
  height: 37px;
  min-height: 37px;
  border-radius: 50%;
  background: var(--swatch);
  border: 2px solid rgba(255, 255, 255, 0.2);
  padding: 0;
  cursor: pointer;
}
.ds7-habit-swatch[aria-pressed='true'] {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.ds7-habit-colour-custom {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.ds7-habit-colour-custom input[type='color'] {
  width: 56px;
  height: 42px;
  padding: 0;
  border: 0;
  background: none;
}
.ds7-education-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 14px;
  align-items: start;
}
.ds7-education-card {
  display: grid;
  gap: 12px;
  min-width: 0;
}
.ds7-education-card h2 {
  font: 800 20px/1.25 var(--ds7-font-display);
  color: #e8faff;
  overflow-wrap: anywhere;
}
.ds7-education-card ol {
  margin: 0;
  padding-inline-start: 23px;
  display: grid;
  gap: 6px;
}
.ds7-education-card li::marker {
  color: #76edff;
  font-weight: 750;
}
.ds7-education-card a {
  display: grid;
  gap: 3px;
  min-height: 44px;
  align-content: center;
  padding: 8px 10px;
  color: #b6f7ff;
  border: 1px solid rgba(75, 224, 247, 0.25);
  border-radius: 9px;
  font-weight: 650;
}
.ds7-education-card a small {
  color: #a9c5d2;
  font-weight: 400;
}
.ds7-education-card a:hover,
.ds7-education-card a:focus-visible {
  border-color: #78efff;
  background: rgba(22, 70, 86, 0.55);
}
.ds7-education-card .pill {
  justify-self: start;
}
@media (max-width: 480px) {
  .ds7-home-habits {
    padding: 13px;
  }
  .ds7-home-quicklinks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ds7-home-quicklinks > .action-btn:last-child {
    grid-column: 1/-1;
  }
  .ds7-preset-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ds7-preset {
    min-height: 135px;
    padding: 12px;
  }
  .ds7-habit-wheel-preview {
    min-height: 116px;
  }
  .ds7-habit-modes-grid span {
    font-size: 12px;
  }
}
@media (max-width: 350px) {
  .ds7-preset-grid {
    grid-template-columns: 1fr;
  }
  .ds7-home-sectionhead button {
    width: 100%;
  }
}

/* === Storm Command Dashboard Premium, owner-approved artwork direction ===
   Strictly scoped to the Home route's .ds7-dashboard. No XP/level/points UI.
   Zeus source artwork is reused as a responsive backdrop, not a pasted UI picture. */
.ds7-dashboard {
  --ds7-home-line: rgba(var(--accent-rgb), 0.5);
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  gap: clamp(14px, 2.4vw, 22px);
}
.ds7-storm-hero {
  position: relative;
  isolation: isolate;
  min-height: clamp(205px, 29vw, 285px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  border-radius: 24px;
  background: #020d15;
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.35),
    0 0 27px rgba(var(--accent-rgb), 0.12);
}
.ds7-storm-hero-art {
  position: absolute;
  z-index: -2;
  inset: -3%;
  background-image:
    linear-gradient(180deg, rgba(0, 8, 15, 0.14), rgba(0, 9, 15, 0.18) 38%, rgba(0, 9, 15, 0.67) 67%, #031019 100%),
    var(--ds7-hero-art);
  background-position:
    center top,
    center 12%;
  background-size: cover, cover;
  filter: saturate(0.84);
  opacity: 0.97;
  transform: scale(1.04);
}
.ds7-storm-hero:after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 76% 16%, transparent 0 16%, rgba(1, 9, 17, 0.24) 64%),
    linear-gradient(0deg, #031019 0, transparent 42%);
}
.ds7-storm-top-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(12px, 2.2vw, 22px) clamp(14px, 3vw, 28px);
}
.ds7-storm-avatar {
  width: 48px;
  height: 48px;
  box-shadow: 0 0 16px rgba(var(--accent-rgb), 0.3);
  background-color: #06212a;
}
.ds7-storm-notices {
  width: 48px;
  height: 46px;
  border-radius: 15px;
  backdrop-filter: blur(8px);
  background: rgba(3, 18, 27, 0.65);
}
.ds7-storm-brand {
  position: relative;
  padding: 14px clamp(12px, 3vw, 30px) 23px;
  text-align: center;
}
.ds7-storm-wordmark {
  display: flex;
  align-items: baseline;
  justify-content: center;
  white-space: nowrap;
  letter-spacing: 0.02em;
  font-family: var(--ds7-font-display);
  font-size: clamp(20px, 6.4vw, 51px);
  font-weight: 900;
  font-style: italic;
  line-height: 1;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.78));
}
.ds7-silver-word {
  background: linear-gradient(180deg, #fff 8%, #eef5f9 30%, #97acba 70%, #ecfaff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.ds7-cyan-word {
  background: linear-gradient(180deg, #e9ffff 0%, #57edfa 38%, #00bbdc 75%, #d5f5fd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 10px rgba(var(--accent-rgb), 0.4));
}
.ds7-storm-tagline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 12px auto 0;
  max-width: 610px;
  color: #71ebf6;
  font-size: clamp(8px, 1.8vw, 13px);
  font-weight: 750;
  letter-spacing: clamp(2px, 0.65vw, 6px);
  white-space: nowrap;
  text-shadow: 0 0 12px rgba(var(--accent-rgb), 0.25);
}
.ds7-storm-tagline i {
  display: block;
  flex: 1;
  height: 1px;
  max-width: 100px;
  background: linear-gradient(90deg, transparent, var(--accent));
}
.ds7-storm-tagline i:last-child {
  transform: scaleX(-1);
}
.ds7-storm-mark {
  display: block;
  color: var(--accent);
  font-size: 18px;
  margin-top: 3px;
  text-shadow: 0 0 12px var(--accent);
}
.ds7-dashboard > .countdown {
  margin: 0;
  min-width: 0;
  border-color: var(--ds7-home-line);
  background: linear-gradient(105deg, rgba(5, 27, 38, 0.9), rgba(5, 17, 24, 0.86));
  box-shadow:
    0 0 24px rgba(var(--accent-rgb), 0.1),
    inset 0 1px rgba(255, 255, 255, 0.06);
}
.ds7-dashboard > .countdown strong {
  flex: 0 1 auto;
  min-width: 0;
}
.ds7-dashboard > .countdown .icon-square {
  margin-left: auto;
}
.ds7-dashboard > .week-strip {
  margin: 0;
  padding: 14px 12px;
  border: 1px solid var(--ds7-home-line);
  background: linear-gradient(175deg, rgba(8, 40, 53, 0.95), rgba(3, 17, 26, 0.94));
  box-shadow: 0 0 23px rgba(var(--accent-rgb), 0.15);
}
.ds7-dashboard > .week-nav-mini {
  margin: -12px 0 -4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ds7-dashboard > .week-nav-mini button {
  min-height: 38px;
  font-size: 12px;
}
.ds7-dashboard-train {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
  border-radius: 16px;
  background: linear-gradient(105deg, rgba(5, 28, 38, 0.72), rgba(3, 14, 22, 0.72));
  border: 1px solid rgba(var(--accent-rgb), 0.27);
}
.ds7-dashboard-train > span {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.ds7-dashboard-train b {
  font: italic 750 13px var(--ds7-font-display);
  letter-spacing: 1.4px;
}
.ds7-dashboard-train small {
  color: #adc2cc;
  line-height: 1.45;
}
.ds7-dashboard-train a {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  flex: none;
  min-height: 44px;
  border: 1px solid var(--ds7-home-line);
  border-radius: 12px;
  color: var(--accent);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
  background: rgba(1, 12, 19, 0.62);
}
.ds7-dashboard-train a svg {
  width: 17px;
  height: 17px;
}
.ds7-dashboard .ds7-home-habits {
  margin: 0;
  padding: clamp(14px, 3vw, 25px);
  border-radius: 21px;
  background: linear-gradient(145deg, rgba(7, 33, 45, 0.89), rgba(2, 14, 22, 0.92));
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  box-shadow:
    0 9px 30px rgba(0, 0, 0, 0.3),
    inset 0 1px rgba(var(--accent-rgb), 0.07);
}
.ds7-dashboard .ds7-home-sectionhead {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.ds7-dashboard .ds7-home-sectionhead h2 {
  font: italic 800 clamp(20px, 3vw, 25px) var(--ds7-font-display);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0;
}
.ds7-dashboard .ds7-home-sectionhead h2:before {
  content: '╱';
  color: var(--accent);
  font-weight: 900;
  padding-right: 8px;
  text-shadow: 0 0 12px rgba(var(--accent-rgb), 0.55);
}
.ds7-dashboard .ds7-home-sectionhead .eyebrow {
  display: none;
}
.ds7-home-all {
  color: #79e8f1;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
  min-height: 42px;
  display: flex;
  align-items: center;
  text-decoration: none;
}
.ds7-habits-home-summary {
  color: #aec5ce;
  font-size: 12px;
  margin: 2px 0 12px;
}
.ds7-home-habit-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(6px, 1.5vw, 12px);
}
.ds7-home-habit-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 126px;
  min-width: 0;
  padding: 10px 4px;
  gap: 7px;
  border-radius: 16px;
  border: 1px solid rgba(var(--accent-rgb), 0.48);
  color: var(--ds7-silver);
  background: linear-gradient(160deg, rgba(5, 38, 52, 0.81), rgba(2, 18, 27, 0.96));
  box-shadow:
    0 5px 13px rgba(0, 0, 0, 0.23),
    inset 0 0 13px rgba(var(--accent-rgb), 0.065);
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}
.ds7-home-habit-tile:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.ds7-home-habit-tile:active {
  transform: scale(0.95);
}
.ds7-home-habit-tile:hover {
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(var(--accent-rgb), 0.19);
}
.ds7-home-habit-tile b {
  font: italic 750 clamp(11px, 2vw, 16px) var(--ds7-font-display);
  text-align: center;
  overflow-wrap: anywhere;
}
.ds7-home-habit-tile small {
  font-size: 10px;
  color: #b5d7e2;
  text-align: center;
  line-height: 1.3;
}
.ds7-home-habit-icon {
  display: grid;
  place-items: center;
  color: var(--habit-accent, var(--accent));
  height: 38px;
}
.ds7-home-habit-icon svg {
  width: 34px;
  height: 34px;
  filter: drop-shadow(0 0 5px rgba(var(--accent-rgb), 0.25));
}
.ds7-home-habit-state {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 1px solid rgba(var(--accent-rgb), 0.55);
  border-radius: 50%;
  font-size: 10px;
  color: var(--accent);
}
.ds7-home-habit-tile.is-met .ds7-home-habit-state {
  border-color: var(--habit-accent);
  background: var(--habit-accent);
  color: #03161a;
}
.ds7-home-habit-tile.is-met {
  border-color: var(--habit-accent);
}
.ds7-home-habit-tile.ds7-habit-active:before {
  content: '';
  pointer-events: none;
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: conic-gradient(var(--habit-accent) var(--habit-progress, 0%), transparent var(--habit-progress, 0%));
  opacity: 0.09;
}
.ds7-create-habit {
  border-color: var(--accent);
  background: linear-gradient(160deg, rgba(1, 67, 76, 0.38), rgba(1, 20, 28, 0.98));
  box-shadow: 0 0 15px rgba(var(--accent-rgb), 0.15);
}
.ds7-home-create-icon {
  color: var(--accent);
  display: grid;
  place-items: center;
}
.ds7-home-create-icon svg {
  width: 34px;
  height: 34px;
}
.ds7-education-cta {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 95px;
  padding: 17px 24px;
  color: #e4f1f7;
  text-decoration: none;
  border: 1px solid rgba(var(--accent-rgb), 0.68);
  border-radius: 22px;
  background: linear-gradient(90deg, rgba(5, 42, 55, 0.94), rgba(2, 19, 30, 0.83)), var(--ds7-hero-art, none);
  box-shadow:
    0 0 22px rgba(var(--accent-rgb), 0.17),
    inset 0 0 10px rgba(var(--accent-rgb), 0.05);
}
.ds7-education-cta svg {
  width: 42px;
  height: 42px;
  flex: none;
  color: #69edf9;
  filter: drop-shadow(0 0 9px rgba(var(--accent-rgb), 0.48));
}
.ds7-education-cta span {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.ds7-education-cta b {
  font: italic 800 22px var(--ds7-font-display);
  letter-spacing: 1.2px;
}
.ds7-education-cta small {
  font: italic 13px var(--ds7-font-body);
  color: #b9d3dd;
}
.ds7-education-cta strong {
  margin-left: auto;
  font-size: 28px;
  font-weight: 400;
}
.ds7-education-cta:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.ds7-dashboard .ds7-today-panel {
  margin: 0;
  padding: 20px 22px;
  border-color: rgba(var(--accent-rgb), 0.42);
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(5, 30, 41, 0.9), rgba(3, 16, 24, 0.96));
}
.ds7-dashboard .ds7-today-panel .panel-heading h2 {
  font: italic 800 22px var(--ds7-font-display);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.ds7-dashboard .ds7-today-panel .panel-heading h2:before {
  content: '╱';
  color: var(--accent);
  padding-right: 8px;
}
@media (max-width: 600px) {
  main:has(> .ds7-dashboard) {
    padding: 12px clamp(10px, 3vw, 18px) 100px;
  }
  .ds7-dashboard {
    gap: 13px;
  }
  .ds7-storm-hero {
    min-height: 230px;
    border-radius: 0 0 20px 20px;
    margin: -12px -10px 0;
  }
  .ds7-storm-hero-art {
    background-position:
      center top,
      52% 7%;
    background-size:
      cover,
      auto 520px;
  }
  .ds7-storm-brand {
    padding-bottom: 25px;
  }
  .ds7-dashboard > .week-strip {
    padding: 8px 4px;
    gap: 2px;
    border-radius: 16px;
  }
  .ds7-dashboard > .week-strip button {
    min-width: 0;
    min-height: 54px;
    padding: 5px 0;
  }
  .ds7-dashboard > .week-strip button.sel b {
    padding: 2px 6px;
  }
  .ds7-dashboard > .week-strip small {
    font-size: 10px;
    letter-spacing: 0;
  }
  .ds7-dashboard > .week-strip b {
    font-size: 20px;
  }
  .ds7-dashboard-train {
    padding: 10px 12px;
  }
  .ds7-dashboard-train small {
    font-size: 11px;
  }
  .ds7-dashboard-train a {
    padding: 7px 9px;
  }
  .ds7-dashboard .ds7-home-habits {
    padding: 13px 9px;
  }
  .ds7-home-habit-tile {
    min-height: 116px;
    border-radius: 13px;
  }
  .ds7-home-habit-tile small {
    font-size: 9px;
  }
  .ds7-education-cta {
    min-height: 84px;
    padding: 15px 18px;
  }
  .ds7-education-cta b {
    font-size: 20px;
  }
}
@media (max-width: 350px) {
  .ds7-storm-wordmark {
    font-size: 18px;
  }
  .ds7-home-habit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ds7-dashboard-train small {
    display: none;
  }
  .ds7-storm-hero {
    min-height: 206px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ds7-dashboard * {
    transition: none !important;
    animation: none !important;
  }
}

/* ===== DS7 Habits Hub — premium mobile-first visual refinement (isolated) =====
   Habits route only. Does not modify habit storage, recording or global navigation. */
.ds7-habits-premium {
  display: grid;
  gap: 16px;
  max-width: 1150px;
  margin: 0 auto;
  min-width: 0;
}
.ds7-habits-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 245px;
  padding: 22px clamp(18px, 4vw, 34px) 27px;
  border: 1px solid rgba(var(--accent-rgb), 0.55);
  border-radius: 23px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: end;
  background: #031019;
  box-shadow:
    0 18px 40px #0008,
    0 0 25px rgba(var(--accent-rgb), 0.1);
}
.ds7-habits-hero-image {
  position: absolute;
  inset: -6px 0 auto;
  z-index: -2;
  display: block;
  width: 100%;
  height: 520px;
  object-fit: cover;
  object-position: center top;
  filter: saturate(0.85) brightness(0.87);
  pointer-events: none;
}
.ds7-habits-hero:before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(0deg, #03131d 0%, rgba(2, 15, 24, 0.6) 32%, rgba(0, 10, 18, 0.08) 73%);
}
.ds7-habits-hero:after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 80% 10%, rgba(0, 228, 246, 0.19), transparent 50%),
    linear-gradient(90deg, #02101ad9, transparent 80%);
}
.ds7-habits-back {
  position: absolute;
  top: 18px;
  left: 18px;
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  border-radius: 12px;
  background: #051924b0;
  color: #e4faff;
  font-size: 12px;
  text-decoration: none;
}
.ds7-habits-back:focus-visible,
.ds7-habits-add-link:focus-visible,
.ds7-habits-preset-tile:focus-visible,
.ds7-habits-create:focus-visible,
.ds7-habit-main-action:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.ds7-habits-hero-mark {
  color: var(--accent);
  margin-bottom: 9px;
  filter: drop-shadow(0 0 10px rgba(var(--accent-rgb), 0.7));
}
.ds7-habits-hero-mark svg {
  width: 29px;
  height: 29px;
}
.ds7-habits-eyebrow,
.ds7-habits-kicker {
  margin: 0;
  color: #7de8f1;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
}
.ds7-habits-hero h1 {
  margin: 4px 0 3px;
  font: italic 900 clamp(36px, 7vw, 63px)/1.02 var(--ds7-font-display);
  letter-spacing: 2.5px;
  color: #e7f9fc;
  text-shadow: 0 0 20px rgba(var(--accent-rgb), 0.4);
}
.ds7-habits-hero-sub {
  margin: 0;
  color: #c2dce6;
  font: italic 14px var(--ds7-font-body);
}
.ds7-habits-overview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-radius: 19px;
  border: 1px solid rgba(var(--accent-rgb), 0.32);
  background: linear-gradient(115deg, rgba(6, 36, 48, 0.92), rgba(2, 17, 24, 0.96));
  min-width: 0;
}
.ds7-habits-overview h2 {
  font: italic 800 21px var(--ds7-font-display);
  margin: 3px 0 2px;
  color: #effbff;
}
.ds7-habits-overview p.subtle {
  font-size: 12px;
  margin: 0;
}
.ds7-habits-day-score {
  display: grid;
  text-align: center;
  min-width: 90px;
  flex: none;
  padding: 8px 13px;
  border-radius: 15px;
  background: rgba(var(--accent-rgb), 0.08);
  border: 1px solid rgba(var(--accent-rgb), 0.28);
}
.ds7-habits-day-score strong {
  font-size: 26px;
  font-weight: 850;
  color: #82f9ff;
  font-variant-numeric: tabular-nums;
}
.ds7-habits-day-score strong span {
  font-size: 15px;
  color: #b7cbd3;
}
.ds7-habits-day-score small {
  color: #b7cbd3;
  font-size: 11px;
}
.ds7-habits-calendar .week-strip {
  margin: 0;
  background: linear-gradient(150deg, #051d29, #03131b);
  border-color: rgba(var(--accent-rgb), 0.38);
  box-shadow: 0 0 15px rgba(var(--accent-rgb), 0.06);
}
.ds7-habits-premium .ds7-habit-list {
  margin: 0;
  display: grid;
  gap: 12px;
}
.ds7-habits-section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  margin: 2px 0 2px;
}
.ds7-habits-section-title h2 {
  margin: 3px 0;
  font: italic 800 24px var(--ds7-font-display);
  color: #ebf6fb;
}
.ds7-habits-add-link {
  display: flex;
  align-items: center;
  min-height: 44px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 800;
  color: #6eefff;
  text-decoration: none;
  background: transparent;
  border: 0;
  padding: 0 4px;
}
.ds7-habits-work-card {
  display: grid;
  gap: 12px;
  padding: 16px 17px;
  border: 1px solid rgba(var(--accent-rgb), 0.46);
  border-radius: 18px;
  background: linear-gradient(110deg, #072431ee, #04141cf5);
  box-shadow:
    0 6px 20px #0005,
    inset 0 0 15px rgba(var(--accent-rgb), 0.06);
  min-width: 0;
  transition:
    transform 0.2s var(--ds7-ease),
    box-shadow 0.2s var(--ds7-ease);
}
.ds7-habits-work-card:hover {
  box-shadow:
    0 8px 22px #0006,
    0 0 15px rgba(var(--accent-rgb), 0.16);
}
.ds7-habits-work-card.is-disabled {
  opacity: 0.7;
}
.ds7-habits-work-head {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}
.ds7-habits-work-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 57px;
  height: 57px;
  border-radius: 15px;
  color: var(--habit-accent);
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.12), #03131d);
  border: 1px solid rgba(var(--accent-rgb), 0.38);
  box-shadow: inset 0 0 15px rgba(var(--accent-rgb), 0.1);
}
.ds7-habits-work-icon svg {
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 0 6px var(--habit-accent));
}
.ds7-habits-work-copy {
  min-width: 0;
  flex: 1;
}
.ds7-habits-work-copy h3 {
  margin: 0 0 5px;
  color: #eefaff;
  font-size: 17px;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.ds7-habits-work-copy p {
  margin: 0;
  font-size: 11px;
  color: #a7c8d4;
  line-height: 1.45;
}
.ds7-habits-percent {
  flex: none;
  align-self: center;
  font-size: 18px;
  font-weight: 850;
  color: var(--habit-accent);
  font-variant-numeric: tabular-nums;
}
.ds7-habits-track {
  height: 7px;
  width: 100%;
  background: #07151d;
  border: 1px solid #244852;
  border-radius: 99px;
  overflow: hidden;
}
.ds7-habits-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--habit-accent), #9ffbff);
  box-shadow: 0 0 10px var(--habit-accent);
  transition: width 0.34s var(--ds7-ease);
}
.ds7-habits-work-foot {
  display: grid;
  gap: 9px;
}
.ds7-habits-status {
  color: #b8d4df;
  font-size: 13px;
  font-weight: 650;
}
.ds7-habits-controls {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.ds7-habits-controls button {
  min-height: 42px;
}
.ds7-habits-controls .quiet {
  min-height: 42px;
}
.ds7-habit-main-action {
  border: 1px solid var(--habit-accent);
  border-radius: 12px;
  padding: 8px 13px;
  color: #031923;
  background: var(--habit-accent);
  font-weight: 800;
  font-size: 12px;
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.14);
}
.ds7-habits-work-card.is-complete .ds7-habits-work-icon {
  box-shadow:
    inset 0 0 15px rgba(var(--accent-rgb), 0.1),
    0 0 15px rgba(var(--accent-rgb), 0.12);
}
.ds7-habits-empty {
  border: 1px dashed rgba(var(--accent-rgb), 0.44);
  border-radius: 18px;
  padding: 28px 18px;
  text-align: center;
  background: #071924a8;
}
.ds7-habits-empty span {
  display: inline-grid;
  place-items: center;
  color: var(--accent);
}
.ds7-habits-empty svg {
  height: 46px;
  width: 46px;
}
.ds7-habits-empty h3 {
  font-size: 18px;
  margin: 10px 0 7px;
}
.ds7-habits-empty p {
  font-size: 12px;
  color: #b7cad3;
  max-width: 340px;
  margin: 0 auto;
}
.ds7-habits-discover {
  border: 1px solid rgba(var(--accent-rgb), 0.33);
  border-radius: 20px;
  padding: 18px;
  background: linear-gradient(140deg, #061d28, #031018);
  display: grid;
  gap: 13px;
  min-width: 0;
}
.ds7-habits-preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}
.ds7-habits-preset-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 139px;
  padding: 12px 7px;
  border-radius: 14px;
  border: 1px solid rgba(var(--accent-rgb), 0.4);
  background: linear-gradient(135deg, #092936, #041721);
  color: #effbfe;
  text-align: center;
  transition:
    transform 0.2s var(--ds7-ease),
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}
.ds7-habits-preset-tile:hover {
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(var(--accent-rgb), 0.18);
}
.ds7-habits-preset-tile:active {
  transform: scale(0.97);
}
.ds7-habits-preset-icon {
  display: grid;
  place-items: center;
  color: #7df3ff;
}
.ds7-habits-preset-icon svg {
  width: 33px;
  height: 33px;
  filter: drop-shadow(0 0 5px #39dbea88);
}
.ds7-habits-preset-tile b {
  font-size: 13px;
}
.ds7-habits-preset-tile small {
  font-size: 10px;
  color: #b9d2db;
}
.ds7-habits-preset-add {
  margin-top: 3px;
  color: #75efff;
  font-weight: 800;
  font-size: 11px;
}
.ds7-habits-create {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 52px;
  border-radius: 14px;
  border: 1px solid var(--accent);
  color: #e8fcff;
  background: linear-gradient(100deg, #05526477, #041721);
  box-shadow: 0 0 15px rgba(var(--accent-rgb), 0.12);
  font-size: 14px;
  font-weight: 800;
}
.ds7-habits-create svg {
  width: 20px;
  height: 20px;
}
@media (max-width: 600px) {
  .ds7-habits-hero {
    min-height: 225px;
    margin: -12px -7px 0;
    border-radius: 0 0 20px 20px;
  }
  .ds7-habits-overview {
    padding: 15px;
  }
  .ds7-habits-work-card {
    padding: 13px;
  }
  .ds7-habits-discover {
    padding: 14px;
  }
  .ds7-habits-work-icon {
    width: 48px;
    height: 48px;
  }
  .ds7-habits-work-icon svg {
    width: 30px;
    height: 30px;
  }
  .ds7-habits-work-copy h3 {
    font-size: 15px;
  }
  .ds7-habits-work-copy p {
    font-size: 10px;
  }
  .ds7-habits-controls .quiet {
    font-size: 11px;
  }
}
@media (max-width: 390px) {
  .ds7-habits-preset-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ds7-habits-day-score {
    min-width: 75px;
    padding: 8px 9px;
  }
  .ds7-habits-controls {
    gap: 6px;
  }
  .ds7-habits-controls .quiet {
    padding: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ds7-habits-work-card,
  .ds7-habits-preset-tile,
  .ds7-habits-track span {
    transition: none;
  }
}

/* DS7 Training Command | premium mobile UI, isolated presentation only.
   Covers Program + Weeks + Editor, Calendar, Exercise Library + Detail, History,
   and standalone/linked Workouts. Does not alter handlers, IDs, calculations or data. */
.ds7-training-premium {
  --train-ice: #b7fcff;
  --train-line: rgba(36, 218, 241, 0.42);
  --train-glow: rgba(0, 211, 239, 0.14);
  min-width: 0;
  max-width: 1370px;
  margin-inline: auto;
  display: flow-root;
}
.ds7-training-premium :where(.panel, .exercise-card, .day-card) {
  background: linear-gradient(143deg, rgba(9, 35, 47, 0.97), rgba(2, 12, 21, 0.99));
  border: 1px solid rgba(56, 216, 234, 0.38);
  box-shadow:
    inset 0 1px rgba(201, 251, 255, 0.1),
    0 10px 32px #0008,
    0 0 18px rgba(0, 209, 233, 0.045);
  border-radius: 17px;
}
.ds7-training-premium :where(.panel, .exercise-card, .day-card):before {
  opacity: 0.8;
}
.ds7-training-premium :where(.panel-heading h2, .ds7-section-heading h2) {
  color: #e9faff;
  font-family: var(--ds7-font-display);
  font-weight: 800;
  letter-spacing: 0.25px;
}
.ds7-training-premium .eyebrow {
  color: #63f4ff;
  letter-spacing: 2px;
}
.ds7-training-premium .tab-row:has([data-training-tab]) > .segmented {
  display: flex;
  width: 100%;
  border: 1px solid rgba(43, 211, 233, 0.38);
  background: linear-gradient(110deg, #041823, #03111a);
  border-radius: 17px;
  padding: 5px;
  gap: 4px;
  box-shadow:
    inset 0 0 12px #13bfd20d,
    0 6px 20px #0004;
}
.ds7-training-premium [data-training-tab] {
  flex: 1;
  min-height: 51px !important;
  white-space: nowrap;
  border-radius: 11px;
  font-weight: 800;
  letter-spacing: 0.3px;
  font-size: 13px;
  transition:
    transform 0.15s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
}
.ds7-training-premium [data-training-tab].active {
  background: linear-gradient(130deg, #095062, #083443);
  color: #bdfaff;
  box-shadow:
    inset 0 0 0 1px rgba(65, 240, 255, 0.63),
    0 0 15px rgba(0, 224, 242, 0.17);
}
.ds7-training-premium :where(.primary, .secondary, .quiet, .icon-button, .text-link) {
  transition:
    filter 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease;
  touch-action: manipulation;
}
.ds7-training-premium :where(button, a, input, select, textarea):focus-visible {
  outline: 2px solid #94faff;
  outline-offset: 3px;
}
.ds7-training-premium :where(.primary, .secondary, .quiet, .icon-button) {
  min-height: 44px;
}
.ds7-training-premium .ds7-program-topline {
  position: relative;
  isolation: isolate;
  min-height: 226px;
  padding: 30px clamp(18px, 4vw, 34px);
  border: 1px solid rgba(66, 240, 255, 0.57);
  border-radius: 22px;
  box-shadow:
    0 0 23px rgba(0, 200, 233, 0.13),
    0 18px 30px #0008;
  overflow: hidden;
  align-items: end;
  background: #03121c;
}
.ds7-training-premium .ds7-program-topline:before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(90deg, #03121cf5 6%, #03121cbb 42%, #00121d31 100%),
    linear-gradient(0deg, #03141be8, transparent 60%), url('assets/zeus-opening.png');
  background-size: cover, cover, cover;
  background-position:
    center,
    center,
    center 7%;
  filter: saturate(0.95);
}
.ds7-training-premium .ds7-program-topline:after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  width: 70%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #46ebffcc);
  box-shadow: 0 0 12px #42d8ed66;
  pointer-events: none;
}
.ds7-training-premium .ds7-program-topline > div {
  position: relative;
  z-index: 1;
}
.ds7-training-premium .ds7-program-topline h2 {
  font: italic 900 clamp(29px, 4vw, 42px)/1.12 var(--ds7-font-display);
  color: #effcff;
  text-shadow: 0 0 20px #31e7ff55;
  margin: 10px 0 6px;
}
.ds7-training-premium .ds7-training-top-caption {
  margin: 0;
  color: #c8dfe6;
  font-size: 13px;
  font-style: italic;
}
.ds7-training-premium .ds7-training-wordmark {
  display: inline-grid;
  gap: 3px;
  margin-bottom: 17px;
}
.ds7-training-premium .ds7-training-wordmark strong {
  font: italic 900 clamp(15px, 2.2vw, 21px)/1 var(--ds7-font-display);
  letter-spacing: 1.4px;
  color: #dde8ed;
  text-shadow:
    0 1px #fff4,
    0 0 10px #8ef0ff41;
}
.ds7-training-premium .ds7-training-wordmark b {
  color: #54edff;
}
.ds7-training-premium .ds7-training-wordmark span {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 4.1px;
  color: #5cebf6;
}
.ds7-training-premium .ds7-program-topline .button-row {
  justify-content: flex-end;
}
.ds7-training-premium .ds7-program-hero {
  border: 1px solid rgba(74, 222, 239, 0.59);
  border-radius: 20px;
  box-shadow:
    0 0 25px rgba(0, 228, 247, 0.1),
    0 17px 33px #0009;
  min-height: 280px;
}
.ds7-training-premium .ds7-program-art {
  opacity: 0.84;
  object-position: center 7%;
}
.ds7-training-premium .ds7-program-hero::before {
  background:
    linear-gradient(90deg, #021019f9, #03121bda 38%, #0416222d 84%), linear-gradient(0deg, #03141be3, transparent 64%);
}
.ds7-training-premium .ds7-program-brand {
  color: #e5f8fe;
  text-shadow: 0 0 14px #10bcd557;
}
.ds7-training-premium .ds7-program-brand b {
  color: #50f1ff;
}
.ds7-training-premium .ds7-program-cta {
  box-shadow: 0 0 20px #20e6f73d;
}
.ds7-training-premium .ds7-program-summary,
.ds7-training-premium .ds7-equipment,
.ds7-training-premium .ds7-program-roadmap {
  padding: clamp(16px, 2.5vw, 27px);
}
.ds7-training-premium .ds7-program-facts strong {
  color: #9bf5ff;
  text-shadow: 0 0 12px rgba(41, 220, 241, 0.26);
}
.ds7-training-premium .ds7-phase-preview,
.ds7-training-premium .ds7-week-card {
  border-radius: 12px;
  background: linear-gradient(115deg, #092631, #03121a);
  border: 1px solid #43dce737;
  min-height: 70px;
  padding-inline: 13px;
}
.ds7-training-premium .ds7-phase-preview {
  margin: 7px 0;
}
.ds7-training-premium .ds7-week-card:is(.is-current, .is-live),
.ds7-training-premium .ds7-workout-day.next {
  border-color: #6becff;
  box-shadow:
    inset 3px 0 #50efff,
    0 0 19px #0cdce628;
}
.ds7-training-premium .ds7-program-file-bar {
  border-radius: 14px;
  background: #051923f2;
}
.ds7-training-premium .storm-page-heading {
  border-radius: 19px;
  min-height: 205px;
  isolation: isolate;
  overflow: hidden;
  background:
    linear-gradient(90deg, #04121af0, #061c2a89),
    url('assets/zeus-opening.png') center 6% / cover no-repeat;
  box-shadow:
    0 0 19px #10dfef1c,
    0 12px 32px #0007;
}
.ds7-training-premium .storm-page-heading h1 {
  color: #e9faff;
  font: italic 900 clamp(27px, 4vw, 39px)/1.12 var(--ds7-font-display);
  text-shadow: 0 0 15px #20d8ef55;
}
.ds7-training-premium .storm-page-heading > .page-dragon-art {
  display: none;
}
.ds7-training-premium .storm-page-heading p {
  color: #c6dbe6;
}
.ds7-training-premium .live-banner {
  border: 1px solid #4fe7ef7a;
  border-radius: 14px;
  background: linear-gradient(95deg, #0a3a45, #031620);
  box-shadow: 0 0 18px #0ce2ed20;
  padding: 14px 16px;
}
/* Logged-date calendar: keep every date and its actions; make small phones legible. */
.ds7-training-premium .calendar {
  border-radius: 16px;
  overflow-x: auto;
}
.ds7-training-premium .cal-head,
.ds7-training-premium .cal-grid {
  gap: 5px;
}
.ds7-training-premium .cal-head span {
  font-size: 11px;
  font-weight: 800;
  color: #b3dfe9;
}
.ds7-training-premium .cal-cell {
  background: linear-gradient(160deg, #071f2a, #03121b);
  border: 1px solid #327b8a63;
  border-radius: 10px;
  min-width: 0;
  min-height: 82px;
  padding: 7px;
  overflow: hidden;
}
.ds7-training-premium .cal-cell.today {
  border-color: #61efff;
  box-shadow:
    inset 0 0 0 1px #45eaff2e,
    0 0 14px #19e0f42b;
}
.ds7-training-premium .cal-date {
  color: #d6e8f1;
  font-weight: 800;
}
.ds7-training-premium .cal-cell.today .cal-date {
  color: #62f8ff;
}
.ds7-training-premium .cal-chip {
  border-radius: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  display: block;
  font-size: 10px;
}
.ds7-training-premium .chart-legend {
  gap: 11px;
  flex-wrap: wrap;
}
/* Master catalogue: one source of truth, unchanged picker/search/import handlers. */
.ds7-training-premium .library-grid {
  gap: 17px;
  min-width: 0;
  align-items: start;
}
.ds7-training-premium .library-grid .panel {
  padding: clamp(14px, 2.5vw, 23px);
}
.ds7-training-premium .library-grid .panel-heading {
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.ds7-training-premium .library-grid .panel-heading .button-row {
  flex-wrap: wrap;
  gap: 7px;
}
.ds7-training-premium .filter-row {
  gap: 9px;
  flex-wrap: wrap;
}
.ds7-training-premium :where(input[type='search'], .filter-row select) {
  min-height: 46px;
  border-radius: 11px;
  border-color: #358b9899;
  background: #051822;
}
.ds7-training-premium .exercise-list {
  border: 1px solid #28788770;
  border-radius: 13px;
  overflow: hidden;
  background: #02131c;
}
.ds7-training-premium .exercise-item {
  border-bottom: 1px solid #2a819a37;
  min-width: 0;
  transition: background 0.16s ease;
}
.ds7-training-premium .exercise-item.active,
.ds7-training-premium .exercise-item:focus-within {
  background: linear-gradient(95deg, #0c4855, #092330);
}
.ds7-training-premium .exercise-open {
  min-height: 52px;
  text-align: left;
  min-width: 0;
}
.ds7-training-premium .exercise-open b {
  color: #e5faff;
}
.ds7-training-premium .exercise-open small {
  color: #9ec1d0;
}
.ds7-training-premium .mini-stats {
  gap: 8px;
}
.ds7-training-premium .mini-stats > div {
  background: #041720;
  border: 1px solid #306c815c;
  border-radius: 11px;
  padding: 12px;
}
.ds7-training-premium .dup-review {
  border-color: #1ebcce73;
}
/* History: visual improvements only. Retain 48-at-a-time cards and all-data analytics. */
.ds7-training-premium .history-item {
  border: 1px solid #326a7b66;
  border-radius: 12px;
  background: linear-gradient(105deg, #082530, #031720);
  padding: 15px;
  margin: 8px 0;
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: space-between;
  min-width: 0;
}
.ds7-training-premium .history-item a {
  color: #b3f7ff;
  font-weight: 800;
  text-decoration: none;
}
.ds7-training-premium .history-item .row-actions {
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.ds7-training-premium .status-pill {
  background: #073e49;
  border: 1px solid #30d9e557;
  color: #b4f7fc;
}
.ds7-training-premium [data-history-more] {
  border-color: #51e7f6;
  background: #06303d;
  color: #b4f9ff;
  font-weight: 800;
  min-height: 48px;
}
/* Live workouts and the program editor inherit the same storm treatment. */
.ds7-training-premium .workout-bar {
  z-index: 6;
  border-radius: 16px;
  border: 1px solid #61ddf3a3;
  background: linear-gradient(105deg, #0b3542f2, #02151cf7);
  box-shadow:
    0 10px 28px #0009,
    0 0 17px #2feeff22;
}
.ds7-training-premium .workout-bar strong {
  color: #bdfaff;
}
.ds7-training-premium .progress-track {
  background: #0d3542;
  border: 1px solid #2c86964d;
  border-radius: 99px;
  overflow: hidden;
}
.ds7-training-premium .progress-fill {
  background: linear-gradient(90deg, #1abbd0, #6af5ff);
  box-shadow: 0 0 10px #38ecfc83;
}
.ds7-training-premium .exercise-cards {
  gap: 15px;
}
.ds7-training-premium .exercise-card {
  padding: clamp(12px, 2.5vw, 22px);
}
.ds7-training-premium .exercise-card.complete {
  border-color: #48e8c599;
}
.ds7-training-premium .exercise-card-head {
  border-bottom: 1px solid #47d8ec2d;
  padding-bottom: 12px;
  margin-bottom: 8px;
}
.ds7-training-premium .exercise-card h3 {
  color: #eafaff;
}
.ds7-training-premium .set-row.v3 {
  border-radius: 9px;
}
.ds7-training-premium .set-row.v3.done {
  background: #0a403d4d;
}
.ds7-training-premium .set-row.v3.skipped {
  background: #18232a77;
}
.ds7-training-premium .set-check {
  min-height: 42px;
  min-width: 42px;
}
.ds7-training-premium .quick-row {
  gap: 8px;
  flex-wrap: wrap;
}
.ds7-training-premium .superset-nav {
  border: 1px solid #29bdcd63;
  border-radius: 12px;
  background: #061e29;
  padding: 15px;
}
.ds7-training-premium .ds7-program-editor .builder-grid,
.ds7-training-premium.ds7-program-editor .builder-grid {
  gap: 16px;
}
.ds7-training-premium :where(.builder-day, .rx-row, .day-name-row) {
  border-color: #3aa6b554;
}
.ds7-training-premium .ds7-workout-day {
  border-radius: 14px;
}
/* Touch and accessibility: no forced minimum width, preserve focused element, reduced motion. */
@media (hover: hover) {
  .ds7-training-premium :where(.exercise-item, .history-item, .day-card):hover {
    border-color: #5ceaf7;
    box-shadow: 0 0 17px #1fc8e61d;
  }
}
@media (max-width: 700px) {
  .ds7-training-premium {
    width: 100%;
    overflow-wrap: anywhere;
  }
  .ds7-training-premium .ds7-program-topline {
    min-height: 200px;
    padding: 22px 16px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 13px;
    margin-bottom: 15px;
  }
  .ds7-training-premium .ds7-program-topline:before {
    background-image:
      linear-gradient(0deg, #03121cfa, #03121c80 85%), linear-gradient(90deg, #03121cc7, transparent 90%),
      url('assets/zeus-opening.png');
    background-position:
      center,
      center,
      center top;
  }
  .ds7-training-premium .ds7-program-topline h2 {
    font-size: 29px;
    margin: 5px 0 3px;
  }
  .ds7-training-premium .ds7-training-wordmark {
    margin-bottom: 8px;
  }
  .ds7-training-premium .ds7-program-topline .button-row {
    width: 100%;
    justify-content: stretch;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
    gap: 8px;
  }
  .ds7-training-premium .ds7-program-topline .button-row > * {
    min-width: 0;
  }
  .ds7-training-premium .tab-row {
    margin: 12px 0 16px;
    overflow: visible;
  }
  .ds7-training-premium .tab-row:has([data-training-tab]) > .segmented {
    width: 100%;
    flex-wrap: nowrap !important;
    gap: 3px;
    padding: 4px;
  }
  .ds7-training-premium [data-training-tab] {
    min-width: 0 !important;
    min-height: 49px !important;
    padding: 8px 3px !important;
    font-size: 11px;
    letter-spacing: 0;
  }
  .ds7-training-premium .ds7-program-hero {
    min-height: 236px;
  }
  .ds7-training-premium .ds7-program-art {
    object-position: 50% 0;
  }
  .ds7-training-premium .ds7-program-summary {
    padding: 15px;
  }
  .ds7-training-premium .storm-page-heading {
    min-height: 176px;
    padding: 19px 16px;
    background-position:
      center,
      center top;
  }
  .ds7-training-premium .cal-head,
  .ds7-training-premium .cal-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 3px;
  }
  .ds7-training-premium .cal-head span {
    font-size: 9px;
  }
  .ds7-training-premium .cal-cell {
    padding: 4px 3px;
    min-height: 68px;
    border-radius: 6px;
  }
  .ds7-training-premium .cal-date {
    font-size: 11px;
  }
  .ds7-training-premium .cal-chip {
    font-size: 8px;
    padding: 3px 2px;
  }
  .ds7-training-premium .library-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .ds7-training-premium .filter-row > * {
    min-width: 0;
  }
  .ds7-training-premium .exercise-list {
    max-height: 450px;
    overflow-y: auto;
  }
  .ds7-training-premium .history-item {
    align-items: flex-start;
    flex-direction: column;
    padding: 13px;
  }
  .ds7-training-premium .history-item .row-actions {
    justify-content: flex-start;
  }
  .ds7-training-premium .history-item .row-actions .quiet {
    min-height: 42px;
  }
  .ds7-training-premium .workout-bar {
    top: 0;
    padding: 12px;
    gap: 10px;
  }
  .ds7-training-premium .workout-bar .button-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: stretch;
    gap: 6px;
  }
  .ds7-training-premium .workout-bar .button-row > * {
    flex: 1 1 100px;
    min-width: 0;
    padding: 9px 8px;
    font-size: 12px;
  }
  .ds7-training-premium .set-row.v3 {
    min-width: 0;
  }
  .ds7-training-premium .set-row.v3 input {
    min-width: 0;
    max-width: 100%;
  }
  .ds7-training-premium .exercise-card-head {
    gap: 8px;
  }
}
@media (max-width: 360px) {
  .ds7-training-premium [data-training-tab] {
    font-size: 10px;
  }
  .ds7-training-premium .cal-chip {
    font-size: 7px;
  }
  .ds7-training-premium .ds7-program-topline h2 {
    font-size: 26px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ds7-training-premium *,
  .ds7-training-premium *:before,
  .ds7-training-premium *:after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
.reduced-motion .ds7-training-premium * {
  animation: none !important;
  transition: none !important;
}
.art-hidden .ds7-training-premium .ds7-program-topline:before,
.art-hidden .ds7-training-premium .storm-page-heading {
  background-image: none;
}

/* Inline artwork is embedded into the standalone HTML through the existing asset resolver. */
.ds7-training-premium .ds7-training-top-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 4%;
  opacity: 0.8;
  pointer-events: none;
  z-index: -1;
  mask-image: linear-gradient(0deg, #0004, #000 70%);
}
.ds7-training-premium .ds7-program-topline:before {
  z-index: 0;
  background:
    linear-gradient(90deg, #021019f8 0%, #03121bd8 44%, #04162235 100%),
    linear-gradient(0deg, #03141af0, transparent 72%);
}
.ds7-training-premium .storm-page-heading .page-dragon-art {
  display: block;
  opacity: 0.64;
  width: 100%;
  height: 100%;
  right: 0;
  top: 0;
  mask-image: linear-gradient(90deg, transparent 5%, #000 55%), linear-gradient(0deg, transparent, #000 60%);
  mask-composite: intersect;
  z-index: -1;
}
.ds7-training-premium .storm-page-heading .page-dragon-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
@media (max-width: 700px) {
  .ds7-training-premium .ds7-training-top-art {
    object-position: 57% 0;
    opacity: 0.65;
  }
}
.art-hidden .ds7-training-premium .ds7-training-top-art,
.art-hidden .ds7-training-premium .storm-page-heading .page-dragon-art {
  display: none;
}

/* Category tabs are horizontally scrollable, never shrink into vertical letters. */
.ds7-training-premium .tab-row:has([data-exercise-tab]) {
  overflow-x: auto !important;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}
.ds7-training-premium .tab-row:has([data-exercise-tab]) > .segmented {
  display: flex;
  width: max-content;
  min-width: 100%;
  flex-wrap: nowrap !important;
  gap: 5px;
  padding: 4px;
}
.ds7-training-premium [data-exercise-tab] {
  min-width: max-content !important;
  flex: none !important;
  white-space: nowrap !important;
  word-break: normal;
  overflow-wrap: normal;
  padding: 10px 14px;
  font-size: 12px;
  min-height: 44px;
}
@media (max-width: 700px) {
  .ds7-training-premium .ds7-training-top-art {
    transform: scale(1.95);
    transform-origin: center top;
    object-position: center top;
  }
  .ds7-training-premium .ds7-program-art {
    transform: scale(1.95);
    transform-origin: center top;
    object-position: center top;
  }
  .ds7-training-premium .storm-page-heading .page-dragon-art img {
    transform: scale(1.9);
    transform-origin: center top;
    object-position: center top;
  }
  .ds7-training-premium .tab-row:has([data-exercise-tab]) {
    margin: 8px 0 15px;
  }
}
/* At very narrow phone widths, keep every header control visible; wrap instead of clipping. */
@media (max-width: 380px) {
  body:has(.ds7-training-premium) .topbar {
    height: auto;
    min-height: 86px;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
    padding: 8px 10px;
  }
  body:has(.ds7-training-premium) .topbar .breadcrumb {
    flex: 0 0 100%;
    max-width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  body:has(.ds7-training-premium) .topbar .top-actions {
    gap: 9px;
    justify-content: center;
  }
}

/* DS7 approved Progress visual direction — real charts, records, and controls remain interactive. */
.ds7-progress-brand {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin: 8px 0 14px;
  padding: 17px 22px;
  text-align: center;
  border: 1px solid rgba(65, 224, 247, 0.5);
  border-radius: 12px;
  background:
    linear-gradient(90deg, rgba(4, 12, 22, 0.95), rgba(6, 32, 44, 0.83)),
    url('assets/zeus-opening.png') center 45% / cover;
  color: #e8f2f9;
  box-shadow:
    inset 0 0 23px rgba(24, 222, 250, 0.12),
    0 0 17px rgba(8, 181, 219, 0.09);
}
.ds7-progress-brand::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.48), rgba(0, 19, 25, 0.2), rgba(0, 0, 0, 0.5));
}
.ds7-progress-eyebrow {
  display: block;
  color: #53edff;
  letter-spacing: 0.27em;
  font-weight: 800;
  font-size: 10px;
}
.ds7-progress-brand strong {
  display: block;
  font-style: italic;
  letter-spacing: 0.19em;
  text-shadow: 0 1px 8px rgba(75, 224, 247, 0.35);
  font-weight: 900;
  font-size: clamp(22px, 3.3vw, 35px);
}
.stats-tabs {
  display: flex;
  gap: 3px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
  background: rgba(2, 10, 19, 0.85);
  border: 1px solid rgba(51, 207, 234, 0.33);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 16px;
}
.stats-tabs a {
  min-width: max-content;
  flex: 1;
  text-align: center;
  color: #c5d9df;
  white-space: nowrap;
  padding: 10px 13px;
  border-radius: 8px;
  font-weight: 700;
  transition:
    background 0.18s ease,
    box-shadow 0.18s ease,
    color 0.18s ease;
}
.stats-tabs a.active {
  color: #eaffff;
  background: linear-gradient(110deg, rgba(0, 169, 206, 0.67), rgba(0, 92, 126, 0.8));
  box-shadow:
    inset 0 0 0 1px #64f0ff,
    0 0 12px rgba(3, 228, 253, 0.25);
}
.weight-hero,
.mcard,
.metric-card,
.metric-list .panel,
.stat-card {
  border-color: rgba(70, 218, 239, 0.45) !important;
  box-shadow:
    inset 0 0 10px rgba(9, 111, 145, 0.12),
    0 0 9px rgba(6, 179, 215, 0.06) !important;
}
.weight-hero .big,
.mcard .v,
.stat-value {
  color: #e8fbff;
  text-shadow: 0 0 12px rgba(27, 227, 250, 0.32);
}
.metric-grid .mcard {
  background-color: rgba(2, 12, 21, 0.92) !important;
  background-blend-mode: soft-light;
}
@media (max-width: 600px) {
  .ds7-progress-brand {
    padding: 13px 10px;
  }
  .stats-tabs {
    gap: 2px;
  }
  .stats-tabs a {
    font-size: 11px;
    padding: 10px 9px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .stats-tabs a {
    transition: none;
  }
}

/* Progress Stats + PRs: real-record, no fabricated comparison values */
.ds7-transformation-overview {
  overflow: hidden;
  border: 1px solid rgba(37, 225, 249, 0.68);
  border-radius: 12px;
  background:
    linear-gradient(100deg, rgba(3, 12, 22, 0.95), rgba(2, 18, 32, 0.88) 52%, rgba(1, 15, 29, 0.7)),
    var(--ds7-progress-art) center/cover;
  padding: 22px;
  margin: 9px 0 17px;
  color: #e9f8fb;
  box-shadow:
    inset 0 0 24px rgba(0, 193, 235, 0.1),
    0 0 17px rgba(0, 177, 213, 0.07);
}
.ds7-transformation-intro .eyebrow,
.ds7-prs-intro .eyebrow {
  color: #6beeff;
  letter-spacing: 0.16em;
}
.ds7-transformation-intro h2,
.ds7-prs-intro h2 {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 850;
  color: #e8f8fa;
  margin: 4px 0 6px;
}
.ds7-transformation-intro p,
.ds7-prs-intro p {
  color: #acc7d1;
  font-size: 13px;
  margin: 0;
}
.ds7-transformation-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin: 16px 0;
}
.ds7-transformation-metrics a {
  color: #efffff;
  text-decoration: none;
  border: 1px solid rgba(45, 207, 233, 0.57);
  border-radius: 8px;
  background: rgba(1, 16, 27, 0.82);
  padding: 12px 10px;
  display: grid;
  gap: 5px;
}
.ds7-transformation-metrics span {
  font-size: 11px;
  color: #a8ced7;
}
.ds7-transformation-metrics b {
  font-size: clamp(16px, 2vw, 24px);
  font-variant-numeric: tabular-nums;
}
.ds7-transformation-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ds7-transformation-links a {
  color: #8af4ff;
  text-decoration: none;
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  border: 1px solid rgba(29, 196, 231, 0.45);
  padding: 8px 12px;
  border-radius: 7px;
  background: rgba(4, 30, 40, 0.75);
  font-weight: 750;
  font-size: 12px;
}
.ds7-transformation-links a:hover,
.ds7-transformation-metrics a:hover {
  border-color: #6beeff;
  background: rgba(5, 63, 77, 0.8);
}
.ds7-prs-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  background: linear-gradient(90deg, #06101b, #072d3c);
  border: 1px solid rgba(45, 207, 233, 0.5);
  border-radius: 10px;
  margin: 8px 0 14px;
}
.ds7-pr-highlights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 15px;
}
.ds7-pr-highlight {
  border: 1px solid rgba(52, 207, 227, 0.56);
  border-radius: 10px;
  background: linear-gradient(110deg, rgba(3, 20, 31, 0.94), rgba(5, 41, 52, 0.82));
  padding: 14px;
  display: grid;
  gap: 6px;
  box-shadow: inset 0 0 12px rgba(0, 167, 204, 0.1);
}
.ds7-pr-highlight h3 {
  font-size: 15px;
  line-height: 1.25;
  margin: 0;
  color: #eef9fc;
}
.ds7-pr-highlight strong {
  font-size: 24px;
  color: #63eeff;
}
.ds7-pr-highlight small {
  font-size: 12px;
}
@media (max-width: 550px) {
  .ds7-transformation-overview {
    padding: 14px;
  }
  .ds7-transformation-metrics {
    gap: 5px;
  }
  .ds7-transformation-metrics a {
    padding: 8px 5px;
  }
  .ds7-transformation-metrics span {
    font-size: 10px;
  }
  .ds7-transformation-metrics b {
    font-size: 16px;
  }
  .ds7-pr-highlights {
    gap: 8px;
  }
}

/* ==========================================================================
   FINAL APPROVED DS7 GRAPHICS — responsive live-component presentation.
   Scope: Progress, Body Measurements, PRs and Recovery only. No data changes.
   ========================================================================== */
:root {
  --ds7-final-ice: #74f5ff;
  --ds7-final-cyan: #19d9f5;
  --ds7-final-edge: rgba(55, 225, 247, 0.58);
}
/* Override the legacy global nav{flex-direction:column} that stacked Progress tabs.
   All five tabs MUST stay in one accessible scrollable row on every viewport. */
.stats-tabs.ds7-progress-nav {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: stretch;
  gap: 5px;
  padding: 5px;
  margin: 14px 0 19px;
  min-height: 53px;
  border: 1px solid var(--ds7-final-edge);
  border-radius: 13px;
  background: rgba(0, 11, 19, 0.96);
  box-shadow:
    inset 0 0 20px rgba(2, 174, 221, 0.1),
    0 0 18px rgba(0, 201, 232, 0.13);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: #158aa6 #061d29;
}
.stats-tabs.ds7-progress-nav a {
  display: flex;
  flex: 1 0 auto;
  align-items: center;
  justify-content: center;
  min-height: 43px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: clamp(12px, 1.1vw, 15px);
  font-style: italic;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #d5e7ef;
  text-decoration: none;
  transition:
    background 0.18s,
    box-shadow 0.18s,
    color 0.18s;
}
.stats-tabs.ds7-progress-nav a.active,
.stats-tabs.ds7-progress-nav a[aria-selected='true'] {
  color: #f2ffff;
  border-color: #75f8ff;
  background: linear-gradient(122deg, #008ea4, #044c73 68%, #0a354b);
  text-shadow: 0 0 5px #b7fdff;
  box-shadow:
    inset 0 0 15px #0ee9ff44,
    0 0 15px #04d3f9a6;
}
.stats-tabs.ds7-progress-nav a:hover {
  color: #fff;
  border-color: #31dcf455;
  background-color: #1a566c77;
}
.stats-tabs.ds7-progress-nav a:focus-visible {
  outline: 2px solid #c7ffff;
  outline-offset: -3px;
}
.ds7-progress-brand {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 113px;
  margin: 14px 0 0;
  padding: 18px 24px;
  border: 1px solid var(--ds7-final-edge);
  border-radius: 14px;
  text-align: center;
  background:
    linear-gradient(90deg, #020b10d9 4%, #06283b7a 50%, #020b10d9 97%),
    url('assets/zeus-opening.png') 50% 46% / cover;
  box-shadow:
    inset 0 0 25px #00c9fa25,
    0 0 13px #10dce51a;
}
.ds7-progress-brand::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(95deg, transparent, #15a9de1b, transparent);
  pointer-events: none;
}
.ds7-progress-brand strong {
  font-family: var(--ds7-font-display, 'Segoe UI', sans-serif);
  font-size: clamp(27px, 3.2vw, 42px);
  font-style: italic;
  font-weight: 900;
  letter-spacing: 0.18em;
  color: #e9f8ff;
  text-shadow:
    0 0 8px #02ebff77,
    0 2px 3px #010509;
}
.ds7-progress-eyebrow {
  letter-spacing: 0.28em;
  font-size: 10px;
  font-weight: 800;
  color: #6cf0ff;
}
.ds7-transformation-overview {
  border: 1px solid var(--ds7-final-edge);
  border-radius: 17px;
  box-shadow:
    inset 0 0 23px #2cd2fa18,
    0 0 19px #0cbad328;
}
.ds7-transformation-overview h2 {
  letter-spacing: 0.02em;
}
.ds7-transformation-metrics > a {
  border: 1px solid #3de0f766;
  border-radius: 10px;
}
.ds7-transformation-links a {
  border: 1px solid #3ddcf355;
  box-shadow: inset 0 0 12px #17d7fc19;
}
.ds7-progress-activity {
  margin: 18px 0 22px;
  padding: 16px 20px;
  border-color: var(--ds7-final-edge);
  background: linear-gradient(143deg, #061823, #02101a);
}
.ds7-progress-activity .panel-heading {
  margin-bottom: 9px;
}
.ds7-progress-activity-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 16px;
  gap: 15px;
  align-items: center;
  padding: 12px 4px;
  border-top: 1px solid #1850655c;
  text-decoration: none;
  color: #edfaff;
}
.ds7-progress-activity-row:first-of-type {
  border-top: 0;
}
.ds7-progress-activity-row span:first-child {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ds7-progress-activity-row small {
  font-size: 11px;
  color: #8aaebe;
}
.ds7-progress-activity-row strong {
  color: #5de8ff;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.ds7-progress-activity-row:hover strong {
  color: #fff;
}
.ds7-prs-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  position: relative;
  margin: 12px 0 16px;
  padding: 26px 22px;
  min-height: 130px;
  overflow: hidden;
  border: 1px solid var(--ds7-final-edge);
  border-radius: 14px;
  background:
    linear-gradient(95deg, #010a10d9, #031520b0),
    url('assets/zeus-opening.png') center 44% / cover;
  box-shadow: inset 0 0 24px #00d9ff20;
}
.ds7-prs-intro h2 {
  font-family: var(--ds7-font-display, 'Segoe UI');
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-style: italic;
  font-size: clamp(22px, 2.7vw, 33px);
}
.ds7-prs-intro p {
  color: #bbd6e6;
  margin: 7px 0 0;
}
.ds7-pr-highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 16px 0 20px;
}
.ds7-pr-highlight {
  padding: 17px;
  border: 1px solid #23d9ef85;
  border-radius: 12px;
  min-width: 0;
  background: linear-gradient(155deg, #092734, #020d15);
  box-shadow: inset 0 0 18px #08a4d21b;
}
.ds7-pr-highlight h3 {
  margin: 7px 0 12px;
  overflow-wrap: anywhere;
}
.ds7-pr-highlight strong {
  display: block;
  font-size: clamp(18px, 2.2vw, 26px);
  color: #78f3ff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 7px #20c5e25b;
}
.ds7-progress-section-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 24px;
  margin: 8px 0 19px;
  min-height: 125px;
  border: 1px solid var(--ds7-final-edge);
  border-radius: 14px;
  background:
    linear-gradient(92deg, #020a10e8, #032138a8),
    url('assets/zeus-opening.png') 53% 50% / cover;
  box-shadow: inset 0 0 20px #1ad4fc23;
}
.ds7-progress-section-hero h2 {
  margin: 4px 0 6px;
  font-size: clamp(23px, 3vw, 36px);
  font-style: italic;
  letter-spacing: 0.08em;
  text-shadow: 0 0 10px #5bdef856;
  color: #ecfaff;
}
.ds7-progress-section-hero p:not(.eyebrow) {
  font-size: 12px;
  color: #b4d9e6;
}
.ds7-progress-section-glyph {
  font-size: 54px;
  color: #59eaff;
  text-shadow: 0 0 17px #16c7f9ba;
}
.ds7-weight-section + .stats-grid {
  margin-top: 12px;
}
.weight-hero {
  box-shadow:
    inset 0 0 15px #00bdff2b,
    0 0 17px #07cdf036;
}
.metric-list .metric-card,
.metric-grid .mcard {
  border-color: #39defa7d;
  box-shadow:
    inset 0 0 18px #04bcde1f,
    0 0 9px #0ac5e019;
}
.ds7-recovery-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 23px 25px;
  margin-bottom: 13px;
  border: 1px solid #4ce6f377;
  border-radius: 15px;
  background:
    linear-gradient(95deg, #041018e8, #072b40b0),
    url('assets/zeus-opening.png') 45% 42% / cover;
  box-shadow: inset 0 0 22px #0ecaf91e;
}
.ds7-recovery-hero h2 {
  font-size: clamp(23px, 3vw, 34px);
  font-style: italic;
  letter-spacing: 0.1em;
  margin: 4px 0;
}
.ds7-recovery-hero p:not(.eyebrow) {
  color: #b3d0dc;
}
.ds7-recovery-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 17px;
}
.ds7-recovery-cards article {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 19px;
  border: 1px solid #2addf577;
  border-radius: 12px;
  background: linear-gradient(120deg, #0a2635, #06121c);
}
.ds7-recovery-cards small {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #a5cee0;
}
.ds7-recovery-cards strong {
  font-size: 27px;
  color: #6fefff;
  font-variant-numeric: tabular-nums;
}
.ds7-recovery-cards span {
  font-size: 11px;
  color: #90b1bf;
}
@media (max-width: 900px) {
  .stats-tabs.ds7-progress-nav a {
    flex: 0 0 auto;
    padding: 9px 14px;
  }
  .ds7-recovery-hero {
    padding: 19px;
  }
  .ds7-recovery-cards article {
    padding: 13px;
  }
}
@media (max-width: 600px) {
  .stats-tabs.ds7-progress-nav {
    gap: 2px;
    min-height: 46px;
    padding: 3px;
    border-radius: 10px;
  }
  .stats-tabs.ds7-progress-nav a {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 8px 12px;
    font-size: 12px;
  }
  .ds7-progress-brand {
    margin: 10px 0 0;
    padding: 13px 8px;
    min-height: 93px;
  }
  .ds7-progress-brand strong {
    font-size: 24px;
    letter-spacing: 0.12em;
  }
  .ds7-progress-eyebrow {
    font-size: 8px;
    letter-spacing: 0.13em;
  }
  .ds7-prs-intro {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 18px;
    min-height: 110px;
  }
  .ds7-pr-highlights {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ds7-pr-highlight {
    padding: 12px;
  }
  .ds7-progress-section-hero {
    min-height: 110px;
    padding: 15px;
  }
  .ds7-progress-section-glyph {
    font-size: 30px;
  }
  .ds7-progress-activity {
    padding: 14px;
  }
  .ds7-progress-activity-row {
    gap: 8px;
  }
  .ds7-recovery-hero {
    flex-wrap: wrap;
  }
  .ds7-recovery-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
  .ds7-recovery-cards article {
    padding: 10px 8px;
  }
  .ds7-recovery-cards strong {
    font-size: 19px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .stats-tabs.ds7-progress-nav a {
    transition: none;
  }
}

/* Dashboard: approved premium cards with real historical data, not an achievement/points system. */
.ds7-dashboard .ds7-home-training-spotlight {
  margin: 18px 0 15px;
}
.ds7-dashboard .ds7-home-training-spotlight .carousel {
  margin: 0;
}
.ds7-dashboard .ds7-home-training-spotlight .program-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(73, 239, 255, 0.72);
  border-radius: 16px;
  min-height: 180px;
  padding: 21px 24px;
  background: linear-gradient(105deg, #020b14e5, #062839aa 54%, #041c22b0);
  box-shadow:
    inset 0 0 20px #26bfe81c,
    0 0 16px #00bfec18;
}
.ds7-dashboard .ds7-home-training-spotlight .program-card .art {
  opacity: 0.4;
  background-size: cover;
  background-position: center 41%;
}
.ds7-dashboard .ds7-home-training-spotlight .program-card h3 {
  position: relative;
  font-size: clamp(21px, 2.5vw, 29px);
  color: #effcff;
  text-shadow: 0 0 9px #23e2fa5a;
}
.ds7-dashboard .ds7-home-training-spotlight .program-card p {
  position: relative;
  max-width: 500px;
  color: #c5d9e6;
}
.ds7-dashboard .ds7-home-training-spotlight .program-card .up-next {
  position: relative;
  z-index: 1;
}
.ds7-dashboard .card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
  margin: 20px 0 10px;
}
.ds7-dashboard .card-grid > .panel {
  min-width: 0;
  padding: 18px;
  border-color: #27cfe860;
  border-radius: 13px;
  background: linear-gradient(145deg, #0b2938cc, #030f19e8);
  box-shadow:
    inset 0 0 14px #03bcdf1f,
    0 0 9px #03cfff0f;
}
.ds7-dashboard .card-grid > .panel h3 {
  font-size: clamp(18px, 1.9vw, 24px);
  color: #e6f8ff;
  font-variant-numeric: tabular-nums;
  margin: 8px 0;
}
.ds7-dashboard .card-grid > .panel .eyebrow {
  color: #78eaff;
  letter-spacing: 0.09em;
}
.ds7-dashboard .card-grid > .panel .kv-list {
  gap: 7px;
}
.ds7-dashboard .card-grid > .panel .pr-line {
  font-size: 12px;
}
.ds7-dashboard .card-grid > .panel .chart-wrap {
  min-width: 0;
}
@media (max-width: 960px) {
  .ds7-dashboard .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 620px) {
  .ds7-dashboard .card-grid {
    grid-template-columns: 1fr;
    gap: 11px;
  }
  .ds7-dashboard .ds7-home-training-spotlight .program-card {
    padding: 17px;
    min-height: 170px;
  }
  .ds7-dashboard .card-grid > .panel {
    padding: 15px;
  }
}

/* Narrow-phone header: preserve Quick Add, preview toggle, and design-studio
   controls without pushing the application's document beyond the viewport. */
@media (max-width: 380px) {
  .topbar {
    height: auto;
    min-height: 84px;
    flex-wrap: wrap;
    align-content: center;
    gap: 5px;
    padding: 7px 12px;
  }
  .topbar .breadcrumb {
    flex: 0 0 100%;
    max-width: 100%;
    min-width: 0;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .topbar .top-actions {
    width: 100%;
    min-width: 0;
    display: flex;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 8px;
  }
  .topbar .mode-pill {
    flex: 0 1 auto;
    min-width: 0;
  }
}

/* DS7 approved UI review: readability, hierarchy and interactive body measurement
   presentation ONLY. All existing records, calculations, scanners, imports and safety
   confirmations are untouched. */
.ds7-tab-short {
  display: none;
}
.ds7-inline-progress-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 16px;
}
.ds7-inline-progress-heading h2 {
  margin: 0;
  font: italic 800 clamp(20px, 2.9vw, 27px) var(--ds7-font-display);
  color: #e4f8ff;
  letter-spacing: 0.045em;
}
.ds7-inline-progress-heading .button-row {
  margin: 0;
}
.ds7-progress-brand {
  background-image: linear-gradient(90deg, #020b10eb 4%, #06283bc2 50%, #020b10eb 97%), url('assets/zeus-opening.png');
}
/* Main hero retains Zeus. Repeated artwork behind data is muted for contrast. */
.metric-grid .mcard:before,
.mcard:before {
  opacity: 0.045 !important;
}
.ds7-food-approved .food-storm-hero::before {
  opacity: 0.13;
}
.ds7-pr-highlight,
.ds7-recovery-cards article,
.ds7-food-approved .food-view-body .panel {
  background-image: none !important;
}

/* Body graphic points are actual buttons selecting the original trend chart below. */
.ds7-body-measurements-live {
  border: 1px solid rgba(var(--accent-rgb), 0.65);
  border-radius: 15px;
  padding: 13px;
  background: linear-gradient(150deg, #081f2bed, #03111ce8);
  box-shadow:
    inset 0 0 20px #09e6ff13,
    0 0 18px #02ccff12;
}
.ds7-body-picker {
  display: grid;
  grid-template-columns: minmax(125px, 0.38fr) minmax(0, 1fr);
  gap: 15px;
  align-items: start;
  min-width: 0;
}
.ds7-body-picture-panel {
  min-width: 0;
  text-align: center;
}
.ds7-body-picture-panel h3 {
  font-size: 13px;
  color: #c6f5ff;
  margin: 0 0 6px;
}
.ds7-body-picture-panel p {
  font-size: 12px;
  color: #adcddb;
  line-height: 1.5;
  margin: 8px 0 0;
}
.ds7-body-interactive-art {
  width: min(100%, 177px);
  aspect-ratio: 162/411;
  position: relative;
  margin: 0 auto;
  isolation: isolate;
  border: 1px solid #25dff05a;
  border-radius: 12px;
  overflow: hidden;
  background: #021018;
}
.ds7-body-interactive-art img {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ds7-body-hotspot {
  position: absolute;
  z-index: 1;
  width: clamp(24px, 3vw, 30px);
  height: clamp(24px, 3vw, 30px);
  padding: 0;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid #9effff;
  box-shadow:
    0 0 10px #13daeed4,
    inset 0 0 10px #13daee99;
  background: #13d0eb30;
  cursor: pointer;
}
/* Preserve anatomical positioning during native pointer/touch presses. */
.ds7-body-hotspot:active {
  transform: translate(-50%, -50%);
}
.ds7-body-hotspot:before {
  content: '';
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: #7af8ff;
  box-shadow: 0 0 8px #2cfaff;
}
.ds7-body-hotspot.active {
  border-color: #fff;
  background: #20d9e3aa;
  box-shadow:
    0 0 0 3px #48f0f84d,
    0 0 15px #9ffcff;
}
.ds7-body-hotspot:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}
.ds7-body-table-panel {
  min-width: 0;
  border: 1px solid #28dafa77;
  border-radius: 10px;
  background: #041922ea;
  overflow: hidden;
}
.ds7-body-table-heading,
.ds7-measure-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.95fr) minmax(0, 0.8fr);
  gap: 5px;
  align-items: center;
}
.ds7-body-table-heading {
  padding: 12px 11px;
  background: #0b3340;
  color: #bdf9ff;
  font-size: 12px;
  letter-spacing: 0.045em;
}
.ds7-measure-row {
  width: 100%;
  min-height: 39px;
  padding: 9px 11px;
  text-align: left;
  background: none;
  border: 0;
  border-top: 1px solid #31b8d132;
  color: #d7eefa;
  font-size: 12px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.ds7-measure-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.ds7-measure-row span:nth-child(n + 2) {
  text-align: right;
}
.ds7-measure-row.active {
  background: #0f526780;
  box-shadow: inset 3px 0 #5ff4ff;
  color: #fff;
}
.ds7-measure-row:hover {
  background: #14455599;
}
.ds7-measure-row:focus-visible {
  outline: 2px solid #9afbff;
  outline-offset: -2px;
}
.ds7-measure-row-label {
  font-weight: 700;
}
.ds7-body-table-panel > p {
  font-size: 12px;
  padding: 8px 12px;
}
.ds7-measure-comparison summary {
  padding: 8px 0;
  cursor: pointer;
  font-weight: 700;
  color: #81eafb;
}
.ds7-measure-comparison select {
  margin: 10px 0;
}
.ds7-measure-trend {
  margin-bottom: 8px;
}

/* Nutrition cards are compact by default. All original actions remain in details. */
.ds7-compact-meal {
  margin: 9px 0;
  border: 1px solid #2bddec62;
  border-radius: 11px;
  background: linear-gradient(110deg, #092a38, #04151e);
  overflow: hidden;
}
.ds7-compact-meal .meal-head {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 0.55fr) minmax(0, 1.5fr) auto;
  align-items: center;
  gap: 9px;
  padding: 12px 13px;
  cursor: pointer;
  list-style: none;
  min-height: 58px;
  margin: 0;
}
.ds7-compact-meal .meal-head::-webkit-details-marker {
  display: none;
}
.ds7-compact-meal .meal-head h3 {
  margin: 0;
  font-size: 15px;
}
.ds7-compact-meal .meal-head .subtle {
  font-size: 12px;
  line-height: 1.5;
}
.ds7-compact-meal .meal-count {
  font-size: 12px;
  color: #9fc9d9;
}
.ds7-compact-meal .meal-chevron {
  font-size: 24px;
  color: #53ebfb;
  transition: transform 0.2s;
}
.ds7-compact-meal[open] .meal-chevron {
  transform: rotate(180deg);
}
.ds7-compact-meal .meal-details {
  padding: 0 13px 12px;
  border-top: 1px solid #42b9c546;
}
.ds7-compact-meal .meal-buttons {
  padding: 10px 0;
  gap: 6px;
  flex-wrap: wrap;
}
.ds7-compact-meal summary:focus-visible {
  outline: 2px solid #80f8ff;
  outline-offset: -2px;
}
.ds7-water-history {
  padding: 12px 15px;
  border: 1px solid #2bdfec73;
  border-radius: 12px;
  background: #041b28;
}
.ds7-water-history > summary {
  color: #a6eefa;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  min-height: 27px;
}
.ds7-water-history .panel-heading {
  padding-top: 10px;
}

@media (max-width: 600px) {
  .ds7-progress-eyebrow {
    font-size: 10px !important;
    letter-spacing: 0.08em !important;
  }
  .ds7-tab-long {
    display: none;
  }
  .ds7-tab-short {
    display: inline;
  }
  .stats-tabs.ds7-progress-nav {
    overflow-x: auto;
    justify-content: stretch;
    gap: 1px;
  }
  .stats-tabs.ds7-progress-nav a {
    padding: 6px 7px;
    min-width: 0;
    flex: 1 1 20%;
    font-size: 12px;
    white-space: nowrap;
  }
  .ds7-inline-progress-heading {
    gap: 9px;
  }
  .ds7-inline-progress-heading h2 {
    font-size: 21px;
  }
  .ds7-inline-progress-heading button {
    font-size: 12px;
  }
  .ds7-food-approved .food-gauge-ring {
    width: min(100%, 78px);
    padding: 6px;
  }
  .ds7-food-approved .food-gauge-inner {
    gap: 1px;
  }
  .ds7-food-approved .food-gauge-label {
    font-size: 12px !important;
    letter-spacing: -0.03em;
  }
  .ds7-food-approved .food-gauge-inner strong {
    font-size: 12px !important;
    letter-spacing: -0.045em;
  }
  .ds7-food-approved .food-gauge-inner small {
    font-size: 12px !important;
    letter-spacing: -0.05em;
  }
  .ds7-food-approved .food-gauge-percent {
    font-size: 12px !important;
  }
  .ds7-food-approved .food-gauge-icon {
    display: none;
  }
  .ds7-food-approved .food-gauges {
    gap: 5px;
  }
  .ds7-food-approved .food-today-head h2,
  .ds7-food-approved .food-trend-mini h3 {
    font-size: 12px;
  }
  .ds7-compact-meal .meal-head {
    grid-template-columns: minmax(0, 0.9fr) auto minmax(0, 1.2fr) auto;
    gap: 6px;
    padding: 11px 9px;
  }
  .ds7-compact-meal .meal-head h3,
  .ds7-compact-meal .meal-head .subtle,
  .ds7-compact-meal .meal-count {
    font-size: 12px;
  }
  .ds7-body-measurements-live {
    padding: 8px;
  }
  .ds7-body-picker {
    grid-template-columns: minmax(110px, 0.39fr) minmax(0, 1fr);
    gap: 8px;
  }
  .ds7-body-picture-panel h3 {
    font-size: 12px;
  }
  .ds7-body-picture-panel p {
    font-size: 12px;
  }
  .ds7-body-hotspot {
    width: 23px;
    height: 23px;
  }
  .ds7-body-hotspot:before {
    inset: 6px;
  }
  .ds7-body-table-heading,
  .ds7-measure-row {
    padding: 8px 5px;
    gap: 3px;
    font-size: 12px;
  }
  .ds7-body-table-heading {
    letter-spacing: 0;
  }
  .ds7-measure-row {
    min-height: 40px;
  }
  .ds7-measure-trend .panel-heading {
    flex-direction: column;
    align-items: stretch;
  }
  .ds7-measure-trend .button-row {
    flex-wrap: wrap;
  }
  .stat-card .stat-label,
  .stat-card .stat-note,
  .ring-label small,
  .ds7-recovery-cards small,
  .ds7-recovery-cards span {
    font-size: 12px !important;
  }
  .ds7-training-premium .eyebrow,
  .ds7-dashboard .eyebrow {
    font-size: 10px !important;
  }
  .ds7-training-premium .subtle.small,
  .ds7-dashboard .subtle.small {
    font-size: 12px !important;
  }
}
@media (max-width: 365px) {
  .ds7-body-picker {
    grid-template-columns: 1fr;
  }
  .ds7-body-interactive-art {
    width: 135px;
  }
  .ds7-body-picture-panel p {
    margin: 3px 0 9px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ds7-compact-meal .meal-chevron {
    transition: none;
  }
}

/* Prioritize the owner-approved interactive body feature. List is an accessible optional fallback, not a second main screen. */
.ds7-body-picker {
  grid-template-columns: minmax(135px, 0.33fr) minmax(0, 1fr);
}
.ds7-body-selected-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 9px;
  padding: 20px;
  min-width: 0;
  border: 1px solid #27d6f779;
  border-radius: 12px;
  background: linear-gradient(160deg, #092936, #04121a);
}
.ds7-body-selected-panel h3 {
  font: italic 800 clamp(19px, 2.5vw, 29px) var(--ds7-font-display);
  color: #e7faff;
  margin: 0;
}
.ds7-body-selected-panel strong {
  font-size: clamp(19px, 3vw, 34px);
  font-variant-numeric: tabular-nums;
  color: #87f9ff;
  overflow-wrap: anywhere;
}
.ds7-body-selected-panel p {
  font-size: 12px;
  color: #b8dbe5;
  margin: 0;
  line-height: 1.55;
}
.ds7-body-selected-panel .eyebrow {
  font-size: 11px;
  color: #7deeff;
}
.ds7-body-selected-panel button {
  margin-top: 6px;
}
.ds7-all-measurements > summary {
  color: #a6eefa;
  font-size: 13px;
  font-weight: 750;
  padding: 11px 5px;
  cursor: pointer;
}
.ds7-all-measurements .ds7-body-table-heading strong {
  min-width: 0;
  overflow-wrap: anywhere;
}
@media (max-width: 600px) {
  .ds7-body-picker {
    grid-template-columns: minmax(112px, 0.41fr) minmax(0, 1fr);
  }
  .ds7-body-selected-panel {
    padding: 12px;
    gap: 6px;
  }
  .ds7-body-selected-panel h3 {
    font-size: 18px;
  }
  .ds7-body-selected-panel strong {
    font-size: 19px;
  }
  .ds7-body-selected-panel button {
    font-size: 12px;
    line-height: 1.3;
  }
  .ds7-body-selected-panel p {
    font-size: 12px;
  }
  .ds7-all-measurements .ds7-measure-row {
    font-size: 12px;
  }
}
@media (max-width: 365px) {
  .ds7-body-picker {
    grid-template-columns: minmax(105px, 0.42fr) minmax(0, 1fr);
  }
  .ds7-body-interactive-art {
    width: 100%;
  }
}
@media (max-width: 600px) {
  /* Fit all five meaningful labels without text painting across neighbouring tabs. */
  .stats-tabs.ds7-progress-nav a {
    flex: 0 1 auto;
    min-width: 0;
    width: auto;
    padding: 6px 6px;
    font-family: 'Arial Narrow', 'Segoe UI', sans-serif;
    font-weight: 700;
    letter-spacing: -0.25px;
  }
}

.ds7-storm-hero {
  position: relative;
}
.ds7-home-profile-action {
  position: absolute;
  z-index: 3;
  right: 12px;
  top: 10px;
  border: 1px solid #45e4ec77;
  border-radius: 8px;
  background: #051b29d9;
  color: #b8faff;
  font-size: 12px;
  padding: 8px 10px;
  min-height: 35px;
}
.ds7-home-profile-action:focus-visible {
  outline: 2px solid #b4faff;
}
/* DS7 approved Nutrition Progression and My Foods & Meals, phase 1. */
.ds7-food-library,
.ds7-nutrition-progression {
  display: grid;
  gap: 14px;
  min-width: 0;
}
.ds7-food-library-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid rgba(var(--accent-rgb), 0.5);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(2, 16, 23, 0.84);
}
.ds7-food-library-tabs button {
  border: 0;
  border-right: 1px solid rgba(var(--accent-rgb), 0.22);
  background: transparent;
  color: #d6f7ff;
  min-height: 46px;
  font-size: clamp(12px, 2.6vw, 15px);
  cursor: pointer;
}
.ds7-food-library-tabs button.active {
  background: rgba(var(--accent-rgb), 0.24);
  box-shadow: inset 0 0 15px rgba(var(--accent-rgb), 0.28);
  color: white;
  font-weight: 800;
}
.ds7-food-library-search label {
  display: block;
  font-size: 12px;
  margin-bottom: 5px;
  color: #c2e5ee;
}
.ds7-food-library-search input {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(var(--accent-rgb), 0.5);
  border-radius: 24px;
  padding: 8px 14px;
  background: rgba(3, 18, 28, 0.88);
  color: white;
  font-size: 14px;
}
.ds7-food-library-list {
  display: grid;
  gap: 9px;
}
.ds7-food-library-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 13px;
  border: 1px solid rgba(var(--accent-rgb), 0.42);
  background: linear-gradient(130deg, rgba(7, 34, 48, 0.95), rgba(4, 20, 29, 0.9));
  border-radius: 9px;
  min-width: 0;
}
.ds7-food-library-item > div:first-child {
  flex: 1;
  min-width: 160px;
}
.ds7-food-library-item strong,
.ds7-food-library-item small {
  display: block;
}
.ds7-food-library-item strong {
  font-size: 15px;
}
.ds7-food-library-item small {
  font-size: 12px;
  line-height: 1.5;
  color: #bed7e2;
  margin-top: 4px;
}
.ds7-food-library-item .row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.ds7-food-section-heading {
  text-align: center;
}
.ds7-food-section-heading h2 {
  font-family: var(--ds7-font-display);
  letter-spacing: 0.13em;
  font-size: clamp(19px, 4vw, 29px);
  margin: 0;
}
.ds7-food-section-heading p {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: #9de8f0;
}
.ds7-food-section-heading .segmented {
  margin: 12px auto;
  max-width: 330px;
}
.ds7-nutrition-progress-card {
  border: 1px solid rgba(var(--accent-rgb), 0.48);
  background: linear-gradient(140deg, rgba(4, 26, 38, 0.94), rgba(2, 15, 24, 0.9));
  box-shadow: inset 0 0 24px rgba(var(--accent-rgb), 0.055);
  padding: 16px;
  border-radius: 12px;
  min-width: 0;
}
.ds7-nutrition-progress-card h3 {
  font-family: var(--ds7-font-display);
  letter-spacing: 0.08em;
  font-size: clamp(14px, 2.5vw, 18px);
  margin: 0 0 12px;
  color: #e8fcff;
}
.ds7-nutrition-progress-card small {
  font-size: 12px;
}
.ds7-progress-hero-stats,
.ds7-nutrition-progress-pair,
.ds7-nutrition-macro-grid,
.ds7-nutrition-totals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.ds7-progress-hero-stats > div {
  display: grid;
  gap: 5px;
}
.ds7-progress-hero-stats strong {
  font-size: clamp(18px, 4vw, 27px);
  color: #f0ffff;
}
.ds7-nutrition-macro-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.ds7-nutrition-macro {
  display: grid;
  gap: 7px;
  text-align: center;
  min-width: 0;
}
.ds7-nutrition-macro b {
  font-size: clamp(17px, 3.2vw, 24px);
}
.ds7-nutrition-macro strong {
  font-size: 13px;
}
.ds7-nutrition-macro span:last-child {
  font-size: 12px;
  color: #b5f8ff;
}
.ds7-food-meter {
  display: block;
  height: 8px;
  border-radius: 10px;
  background: rgba(111, 167, 184, 0.22);
  overflow: hidden;
  margin: 9px 0;
}
.ds7-food-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #00b2cb, #6cffff);
  box-shadow: 0 0 9px rgba(20, 240, 255, 0.6);
}
.ds7-nutrition-daydots {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.ds7-nutrition-daydots span {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 30px;
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  border-radius: 6px;
  color: #b5d8de;
}
.ds7-nutrition-daydots span.logged {
  color: #64f7ff;
  border-color: #36e5ed;
}
.ds7-nutrition-totals {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.ds7-nutrition-totals > div {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.ds7-nutrition-totals strong {
  font-size: clamp(13px, 2vw, 18px);
  overflow-wrap: anywhere;
}
.ds7-food-history-row {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) auto minmax(150px, 1.6fr) 14px;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 45px;
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  background: rgba(3, 26, 37, 0.75);
  color: #e6fbff;
  border-radius: 6px;
  text-align: left;
  padding: 8px 10px;
  margin: 5px 0;
  cursor: pointer;
  font-size: 13px;
}
.ds7-food-history-row small {
  font-size: 12px;
}
@media (max-width: 600px) {
  .ds7-nutrition-progress-pair {
    grid-template-columns: 1fr;
  }
  .ds7-nutrition-totals {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ds7-nutrition-macro-grid {
    gap: 6px;
  }
  .ds7-food-history-row {
    grid-template-columns: 1fr auto 12px;
  }
  .ds7-food-history-row small {
    grid-column: 1/-1;
    grid-row: 2;
  }
  .ds7-food-library-tabs button {
    font-size: 12px;
    padding: 4px;
  }
  .ds7-food-library-item .row-actions {
    width: 100%;
  }
}

/* DS7 Phase 2 cumulative refinements — scoped presentation only, no user record changes. */
.ds7-corner > img[data-asset='ds7-zeus-option1-banner.png'] {
  width: 100%;
  height: auto;
  max-height: 66px;
  object-fit: contain;
  border-radius: 9px;
}
.ds7-phase2-mobile-banner {
  display: none;
}
.ds7-phase2-pr-mobile {
  display: none;
}
.ds7-phase2-pr-card {
  border: 1px solid #16d9ed80;
  border-radius: 12px;
  background: linear-gradient(140deg, #092633, #020d15);
  padding: 14px;
  min-width: 0;
}
.ds7-phase2-pr-card-header h3 {
  font-family: var(--ds7-font-display, 'Segoe UI', sans-serif);
  margin: 4px 0 12px;
  color: #e7faff;
  overflow-wrap: anywhere;
}
.ds7-phase2-pr-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}
.ds7-phase2-pr-card dl > div {
  border-top: 1px solid #1aaac149;
  padding-top: 9px;
  min-width: 0;
}
.ds7-phase2-pr-card dt {
  font-size: 11px;
  color: #9cc5d5;
  margin-bottom: 5px;
}
.ds7-phase2-pr-card dd {
  margin: 0;
  color: #72f0fc;
  font-size: 15px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.ds7-phase2-pr-card dd small {
  display: block;
  font-weight: 400;
  color: #a5c4d0;
  font-size: 10px;
  margin-top: 3px;
}
.ds7-phase2-measure-history {
  background: linear-gradient(155deg, #081d2a, #06121b);
  border-color: #20bcd16a;
}
.ds7-phase2-measure-history .history-day {
  margin: 12px 0;
  padding: 8px 12px;
  border: 1px solid #25d5eb40;
  border-radius: 11px;
  background: #071b27;
}
.ds7-phase2-measure-history .history-day h3 {
  color: #88f9ff;
  letter-spacing: 0.05em;
}
.ds7-phase2-measure-history .history-item {
  align-items: center;
  flex-wrap: wrap;
}
.ds7-phase2-measure-import {
  border: 1px solid #28c6dc8c;
  background: linear-gradient(145deg, #061d2b, #041019);
}
.ds7-phase2-measure-import .dropzone {
  min-height: 125px;
  border: 1px dashed #39dceeb8;
  border-radius: 11px;
  background: #07273573;
}
.ds7-phase2-photo-quick {
  border-color: #41d5e58f;
  font-weight: 700;
  min-height: 40px;
}
@media (max-width: 720px) {
  .ds7-phase2-pr-mobile {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .ds7-phase2-pr-desktop {
    display: none;
  }
  .ds7-phase2-mobile-banner {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 24px auto 0;
    max-width: 390px;
    width: 100%;
    min-height: 44px;
  }
  .ds7-phase2-mobile-banner img {
    display: block;
    max-width: 100%;
    width: 100%;
    height: auto;
    max-height: 54px;
    object-fit: contain;
  }
  .ds7-phase2-measure-history .history-item .row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
  }
  .ds7-phase2-measure-history .history-item > span:first-child {
    min-width: 100px;
    flex: 1;
  }
  .ds7-phase2-photo-quick {
    width: 100%;
  }
}
@media (min-width: 721px) and (max-width: 1040px) {
  .ds7-phase2-pr-mobile {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .ds7-phase2-pr-desktop {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ds7-phase2-pr-card {
    transition: none;
  }
}

/* PHASE 2 — owner-approved PR #2, Measurements #3.1 and Photos #2.
   Layout-only; all calculations and stored records stay in the original modules. */
.app-header {
  min-height: 126px;
  align-items: center;
}
.app-header .brand-center {
  display: flex;
  justify-content: center;
}
.app-header .brand-image.ds7-full-storm-banner {
  display: block;
  max-height: 115px;
  width: min(100%, 480px);
  height: auto;
  object-fit: contain;
  border-radius: 11px;
  filter: drop-shadow(0 2px 14px rgba(0, 220, 240, 0.15));
}
.ds7-p2-section-heading {
  padding: 16px 17px 18px;
  margin: 6px 0 15px;
  border: 1px solid rgba(var(--accent-rgb), 0.43);
  border-radius: 12px;
  background: linear-gradient(120deg, rgba(5, 30, 41, 0.92), rgba(2, 11, 19, 0.94));
  box-shadow:
    inset 0 1px rgba(230, 255, 255, 0.06),
    0 0 19px rgba(var(--accent-rgb), 0.08);
  min-width: 0;
}
.ds7-p2-section-heading .eyebrow {
  display: block;
  color: #68eff8;
  font-size: 11px;
  letter-spacing: 0.17em;
  margin-bottom: 6px;
}
.ds7-p2-section-heading h2 {
  font-family: var(--ds7-font-display);
  font-size: clamp(21px, 4vw, 30px);
  color: #e1faff;
  letter-spacing: 0.065em;
  font-style: italic;
  line-height: 1.13;
  margin: 0 0 6px;
  overflow-wrap: anywhere;
}
.ds7-p2-section-heading p {
  font-size: 13px;
  color: #bed4df;
  line-height: 1.45;
  margin: 0;
}
.ds7-p2-pr-summary,
.ds7-p2-measure-snapshot,
.ds7-p2-photo-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin: 13px 0 16px;
}
.ds7-p2-pr-summary > div,
.ds7-p2-measure-snapshot > div,
.ds7-p2-photo-summary > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 15px 12px;
  border: 1px solid rgba(var(--accent-rgb), 0.45);
  border-radius: 9px;
  background: #061c28;
  box-shadow: inset 0 0 16px #04e4fa0c;
}
.ds7-p2-pr-summary span,
.ds7-p2-measure-snapshot span,
.ds7-p2-photo-summary span {
  font-size: 11px;
  color: #b9d3dc;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.ds7-p2-pr-summary b,
.ds7-p2-measure-snapshot b,
.ds7-p2-photo-summary b {
  font-size: clamp(14px, 3.8vw, 24px);
  color: #72f4ff;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.ds7-p2-measure-snapshot {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.ds7-p2-pr-panel,
.ds7-p2-measure-panel,
.ds7-p2-photo-panel {
  margin: 15px 0;
  padding: 17px;
  border: 1px solid rgba(var(--accent-rgb), 0.46);
  border-radius: 12px;
  background: linear-gradient(145deg, #061c28, #020d16);
  box-shadow:
    inset 0 0 22px rgba(var(--accent-rgb), 0.055),
    0 6px 26px #0005;
  min-width: 0;
}
.ds7-p2-pr-panel h3,
.ds7-p2-measure-panel h3,
.ds7-p2-photo-panel h3 {
  font-size: clamp(15px, 3.6vw, 19px);
  font-weight: 850;
  letter-spacing: 0.06em;
  color: #e1faff;
  margin: 0 0 10px;
}
.ds7-p2-pr-panel h4 {
  font-size: 14px;
  color: #b5ebee;
  letter-spacing: 0.12em;
  margin: 18px 0 10px;
}
.ds7-p2-barheading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.24);
}
.ds7-p2-barheading h3 {
  margin: 0;
}
.ds7-p2-barheading span,
.ds7-p2-barheading small {
  color: #a5c7d5;
  font-size: 12px;
}
.ds7-p2-pr-exercise {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  text-align: left;
  color: #d8f7ff;
  background: linear-gradient(115deg, #082632, #061522);
  border: 1px solid rgba(var(--accent-rgb), 0.48);
  border-radius: 9px;
  margin: 10px 0;
  padding: 13px;
  min-height: 76px;
  cursor: pointer;
}
.ds7-p2-pr-exercise:hover,
.ds7-p2-pr-exercise:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 15px #22ebff44;
}
.ds7-p2-pr-name,
.ds7-p2-pr-best {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.ds7-p2-pr-name small {
  font-size: 10px;
  letter-spacing: 0.05em;
  color: #83d9e3;
}
.ds7-p2-pr-name strong {
  font-size: 15px;
  overflow-wrap: anywhere;
}
.ds7-p2-pr-best {
  text-align: right;
}
.ds7-p2-pr-best b {
  font-size: 18px;
  color: #6df5ff;
  font-variant-numeric: tabular-nums;
}
.ds7-p2-pr-best small {
  font-size: 10px;
  color: #adc8d2;
}
.ds7-p2-chevron {
  font-size: 24px;
  color: #69f6ff;
}
.ds7-p2-filterbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}
.ds7-p2-filterbar label {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  color: #b8dae5;
}
.ds7-p2-filterbar select {
  min-height: 43px;
  max-width: 240px;
}
.ds7-p2-back {
  min-height: 42px;
  margin: 6px 0;
}
.ds7-p2-pr-detail > h3 {
  font-size: clamp(22px, 5vw, 31px);
}
.ds7-p2-graph {
  overflow: hidden;
  min-width: 0;
}
.ds7-p2-graph .chart-wrap {
  width: 100%;
  overflow: hidden;
}
.ds7-p2-graph svg {
  width: 100%;
  height: auto;
}
.ds7-p2-graph-controls {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 9px 0;
}
.ds7-p2-graph-controls button,
.ds7-p2-measure-picker button,
.ds7-p2-photo-nav button {
  color: #d1e8f1;
  background: #08212e;
  border: 1px solid #31adbd77;
  border-radius: 8px;
  min-height: 43px;
  padding: 8px 13px;
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
}
.ds7-p2-graph-controls button.active,
.ds7-p2-measure-picker button.active,
.ds7-p2-photo-nav button.active {
  color: #05151b;
  background: linear-gradient(180deg, #78f6ff, #23d7ee);
  border-color: #92fcff;
  box-shadow: 0 0 14px #00deee77;
}
.ds7-p2-measure-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: 332px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px 3px 6px;
}
.ds7-p2-measure-panel:has(.ds7-p2-measure-grid) .ds7-p2-measure-grid:has(~ .ds7-p2-measure-actions) {
} /* scoped grid */
.ds7-p2-measure-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  min-height: 125px;
  text-align: left;
  background: #072330;
  border: 1px solid #37b8ca88;
  border-radius: 11px;
  padding: 13px 12px;
  color: #dff6fa;
  cursor: pointer;
}
.ds7-p2-measure-card.selected {
  border-color: #57f7ff;
  box-shadow: 0 0 14px #06edff55;
}
.ds7-p2-measure-card span {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
}
.ds7-p2-measure-card span small {
  font-size: 10px;
  color: #a1ccd6;
}
.ds7-p2-measure-card b {
  font-size: clamp(22px, 5vw, 30px);
  color: #6ff5ff;
  font-variant-numeric: tabular-nums;
}
.ds7-p2-measure-card > small {
  font-size: 12px;
  color: #a7cbd6;
}
.ds7-p2-measure-actions,
.ds7-p2-measure-footer,
.ds7-p2-photo-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 13px;
}
.ds7-p2-measure-actions button,
.ds7-p2-measure-footer button,
.ds7-p2-photo-actions button {
  flex: 1 1 160px;
  min-height: 46px;
}
.ds7-p2-measure-picker {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 2px 0 12px;
  scrollbar-width: thin;
}
.ds7-p2-measure-picker button {
  flex: 0 0 auto;
  white-space: nowrap;
}
.ds7-p2-measure-bodymap {
  margin: 17px auto;
  border: 1px solid #2fbcd155;
  border-radius: 10px;
  padding: 12px;
}
.ds7-p2-measure-bodymap summary {
  font-size: 14px;
  color: #8cecf8;
  font-weight: 750;
  cursor: pointer;
}
.ds7-p2-measure-bodymap .ds7-body-picture-panel {
  max-width: 360px;
  margin: 12px auto;
  padding: 0;
}
.ds7-p2-measure-compare table {
  min-width: 420px;
}
.ds7-p2-photo-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 12px 0;
}
.ds7-p2-photo-nav button {
  min-height: 48px;
}
.ds7-p2-photo-summary b {
  font-size: clamp(14px, 3.2vw, 20px);
}
.ds7-p2-photo-angles .eyebrow {
  display: block;
  margin: 18px 0 9px;
  font-size: 12px;
}
.ds7-p2-photo-angles .segmented {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: thin;
  padding: 3px;
}
.ds7-p2-photo-angles .segmented button {
  flex: 0 0 auto;
  min-height: 42px;
  white-space: nowrap;
}
.ds7-p2-photo-selection {
  display: flex;
  justify-content: space-between;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
  margin: 10px 0;
}
.ds7-p2-photo-selection > span {
  font-size: 12px;
  color: #aacbd7;
}
.ds7-p2-photo-selection button {
  min-height: 43px;
}
.ds7-p2-photo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.ds7-p2-photo-grid .photo-select {
  display: block;
  min-height: 140px;
  width: 100%;
}
.ds7-p2-photo-grid .photo-select img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: contain;
  background: #000d15;
}
.ds7-p2-photo-grid .photo-meta {
  display: grid;
  gap: 4px;
  padding: 10px;
}
.ds7-p2-photo-grid .photo-meta small {
  font-size: 11px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.ds7-p2-photo-grid .ds7-photo-tile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.ds7-p2-photo-grid .ds7-photo-tile-actions button {
  min-height: 40px;
}
.ds7-p2-photos .compare-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 13px;
}
.ds7-p2-photos .compare-controls .segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.ds7-p2-photos .compare-controls button {
  min-height: 43px;
}
.ds7-p2-photos .compare-view {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}
.ds7-p2-photos .ds7-photo-compare-frame {
  margin: 0;
  min-width: 0;
}
.ds7-p2-photos .ds7-photo-compare-frame img {
  display: block;
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: contain;
}
.ds7-p2-photo-empty-compare {
  padding: 13px 5px;
  display: grid;
  gap: 12px;
  justify-items: center;
}
.ds7-p2-photo-timeline {
  display: grid;
  gap: 11px;
}
.ds7-p2-photo-timeline-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid #2bc7d66b;
  padding: 10px;
  border-radius: 10px;
  background: #07202c;
}
.ds7-p2-photo-timeline-row > img {
  width: 96px;
  aspect-ratio: 3/4;
  object-fit: contain;
  background: #000d13;
  border-radius: 7px;
}
.ds7-p2-photo-timeline-row > div:nth-child(2) {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.ds7-p2-photo-timeline-row strong {
  font-size: 14px;
}
.ds7-p2-photo-timeline-row small,
.ds7-p2-photo-timeline-row p {
  font-size: 12px;
  color: #b1cdd9;
  overflow-wrap: anywhere;
  margin: 0;
}
.ds7-p2-photo-timeline-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  grid-column: 1/-1;
}
.ds7-p2-photo-timeline-actions button {
  flex: 1;
  min-height: 42px;
}
.ds7-p2-photos .ds7-photo-privacy {
  line-height: 1.6;
  margin: 18px 0 0;
  border-top: 1px solid #38e0ed44;
  padding: 14px 0;
}
@media (max-width: 720px) {
  .app-header {
    min-height: 107px;
  }
  .app-header .brand-image.ds7-full-storm-banner {
    max-height: 95px;
    width: 100%;
  }
  .ds7-p2-pr-panel,
  .ds7-p2-measure-panel,
  .ds7-p2-photo-panel {
    padding: 13px;
  }
  .ds7-p2-pr-name strong {
    font-size: 14px;
  }
  .ds7-p2-pr-best b {
    font-size: 17px;
  }
  .ds7-p2-measure-grid {
    max-height: 340px;
  }
}
@media (max-width: 370px) {
  .ds7-p2-pr-summary,
  .ds7-p2-photo-summary {
    gap: 5px;
  }
  .ds7-p2-pr-summary > div,
  .ds7-p2-photo-summary > div {
    padding: 10px 7px;
  }
  .ds7-p2-pr-summary b,
  .ds7-p2-photo-summary b {
    font-size: 13px;
  }
  .ds7-p2-pr-exercise {
    gap: 5px;
    padding: 10px;
  }
  .ds7-p2-pr-best b {
    font-size: 15px;
  }
  .ds7-p2-measure-grid {
    gap: 7px;
  }
  .ds7-p2-measure-card {
    padding: 10px;
  }
}
@media (min-width: 780px) {
  .ds7-p2-measure-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-height: none;
  }
  .ds7-p2-photo-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (prefers-reduced-motion: reduce) {
  .ds7-p2-pr-exercise,
  .ds7-p2-measure-card,
  .ds7-p2-photo-grid .photo-tile {
    transition: none;
  }
}

.ds7-p2-measure-grid.expanded {
  max-height: none;
  overflow-y: visible;
}

.ds7-p2-masthead {
  display: block;
  width: 100%;
  max-width: 1000px;
  height: auto;
  max-height: 190px;
  object-fit: cover;
  object-position: center;
  border-radius: 13px;
  border: 1px solid rgba(var(--accent-rgb), 0.46);
  box-shadow: 0 0 22px rgba(var(--accent-rgb), 0.17);
  margin: 3px auto 17px;
}
@media (max-width: 720px) {
  .ds7-p2-masthead {
    max-height: 124px;
    object-fit: contain;
    margin-top: 0;
    margin-bottom: 13px;
  }
}

/* Phase 2 completion pass: readable phone controls and the approved full-screen sections. */
.ds7-p2-muscle-tabs {
  display: flex;
  overflow-x: auto;
  scrollbar-width: thin;
  gap: 7px;
  padding: 6px 1px 12px;
  scroll-snap-type: x proximity;
}
.ds7-p2-muscle-tabs button,
.ds7-p2-timeline-layout button {
  flex: 0 0 auto;
  color: #c8e7f0;
  background: #071c28;
  border: 1px solid #29b2c47a;
  border-radius: 9px;
  min-height: 44px;
  padding: 10px 14px;
  font-weight: 750;
  cursor: pointer;
  scroll-snap-align: start;
}
.ds7-p2-muscle-tabs button.active,
.ds7-p2-timeline-layout button.active {
  background: linear-gradient(180deg, #7bf5ff, #22cbe0);
  color: #04141c;
  box-shadow: 0 0 13px #1ddff866;
}
.ds7-p2-latest-delta {
  padding: 10px 13px;
  border: 1px solid #2cb7c55b;
  border-radius: 8px;
  color: #b9ebf4;
  margin: 4px 0 14px;
}
.ds7-p2-compare-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 12px 0 18px;
}
.ds7-p2-compare-dates label {
  display: grid;
  gap: 7px;
  flex: 1 1 155px;
}
.ds7-p2-compare-dates select {
  max-width: 100%;
  min-width: 0;
  min-height: 46px;
}
.ds7-p2-timeline-layout {
  display: flex;
  gap: 9px;
  margin: 7px 0 15px;
}
.ds7-p2-photo-timeline-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: thin;
  padding: 4px 0 17px;
  margin: 0 0 12px;
}
.ds7-p2-photo-timeline-strip button {
  min-width: 99px;
  width: 99px;
  display: grid;
  gap: 6px;
  padding: 6px;
  background: #061c27;
  border: 1px solid #29bdcb99;
  border-radius: 9px;
  color: #dcf8fd;
  cursor: pointer;
  font-size: 12px;
}
.ds7-p2-photo-timeline-strip img {
  height: 116px;
  width: 100%;
  object-fit: cover;
  object-position: center;
  background: #020d15;
  border-radius: 5px;
}
.ds7-p2-photo-category-counts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 0;
}
.ds7-p2-photo-category-counts button {
  display: grid;
  gap: 4px;
  justify-items: center;
  padding: 15px;
  border-radius: 10px;
  border: 1px solid #2cbece8a;
  background: #06202c;
  min-height: 75px;
  color: #bfeefa;
  cursor: pointer;
}
.ds7-p2-photo-category-counts strong {
  font-size: 25px;
  color: #6ef0fb;
}
.ds7-p2-measure-grid.expanded {
  max-height: none;
  overflow: visible;
}
@media (max-width: 390px) {
  .ds7-p2-measure-card {
    min-height: 112px;
    padding: 11px;
  }
  .ds7-p2-photo-category-counts button {
    min-height: 68px;
  }
  .ds7-p2-section-heading {
    padding: 13px;
  }
}
/* The approved full storm masthead already carries the wordmark; avoid repeating
   another large PROGRESS title directly underneath on Phase 2 screens. */
#main:has(> .ds7-p2-masthead) > .ds7-progress-brand {
  display: none;
}
/* Four approved photo views must remain one readable row at phone widths. */
.ds7-p2-photo-nav {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.ds7-p2-photo-nav button {
  font-size: 12px;
  padding: 8px 4px;
  white-space: nowrap;
}
@media (max-width: 350px) {
  .ds7-p2-photo-nav button {
    font-size: 11px;
  }
}

/* Dashboard v3: owner-approved phone-first, four-tab, Habits + Education design. */
.ds7-dashboard-v3 {
  max-width: 1000px;
  gap: clamp(12px, 2vw, 19px);
}
.ds7-v3-header {
  min-width: 0;
  text-align: center;
  border: 1px solid rgba(var(--accent-rgb), 0.43);
  border-radius: 16px;
  overflow: hidden;
  background: #04141e;
  box-shadow: 0 0 16px rgba(var(--accent-rgb), 0.12);
}
.ds7-v3-banner {
  display: block;
  width: 100%;
  max-height: 192px;
  object-fit: cover;
  object-position: center 45%;
  aspect-ratio: 4.5/1;
}
.ds7-v3-header h1 {
  font: italic 900 clamp(21px, 4vw, 36px) var(--ds7-font-display);
  letter-spacing: 0.11em;
  color: #e5f7fd;
  margin: 0;
  padding: 7px 9px 11px;
  text-shadow: 0 0 12px rgba(var(--accent-rgb), 0.25);
}
.ds7-v3-quotes {
  position: relative;
  isolation: isolate;
  min-width: 0;
  padding: 0 48px 26px;
  border: 1px solid rgba(var(--accent-rgb), 0.66);
  border-radius: 15px;
  background: linear-gradient(110deg, #071925e6, #03212ce8, #071925e6);
  box-shadow:
    inset 0 0 25px #0ff2ff0d,
    0 0 15px #00ecff14;
  overflow: hidden;
}
.ds7-v3-quote-viewport {
  overflow: hidden;
  min-width: 0;
}
.ds7-v3-quote-track {
  display: flex;
  transition: transform 0.52s cubic-bezier(0.2, 0.75, 0.2, 1);
  will-change: transform;
}
.ds7-v3-quote {
  flex: 0 0 100%;
  min-width: 0;
  margin: 0;
  min-height: 87px;
  display: grid;
  place-items: center;
  padding: 12px 0;
}
.ds7-v3-quote p {
  font: italic 750 clamp(14px, 2.2vw, 20px)/1.38 var(--ds7-font-display);
  letter-spacing: 0.055em;
  text-align: center;
  color: #eefbff;
  margin: 0;
  overflow-wrap: break-word;
  text-shadow: 0 0 10px #008aab40;
}
.ds7-v3-quote-arrow {
  position: absolute;
  top: 17px;
  width: 42px;
  height: 51px;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 36px;
  line-height: 1;
  z-index: 2;
  cursor: pointer;
}
.ds7-v3-prev {
  left: 2px;
}
.ds7-v3-next {
  right: 2px;
}
.ds7-v3-dots {
  position: absolute;
  bottom: 9px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 10px;
}
.ds7-v3-dots button {
  width: 15px;
  height: 15px;
  min-height: 15px;
  border-radius: 50%;
  background: #385766;
  border: 1px solid #77c7cd6b;
  padding: 0;
  cursor: pointer;
}
.ds7-v3-dots button.is-active {
  background: var(--accent);
  box-shadow: 0 0 9px rgba(var(--accent-rgb), 0.56);
}
.ds7-v3-section {
  min-width: 0;
  border: 1px solid rgba(var(--accent-rgb), 0.66);
  border-radius: 16px;
  background: linear-gradient(145deg, #0a2835ee, #031019f2);
  padding: clamp(14px, 2.4vw, 22px);
  box-shadow:
    inset 0 1px #ffffff10,
    0 0 17px #00e7ff15;
}
.ds7-v3-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.ds7-v3-section-title h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  font: italic 800 clamp(19px, 2.9vw, 25px) var(--ds7-font-display);
  margin: 0;
  letter-spacing: 0.06em;
  color: #effaff;
}
.ds7-v3-section-title h2 svg {
  width: 23px;
  height: 23px;
  color: var(--accent);
}
.ds7-v3-section-title > a {
  font-size: 12px;
  font-weight: 700;
  color: #9beef2;
  text-decoration: underline;
  text-underline-offset: 3px;
  min-height: 42px;
  display: flex;
  align-items: center;
  flex: none;
}
.ds7-v3-habit-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(118px, 28%);
  gap: clamp(12px, 3vw, 30px);
  align-items: center;
}
.ds7-v3-habit-list {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.ds7-v3-habit-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
  color: #dceef5;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #57c2c43d;
  padding: 7px 3px;
  min-height: 42px;
  font-size: clamp(13px, 1.8vw, 16px);
  cursor: pointer;
}
.ds7-v3-habit-row:last-of-type {
  border-bottom: 0;
}
.ds7-v3-habit-row > span:nth-child(2) {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.ds7-v3-habit-row > small {
  font-size: 11px;
  color: #9ab8c6;
  text-align: right;
  flex: none;
}
.ds7-v3-check {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  flex: none;
  border: 2px solid var(--accent);
  border-radius: 5px;
  color: #03161b;
  font-size: 15px;
  font-weight: 900;
}
.ds7-v3-habit-row.is-met .ds7-v3-check {
  background: var(--accent);
  box-shadow: 0 0 7px #00f0ff42;
}
.ds7-v3-add {
  color: var(--accent);
}
.ds7-v3-see-all {
  color: #9cedf4;
  padding: 10px 3px;
  font-size: 12px;
}
.ds7-v3-habit-ring {
  width: min(100%, 195px);
  aspect-ratio: 1/1;
  border-radius: 50%;
  margin: auto;
  background: conic-gradient(var(--accent) var(--ds7-habit-pct, 0%), #244a5b var(--ds7-habit-pct, 0%));
  padding: clamp(10px, 1.9vw, 15px);
  box-shadow: 0 0 20px #00e0ff20;
}
.ds7-v3-habit-ring-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  border-radius: 50%;
  background: #061b26;
  text-align: center;
}
.ds7-v3-habit-ring-inner strong {
  font-size: clamp(21px, 4vw, 35px);
  font-variant-numeric: tabular-nums;
}
.ds7-v3-habit-ring-inner small {
  font-size: clamp(9px, 1vw, 12px);
  letter-spacing: 0.12em;
  color: #bdd9e5;
}
.ds7-v3-learning-intro {
  color: #a2c9d5;
  font-size: 12px;
  letter-spacing: 0.1em;
  margin: 0 0 13px;
}
.ds7-v3-topics {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(160px, 1fr);
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding: 4px 3px 12px;
  scrollbar-width: thin;
  scrollbar-color: #178eaa #071925;
}
.ds7-v3-topic {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  min-height: 160px;
  padding: 12px 8px;
  border: 1px solid #42e5f0c9;
  border-radius: 14px;
  scroll-snap-align: start;
  background: linear-gradient(#0a3c4c80, #04121bf7);
  color: #e8f9ff;
  text-decoration: none;
  box-shadow: inset 0 0 14px #00ddff14;
}
.ds7-v3-topic-icon {
  color: var(--accent);
  height: 28px;
}
.ds7-v3-topic-icon svg {
  width: 29px;
  height: 29px;
}
.ds7-v3-topic b {
  font: italic 750 clamp(12px, 1.5vw, 16px)/1.25 var(--ds7-font-display);
  overflow-wrap: break-word;
}
.ds7-v3-topic small {
  font-size: 10px;
  line-height: 1.2;
  color: #a6c9d6;
}
.ds7-v3-topic-chevron {
  color: #90ecf4;
  font-size: 25px;
  line-height: 1;
}
.ds7-dashboard-v3 :is(button, a):focus-visible {
  outline: 2px solid #9fffff;
  outline-offset: 2px;
}
@media (max-width: 600px) {
  .ds7-dashboard-v3 {
    gap: 12px;
  }
  .ds7-v3-header {
    border-radius: 13px;
  }
  .ds7-v3-banner {
    aspect-ratio: 3.3/1;
    max-height: 114px;
  }
  .ds7-v3-header h1 {
    font-size: 22px;
    padding: 7px 5px;
  }
  .ds7-v3-quotes {
    padding: 0 34px 25px;
  }
  .ds7-v3-quote {
    min-height: 108px;
    padding: 16px 0;
  }
  .ds7-v3-quote p {
    font-size: 14px;
    line-height: 1.45;
    letter-spacing: 0.02em;
  }
  .ds7-v3-quote-arrow {
    width: 33px;
    height: 48px;
    top: 31px;
    font-size: 31px;
  }
  .ds7-v3-section {
    padding: 13px 12px;
  }
  .ds7-v3-habit-layout {
    grid-template-columns: minmax(0, 1fr) 104px;
    gap: 10px;
  }
  .ds7-v3-habit-ring {
    padding: 9px;
  }
  .ds7-v3-habit-ring-inner strong {
    font-size: 20px;
  }
  .ds7-v3-habit-ring-inner small {
    font-size: 9px;
    letter-spacing: 0;
  }
  .ds7-v3-habit-row {
    font-size: 13px;
    gap: 8px;
    min-height: 42px;
  }
  .ds7-v3-habit-row small {
    font-size: 10px;
  }
  .ds7-v3-topics {
    grid-auto-columns: minmax(156px, 72%);
  }
  .sidebar nav .nav-link {
    min-width: 0;
  }
  .sidebar nav .nav-link span {
    font-size: 10px;
  }
}
@media (max-width: 340px) {
  .ds7-v3-habit-layout {
    grid-template-columns: minmax(0, 1fr) 88px;
  }
  .ds7-v3-habit-row > small {
    display: none;
  }
  .ds7-v3-topic {
    min-height: 143px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ds7-v3-quote-track {
    transition: none;
  }
}
.reduced-motion .ds7-v3-quote-track,
.fx-off .ds7-v3-quote-track {
  transition: none;
}

/* DS7 Settings · Concept #2 approved shell and in-place category navigation.
   Nothing outside Settings is restyled or restructured. */
.ds7-settings-page {
  --ds7-settings-border: #28daf0;
  max-width: 950px;
  width: 100%;
  min-width: 0;
  margin: 0 auto;
  display: grid;
  gap: clamp(12px, 2vw, 18px);
  padding: clamp(10px, 2.2vw, 23px);
  border-radius: 18px;
  border: 1px solid #57e9f250;
  background: linear-gradient(155deg, #092533ef 0%, #07141fee 48%, #04131bee 100%);
  box-shadow:
    0 5px 50px #010a15ba,
    inset 0 0 20px #00d6e80c;
  color: #e5f7ff;
  overflow-wrap: anywhere;
}
.ds7-settings-page,
.ds7-settings-page * {
  box-sizing: border-box;
}
.ds7-settings-shell-head {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #46d9f28a;
  border-radius: 15px;
  background: #071a23;
  box-shadow: 0 0 18px #00e9ff24;
}
.ds7-settings-banner {
  display: block;
  width: 100%;
  height: clamp(84px, 16vw, 170px);
  object-fit: cover;
  object-position: center center;
  background: #071a27;
}
.ds7-settings-shell-caption {
  padding: 10px 14px 13px;
  text-align: center;
  border-top: 1px solid #48e8f04a;
  background: linear-gradient(90deg, #081923, #0c3444, #081923);
}
.ds7-settings-shell-caption p {
  margin: 0;
  color: #65eeff;
  font-size: 10px;
  letter-spacing: 0.22em;
  font-weight: 750;
}
.ds7-settings-shell-caption h1 {
  margin: 2px 0;
  font: italic 900 clamp(22px, 4.5vw, 31px)/1.15 var(--ds7-font-display, system-ui);
  letter-spacing: 0.13em;
  color: #f0fcff;
  text-shadow: 0 0 12px #67d9ff55;
}
.ds7-settings-shell-caption span {
  font-size: 11px;
  letter-spacing: 0.13em;
  color: #a6dbe4;
}
.ds7-settings-intro {
  font-size: 13px;
  line-height: 1.4;
  color: #b7d6de;
  margin: 0 2px 1px;
}
.ds7-settings-menu {
  display: grid;
  gap: 10px;
  min-width: 0;
}
.ds7-settings-menu-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 17px;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 70px;
  padding: 12px 13px;
  border: 1px solid #37d8eea6;
  border-radius: 11px;
  background: linear-gradient(108deg, #0d3748d9, #08202eee);
  box-shadow:
    inset 2px 0 #36dbea,
    0 0 12px #00e7ff17;
  text-decoration: none;
  color: #f4fcff;
  transition:
    background 0.18s,
    border-color 0.18s,
    transform 0.18s;
}
.ds7-settings-menu-row:hover {
  border-color: #7af5ff;
  background: #104455;
}
.ds7-settings-menu-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: #063447;
  border-radius: 9px;
  border: 1px solid #2eddf176;
  color: #6bf2ff;
}
.ds7-settings-menu-icon svg {
  width: 24px;
  height: 24px;
}
.ds7-settings-menu-text {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.ds7-settings-menu-text b {
  font-size: clamp(14px, 2.3vw, 18px);
  line-height: 1.18;
  color: #f1fcff;
  letter-spacing: 0.025em;
}
.ds7-settings-menu-text small {
  font-size: clamp(11px, 1.8vw, 13px);
  line-height: 1.3;
  color: #a8d1de;
  overflow-wrap: anywhere;
}
.ds7-settings-menu-chevron {
  font-size: 29px;
  color: #60eaff;
  line-height: 1;
}
.ds7-settings-section-head {
  padding: 0 2px 4px;
  border-bottom: 1px solid #2ad5e749;
  min-width: 0;
}
.ds7-settings-back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 0;
  color: #7bf2ff;
  font-size: 13px;
  font-weight: 750;
}
.ds7-settings-section-head h2 {
  margin: 3px 0 2px;
  font: italic 800 clamp(20px, 3.2vw, 27px)/1.2 var(--ds7-font-display, system-ui);
  color: #f6fbff;
}
.ds7-settings-section-head p {
  margin: 3px 0 8px;
  color: #adcbd7;
  font-size: 13px;
}
.ds7-settings-content {
  min-width: 0;
  display: grid;
  gap: 14px;
}
.ds7-settings-card {
  min-width: 0;
  border-radius: 13px;
  border: 1px solid #45d7e995;
  background: linear-gradient(145deg, #0c3040dd, #051725f2);
  padding: clamp(12px, 2.5vw, 20px);
  box-shadow: inset 0 0 15px #00eff20e;
}
.ds7-settings-card h3 {
  font-size: clamp(16px, 2vw, 21px);
  margin: 0 0 12px;
  color: #eff9ff;
}
.ds7-settings-card p {
  line-height: 1.5;
}
.ds7-settings-form {
  min-width: 0;
  display: grid;
  gap: 14px;
}
.ds7-settings-form .form-grid {
  min-width: 0;
}
.ds7-settings-form input:not([type='checkbox']):not([type='file']),
.ds7-settings-form select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.ds7-settings-form label {
  min-width: 0;
}
.ds7-settings-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  margin: 12px 0;
  color: #dceef6;
  font-size: 14px;
  line-height: 1.4;
  cursor: pointer;
}
.ds7-settings-check input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex: none;
  accent-color: #10e1f0;
}
.ds7-settings-file {
  display: grid;
  gap: 9px;
  margin: 10px 0;
  font-size: 13px;
  color: #cfdee5;
}
.ds7-settings-file input {
  max-width: 100%;
  font-size: 12px;
}
.ds7-settings-avatar {
  display: block;
  width: 86px;
  height: 86px;
  border: 2px solid #3be6f9;
  border-radius: 50%;
  object-fit: cover;
  margin: 7px 0 17px;
  box-shadow: 0 0 21px #27e2ff51;
}
.ds7-settings-placeholder {
  display: grid;
  place-items: center;
  color: #6df1ff;
  font-size: 19px;
  font-weight: 900;
  background: #082c39;
}
.ds7-settings-submit {
  display: flex;
  justify-content: flex-start;
  padding-top: 2px;
}
.ds7-settings-submit button {
  min-height: 44px;
}
.ds7-settings-planned {
  display: inline-flex;
  max-width: 100%;
  padding: 9px 11px;
  border-radius: 9px;
  border: 1px solid #66b5c350;
  color: #b1ccd7;
  background: #152836;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.ds7-settings-data-inline,
.ds7-settings-source-inline {
  min-width: 0;
}
.ds7-settings-data-inline .dashboard-grid {
  margin: 0;
  gap: 13px;
}
.ds7-settings-data-inline .panel,
.ds7-settings-source-inline .source-card {
  min-width: 0;
}
.ds7-settings-data-inline .button-row {
  flex-wrap: wrap;
}
.ds7-settings-data-inline :is(button, a, label) {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}
.ds7-settings-source-inline .sources-page {
  min-width: 0;
}
.ds7-settings-source-inline pre {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.ds7-settings-page :is(a, button, input, select):focus-visible {
  outline: 2px solid #b1ffff;
  outline-offset: 2px;
}
@media (max-width: 430px) {
  .ds7-settings-page {
    border-radius: 13px;
    padding: 11px;
    gap: 12px;
  }
  .ds7-settings-menu-row {
    grid-template-columns: 35px minmax(0, 1fr) 14px;
    gap: 9px;
    min-height: 66px;
    padding: 11px 9px;
  }
  .ds7-settings-menu-icon {
    width: 33px;
    height: 33px;
  }
  .ds7-settings-menu-icon svg {
    width: 21px;
    height: 21px;
  }
  .ds7-settings-banner {
    height: 95px;
  }
  .ds7-settings-shell-caption {
    padding: 8px 9px 10px;
  }
  .ds7-settings-data-inline .dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
  .ds7-settings-content :is(.stack, .stack-main, .panel) {
    min-width: 0;
  }
  .ds7-settings-content .history-item {
    flex-wrap: wrap;
    gap: 8px;
  }
  .ds7-settings-form .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (prefers-reduced-motion: reduce) {
  .ds7-settings-menu-row {
    transition: none;
  }
}

.ds7-settings-credit-pre {
  max-width: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow-x: auto;
  color: #d7eaf1;
  font-size: 12px;
}

/* === DS7 Training phone-first approved concept (Nov 12): presentation only. === */
.ds7-training-premium {
  min-width: 0;
}
.ds7-training-premium
  :where(.ds7-program-summary, .ds7-current-week-preview, .ds7-program-roadmap, .library-grid, .exercise-card) {
  min-width: 0;
}
.ds7-training-premium .ds7-training-compact-topline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 0;
  padding: 0 0 14px;
  gap: 10px;
  background: #03131c;
  border: 1px solid #34ddea78;
  overflow: hidden;
  align-items: center;
}
.ds7-training-premium .ds7-training-compact-topline::before {
  display: none;
}
.ds7-training-premium .ds7-training-compact-topline .ds7-training-top-art {
  position: relative;
  display: block;
  inset: auto;
  grid-column: 1/-1;
  width: 100%;
  height: auto;
  max-height: 220px;
  transform: none;
  object-fit: contain;
  opacity: 1;
  mask-image: none;
  z-index: auto;
}
.ds7-training-premium .ds7-training-headline {
  padding-left: 16px;
  min-width: 0;
}
.ds7-training-premium .ds7-training-headline h2 {
  font-size: clamp(20px, 3vw, 28px);
  margin: 3px 0;
}
.ds7-training-premium .ds7-training-compact-topline .button-row {
  padding: 0 14px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}
.ds7-training-premium .ds7-program-hero {
  min-height: 0;
  border: 1px solid #2abbd183;
}
.ds7-training-premium .ds7-program-hero .ds7-program-art {
  display: none;
}
.ds7-training-premium .ds7-program-hero .ds7-program-brand {
  display: none;
}
.ds7-training-premium .ds7-program-hero-content {
  padding: 19px 20px;
}
.ds7-training-premium .ds7-program-hero h1 {
  font-size: clamp(20px, 4vw, 30px);
  line-height: 1.2;
}
.ds7-training-premium .ds7-program-file-bar {
  margin: 10px 0 16px;
  padding: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  background: #051d27;
  border: 1px solid #30b6cb85;
}
.ds7-training-premium .ds7-file-bar-intro {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: min(100%, 240px);
  flex: 1 1 260px;
}
.ds7-training-premium .ds7-file-bar-intro strong {
  font-size: 16px;
  color: #d7fbff;
}
.ds7-training-premium .ds7-file-bar-intro span {
  font-size: 13px;
  line-height: 1.45;
  color: #b1ccdb;
}
.ds7-training-premium .ds7-file-bar-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}
.ds7-training-premium .ds7-file-bar-controls :where(a, label, button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid #37bbd1a0;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  color: #d9fbff;
  cursor: pointer;
  text-decoration: none;
  background: #052c37;
}
.ds7-training-premium .ds7-file-bar-controls :where(a, label, button):focus-visible {
  outline: 2px solid #89f8ff;
  outline-offset: 2px;
}
.ds7-training-premium .ds7-current-week-preview {
  padding: 16px;
}
.ds7-training-premium .ds7-current-week-preview .ds7-section-heading {
  margin-bottom: 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.ds7-training-premium .ds7-current-week-preview .ds7-section-heading h2 {
  font-size: clamp(19px, 3vw, 24px);
  line-height: 1.2;
}
.ds7-training-premium .ds7-day-preview-list {
  display: grid;
  gap: 8px;
}
.ds7-training-premium .ds7-day-preview {
  border: 1px solid #2da9be7a;
  border-radius: 12px;
  background: #061b27;
  overflow: hidden;
}
.ds7-training-premium .ds7-day-preview > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 65px;
  padding: 10px 13px;
  cursor: pointer;
  list-style: none;
}
.ds7-training-premium .ds7-day-preview > summary::-webkit-details-marker {
  display: none;
}
.ds7-training-premium .ds7-preview-index {
  display: grid;
  place-items: center;
  flex: 0 0 37px;
  height: 38px;
  color: #051820;
  background: #5ce6ef;
  border-radius: 9px;
  font-weight: 900;
}
.ds7-training-premium .ds7-preview-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.ds7-training-premium .ds7-preview-title b {
  font-size: 17px;
  color: #e4faff;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.ds7-training-premium .ds7-preview-title small {
  font-size: 13px;
  color: #afcbd5;
}
.ds7-training-premium .ds7-preview-arrow {
  color: #6af2fb;
  font-size: 21px;
}
.ds7-training-premium .ds7-preview-details {
  padding: 8px 15px 15px;
  border-top: 1px solid #23647680;
}
.ds7-training-premium .ds7-preview-details ol {
  margin: 3px 0 12px;
  padding-left: 20px;
  display: grid;
  gap: 8px;
}
.ds7-training-premium .ds7-preview-details li {
  padding-left: 4px;
}
.ds7-training-premium .ds7-preview-details strong,
.ds7-training-premium .ds7-workout-day .rx-list li span {
  display: block;
  font-size: 15px;
  line-height: 1.35;
  color: #e8fcff;
  overflow-wrap: anywhere;
}
.ds7-training-premium .ds7-preview-details small,
.ds7-training-premium .ds7-workout-day .rx-list small {
  display: block;
  font-size: 13px;
  line-height: 1.4;
  color: #b7d0de;
}
.ds7-training-premium .ds7-workout-day .ds7-day-exercises > summary {
  font-size: 15px;
  min-height: 44px;
}
.ds7-training-premium .exercise-open b {
  display: block;
  font-size: 17px;
  line-height: 1.36;
  overflow-wrap: anywhere;
}
.ds7-training-premium .exercise-open small {
  font-size: 13px;
  line-height: 1.4;
}
.ds7-training-premium .exercise-card-head h3 {
  font-size: 19px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.ds7-training-premium .exercise-card-head .subtle.small {
  font-size: 13px !important;
  line-height: 1.48;
}
.ds7-training-premium .set-table {
  min-width: 0;
}
.ds7-training-premium .set-row.v3 input {
  font-size: 16px;
  min-width: 0;
}
.ds7-training-premium .quick-row :where(button, a) {
  min-height: 44px;
  font-size: 13px;
}
.ds7-training-premium .ds7-workout-day :where(button, a) {
  min-height: 44px;
}
@media (max-width: 700px) {
  .ds7-training-premium .ds7-training-compact-topline {
    display: block;
    padding: 0 0 12px;
    min-height: 0;
    margin-bottom: 12px;
  }
  .ds7-training-premium .ds7-training-compact-topline .ds7-training-top-art {
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
    transform: none;
    opacity: 1;
    position: relative;
  }
  .ds7-training-premium .ds7-training-headline {
    padding: 6px 14px 0;
  }
  .ds7-training-premium .ds7-training-headline h2 {
    font-size: 22px;
  }
  .ds7-training-premium .ds7-training-compact-topline .button-row {
    padding: 6px 13px;
    display: flex;
    gap: 6px;
    justify-content: flex-start;
  }
  .ds7-training-premium .ds7-program-hero {
    min-height: 0;
  }
  .ds7-training-premium .ds7-program-hero-content {
    padding: 15px;
  }
  .ds7-training-premium .ds7-program-hero h1 {
    font-size: 22px;
  }
  .ds7-training-premium .ds7-program-file-bar {
    margin: 10px 0 14px;
    padding: 12px;
  }
  .ds7-training-premium .ds7-file-bar-intro {
    min-width: 0;
    flex-basis: 100%;
  }
  .ds7-training-premium .ds7-file-bar-controls {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ds7-training-premium .ds7-file-bar-controls :where(a, label, button) {
    min-width: 0;
    min-height: 48px;
    font-size: 12px;
    white-space: normal;
    text-align: center;
  }
  .ds7-training-premium .ds7-file-bar-controls > *:last-child:nth-child(odd) {
    grid-column: 1/-1;
  }
  .ds7-training-premium .ds7-current-week-preview {
    padding: 12px;
  }
  .ds7-training-premium [data-training-tab] {
    font-size: clamp(10px, 2.9vw, 13px) !important;
    min-height: 46px !important;
    padding: 8px 3px !important;
  }
  .ds7-training-premium .ds7-day-preview > summary {
    min-height: 60px;
    padding: 10px;
  }
  .ds7-training-premium .ds7-workout-day .rx-list {
    font-size: 15px;
  }
  .ds7-training-premium .exercise-list {
    max-height: none;
  }
  .ds7-training-premium .exercise-card {
    padding: 12px;
  }
  .ds7-training-premium .exercise-cards {
    grid-template-columns: minmax(0, 1fr);
  }
  .ds7-training-premium .exercise-card .quick-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ds7-training-premium .exercise-card .quick-row > * {
    min-width: 0;
  }
  .ds7-training-premium .set-row.v3 {
    gap: 3px;
    grid-template-columns: 26px minmax(76px, 1.3fr) minmax(48px, 0.8fr) 42px 42px;
  }
  .ds7-training-premium .set-row.v3 .stepper {
    grid-template-columns: 27px minmax(0, 1fr) 27px;
  }
  .ds7-training-premium .set-row.v3 .stepper button {
    min-width: 27px;
    padding: 0;
  }
  .ds7-training-premium .set-row.v3 .set-check {
    min-width: 42px;
    min-height: 44px;
  }
  .ds7-training-premium .set-row.v3 input {
    font-size: 16px;
    padding-inline: 2px;
  }
}
@media (max-width: 370px) {
  .ds7-training-premium .set-table {
    width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }
  .ds7-training-premium .set-row.v3 {
    min-width: 270px;
  }
  .ds7-training-premium .ds7-file-bar-controls {
    grid-template-columns: minmax(0, 1fr);
  }
  .ds7-training-premium .ds7-file-bar-controls > * {
    grid-column: 1/-1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ds7-training-premium .ds7-day-preview * {
    transition: none !important;
  }
}

/* DS7 owner-approved educational guide. Content preserved verbatim; design uses existing brand asset. */
.ds7-body-guide {
  width: min(100%, 970px);
  margin: 0 auto 56px;
  color: #dceaf1;
  min-width: 0;
}
.ds7-guide-breadcrumb {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 4px 0 14px;
  font-size: 13px;
  font-weight: 650;
  color: #88a7b7;
}
.ds7-guide-breadcrumb a,
.ds7-guide-bottom a {
  color: #8eeffd;
  text-decoration: none;
}
.ds7-guide-breadcrumb a:hover,
.ds7-guide-bottom a:hover {
  text-decoration: underline;
}
.ds7-guide-cover {
  overflow: hidden;
  position: relative;
  border: 1.5px solid rgba(70, 235, 247, 0.65);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(7, 29, 40, 0.95), rgba(3, 13, 20, 0.98));
  box-shadow:
    0 0 25px rgba(0, 226, 245, 0.12),
    inset 0 0 15px rgba(0, 219, 239, 0.04);
}
.ds7-guide-approved-logo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1200/370;
  object-fit: cover;
  object-position: center;
  border-bottom: 1px solid rgba(100, 231, 251, 0.2);
}
.ds7-guide-cover-title {
  position: relative;
  padding: 26px clamp(18px, 4vw, 42px) 25px;
}
.ds7-guide-brandline {
  margin: 0 0 8px;
  color: #b4d0dc;
  letter-spacing: 3px;
  font: 700 11px/1.4 var(--ds7-font-display);
}
.ds7-guide-cover h1 {
  margin: 0 0 11px;
  font: italic 900 clamp(23px, 4.1vw, 40px)/1.13 var(--ds7-font-display);
  letter-spacing: 0.75px;
  color: #f0f6f8;
  text-shadow: 0 0 16px rgba(41, 212, 239, 0.17);
}
.ds7-guide-tagline {
  margin: 0;
  color: #64ecfa;
  letter-spacing: 3.5px;
  font: 700 11px/1.4 var(--ds7-font-display);
}
.ds7-guide-revision {
  position: absolute;
  right: clamp(18px, 4vw, 42px);
  bottom: 20px;
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  white-space: nowrap;
  border: 1px solid rgba(93, 227, 247, 0.55);
  border-radius: 6px;
  background: rgba(11, 47, 56, 0.8);
  color: #9ef4ff;
  letter-spacing: 1.4px;
  font: 800 11px var(--ds7-font-display);
}
.ds7-guide-content {
  display: grid;
  gap: 17px;
  margin: 20px 0;
}
.ds7-guide-lead {
  padding: 25px clamp(20px, 4vw, 38px);
  border-left: 3px solid #4ae7f5;
  border-radius: 0 16px 16px 0;
  background: linear-gradient(90deg, rgba(22, 67, 79, 0.48), rgba(5, 20, 30, 0.7));
  box-shadow: inset 0 0 18px rgba(5, 187, 216, 0.04);
}
.ds7-guide-lead h2 {
  margin: 0 0 14px;
  color: #eafaff;
  font: italic 800 clamp(21px, 3vw, 27px) var(--ds7-font-display);
}
.ds7-guide-content p {
  font-size: 14px;
  line-height: 1.72;
  color: #cddce5;
  margin: 0 0 12px;
}
.ds7-guide-content p:last-child {
  margin-bottom: 0;
}
.ds7-guide-section {
  min-width: 0;
  padding: clamp(18px, 3.3vw, 33px);
  border-radius: 16px;
  border: 1px solid rgba(49, 172, 196, 0.3);
  background: linear-gradient(150deg, rgba(10, 36, 49, 0.96), rgba(4, 17, 26, 0.97));
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.14);
}
.ds7-guide-section-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 0 0 17px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(83, 206, 227, 0.24);
}
.ds7-guide-section-head > span {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(96, 239, 249, 0.5);
  border-radius: 9px;
  background: rgba(36, 158, 187, 0.14);
  font: 800 13px var(--ds7-font-display);
  color: #76edff;
}
.ds7-guide-section h2 {
  font: italic 800 clamp(17px, 2.6vw, 22px)/1.2 var(--ds7-font-display);
  letter-spacing: 0.5px;
  color: #e8faff;
  margin: 5px 0 0;
  min-width: 0;
  overflow-wrap: anywhere;
}
.ds7-guide-section h3 {
  margin: 21px 0 11px;
  color: #68e5f3;
  font: 700 clamp(15px, 2vw, 18px)/1.4 var(--ds7-font-display);
}
.ds7-guide-section h4 {
  margin: 17px 0 9px;
  color: #ebf5fa;
  font: 750 14px var(--ds7-font-display);
}
.ds7-guide-section ul,
.ds7-guide-section ol {
  padding-left: 23px;
  margin: 5px 0 16px;
  display: grid;
  gap: 7px;
}
.ds7-guide-section li {
  padding-left: 3px;
  font-size: 14px;
  line-height: 1.65;
  color: #cddce5;
}
.ds7-guide-section li::marker {
  color: #68ddea;
  font-weight: 750;
}
.ds7-guide-section strong {
  color: #e4f7fd;
}
.ds7-guide-important {
  padding: 13px 15px !important;
  margin-top: 20px !important;
  border-left: 3px solid #48e5ee;
  border-radius: 0 9px 9px 0;
  background: rgba(36, 151, 174, 0.13);
  color: #e1eef5 !important;
}
.ds7-guide-table-scroll {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  margin: 9px 0 21px;
  border-radius: 10px;
  border: 1px solid rgba(67, 183, 208, 0.36);
}
.ds7-guide-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  font-size: 13px;
  color: #d4e5eb;
}
.ds7-guide-table caption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.ds7-guide-table thead {
  background: rgba(28, 115, 139, 0.3);
}
.ds7-guide-table th,
.ds7-guide-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(62, 174, 200, 0.15);
  text-align: left;
  vertical-align: top;
  line-height: 1.5;
}
.ds7-guide-table tbody tr:last-child > td,
.ds7-guide-table tbody tr:last-child > th {
  border-bottom: 0;
}
.ds7-guide-table tbody tr:nth-child(2n) {
  background: rgba(16, 65, 84, 0.14);
}
.ds7-guide-table tbody th {
  font-weight: 700;
  color: #9de5f0;
}
.ds7-guide-table thead th {
  color: #e4fdff;
  font-weight: 800;
}
.ds7-guide-table tbody td:first-child {
  color: #6feafa;
  font-weight: 800;
}
.ds7-guide-final-quote {
  margin: 24px 0 19px !important;
  padding: 19px 14px !important;
  border: 1px solid rgba(73, 230, 249, 0.48);
  border-radius: 11px;
  background: linear-gradient(100deg, rgba(7, 70, 88, 0.43), rgba(9, 31, 48, 0.55));
  font: italic 800 15px/1.65 var(--ds7-font-display) !important;
  text-align: center;
  letter-spacing: 0.3px;
  color: #e9fcff !important;
}
.ds7-guide-disclaimer {
  margin-top: 18px !important;
  padding-top: 16px;
  border-top: 1px solid rgba(70, 194, 215, 0.23);
  font-size: 12px !important;
  color: #aac0cc !important;
}
.ds7-guide-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin: 24px 0;
  font-size: 12px;
  font-weight: 700;
  color: #a3ceda;
}
.ds7-guide-cover h1 {
  overflow-wrap: anywhere;
}
.ds7-guide-table-scroll:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.ds7-guide-wide-table .ds7-guide-table th:first-child {
  min-width: 6.25rem;
}
.ds7-guide-wide-table .ds7-guide-table :is(th, td):not(:first-child) {
  min-width: 7.25rem;
}
.ds7-guide-links li a,
.ds7-guide-insert li a,
.ds7-guide-next a,
.ds7-guide-breadcrumb a,
.ds7-guide-bottom a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-block: 5px;
  overflow-wrap: anywhere;
  color: #8eeffd;
}
.ds7-guide-links ul,
.ds7-guide-links ol {
  gap: 0;
}
.ds7-guide-next a {
  margin: 0 0 4px;
  padding: 8px 12px;
  border: 1px solid rgba(78, 228, 249, 0.65);
  border-radius: 9px;
  background: #10333f;
  font-size: 15px;
}
.ds7-guide-closing {
  margin: 0;
  min-width: 0;
  text-align: center;
}
.ds7-guide-closing .ds7-guide-final-quote {
  margin: 0 0 10px !important;
}
.ds7-guide-closing .ds7-guide-tagline {
  color: #64ecfa;
}
.ds7-guide-insert {
  margin: 18px 0;
  padding: 0 12px;
  border-inline-start: 2px solid var(--accent);
}
.ds7-guide-insert > h3:first-child {
  margin: 0 0 11px;
}
@media (max-width: 600px) {
  .ds7-guide-breadcrumb {
    margin: 0 0 10px;
  }
  .ds7-guide-cover-title {
    padding: 18px 17px 20px;
  }
  .ds7-guide-cover h1 {
    max-width: 100%;
    font-size: clamp(21px, 6vw, 29px);
    margin-bottom: 13px;
  }
  .ds7-guide-tagline {
    font-size: 10px;
    letter-spacing: 2px;
  }
  .ds7-guide-brandline {
    font-size: 10px;
    letter-spacing: 2px;
  }
  .ds7-guide-revision {
    position: static;
    margin-top: 14px;
  }
  .ds7-guide-content {
    gap: 13px;
    margin: 14px 0;
  }
  .ds7-guide-lead {
    padding: 18px 18px;
  }
  .ds7-guide-section {
    padding: 18px 15px;
  }
  .ds7-guide-section-head {
    gap: 10px;
  }
  .ds7-guide-section-head > span {
    width: 32px;
    height: 32px;
    font-size: 11px;
  }
  .ds7-guide-section h2 {
    font-size: 17px;
  }
  .ds7-guide-section li,
  .ds7-guide-content p {
    font-size: 13px;
  }
  .ds7-guide-table th,
  .ds7-guide-table td {
    padding: 9px 7px;
    font-size: 12px;
  }
  .ds7-guide-table {
    min-width: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ds7-body-guide * {
    scroll-behavior: auto !important;
  }
}

/* DS7 approved shell cleanup: remove obsolete global preview toolbar everywhere.
   Retain DOM nodes for existing event wiring; approved page banners remain intact. */
/* The obsolete global toolbar was removed from the document and scripts. */

/* DS7 approved footer-brand placement: move the existing compact logo from the
   sidebar corner to the established footer branding position. */
.workspace > footer {
  gap: 16px;
  flex-wrap: wrap;
  min-width: 0;
}
.workspace > footer .ds7-footer-approved-brand {
  display: block;
  width: min(285px, 100%);
  height: auto;
  max-height: 86px;
  object-fit: contain;
  object-position: left center;
  flex: 0 1 auto;
}
.workspace > footer .footer-links {
  flex-wrap: wrap;
  justify-content: flex-end;
  column-gap: 14px;
  row-gap: 4px;
  margin-left: auto;
  letter-spacing: normal;
}
@media (max-width: 600px) {
  .workspace > footer {
    align-items: flex-start;
    padding-bottom: 26px;
  }
  .workspace > footer .ds7-footer-approved-brand {
    width: min(230px, 100%);
  }
  .workspace > footer .footer-links {
    margin-left: 0;
    justify-content: flex-start;
  }
}

/* DS7 Advanced Set initials and consecutive superset grouping — isolated to Training workout cards. */
.ds7-training-workout .ds7-advanced-set-badges {
  display: flex;
  gap: 5px;
  margin: 6px 0 4px 34px;
  flex-wrap: wrap;
}
.ds7-training-workout .ds7-advanced-set-badge,
.ds7-training-premium .rx-row .ds7-advanced-set-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 2px 9px;
  border-radius: 4px 9px 4px 9px;
  border: 1px solid rgba(87, 240, 250, 0.77);
  background: rgba(5, 39, 54, 0.95);
  color: #b4faff;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.12em;
  box-shadow: 0 0 11px rgba(33, 224, 246, 0.16);
}
.ds7-training-workout .ds7-superset-block {
  min-width: 0;
  grid-column: 1/-1;
  display: block;
  padding: clamp(12px, 2.8vw, 22px);
  border: 3px solid #4be4f0;
  border-radius: 17px 5px 17px 5px;
  background: linear-gradient(140deg, rgba(2, 46, 59, 0.9), rgba(2, 23, 35, 0.96));
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.5),
    inset 0 1px rgba(169, 252, 255, 0.2),
    0 0 26px rgba(0, 224, 255, 0.17);
}
.ds7-training-workout .ds7-superset-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 15px;
  color: #c8fbff;
}
.ds7-training-workout .ds7-superset-heading > span {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.17em;
}
.ds7-training-workout .ds7-superset-heading > b {
  border: 1px solid #57eefa88;
  padding: 2px 7px;
  border-radius: 4px;
  color: #fff;
}
.ds7-training-workout .ds7-superset-heading > small {
  margin-left: auto;
  color: #8bcedb;
}
.ds7-training-workout .ds7-superset-exercises {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 385px), 1fr));
  gap: 15px;
}
.ds7-training-premium .ds7-plan-superset {
  list-style: none;
  border: 2px solid #4be4f0;
  border-radius: 10px;
  background: #07313d;
  padding: 10px;
  min-width: 0;
}
.ds7-plan-superset > ol {
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
  display: grid;
  gap: 6px;
}
.ds7-plan-superset > b,
.ds7-plan-superset-member {
  color: #8ff5ff;
  font-weight: 800;
}
.ds7-training-workout .ds7-superset-block .exercise-card {
  min-width: 0;
  border-color: rgba(94, 219, 239, 0.49);
  background: linear-gradient(143deg, rgba(6, 30, 42, 0.95), rgba(1, 15, 27, 0.98));
  box-shadow: none;
}
@media (max-width: 650px) {
  .ds7-training-workout .ds7-superset-heading > small {
    margin-left: 0;
    width: 100%;
  }
  .ds7-training-workout .ds7-superset-block {
    padding: 10px;
  }
  .ds7-training-workout .ds7-superset-exercises {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* Pre-beta refinement 2026-11-15: the chosen portion comes first; per-100 values are a labelled reference. */
#entry-form details.food-reference {
  margin: 14px 0;
  padding: 10px 12px;
  border: 1px dashed rgba(var(--accent-rgb), 0.38);
  border-radius: 11px;
}
#entry-form details.food-reference > summary {
  cursor: pointer;
  color: var(--ds7-muted);
  font-size: 13px;
  letter-spacing: 0.04em;
  min-height: 28px;
}
#entry-form details.food-reference[open] > summary {
  margin-bottom: 8px;
}
#entry-form #barcode-next-step {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid rgba(var(--accent-rgb), 0.6);
  border-radius: 11px;
}
#entry-form #barcode-next-step .button-row {
  margin-top: 10px;
  flex-wrap: wrap;
}
.food-result small.subtle,
.saved-food-reference {
  opacity: 0.78;
}
.saved-food-serving {
  font-weight: 700;
}
/* Master Recipe Library and readable food names (pre-beta 2026-11-15). Existing tokens and components only. */
.ds7-recipe-section {
  margin: 18px 0 4px;
  font-size: 15px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.ds7-recipe-filter {
  margin: 8px 0 10px;
}
.ds7-master-recipe {
  border-color: rgba(var(--accent-rgb), 0.45);
}
.ds7-food-library-item .pill {
  margin-left: 6px;
}
#entry-form .recipe-ingredients {
  list-style: none;
  padding: 0;
  margin: 8px 0 14px;
  display: grid;
  gap: 8px;
}
#entry-form .recipe-ingredients li {
  padding: 9px 11px;
  border: 1px solid rgba(var(--accent-rgb), 0.25);
  border-radius: 10px;
}
#entry-form .recipe-ingredients small {
  display: block;
  color: var(--ds7-muted);
  overflow-wrap: anywhere;
}
#entry-form .recipe-instructions {
  white-space: pre-line;
  line-height: 1.55;
}
#entry-form .recipe-ingredient {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
  padding: 10px 11px;
  margin: 8px 0;
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  border-radius: 10px;
}
#entry-form .recipe-ingredient-name {
  grid-column: 1/-1;
  min-width: 0;
}
#entry-form .recipe-ingredient-name small {
  display: block;
  color: var(--ds7-muted);
  overflow-wrap: anywhere;
}
#entry-form .recipe-ingredient-amount {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  margin: 0;
}
#entry-form .recipe-ingredient-manual {
  grid-template-columns: minmax(0, 1fr) auto;
}
#entry-form .recipe-ingredient input[aria-invalid='true'] {
  border-color: var(--ds7-warn);
}
#entry-form .recipe-add {
  margin: 12px 0 16px;
  padding: 12px;
  border: 1px dashed rgba(var(--accent-rgb), 0.38);
  border-radius: 11px;
}
#entry-form textarea[name='instructions'] {
  width: 100%;
  min-height: 110px;
}
.food-result small.food-original-name {
  opacity: 0.78;
}
@media (max-width: 560px) {
  #entry-form .recipe-ingredient {
    grid-template-columns: minmax(0, 1fr);
  }
}

.pill.warn {
  color: #ffcf6b;
  background: #ffcf6b14;
  border-color: #ffcf6b59;
}

.ds7-dashboard-links,
.ds7-dashboard-reminder {
  margin: 18px 0;
}
.ds7-dashboard-links {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 1100px) and (min-width: 701px) {
  .ds7-dashboard-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.ds7-dashboard-links a,
.ds7-dashboard-reminder,
.ds7-review-links {
  border: 1px solid rgba(var(--accent-rgb), 0.45);
  border-radius: 12px;
  background: linear-gradient(130deg, #102d38, #081b24);
}
.ds7-dashboard-links a,
.ds7-dashboard-reminder {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  color: var(--text);
}
.ds7-dashboard-links a:hover,
.ds7-dashboard-reminder:hover {
  border-color: var(--accent);
}
.ds7-dashboard-links svg,
.ds7-dashboard-reminder svg {
  width: 20px;
  height: 20px;
  flex: none;
  color: var(--accent);
}
.ds7-dashboard-links a > span,
.ds7-dashboard-reminder > b {
  margin-left: auto;
  color: var(--accent);
}
.ds7-dashboard-reminder {
  border-left: 4px solid var(--accent);
}
.ds7-dashboard-reminder > span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.ds7-dashboard-reminder strong,
.ds7-dashboard-reminder small,
.ds7-dashboard-reminder > span > span {
  display: block;
}
.ds7-dashboard-reminder small {
  font-size: 10px;
  color: var(--accent);
}
.ds7-dashboard-reminder > span > span {
  font-size: 12px;
  color: var(--muted);
}
.ds7-dashboard-reminder > b {
  min-width: max-content;
  text-align: right;
}
.ds7-review-heading {
  align-items: center;
  flex-wrap: wrap;
  margin: 18px 0;
}
.ds7-review-heading h1,
.ds7-stats-review h1 {
  font-size: clamp(27px, 5vw, 38px);
  line-height: 1.1;
  margin: 0;
}
.ds7-checkin-value {
  font-size: clamp(30px, 6vw, 51px);
  font-weight: 750;
  line-height: 1.14;
  margin: 10px 0;
  color: var(--text);
}
.ds7-stats-checkin {
  background:
    linear-gradient(90deg, #0c242f 12%, #0b202aeb 55%, #0a1b25a6),
    var(--ds7-progress-art) center 42% / cover;
}
.ds7-review-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  margin: 16px 0;
  padding: 4px 12px;
}
.ds7-review-links a {
  padding: 11px 0;
  color: var(--accent);
}
.ds7-measure-focus select {
  width: 100%;
}
.ds7-measure-focus .chart {
  margin-top: 14px;
}
.ds7-measure-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 8px;
}
.ds7-measure-choices label {
  min-height: 42px;
  align-items: center;
  margin: 0;
  padding: 6px;
  border-bottom: 1px solid var(--border);
  overflow-wrap: anywhere;
}
.ds7-measure-comparison th,
.ds7-measure-comparison td {
  padding: 8px 4px;
  white-space: normal;
}
.ds7-recovery-cards {
  margin: 12px 0 0;
}
.ds7-recovery-cards article {
  padding: 10px;
}
.ds7-recovery-cards strong {
  font-size: clamp(18px, 4vw, 30px);
}
.ds7-habits-hero h1 {
  margin-top: 28px;
}
.ds7-habits-calendar {
  margin-top: 12px;
}
.ds7-habits-calendar h2 {
  margin-bottom: 10px;
}
.ds7-habit-checklist-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 13px 0;
  border-top: 1px solid var(--border);
}
.ds7-habit-checklist-row h3 {
  overflow-wrap: anywhere;
}
.ds7-habit-checklist-row .ds7-habits-track {
  margin: 8px 0 0;
}
.ds7-habit-checklist-row .ds7-habit-main-action {
  margin: 0;
}
.ds7-habit-streak {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  margin: 8px 0 14px;
  text-align: center;
  gap: 4px;
}
.ds7-habit-streak b {
  display: block;
  margin: 4px auto;
  color: var(--accent);
}
.ds7-food-approved .food-log-date {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(var(--accent-rgb), 0.4);
  border-radius: 12px;
  background: #0c2632;
  padding: 10px 12px;
  margin: 13px 0;
}
.food-log-date strong,
.food-log-date small {
  display: block;
}
.food-log-date small {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
}
.food-log-date .text-link {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
}
.ds7-food-approved .food-today-head {
  grid-template-columns: minmax(0, 1fr) auto;
}
.ds7-food-approved .food-today-head .text-link {
  align-self: start;
}
.ds7-food-approved .food-gauges {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.ds7-food-approved .food-water-card {
  grid-template-columns: auto minmax(0, 1fr) auto;
}
.ds7-food-approved .food-water-card .food-linear-track {
  grid-column: 2;
  grid-row: 2;
}
.ds7-food-approved .food-water-card .quiet {
  grid-column: 3;
  grid-row: 1/3;
  min-height: 44px;
}
/* Restored Today content (approved 01_today reference): trend, water %, shortcuts and meal cards. */
.ds7-food-approved .food-today-head {
  grid-template-columns: minmax(0, 1fr) minmax(140px, 0.62fr) auto;
}
.ds7-food-approved .food-water-card {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
}
.ds7-food-approved .food-water-card .food-water-percent {
  grid-column: 3;
  grid-row: 1/3;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}
.ds7-food-approved .food-water-card .quiet {
  grid-column: 4;
}
.ds7-food-approved .food-quick-actions-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.ds7-food-approved .food-quick {
  min-height: 72px;
}
.ds7-food-approved .food-meal-cards {
  display: grid;
  gap: 10px;
  margin: 0 0 16px;
}
.ds7-food-approved .food-meal-card {
  border: 1px solid rgba(var(--accent-rgb), 0.6);
  border-radius: 12px;
  background: linear-gradient(110deg, #0b2f3b, #051923);
  box-shadow: var(--food-glow);
}
.ds7-food-approved .food-meal-card > summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  min-height: 64px;
  cursor: pointer;
  list-style: none;
}
.ds7-food-approved .food-meal-card > summary::-webkit-details-marker {
  display: none;
}
.ds7-food-approved .food-meal-icon {
  font-size: 22px;
  color: var(--accent);
  width: 28px;
  text-align: center;
}
.ds7-food-approved .food-meal-name strong,
.ds7-food-approved .food-meal-totals strong {
  display: block;
  font-size: clamp(15px, 2vw, 18px);
  color: #f0faff;
}
.ds7-food-approved .food-meal-name small,
.ds7-food-approved .food-meal-totals small {
  display: block;
  font-size: 12px;
  color: #afc3ce;
}
.ds7-food-approved .food-meal-totals {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.ds7-food-approved .food-meal-totals strong small {
  display: inline;
  font-size: 0.75em;
}
.ds7-food-approved .food-meal-chevron {
  font-size: 22px;
  color: #c9f9fa;
  transition: transform 0.16s;
}
.ds7-food-approved .food-meal-card[open] .food-meal-chevron {
  transform: rotate(90deg);
}
.ds7-food-approved .food-meal-items {
  padding: 0 12px 12px;
  border-top: 1px solid rgba(var(--accent-rgb), 0.2);
}
.ds7-food-approved .food-meal-items .food-row {
  background: rgba(2, 18, 27, 0.54);
  border-radius: 7px;
  margin-top: 6px;
  padding-inline: 8px;
}
@media (max-width: 700px) {
  .ds7-food-approved .food-today-head {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .ds7-food-approved .food-today-head .food-trend-mini {
    grid-column: 1/-1;
    grid-row: 2;
  }
  .ds7-food-approved .food-meal-card > summary {
    gap: 8px;
    padding: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ds7-food-approved .food-meal-chevron {
    transition: none;
  }
}
/* Catalogue results state each calorie basis (per 100 g / per serving / per portion). */
.food-result > span:last-child {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.food-result > span:last-child small {
  font-size: 10px;
  letter-spacing: 0.04em;
}
.food-staple-result {
  border-color: rgba(var(--accent-rgb), 0.55);
}
@media (max-width: 700px) {
  .ds7-dashboard-links {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .ds7-dashboard-links a {
    min-height: 46px;
  }
  .sidebar #navigation .nav-link {
    flex: 1 1 0;
    min-width: 0;
    padding-inline: 1px;
  }
  .sidebar #navigation .nav-link span {
    font-size: clamp(8px, 2.55vw, 10px);
  }
  .ds7-food-approved .food-log-date .primary,
  .ds7-food-approved .food-log-date .secondary {
    padding-inline: 9px;
  }
}
@media (max-width: 385px) {
  .ds7-food-approved .food-log-date {
    padding-inline: 8px;
    gap: 5px;
  }
  .food-log-date strong {
    font-size: 12px;
  }
  .ds7-habit-checklist-row {
    gap: 7px;
  }
}

/* DS7 graphic review */
:root {
  --review-cyan: #80f1f5;
  --review-ice: #eefbff;
}
.ds7-dashboard-v3 .ds7-dashboard-reminder,
.ds7-dashboard-v3 .ds7-dashboard-links a,
.ds7-habits-premium .ds7-habit-checklist-row,
.ds7-food-approved .food-log-date,
.ds7-stats-review .ds7-stats-checkin {
  transition:
    border-color 0.16s,
    background-color 0.16s;
}
.ds7-dashboard-v3 .ds7-dashboard-reminder {
  margin: 5px 0;
  border-color: #48a8b8;
  border-left: 4px solid #80f1f5;
  background: linear-gradient(110deg, #133744, #0a202b 66%);
  padding: 11px 15px;
}
.ds7-dashboard-reminder strong {
  font-size: 15px;
  color: var(--review-ice);
}
.ds7-dashboard-reminder > b {
  background: #113642;
  border: 1px solid #356b78;
  border-radius: 7px;
  padding: 5px 9px;
  color: var(--review-cyan);
}
.ds7-dashboard-v3 .ds7-dashboard-links {
  margin: 5px 0;
  gap: 9px;
}
.ds7-dashboard-v3 .ds7-dashboard-links a {
  border-color: #2b6474;
  min-height: 48px;
  background: #0c2531;
  padding: 10px 12px;
}
.ds7-dashboard-v3 .ds7-dashboard-links a:hover {
  border-color: #77e4eb;
  background: #11313d;
}
.ds7-dashboard-v3 .ds7-dashboard-links a b {
  font-size: 14px;
}
.ds7-dashboard-v3 .ds7-dashboard-links svg {
  color: var(--review-cyan);
}
.ds7-habits-premium .ds7-habits-hero {
  border-radius: 15px;
  border-color: #368292;
  min-height: 190px;
}
.ds7-habits-premium .ds7-habits-calendar {
  margin: 5px 0;
  padding: 12px 14px;
}
.ds7-habits-premium .ds7-habit-checklist-row {
  --habit-accent: #6ee0e8;
  gap: 10px;
}
.ds7-habits-premium .ds7-habit-checklist-row .ds7-habits-work-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: #102d39;
}
.ds7-habits-premium .ds7-habit-checklist-row .ds7-habits-work-icon svg {
  width: 22px;
  height: 22px;
  filter: none;
}
.ds7-habits-premium .ds7-habit-checklist-row button.ds7-habit-main-action {
  min-height: 44px;
  color: #d4fcff;
  background: #123642;
  border: 1px solid #4a8d99;
  border-radius: 9px;
  box-shadow: none;
}
/* G2-D06: the "−" correction sits beside the one-tap action, same size and style */
.ds7-habit-checklist-row .ds7-habit-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ds7-habits-premium .ds7-habit-checklist-row button.ds7-habit-step-down {
  min-width: 44px;
  padding-inline: 0;
  font-size: 18px;
  line-height: 1;
}
.ds7-habits-premium .ds7-habit-checklist-row.is-complete button.ds7-habit-main-action {
  color: #b5f8e5;
  background: #12332f;
  border-color: #4d8174;
}
.ds7-habits-premium .ds7-habit-checklist-row h3 {
  font-size: 15px;
}
.ds7-habits-premium .ds7-habit-checklist-row .ds7-habits-track {
  height: 5px;
}
.ds7-food-approved .food-log-date {
  border-color: #438d9c;
  background: linear-gradient(110deg, #123641, #0a242f);
  margin-block: 8px;
}
.ds7-food-approved .food-log-date button {
  min-height: 44px;
}
.ds7-food-approved .food-today-panel {
  background: #0a202b;
  border-color: #397787;
  padding: 14px;
}
.ds7-food-approved .food-today-panel .food-gauge-icon {
  display: block;
  font-family: 'Segoe UI Emoji', sans-serif;
  font-size: 15px;
  line-height: 1;
}
.ds7-food-approved .food-gauge-ring {
  width: 102px;
}
.ds7-food-approved .food-gauges {
  max-width: 680px;
  margin-inline: auto;
}
.ds7-food-approved .food-water-card .quiet {
  border: 1px solid #468392;
  background: #11323f;
  color: #bdedf5;
  border-radius: 8px;
  padding-inline: 10px;
}
.ds7-stats-review .ds7-stats-checkin {
  border-color: #428491;
  background:
    linear-gradient(90deg, #09232ff5 0%, #0a232ed4 46%, #061c2777 100%),
    var(--ds7-progress-art) right 42% / cover;
}
.ds7-stats-checkin a {
  color: #d2f9fc;
  background: #0b2936;
  border-color: #507f8d;
}
.ds7-measure-focus,
.ds7-measure-comparison,
.ds7-recovery-cards article {
  border-color: #356474;
  background-color: #0d2632;
}
.ds7-measure-focus select {
  min-height: 44px;
}
.ds7-review-links {
  border-color: #36707d;
  background: #0c2833;
}
@media (max-width: 700px) {
  .ds7-dashboard-v3 .ds7-dashboard-links {
    gap: 6px;
  }
  .ds7-dashboard-v3 .ds7-dashboard-reminder {
    padding-block: 9px;
  }
  .ds7-habits-premium .ds7-habits-hero {
    min-height: 150px;
    margin-inline: 0;
  }
  .ds7-habits-premium .ds7-habits-hero h1 {
    margin-top: 14px;
  }
  .ds7-habits-premium .ds7-habit-checklist-row {
    padding-block: 8px;
  }
  .ds7-habits-premium .ds7-habits-calendar {
    padding: 9px;
  }
  .ds7-food-approved .food-gauge-ring {
    width: 85px;
  }
  .ds7-food-approved .food-today-panel .food-gauge-icon {
    font-size: 12px;
  }
  .ds7-food-approved .food-gauge-inner {
    gap: 0;
  }
  .ds7-food-approved .food-gauges {
    padding-top: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ds7-dashboard-v3 .ds7-dashboard-reminder,
  .ds7-dashboard-v3 .ds7-dashboard-links a,
  .ds7-habits-premium .ds7-habit-checklist-row,
  .ds7-food-approved .food-log-date,
  .ds7-stats-review .ds7-stats-checkin {
    transition: none;
  }
}

/* ===== Habit form (Add habit / Edit habit): one form for every entry point ===== */
dialog.ds7-habit-dialog {
  padding: 0;
  width: min(560px, calc(100% - 24px));
}
.ds7-habit-dialog .dialog-heading {
  position: relative;
  margin: 0;
  min-height: 150px;
  padding: 20px 22px;
  align-items: end;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(6, 22, 30, 0.92) 0%, rgba(6, 22, 30, 0.55) 48%, rgba(6, 22, 30, 0.15) 100%),
    var(--habit-hero) right 38% / cover no-repeat,
    #0e202b;
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.45);
}
.ds7-habit-dialog .dialog-heading .eyebrow {
  display: none;
}
.ds7-habit-dialog .dialog-heading h2 {
  font-family: var(--ds7-font-display);
  font-style: italic;
  font-weight: 900;
  font-size: clamp(30px, 8vw, 40px);
  line-height: 1;
  margin: 0;
  color: #fff;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.6))
    drop-shadow(0 0 calc(12px * var(--ds7-glow-scale)) rgba(var(--accent-rgb), calc(0.35 * var(--ds7-glow-scale))));
}
.ds7-habit-dialog .dialog-heading .icon-button {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: rgba(6, 22, 30, 0.78);
  border: 1px solid rgba(var(--accent-rgb), 0.45);
  font-size: 22px;
}
.ds7-habit-dialog #entry-form {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  padding: 18px 22px 20px;
}
.ds7-habit-dialog .ds7-habit-form {
  display: contents;
}
.ds7-habit-dialog #entry-form > *,
.ds7-habit-dialog .ds7-habit-form > * {
  grid-column: 1/-1;
  min-width: 0;
}
.ds7-habit-dialog #form-error {
  order: 1;
  margin: 0;
}
.ds7-habit-dialog #form-error:empty {
  display: none;
}
.ds7-habit-dialog .ds7-habit-cancel {
  order: 2;
  grid-column: 1;
  min-height: 52px;
  padding-inline: 22px;
  font-weight: 800;
  font-size: 16px;
}
.ds7-habit-dialog #entry-form > .primary {
  order: 2;
  grid-column: 2;
  min-height: 52px;
  font-size: 16px;
  margin: 0;
  align-self: stretch;
}
.ds7-habit-dialog .ds7-habit-cancel {
  margin: 0;
  align-self: stretch;
}
.ds7-habit-dialog label,
.ds7-habit-dialog legend {
  font-weight: 700;
}
.ds7-habit-presets summary {
  cursor: pointer;
  font-weight: 800;
  font-size: 17px;
  padding: 4px 0;
  list-style-position: inside;
}
.ds7-habit-presets summary b {
  color: var(--accent);
}
.ds7-habit-preset-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.ds7-habit-preset {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 72px;
  padding: 8px 4px;
  border-radius: 12px;
  border: 1px solid rgba(var(--accent-rgb), 0.32);
  background: linear-gradient(180deg, #0e2a36, #081c25);
  color: var(--text);
  text-align: center;
}
.ds7-habit-preset b {
  font-weight: 800;
  font-size: 14px;
  line-height: 1.15;
  overflow-wrap: normal;
  word-break: normal;
}
.ds7-habit-preset small {
  font-size: 12px;
  color: var(--muted);
}
.ds7-habit-preset:hover:not(:disabled) {
  border-color: rgba(var(--accent-rgb), 0.7);
}
.ds7-habit-preset[aria-pressed='true'] {
  border-color: var(--accent);
  background: linear-gradient(180deg, #15495a, #0d2f3c);
  box-shadow:
    inset 0 1px 0 rgba(214, 250, 255, 0.2),
    0 0 calc(14px * var(--ds7-glow-scale)) rgba(var(--accent-rgb), calc(0.3 * var(--ds7-glow-scale)));
}
.ds7-habit-preset:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.ds7-habit-dialog .ds7-habit-modes legend {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 10px;
}
.ds7-habit-dialog .ds7-habit-modes-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.ds7-habit-dialog .ds7-habit-modes-grid span {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-height: 72px;
  padding: 12px 14px;
  text-align: left;
}
.ds7-habit-dialog .ds7-habit-modes-grid span b {
  font-weight: 800;
  font-size: 16px;
}
.ds7-habit-dialog .ds7-habit-modes-grid span small {
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
}
.ds7-habit-target-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.ds7-habit-numeric {
  display: grid;
  gap: 16px;
}
.ds7-habit-numeric[hidden] {
  display: none;
}
.ds7-habit-checklist-preview {
  margin: 0;
  padding: 14px 18px;
  border-radius: 12px;
  background: #0f2a36;
  color: var(--muted);
}
.ds7-habit-checklist-preview b {
  color: var(--accent);
  font-weight: 800;
}
.ds7-habit-appearance {
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  border-radius: 12px;
  padding: 14px 18px;
  background: #0b2230;
}
.ds7-habit-appearance summary {
  cursor: pointer;
  font-size: 16px;
}
.ds7-habit-appearance[open] summary {
  margin-bottom: 14px;
}
.ds7-habit-appearance .ds7-habit-palette {
  margin-bottom: 12px;
}
@media (max-width: 480px) {
  .ds7-habit-dialog .dialog-heading {
    min-height: 130px;
    padding: 16px;
  }
  .ds7-habit-dialog #entry-form {
    padding: 14px 16px 16px;
    gap: 14px;
  }
  .ds7-habit-preset-grid {
    gap: 7px;
  }
  .ds7-habit-preset {
    min-height: 66px;
  }
  .ds7-habit-preset b {
    font-size: 12.5px;
    letter-spacing: -0.01em;
  }
  .ds7-habit-preset {
    padding-inline: 2px;
  }
  .ds7-habit-dialog .ds7-habit-modes-grid {
    gap: 7px;
  }
  .ds7-habit-dialog .ds7-habit-modes-grid span {
    padding: 10px;
    min-height: 66px;
  }
  .ds7-habit-dialog .ds7-habit-modes-grid span b {
    font-size: 14px;
  }
  .ds7-habit-dialog .ds7-habit-modes-grid span small {
    font-size: 12px;
  }
}

/* ===== DS7 REFINE: depth, boldness and polish (loaded last; visual only) =====
   One finishing layer over every page. It changes colour, shadow, weight and
   spacing only: never layout structure, content or behaviour.
   Scoped under #main / dialogs / the sidebar so it reliably sits above the
   earlier page-specific layers without !important.
   Glow scales with Settings → Animation intensity (--ds7-glow-scale) and all
   motion respects Reduce motion and prefers-reduced-motion. */
:root {
  --rf-hi: inset 0 1px 0 rgba(214, 250, 255, 0.13);
  --rf-lo: inset 0 -1px 0 rgba(0, 0, 0, 0.45);
  --rf-e1: 0 1px 2px rgba(0, 0, 0, 0.5), 0 6px 14px -6px rgba(0, 0, 0, 0.65);
  --rf-e2: 0 2px 4px rgba(0, 0, 0, 0.45), 0 18px 38px -12px rgba(0, 0, 0, 0.85);
  --rf-e3: 0 6px 12px rgba(0, 0, 0, 0.5), 0 30px 70px -16px rgba(0, 0, 0, 0.9);
  --rf-glow: 0 0 calc(28px * var(--ds7-glow-scale)) rgba(var(--accent-rgb), calc(0.14 * var(--ds7-glow-scale)));
  --rf-lit: linear-gradient(180deg, rgba(28, 82, 100, 0.42) 0%, rgba(12, 42, 55, 0.18) 26%, rgba(3, 13, 20, 0) 60%);
  --rf-body: linear-gradient(155deg, rgba(13, 40, 52, 0.97), rgba(4, 15, 22, 0.985) 70%);
  --rf-border: rgba(var(--accent-rgb), 0.42);
  --rf-border-hi: rgba(var(--accent-rgb), 0.72);
  --rf-ink: #f3fcff;
}

/* ---------- surfaces: lifted, top-lit cards ---------- */
#main
  :is(
    .panel,
    .stat-card,
    .day-card,
    .exercise-card,
    .mcard,
    .metric-card,
    .hub-card,
    .meal-card,
    .program-card,
    .ds7-program-card,
    .food-today-panel,
    .food-water-card,
    .ds7-habits-calendar,
    .ds7-measure-focus,
    .ds7-measure-comparison,
    .source-card,
    .history-item,
    .ds7-dashboard-reminder,
    .food-log-date,
    .countdown,
    .ds7-stats-checkin
  ),
.workout-bar {
  border-color: var(--rf-border);
  box-shadow: var(--rf-hi), var(--rf-lo), var(--rf-e2), var(--rf-glow);
}
#main
  :is(
    .panel,
    .stat-card,
    .day-card,
    .exercise-card,
    .hub-card,
    .meal-card,
    .ds7-program-card,
    .food-today-panel,
    .ds7-habits-calendar,
    .ds7-measure-focus,
    .ds7-measure-comparison,
    .source-card
  ) {
  background-image: var(--rf-lit), var(--rf-body);
}
#main :is(.panel, .day-card, .exercise-card, .hub-card, .ds7-program-card, .history-item):hover {
  border-color: rgba(var(--accent-rgb), 0.58);
}
#main :is(.panel, .stat-card):focus-within {
  border-color: var(--rf-border-hi);
}
/* nested cards sit one level lower: recessed, so hierarchy reads at a glance */
#main
  :is(.panel, .exercise-card, .day-card)
  :is(.panel, .stat-card, .history-item, .mcard, .suggestion, .ds7-recovery-cards article),
#main .ds7-recovery-cards article {
  background-image: linear-gradient(165deg, rgba(8, 28, 38, 0.95), rgba(3, 14, 20, 0.97));
  box-shadow:
    inset 0 1px 0 rgba(214, 250, 255, 0.06),
    inset 0 3px 12px rgba(0, 0, 0, 0.45),
    var(--rf-e1);
}
/* dialogs float above everything */
dialog[open] {
  border-color: var(--rf-border);
  box-shadow:
    var(--rf-hi),
    var(--rf-e3),
    0 0 calc(44px * var(--ds7-glow-scale)) rgba(var(--accent-rgb), calc(0.2 * var(--ds7-glow-scale)));
}
dialog::backdrop {
  background: rgba(1, 6, 10, 0.74);
  backdrop-filter: blur(3px);
}

/* ---------- type: bolder, crisper ---------- */
#main h1 {
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.55))
    drop-shadow(0 0 calc(10px * var(--ds7-glow-scale)) rgba(var(--accent-rgb), calc(0.3 * var(--ds7-glow-scale))));
}
#main h2,
dialog h2 {
  font-weight: 800;
  letter-spacing: 0.005em;
  color: var(--rf-ink);
}
#main h3 {
  font-weight: 750;
}
#main :is(.eyebrow, .section-title, .ds7-program-kicker) {
  font-weight: 800;
  letter-spacing: 0.14em;
}
#main
  :is(
    .stat-value,
    .ds7-checkin-value,
    .mcard .v,
    .ds7-recovery-cards strong,
    .food-gauge-inner strong,
    .cal-ring strong,
    .big-number,
    .weight-hero strong
  ) {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.55))
    drop-shadow(0 0 calc(8px * var(--ds7-glow-scale)) rgba(var(--accent-rgb), calc(0.35 * var(--ds7-glow-scale))));
}
/* BETA-103: the smallest labels get a readable floor */
#main :is(.pill, .status-pill, .cal-chip) {
  font-size: 11px;
}
.nav-caption {
  font-size: 11px;
}

/* ---------- actions: a weighty primary, solid secondary ---------- */
:is(#main, dialog) .primary,
.workout-bar .primary {
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #021117;
  background-image: linear-gradient(180deg, #c8fdff 0%, var(--accent) 50%, #19aebd 100%);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    inset 0 -2px 0 rgba(0, 40, 52, 0.35),
    0 8px 18px -8px rgba(0, 0, 0, 0.8),
    0 0 calc(20px * var(--ds7-glow-scale)) rgba(var(--accent-rgb), calc(0.42 * var(--ds7-glow-scale)));
  transition:
    transform var(--ds7-fast) var(--ds7-ease),
    filter var(--ds7-fast),
    box-shadow var(--ds7-fast);
}
:is(#main, dialog) .primary:hover {
  filter: brightness(1.07);
}
:is(#main, dialog) .primary:active {
  transform: translateY(1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 2px 7px rgba(0, 40, 52, 0.5),
    0 2px 8px -4px rgba(0, 0, 0, 0.8);
}
:is(#main, dialog) .secondary,
.workout-bar .secondary {
  font-weight: 750;
  border-color: rgba(var(--accent-rgb), 0.55);
  background-image: linear-gradient(180deg, rgba(26, 74, 90, 0.75), rgba(8, 30, 40, 0.9));
  box-shadow:
    inset 0 1px 0 rgba(214, 250, 255, 0.14),
    inset 0 -1px 0 rgba(0, 0, 0, 0.4),
    var(--rf-e1);
}
:is(#main, dialog) .secondary:hover {
  border-color: var(--rf-border-hi);
}
:is(#main, dialog) :is(.secondary, .quiet):active {
  transform: translateY(1px);
}
:is(#main, dialog) :is(.danger, .quiet.danger, .danger-button) {
  font-weight: 750;
}
:is(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- tabs and segmented controls: obvious current state ---------- */
#main :is(.tab-row, .stats-tabs, .segmented) {
  box-shadow:
    inset 0 2px 8px rgba(0, 0, 0, 0.45),
    inset 0 -1px 0 rgba(214, 250, 255, 0.05);
}
/* underline-style program tabs keep their underline; it just gets bolder and lit */
#main .ds7-program-tabs [aria-current='page'] {
  font-weight: 800;
  color: var(--rf-ink);
  text-shadow: 0 0 calc(10px * var(--ds7-glow-scale)) rgba(var(--accent-rgb), calc(0.5 * var(--ds7-glow-scale)));
}
#main
  :is(
    .tab-row [aria-selected='true'],
    .tab-row [aria-pressed='true'],
    .tab-row .active,
    .stats-tabs .active,
    .stats-tabs [aria-current='page'],
    .segmented [aria-pressed='true']
  ) {
  font-weight: 800;
  color: var(--rf-ink);
  background-image: linear-gradient(180deg, rgba(var(--accent-rgb), 0.38), rgba(var(--accent-rgb), 0.14));
  box-shadow:
    inset 0 1px 0 rgba(214, 250, 255, 0.28),
    inset 0 0 0 1px rgba(var(--accent-rgb), 0.7),
    0 4px 12px -4px rgba(0, 0, 0, 0.7),
    0 0 calc(16px * var(--ds7-glow-scale)) rgba(var(--accent-rgb), calc(0.32 * var(--ds7-glow-scale)));
}

/* ---------- navigation ---------- */
.sidebar {
  box-shadow:
    inset -1px 0 0 rgba(var(--accent-rgb), 0.2),
    14px 0 44px -22px rgba(0, 0, 0, 0.95);
}
.sidebar #navigation :is(.nav-link.active, [aria-current='page']) {
  font-weight: 800;
  box-shadow:
    inset 0 1px 0 rgba(214, 250, 255, 0.22),
    inset 0 0 0 1px rgba(var(--accent-rgb), 0.6),
    0 0 calc(18px * var(--ds7-glow-scale)) rgba(var(--accent-rgb), calc(0.32 * var(--ds7-glow-scale)));
}
@media (max-width: 600px) {
  .sidebar {
    box-shadow:
      0 -1px 0 rgba(var(--accent-rgb), 0.28),
      0 -16px 36px -10px rgba(0, 0, 0, 0.92),
      0 0 calc(22px * var(--ds7-glow-scale)) rgba(var(--accent-rgb), calc(0.12 * var(--ds7-glow-scale)));
  }
}

/* ---------- inputs: recessed wells ---------- */
:is(#main, dialog)
  :is(
    input:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='color']):not([type='file']),
    select,
    textarea
  ) {
  background-color: #03111a;
  border-color: rgba(var(--accent-rgb), 0.34);
  box-shadow:
    inset 0 2px 7px rgba(0, 0, 0, 0.6),
    inset 0 -1px 0 rgba(214, 250, 255, 0.05);
}
:is(#main, dialog) :is(input, select, textarea):focus {
  border-color: var(--rf-border-hi);
}

/* ---------- motion settings ---------- */
@media (prefers-reduced-motion: reduce) {
  :is(#main, dialog) :is(.primary, .secondary, .quiet) {
    transition: none;
  }
  :is(#main, dialog) :is(.primary, .secondary, .quiet):active {
    transform: none;
  }
}
body.fx-off :is(#main, dialog) :is(.primary, .secondary, .quiet):active {
  transform: none;
}

/* ---- Where to measure? body map (repair 2026-11-15): figure and instructions side by side; stacked on phones ---- */
.ds7-measure-map .ds7-measure-map-layout {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}
.ds7-p2-measure-bodymap.ds7-measure-map .ds7-body-picture-panel {
  max-width: none;
  margin: 0;
  padding: 0;
}
.ds7-measure-map .ds7-body-interactive-art {
  width: min(100%, 300px);
}
.ds7-measure-map .ds7-body-hotspot {
  width: 30px;
  height: 30px;
}
.ds7-measure-map .ds7-body-hotspot:before {
  inset: 9px;
}
.ds7-measure-map .ds7-body-hotspot.active {
  width: 36px;
  height: 36px;
  border-width: 3px;
  background: #20d9e3cc;
  box-shadow:
    0 0 0 4px #48f0f866,
    0 0 18px #b6fdff;
}
.ds7-measure-map .ds7-body-hotspot.active:before {
  inset: 9px;
  background: #fff;
}
.ds7-measure-map-info {
  min-width: 0;
  text-align: left;
}
.ds7-measure-map-info h2 {
  margin: 2px 0 10px;
}
.ds7-measure-where {
  margin: 0 0 8px;
  line-height: 1.5;
}
.ds7-measure-steps {
  margin: 0 0 12px;
  padding-left: 20px;
  line-height: 1.55;
}
.ds7-measure-steps li {
  margin: 3px 0;
}
.ds7-measure-map-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ds7-measure-chip {
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(var(--accent-rgb), 0.45);
  background: #06202bcc;
  color: #d6f8ff;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.ds7-measure-chip.active {
  border-color: #fff;
  background: rgba(var(--accent-rgb), 0.28);
  color: #fff;
}
.ds7-measure-chip:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}
.ds7-guide-proposed {
  margin: 18px 0;
  padding: 14px;
  border: 1px dashed rgba(var(--accent-rgb), 0.6);
  border-radius: 12px;
}
.ds7-guide-proposed h3 {
  margin-top: 0;
}
@media (max-width: 720px) {
  .ds7-measure-map .ds7-measure-map-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .ds7-measure-map .ds7-body-interactive-art {
    width: min(82vw, 300px);
  }
  .ds7-measure-map .ds7-body-hotspot {
    width: 32px;
    height: 32px;
  }
  .ds7-measure-map .ds7-body-hotspot:before {
    inset: 10px;
  }
  .ds7-measure-chip {
    min-height: 44px;
  }
}

.ds7-measure-latest {
  margin: 10px 0 10px;
  line-height: 1.5;
}

/* DEADLYSIN_SEVEN · Storm Command graphics.
   One presentation system over the approved application. No layout ordering,
   data-derived values, routes or record handlers are replaced here. */
:root {
  --storm-purple: #b9a6ff;
  --storm-purple-rgb: 185, 166, 255;
  --storm-edge: rgba(var(--accent-rgb), 0.28);
  --storm-surface:
    linear-gradient(155deg, rgba(30, 74, 88, 0.24), transparent 42%), linear-gradient(145deg, #0a202cfa, #05121dfc 75%);
  --storm-shadow: inset 0 1px rgba(235, 251, 255, 0.1), 0 12px 30px -16px #000c;
  --rf-body: var(--storm-surface);
  --rf-border: var(--storm-edge);
  --rf-border-hi: rgba(var(--accent-rgb), 0.7);
  --rf-lit: linear-gradient(
    120deg,
    rgba(var(--accent-rgb), 0.055),
    transparent 52%,
    rgba(var(--storm-purple-rgb), 0.035)
  );
}

/* Light travels through the space between surfaces. These are decorative,
   bounded compositor layers, with no canvas, timer loop or interaction target. */
body {
  /* Resolve intensity-dependent tokens where the Full/Subtle/Off class lives. */
  --storm-highlight: rgba(var(--accent-rgb), calc(0.28 * var(--ds7-glow-scale)));
  --rf-glow: 0 0 calc(20px * var(--ds7-glow-scale)) rgba(var(--accent-rgb), calc(0.09 * var(--ds7-glow-scale)));
  background:
    radial-gradient(ellipse at 90% 10%, rgba(var(--storm-purple-rgb), 0.055), transparent 48%),
    radial-gradient(ellipse at 8% 35%, rgba(var(--accent-rgb), var(--glow)), transparent 54%),
    linear-gradient(160deg, #05131d, #02080e 72%);
}
.dashboard-atmosphere,
.dashboard-atmosphere * {
  pointer-events: none;
}
.dashboard-atmosphere::before,
.dashboard-atmosphere::after {
  content: '';
  position: absolute;
  pointer-events: none;
}
.dashboard-atmosphere::before {
  inset: -3%;
  background:
    radial-gradient(ellipse at 15% 25%, rgba(var(--accent-rgb), 0.17), transparent 38%),
    radial-gradient(ellipse at 84% 72%, rgba(var(--storm-purple-rgb), 0.14), transparent 40%);
  opacity: calc(0.34 * var(--ds7-glow-scale));
  animation: storm-atmosphere-drift 20s ease-in-out infinite alternate;
}
.dashboard-atmosphere::after {
  inset: 10% -4% 5%;
  background: linear-gradient(
    122deg,
    transparent 24%,
    rgba(var(--accent-rgb), 0.06) 35%,
    transparent 42%,
    rgba(var(--storm-purple-rgb), 0.05) 64%,
    transparent 72%
  );
  opacity: calc(0.38 * var(--ds7-glow-scale));
  animation: storm-current-drift 16s ease-in-out infinite alternate;
}
body.storm-dashboard .dashboard-atmosphere::before {
  opacity: calc(0.65 * var(--ds7-glow-scale));
}
.dashboard-atmosphere svg {
  opacity: calc(0.14 * var(--ds7-glow-scale));
  filter: drop-shadow(0 0 4px rgba(var(--accent-rgb), 0.3));
}
.dashboard-atmosphere .ambient-bolts {
  animation: storm-ambient-light 18s ease-in-out infinite alternate;
}
.dashboard-atmosphere .ambient-bolts path:nth-child(even) {
  stroke: var(--storm-purple);
}
@keyframes storm-atmosphere-drift {
  from {
    transform: translate3d(-1%, -0.6%, 0);
  }
  to {
    transform: translate3d(1%, 0.6%, 0);
  }
}
@keyframes storm-current-drift {
  from {
    transform: translate3d(-2%, 1%, 0);
  }
  to {
    transform: translate3d(2%, -1%, 0);
  }
}
@keyframes storm-ambient-light {
  from {
    opacity: 0.22;
  }
  to {
    opacity: 0.5;
  }
}

/* Shared surfaces keep the application hierarchy and existing semantic colours. */
#main :is(.panel, .stat-card, .day-card, .hub-card, .ds7-v3-section, .ds7-v3-quotes),
dialog:not(.opening-screen):not(.image-viewer) {
  border-color: var(--storm-edge);
  box-shadow: var(--storm-shadow), var(--rf-glow);
}
dialog:not(.opening-screen):not(.image-viewer) {
  background: var(--storm-surface);
}
#main :is(.panel, .ds7-v3-section):focus-within {
  border-color: rgba(var(--accent-rgb), 0.55);
}
#main :is(.secondary, .quiet, .small-btn),
dialog :is(.secondary, .quiet, .small-btn) {
  transition:
    border-color 0.16s var(--ds7-ease),
    background-color 0.16s var(--ds7-ease),
    box-shadow 0.16s var(--ds7-ease);
}
#main :is(.secondary, .quiet, .small-btn):focus-visible,
dialog :is(.secondary, .quiet, .small-btn):focus-visible {
  box-shadow:
    inset 0 0 0 1px rgba(var(--accent-rgb), 0.25),
    0 0 14px var(--storm-highlight);
}
:is(#main, dialog, .sidebar) :is(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
dialog .icon-button {
  min-width: 44px;
  min-height: 44px;
}
#main.page-enter {
  animation: storm-page-enter 0.18s ease-out both;
}
@keyframes storm-page-enter {
  from {
    opacity: 0.7;
  }
  to {
    opacity: 1;
  }
}

/* Dashboard art changes only its image and lighting. Header, quotes, reminder,
   Habits, the four tool links and Education retain their original order. */
#main .ds7-v3-header {
  position: relative;
  isolation: isolate;
  background: linear-gradient(180deg, #061824, #07151e);
  border-color: rgba(var(--accent-rgb), 0.24);
  box-shadow:
    var(--storm-shadow),
    0 0 24px rgba(var(--storm-purple-rgb), calc(0.07 * var(--ds7-glow-scale)));
}
.ds7-v3-banner {
  object-position: 50% 0;
  -webkit-mask-image: linear-gradient(#000 75%, transparent 100%);
  mask-image: linear-gradient(#000 75%, transparent 100%);
}
#main .ds7-v3-header h1 {
  position: relative;
  z-index: 1;
  color: #edf8fc;
  text-shadow: 0 2px 1px #0009;
}
/* A restrained light pass on existing decorative headers; it never takes input. */
.ds7-v3-header::after,
.ds7-training-premium .ds7-training-compact-topline::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(
    112deg,
    transparent 28%,
    rgba(var(--accent-rgb), 0.08) 43%,
    rgba(var(--storm-purple-rgb), 0.09) 50%,
    transparent 66%
  );
  opacity: calc(0.6 * var(--ds7-glow-scale));
  animation: storm-header-current 13s ease-in-out infinite alternate;
  animation-play-state: paused;
}
.ds7-training-premium .ds7-training-compact-topline {
  position: relative;
}
.ds7-v3-header.storm-in-view::after,
.ds7-training-compact-topline.storm-in-view::after {
  animation-play-state: running;
}
@keyframes storm-header-current {
  from {
    transform: translate3d(-24%, 0, 0);
  }
  to {
    transform: translate3d(24%, 0, 0);
  }
}
#main .ds7-v3-quotes,
#main .ds7-v3-section {
  background: var(--storm-surface);
}
#main .ds7-v3-quotes {
  padding-inline: 46px;
  padding-bottom: 40px;
}
.ds7-v3-quote-arrow {
  width: 44px;
  min-width: 44px;
  height: 48px;
  min-height: 48px;
  top: 0;
  bottom: 40px;
  margin-block: auto;
}
.ds7-v3-quote-arrow:active {
  transform: none;
}
.ds7-v3-dots {
  bottom: 0;
  gap: 0;
}
.ds7-v3-dots button,
.ds7-v3-dots button.is-active {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.ds7-v3-dots button::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #496577;
  border: 1px solid #9cbacb;
  pointer-events: none;
}
.ds7-v3-dots button.is-active::after {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 9px var(--storm-highlight);
}
.ds7-v3-section-title > a,
.ds7-v3-see-all {
  min-height: 44px;
  font-size: 14px;
}
.ds7-v3-habit-row {
  min-height: 48px;
}
.ds7-v3-habit-row > small {
  color: #b2cbd6;
  font-size: 12px;
}
.ds7-v3-habit-row.is-met .ds7-v3-check {
  box-shadow: 0 0 10px var(--storm-highlight);
}

/* The progress geometry and text still use the actual --ds7-habit-pct and
   existing habit calculations. The outer light is a separate decoration. */
.ds7-v3-habit-ring {
  position: relative;
  isolation: isolate;
  background: conic-gradient(var(--accent) 0%, var(--storm-purple) var(--ds7-habit-pct, 0%), #244a5b 0);
  box-shadow: 0 0 14px rgba(var(--accent-rgb), calc(0.15 * var(--ds7-glow-scale)));
}
.ds7-v3-habit-ring::before,
.ds7-v3-habit-ring::after {
  content: '';
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  animation-play-state: paused;
}
.ds7-v3-habit-ring::before {
  inset: -5px;
  border: 1px solid rgba(var(--accent-rgb), 0.32);
  box-shadow:
    0 0 13px rgba(var(--storm-purple-rgb), 0.28),
    inset 0 0 12px rgba(var(--accent-rgb), 0.14);
  opacity: calc(0.42 * var(--ds7-glow-scale));
  animation: storm-ring-breathe 5.6s ease-in-out infinite;
  animation-play-state: paused;
}
.ds7-v3-habit-ring::after {
  inset: -2px;
  border: 2px solid transparent;
  border-top-color: rgba(var(--accent-rgb), 0.64);
  border-inline-end-color: rgba(var(--storm-purple-rgb), 0.18);
  opacity: calc(0.65 * var(--ds7-glow-scale));
  animation: storm-ring-orbit 18s linear infinite;
  animation-play-state: paused;
}
.ds7-v3-habit-ring.storm-in-view::before,
.ds7-v3-habit-ring.storm-in-view::after {
  animation-play-state: running;
}
.ds7-v3-habit-ring-inner {
  position: relative;
  z-index: 1;
  background: radial-gradient(ellipse at 40% 20%, #102d3c, #06141f 75%);
  box-shadow:
    inset 0 1px 1px #c5f5ff19,
    inset 0 3px 14px #0007;
}
@keyframes storm-ring-breathe {
  0%,
  100% {
    transform: scale(1);
    opacity: calc(0.32 * var(--ds7-glow-scale));
  }
  50% {
    transform: scale(1.035);
    opacity: calc(0.68 * var(--ds7-glow-scale));
  }
}
@keyframes storm-ring-orbit {
  to {
    transform: rotate(360deg);
  }
}
#main .ds7-dashboard-links a {
  background:
    linear-gradient(118deg, rgba(var(--accent-rgb), 0.055), transparent 55%, rgba(var(--storm-purple-rgb), 0.045)),
    var(--storm-surface);
  border-color: var(--storm-edge);
  box-shadow:
    inset 0 1px #ecfbff0b,
    0 5px 14px -9px #000b;
}
#main .ds7-dashboard-links a:focus-visible,
#main .ds7-v3-topic:focus-visible {
  border-color: var(--accent);
  box-shadow:
    var(--storm-shadow),
    0 0 16px var(--storm-highlight);
}
.ds7-v3-topic {
  background:
    linear-gradient(155deg, rgba(var(--accent-rgb), 0.09), transparent 52%, rgba(var(--storm-purple-rgb), 0.06)),
    var(--storm-surface);
  border-color: rgba(var(--accent-rgb), 0.35);
  box-shadow: var(--storm-shadow);
}
.ds7-v3-topic small {
  font-size: 12px;
  line-height: 1.4;
  color: #b1cbd7;
}
@media (hover: hover) and (pointer: fine) {
  #main .ds7-dashboard-links a:hover,
  #main .ds7-v3-topic:hover {
    border-color: rgba(var(--accent-rgb), 0.65);
    box-shadow:
      var(--storm-shadow),
      0 0 16px var(--storm-highlight);
  }
}

/* Native anchors, routes, SVG icons and selected-parent mapping are unchanged. */
.sidebar #navigation .nav-link {
  position: relative;
  min-height: 48px;
  color: #bad0dc;
  transition:
    color 0.16s var(--ds7-ease),
    background-color 0.16s var(--ds7-ease),
    border-color 0.16s var(--ds7-ease),
    box-shadow 0.16s var(--ds7-ease);
}
.sidebar #navigation .nav-link[aria-current='page'] {
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.44);
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.13), rgba(var(--storm-purple-rgb), 0.055));
  box-shadow:
    inset 0 1px #e5fbff17,
    0 0 14px var(--storm-highlight) !important;
}
.sidebar #navigation .nav-link[aria-current='page'] svg {
  filter: drop-shadow(0 0 4px var(--storm-highlight));
}
.sidebar #navigation .nav-link:focus-visible {
  outline-offset: -3px;
}
.sidebar #navigation .nav-link:active {
  border-color: var(--accent);
  box-shadow: inset 0 0 15px var(--storm-highlight) !important;
}
.sidebar #navigation .nav-link span {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}
@media (min-width: 601px) and (max-width: 850px) {
  .sidebar {
    padding-inline: 4px;
  }
  .sidebar #navigation .nav-link {
    flex-direction: column;
    gap: 5px;
    min-height: 62px;
    padding-inline: 0;
  }
  body .sidebar #navigation .nav-link span {
    display: block;
    max-width: 100%;
    font-size: max(12px, calc(6rem / 7));
    line-height: 1.2;
    letter-spacing: 0;
    text-align: center;
  }
}
@media (max-width: 600px) {
  .sidebar {
    left: 8px;
    right: 8px;
    height: auto;
    min-height: 76px;
    padding: 4px;
    background: linear-gradient(135deg, #0b2531f7, #07131efc);
    box-shadow:
      inset 0 1px #d9faff17,
      0 -6px 28px #0008;
  }
  .sidebar #navigation {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: stretch;
    gap: 0;
    width: 100%;
    height: auto;
    min-height: 65px;
  }
  .sidebar #navigation .nav-link {
    min-width: 0;
    min-height: 60px;
    padding: 7px 1px 5px;
    gap: 5px;
    justify-content: flex-start;
    border-radius: 10px;
  }
  body .sidebar #navigation .nav-link span {
    display: block;
    max-width: 100%;
    font-size: max(12px, calc(6rem / 7));
    font-weight: 650;
    letter-spacing: 0;
    line-height: 1.2;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  body .sidebar #navigation .nav-link[aria-current='page'] span {
    font-weight: 750;
  }
  .sidebar #navigation .nav-link svg {
    width: 22px;
    height: 22px;
    flex: none;
  }
  .workspace {
    padding-bottom: calc(var(--storm-nav-height, 76px) + 26px + env(safe-area-inset-bottom, 0px));
  }
  html {
    scroll-padding-bottom: calc(var(--storm-nav-height, 76px) + 26px + env(safe-area-inset-bottom, 0px));
  }
  /* Keep the existing rest dock above the bar even when navigation text grows. */
  .timer-dock {
    bottom: calc(var(--storm-nav-height, 76px) + max(10px, env(safe-area-inset-bottom, 0px)) + 6px);
  }
  body.timer-on main {
    padding-bottom: calc(
      var(--timer-space, 0px) + var(--storm-nav-height, 76px) + max(10px, env(safe-area-inset-bottom, 0px)) + 10px
    );
  }
  html:has(body.timer-on) {
    scroll-padding-bottom: calc(
      var(--timer-space, 0px) + var(--storm-nav-height, 76px) + max(10px, env(safe-area-inset-bottom, 0px)) + 10px
    );
  }
  .toast {
    bottom: max(150px, calc(var(--storm-nav-height, 76px) + max(10px, env(safe-area-inset-bottom, 0px)) + 6px));
  }
  :is(dialog, .ds7-settings-page) :is(input:not([type='checkbox']):not([type='radio']), select, textarea) {
    font-size: 16px;
  }
  .ds7-v3-section-title h2 {
    font-size: 19px;
  }
}
@media (max-width: 360px) {
  .sidebar {
    left: 4px;
    right: 4px;
    padding-inline: 2px;
  }
  .sidebar #navigation .nav-link {
    padding-inline: 0;
  }
  body .sidebar #navigation .nav-link span {
    letter-spacing: 0;
  }
}

/* Effects Off must stop loops, including pseudo-elements. A tiny duration would
   run an infinite animation faster; it does not mean off. */
body.fx-off *,
body.fx-off *::before,
body.fx-off *::after,
body.reduced-motion *,
body.reduced-motion *::before,
body.reduced-motion *::after {
  animation: none !important;
  transition: none !important;
}
body.storm-paused .dashboard-atmosphere *,
body.storm-paused .dashboard-atmosphere::before,
body.storm-paused .dashboard-atmosphere::after,
body.storm-paused .ds7-v3-header::after,
body.storm-paused .ds7-training-compact-topline::after,
body.storm-paused .ds7-v3-habit-ring::before,
body.storm-paused .ds7-v3-habit-ring::after {
  animation-play-state: paused !important;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
/* A chart normally animates from an undrawn state. Off shows its final real data. */
body.fx-off .chart-anim .curve:not(.dashed) {
  stroke-dashoffset: 0;
}
body.fx-off .chart-anim .area {
  opacity: 1;
}
body.fx-off .chart-anim .bar {
  transform: none;
}
@media (forced-colors: active) {
  .dashboard-atmosphere,
  .ds7-v3-header::after,
  .ds7-training-compact-topline::after,
  .ds7-v3-habit-ring::before,
  .ds7-v3-habit-ring::after {
    display: none;
  }
  .sidebar #navigation .nav-link[aria-current='page'],
  .ds7-v3-dots button.is-active::after {
    border: 2px solid Highlight;
  }
}

/* Storm Command — training presentation.
   Existing markup, action order, program identities and logging logic are retained.
   Load after the shared Storm layer. No continuous animation runs on logging cards. */

/* Quiet glass beneath the existing banner, program summaries and editor sections. */
#main .ds7-training-premium :is(.ds7-training-compact-topline, .ds7-program-hero, .ds7-program-file-bar, .builder-day) {
  background-image: var(--storm-surface);
  border-color: var(--storm-edge);
  box-shadow: var(--storm-shadow);
}

/* A short angular reflection is painted into each card, so it cannot take focus,
   cover a control or interfere with the existing decorative pseudo-elements. */
#main .ds7-training-premium :is(.ds7-program-card, .ds7-starter-card, .ds7-workout-day, .exercise-card) {
  background:
    linear-gradient(
        135deg,
        transparent 43%,
        rgba(var(--accent-rgb), calc(0.36 * var(--ds7-glow-scale))) 44%,
        rgba(var(--storm-purple-rgb), calc(0.22 * var(--ds7-glow-scale))) 46%,
        transparent 47%
      )
      right top / 76px 18px no-repeat,
    var(--storm-surface);
  box-shadow: var(--storm-shadow);
  transition:
    box-shadow var(--ds7-fast) var(--ds7-ease),
    border-color var(--ds7-fast) var(--ds7-ease);
}

/* These surfaces carry actual completion/current states. Leave their border and
   status colours authoritative; interaction adds light rather than recolouring them. */
#main .ds7-training-premium .ds7-workout-day:is(.next, .status-in-progress) {
  border-color: var(--accent);
}
#main .ds7-training-premium .ds7-workout-day.status-completed {
  border-color: #3cddb49e;
}
#main .ds7-training-workout .exercise-card.complete {
  border-color: #4eeac1a1;
}
#main
  .ds7-training-premium
  :is(.ds7-program-card, .ds7-starter-card, .ds7-workout-day, .exercise-card, .ds7-week-card):focus-within {
  box-shadow:
    var(--storm-shadow),
    inset 0 0 0 1px rgba(var(--accent-rgb), calc(0.3 * var(--ds7-glow-scale))),
    0 0 18px rgba(var(--accent-rgb), calc(0.1 * var(--ds7-glow-scale))),
    0 0 7px rgba(var(--storm-purple-rgb), calc(0.08 * var(--ds7-glow-scale)));
}

@media (hover: hover) and (pointer: fine) {
  #main
    .ds7-training-premium
    :is(.ds7-program-card, .ds7-starter-card, .ds7-workout-day, .exercise-card, .ds7-week-card):hover {
    box-shadow:
      var(--storm-shadow),
      inset 0 0 0 1px rgba(var(--accent-rgb), calc(0.22 * var(--ds7-glow-scale))),
      0 0 18px rgba(var(--storm-purple-rgb), calc(0.08 * var(--ds7-glow-scale)));
  }

  /* Stable card bounds while selecting a program or reading a week. */
  #main .ds7-training-premium :is(.ds7-program-card, .ds7-week-card, .ds7-phase-preview):hover {
    transform: none;
  }
}

/* Preserve the user's superset colour language and strong grouping boundary. */
#main .ds7-training-workout .ds7-superset-block {
  background-image:
    linear-gradient(125deg, rgba(var(--storm-purple-rgb), 0.055), transparent 48%),
    linear-gradient(150deg, rgba(var(--accent-rgb), 0.055), transparent 72%), var(--storm-surface);
  box-shadow:
    var(--storm-shadow),
    0 0 20px rgba(var(--accent-rgb), calc(0.09 * var(--ds7-glow-scale)));
}

#main .ds7-training-workout .ds7-superset-heading {
  text-shadow: 0 0 12px rgba(var(--accent-rgb), calc(0.16 * var(--ds7-glow-scale)));
}

#main .ds7-training-workout .ds7-superset-block .exercise-card {
  box-shadow:
    inset 0 1px rgba(235, 251, 255, 0.07),
    0 6px 16px -12px #000c;
}

#main .ds7-training-workout .ds7-superset-block .exercise-card:focus-within {
  box-shadow:
    inset 0 1px rgba(235, 251, 255, 0.07),
    inset 0 0 0 1px rgba(var(--accent-rgb), calc(0.3 * var(--ds7-glow-scale))),
    0 0 16px rgba(var(--accent-rgb), calc(0.08 * var(--ds7-glow-scale)));
}

/* Existing tabs and management actions keep their order and native semantics. */
#main .ds7-training-premium :is(.ds7-program-tabs, .tab-row:has([data-training-tab])) {
  max-width: 100%;
  min-width: 0;
}

#main .ds7-training-premium .tab-row:has([data-training-tab]) {
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

#main .ds7-training-premium .tab-row:has([data-training-tab]) > .segmented {
  background: var(--storm-surface);
  border-color: var(--storm-edge);
  box-shadow: inset 0 1px rgba(235, 251, 255, 0.07);
}

#main .ds7-training-premium [data-training-tab] {
  font-size: clamp(12px, 2.5vw, 14px) !important;
  min-height: 48px !important;
  letter-spacing: 0;
  transition:
    background-color var(--ds7-fast) var(--ds7-ease),
    box-shadow var(--ds7-fast) var(--ds7-ease);
}

#main .ds7-training-premium [data-training-tab].active {
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.16), rgba(var(--storm-purple-rgb), 0.06));
  color: var(--ds7-text);
  box-shadow:
    inset 0 0 0 1px rgba(var(--accent-rgb), 0.6),
    0 0 12px rgba(var(--accent-rgb), calc(0.12 * var(--ds7-glow-scale)));
}

#main .ds7-training-premium .ds7-program-tabs > a[aria-current='page'] {
  text-shadow: 0 0 10px rgba(var(--accent-rgb), calc(0.18 * var(--ds7-glow-scale)));
}

#main
  .ds7-training-premium
  :is(.ds7-card-description, .ds7-card-objective, .ds7-card-history, .ds7-week-card small, .ds7-preview-title small) {
  font-size: 13px;
  line-height: 1.5;
}

#main .ds7-training-premium .ds7-program-card .ds7-card-history {
  letter-spacing: 0.025em;
}

#main .ds7-training-premium :is(.builder-day, .rx-row, .exercise-item, .history-item):focus-within {
  outline: 1px solid rgba(var(--accent-rgb), 0.48);
  outline-offset: -1px;
}

/* Logging values remain stationary. Keep all five columns and the original
   minus / load / plus order. No new scrolling or containing ancestor is added:
   the tempo badge retains its existing sticky relationship.
   Desktop minimum: 40 + 140 + 56 + 44 + 44 + (4 x 3) = 336px.
   Inputs use explicit pixels because the app root is 14px. */
#main .ds7-training-workout .set-row.v3 {
  grid-template-columns: 40px minmax(140px, 1.3fr) minmax(56px, 1fr) 44px 44px;
  gap: 3px;
}

#main .ds7-training-workout .set-row.v3 .stepper {
  grid-template-columns: 44px minmax(48px, 1fr) 44px;
}

#main .ds7-training-workout .set-row.v3 .stepper button {
  width: 44px;
  min-width: 44px;
  padding: 0;
}

#main .ds7-training-workout .set-row.v3 :is(.stepper button, .set-check) {
  height: 44px;
  min-height: 44px;
}

#main .ds7-training-workout .set-row.v3 .stepper input,
#main .ds7-training-workout .set-row.v3 > input {
  padding-inline: 2px;
}

#main .ds7-training-workout .set-row.v3 input,
#main .ds7-training-workout .set-extra select {
  min-height: 44px;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

#main .ds7-training-workout .set-head {
  font-size: 11px;
  letter-spacing: 0.025em;
  color: #b9ced8;
}

#main .ds7-training-workout :is(.exercise-card-head, .workout-bar, .quick-row) {
  min-width: 0;
}

#main .ds7-training-workout .quick-row > * {
  overflow-wrap: break-word;
}

@media (max-width: 700px) {
  #main .ds7-training-premium .tab-row:has([data-training-tab]) > .segmented {
    gap: 2px;
    padding: 4px;
  }

  /* Minimum 302px, including gaps. This fits both the ordinary 330px row and
     the nested superset's 304px row at the audited 390px viewport. */
  #main .ds7-training-workout .set-row.v3 {
    grid-template-columns: 26px minmax(140px, 1.3fr) minmax(44px, 0.8fr) 42px 42px;
    gap: 2px;
  }
}

/* Between 370px and 388px, the existing superset nesting leaves at most 302px.
   Enlarge its buttons from 27px to 36px while retaining a 48px load input and
   the five columns. Keep targets inside their own cells. :where() lets the
   baseline's <=370px scrolling refinement below restore full 44px buttons. */
@media (max-width: 388px) {
  #main .ds7-training-workout :where(.ds7-superset-block) .set-row.v3 {
    grid-template-columns: 26px minmax(124px, 1.3fr) minmax(44px, 0.8fr) 42px 42px;
    gap: 1px;
  }

  #main .ds7-training-workout :where(.ds7-superset-block) .set-row.v3 .stepper {
    grid-template-columns: 36px minmax(48px, 1fr) 36px;
  }

  #main .ds7-training-workout :where(.ds7-superset-block) .set-row.v3 .stepper button {
    width: 36px;
    min-width: 36px;
  }
}

/* The baseline already scrolls set-table horizontally at this breakpoint.
   The five visible columns remain in their original order for all 12 checked
   tracking variants. The first column also accommodates Left/Right set labels.
   Minimum: 44 + 140 + 48 + 44 + 44 + (4 x 3) = 332px.
   Its existing scrolling ancestor is intentionally confined to this breakpoint. */
@media (max-width: 370px) {
  #main .ds7-training-workout .set-table {
    max-width: 100%;
    scrollbar-color: rgba(var(--accent-rgb), 0.55) #06131b;
    scrollbar-width: thin;
  }

  #main .ds7-training-workout .set-row.v3 {
    min-width: 332px;
    grid-template-columns: 44px minmax(140px, 1.3fr) minmax(48px, 0.8fr) 44px 44px;
    gap: 3px;
  }

  #main .ds7-training-workout .set-row.v3 .stepper {
    grid-template-columns: 44px minmax(48px, 1fr) 44px;
  }

  #main .ds7-training-workout .set-row.v3 :is(.stepper button, .set-check) {
    width: 44px;
    min-width: 44px;
    padding: 0;
  }
}

/* No new keyframes are required for this quiet logging layer. These guards also
   stop inherited card animations when the owner or operating system asks for rest. */
body:is(.reduced-motion, .fx-off, .storm-paused)
  #main
  .ds7-training-premium
  :is(.ds7-program-card, .ds7-starter-card, .ds7-workout-day, .exercise-card, .ds7-week-card, [data-training-tab]) {
  animation: none !important;
  transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
  #main
    .ds7-training-premium
    :is(.ds7-program-card, .ds7-starter-card, .ds7-workout-day, .exercise-card, .ds7-week-card, [data-training-tab]) {
    animation: none !important;
    transition: none !important;
  }
}

/* Storm Command · quiet content surfaces.
   Presentation only: existing artwork, DOM order, chart geometry, semantic
   colours, scanner states and record handlers remain authoritative. */

/* Reuse the shared glass system on content components that are not .panel. */
.ds7-food-approved :is(.food-today-panel, .food-water-card, .food-meal-card, .food-quick),
.ds7-food-library-item,
.ds7-p2-pr-panel,
.ds7-p2-measure-panel,
.ds7-p2-photo-panel,
.ds7-settings-card,
.source-card,
.ds7-guide-section {
  border-color: var(--storm-edge);
  background: var(--storm-surface);
  box-shadow: var(--storm-shadow);
}

.ds7-food-approved .food-view-body .panel {
  border-color: var(--storm-edge);
  background: var(--storm-surface);
  box-shadow: var(--storm-shadow);
}

/* Artwork-bearing panels keep their existing background images and crops. */
.ds7-stats-review .ds7-stats-checkin,
.ds7-settings-shell-head,
.ds7-guide-cover {
  border-color: rgba(var(--accent-rgb), 0.4);
  box-shadow:
    var(--storm-shadow),
    0 0 calc(20px * var(--ds7-glow-scale)) rgba(var(--storm-purple-rgb), 0.07);
}

.ds7-food-approved .food-today-head,
.ds7-food-approved .food-meal-items,
.ds7-guide-section-head {
  border-color: rgba(var(--accent-rgb), 0.18);
}

/* A static top reflection keeps numeric areas calm while linking the palette. */
.ds7-food-approved .food-log-date,
.ds7-p2-pr-summary > div,
.ds7-p2-measure-snapshot > div,
.ds7-p2-photo-summary > div,
.ds7-settings-menu-row {
  border-color: var(--storm-edge);
  background:
    linear-gradient(115deg, rgba(var(--accent-rgb), 0.07), transparent 46%, rgba(var(--storm-purple-rgb), 0.04)),
    var(--storm-surface);
  box-shadow: var(--storm-shadow);
}

.ds7-settings-page {
  border-color: var(--storm-edge);
  background: linear-gradient(155deg, #09232ff5, #07141ff7 50%, #04131bf7);
  box-shadow: var(--storm-shadow);
}

.ds7-settings-shell-caption {
  border-top-color: rgba(var(--accent-rgb), 0.2);
  background: linear-gradient(110deg, #081923, #0c2938 55%, #141d30);
}

/* Responsive edge highlights, without moving any form, card or target. */
.ds7-food-approved :is(.food-quick, .food-meal-card),
.ds7-food-library-item,
.food-scan-option,
.ds7-p2-photos .photo-tile,
.ds7-settings-menu-row,
.ds7-education-card a,
.source-link {
  transition:
    border-color var(--ds7-fast) var(--ds7-ease),
    box-shadow var(--ds7-fast) var(--ds7-ease),
    color var(--ds7-fast) var(--ds7-ease);
}

.ds7-food-approved :is(.food-quick, .food-meal-card):focus-within,
.ds7-food-library-item:focus-within,
.food-scan-option:focus-visible,
.ds7-p2-photos .photo-tile:focus-within,
.ds7-settings-menu-row:focus-visible,
.ds7-education-card a:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.78);
  box-shadow:
    var(--storm-shadow),
    0 0 calc(16px * var(--ds7-glow-scale)) rgba(var(--accent-rgb), 0.13);
}

@media (hover: hover) and (pointer: fine) {
  .ds7-food-approved :is(.food-quick, .food-meal-card):hover,
  .ds7-food-library-item:hover,
  .food-scan-option:hover,
  .ds7-p2-photos .photo-tile:hover,
  .ds7-settings-menu-row:hover,
  .ds7-education-card a:hover {
    border-color: rgba(var(--accent-rgb), 0.65);
    box-shadow:
      var(--storm-shadow),
      0 0 calc(16px * var(--ds7-glow-scale)) rgba(var(--accent-rgb), 0.11);
  }
}

.ds7-food-approved .food-meal-card[open] {
  border-color: rgba(var(--accent-rgb), 0.52);
}

/* Nutrition: values and progress paints are untouched; only the inner well
   gains depth. There is no animated illumination behind the numbers. */
.ds7-food-approved .food-gauge-inner {
  background: linear-gradient(145deg, #0a222e, #04131c);
  box-shadow: inset 0 1px 2px #0007;
}

.ds7-food-approved .food-primary-tabs .segmented {
  background: #061720;
  border-color: var(--storm-edge);
  box-shadow: inset 0 1px rgba(235, 251, 255, 0.07);
}

.ds7-food-approved .food-primary-tabs .segmented button {
  font-size: clamp(14px, 1.5vw, 17px);
}

.ds7-food-approved .food-today-head h2,
.ds7-food-approved .food-trend-mini h3 {
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: 0.06em;
}

.ds7-food-approved .food-quick {
  font-size: 14px;
}

.ds7-food-library-item small,
.ds7-food-approved .food-water-card div:nth-child(2) span,
.ds7-nutrition-progress-card :is(p, small),
.ds7-food-section-heading p {
  font-size: 14px;
  line-height: 1.5;
}

.ds7-food-library-item > div:first-child {
  min-width: min(160px, 100%);
  overflow-wrap: anywhere;
}

.ds7-food-approved .food-log-date .text-link,
.ds7-food-library-tabs button,
.ds7-food-history-row,
.nutrition-page .week-nav-mini :is(a, button),
.nutrition-page .date-nav .icon-button {
  min-height: 44px;
}

.nutrition-page .week-nav-mini button,
.nutrition-page .date-nav .icon-button {
  min-width: 44px;
}

/* Scanner chooser/review keeps all warnings, previews and crop layers intact.
   Shared dialog/input rules supply the rest of the treatment. */
.food-scan-option {
  border-color: var(--storm-edge);
  background: var(--storm-surface);
  box-shadow: var(--storm-shadow);
}

.label-scan-review .form-help,
.label-scan-review .label-crop-note,
.food-scan-option span,
.food-scan-chooser > p {
  font-size: 14px;
  line-height: 1.55;
}

/* Progress: retain the existing grids and all real chart/data colours. */
.ds7-p2-pr-summary span,
.ds7-p2-measure-snapshot span,
.ds7-p2-photo-summary span,
.ds7-p2-section-heading p,
.ds7-stats-review .history-item small,
.ds7-p2-photos .photo-meta small {
  font-size: 14px;
  line-height: 1.45;
}

.analytics-grid .chip,
.ds7-measure-chip {
  min-height: 44px;
  max-width: 100%;
  padding: 8px 12px;
  font-size: 14px;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Extend only the well-separated limb targets. The original marker circles,
   anatomical coordinates and repaired press transform remain untouched.
   Central points are too close for blanket enlargement; their 44px labeled
   measurement chips remain the larger alternative. */
@media (min-width: 320px) {
  .ds7-body-hotspot:is(
      [data-map-metric='armL'],
      [data-map-metric='armR'],
      [data-map-metric='forearmL'],
      [data-map-metric='forearmR'],
      [data-map-metric='thighL'],
      [data-map-metric='thighR'],
      [data-map-metric='calfL'],
      [data-map-metric='calfR']
    )::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 44px;
    height: 44px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: transparent;
    pointer-events: auto;
  }
}

.stats-tabs.ds7-progress-nav a,
.ds7-p2-photo-nav button {
  min-height: 44px;
}

.analytics-grid :is(.change-list, .chart-legend),
.analytics-grid .mini-stats span {
  font-size: 14px;
  line-height: 1.5;
}

.ds7-p2-photos .photo-tile.selected {
  border-color: var(--accent);
  box-shadow:
    inset 0 0 0 1px rgba(var(--accent-rgb), 0.4),
    0 0 calc(16px * var(--ds7-glow-scale)) rgba(var(--accent-rgb), 0.13);
}

/* Settings remain a category list with the same nested forms and actions. */
.ds7-settings-menu-text small,
.ds7-settings-intro,
.ds7-settings-section-head p,
.ds7-settings-card p,
.ds7-settings-planned,
.ds7-settings-file {
  font-size: 14px;
  line-height: 1.55;
}

.ds7-settings-shell-caption :is(p, span) {
  font-size: 12px;
  letter-spacing: 0.12em;
  line-height: 1.5;
}

.ds7-settings-check {
  min-height: 44px;
  align-items: center;
}

.ds7-settings-check input {
  margin-top: 0;
  accent-color: var(--accent);
}

.ds7-settings-back,
.source-link {
  min-height: 44px;
  font-size: 14px;
}

/* Wrap long provenance URLs in their own containers, without clipping pages
   or changing source/legal wording. */
.source-card p,
.source-section-title p,
.sources-intro,
.sources-disclaimer {
  font-size: 14px;
  line-height: 1.6;
}

.source-links,
.source-link,
.source-card a,
.ds7-settings-source-inline,
.ds7-settings-credit-pre,
.ds7-guide-content a {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.source-link {
  flex-wrap: wrap;
}

/* Education: atmospheric cover above steady, comfortable reading surfaces. */
.ds7-guide-lead {
  background: linear-gradient(110deg, rgba(var(--accent-rgb), 0.06), transparent 62%), var(--storm-surface);
  border-left-color: var(--accent);
  box-shadow: var(--storm-shadow);
}

.ds7-body-guide .ds7-guide-content p,
.ds7-body-guide .ds7-guide-section li {
  font-size: 16px;
  line-height: 1.7;
}

.ds7-body-guide .ds7-guide-table :is(th, td),
.ds7-education-card a small,
.ds7-guide-breadcrumb,
.ds7-guide-bottom {
  font-size: 14px;
  line-height: 1.5;
}

.ds7-body-guide .ds7-guide-disclaimer {
  /* Existing source marks this declaration important at 12px. */
  font-size: 14px !important;
  line-height: 1.65;
}

.ds7-guide-table-scroll {
  min-width: 0;
  border-color: var(--storm-edge);
  background-color: #051722;
}

.ds7-guide-section :is(h3, h4),
.ds7-guide-section li::marker {
  color: var(--accent);
}

/* This layer adds no continuous animation. Its interactive transitions also
   stop under both application and operating-system motion preferences. */
:is(body.fx-off, body.reduced-motion)
  :is(
    .food-quick,
    .food-meal-card,
    .ds7-food-library-item,
    .food-scan-option,
    .ds7-p2-photos .photo-tile,
    .ds7-settings-menu-row,
    .ds7-education-card a,
    .source-link
  ) {
  transition: none;
}

@media (prefers-reduced-motion: reduce) {
  .ds7-food-approved :is(.food-quick, .food-meal-card),
  .ds7-food-library-item,
  .food-scan-option,
  .ds7-p2-photos .photo-tile,
  .ds7-settings-menu-row,
  .ds7-education-card a,
  .source-link {
    transition: none;
  }
}
