:root {
  color-scheme: dark;
  --bg: #000000;
  --surface: #141210;
  --surface-2: #1d1a16;
  --line: #2e2c29;
  --text: #f3f5f4;
  --text-strong: #ffffff;
  --text-secondary: #b7bcb9;
  --text-tertiary: #8e9591;
  --text-on-accent: #17140e;
  --text-on-success: #071b13;
  --muted: var(--text-secondary);
  --accent: #d5b15f;
  --accent-strong: #e8ca83;
  --accent-2: #55c995;
  --warn: var(--accent-strong);
  --danger: #ff737d;
  --blue: var(--accent-strong);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(216, 173, 82, 0.06), transparent 32rem),
    #000000;
  color: var(--text);
  font-family:
    "Microsoft YaHei", "微软雅黑", "Microsoft JhengHei", "PingFang SC", "PingFang TC", Arial, sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Light appearance keeps the training hierarchy intact with neutral surfaces and darker accents. */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f5f2;
  --surface: #ffffff;
  --surface-2: #edf0ec;
  --line: #d3d9d4;
  --text: #252a26;
  --text-strong: #101411;
  --text-secondary: #4f5952;
  --text-tertiary: #6c766f;
  --text-on-accent: #17140e;
  --text-on-success: #082719;
  --muted: var(--text-secondary);
  --accent: #a67d28;
  --accent-strong: #8b651c;
  --accent-2: #168259;
  --warn: var(--accent-strong);
  --danger: #bf3544;
  --blue: #765714;
  --shadow: 0 10px 28px rgba(29, 43, 34, 0.1);
}

:root[data-theme="light"] body,
:root[data-theme="light"] body[data-app-screen="training"],
:root[data-theme="light"] body[data-app-screen="completion"] {
  background:
    radial-gradient(circle at top left, rgba(166, 125, 40, 0.09), transparent 32rem),
    var(--bg);
}

:root[data-theme="light"] .site-topbar {
  margin: -4px -8px 0;
  padding: 6px 8px 7px;
  border-bottom-color: #30342f;
  border-radius: 0 0 8px 8px;
  background: #151713;
}

:root[data-theme="light"] .site-nav a {
  color: #eef1ed;
}

:root[data-theme="light"] .site-nav a:hover,
:root[data-theme="light"] .site-nav a:focus-visible {
  color: #ffffff;
}

:root[data-theme="light"] .plan-selector,
:root[data-theme="light"] .cover,
:root[data-theme="light"] .panel,
:root[data-theme="light"] .exercise-card,
:root[data-theme="light"] .history-item,
:root[data-theme="light"] .timer-bar,
:root[data-theme="light"] .finish-panel,
:root[data-theme="light"] .metrics > div,
:root[data-theme="light"] .session-score,
:root[data-theme="light"] .library-card,
:root[data-theme="light"] .pay-wall,
:root[data-theme="light"] .donation,
:root[data-theme="light"] .home-training-preview,
:root[data-theme="light"] .training-action-card,
:root[data-theme="light"] .training-paused-card,
:root[data-theme="light"] .training-finish-card,
:root[data-theme="light"] .completion-content,
:root[data-theme="light"] .cultivation-panel,
:root[data-theme="light"] .training-plan-overview,
:root[data-theme="light"] .training-plan-exercise,
:root[data-theme="light"] .completion-summary-grid div,
:root[data-theme="light"] .training-advanced,
:root[data-theme="light"] .custom-plan-manager {
  background: var(--surface);
}

:root[data-theme="light"] .plan-catalog-card {
  background: var(--surface);
}

:root[data-theme="light"] .plan-catalog-2025-group,
:root[data-theme="light"] .training-plan-block--alternating {
  background: #f6f8f5;
}

:root[data-theme="light"] .alternating-round,
:root[data-theme="light"] .training-set-row {
  background: rgba(255, 255, 255, 0.78);
}

:root[data-theme="light"] .hero-row {
  background: linear-gradient(135deg, #ffffff, #eef1ed);
}

:root[data-theme="light"] textarea,
:root[data-theme="light"] input,
:root[data-theme="light"] select,
:root[data-theme="light"] .set-table input,
:root[data-theme="light"] .segmented-control,
:root[data-theme="light"] .training-set-menu-body,
:root[data-theme="light"] .training-advanced-menu[open] > .training-advanced-body,
:root[data-theme="light"] .exercise-tools,
:root[data-theme="light"] .exercise-unit-switch button,
:root[data-theme="light"] .exercise-history-action,
:root[data-theme="light"] .community-filters,
:root[data-theme="light"] .cycle-step {
  background: var(--surface-2);
  color: var(--text);
}

:root[data-theme="light"] select {
  color-scheme: light;
}

:root[data-theme="light"] .rank-emblem::before {
  background: #f8f4e9;
}

:root[data-theme="light"] .rank-progress-track {
  background: #dfe5e0;
}

:root[data-theme="light"] .home-heatmap-day {
  background: #dce2dd;
}

:root[data-theme="light"] .home-heatmap-day[data-level="1"] { background: #b6dfcb; }
:root[data-theme="light"] .home-heatmap-day[data-level="2"] { background: #74c69d; }
:root[data-theme="light"] .home-heatmap-day[data-level="3"] { background: #36a874; }
:root[data-theme="light"] .home-heatmap-day[data-level="4"] { background: #14734e; }

:root[data-theme="light"] #supportBtn,
:root[data-theme="light"] .floating-timer,
:root[data-theme="light"] .training-resume-dock,
:root[data-theme="light"] .toast {
  background: #ffffff;
  color: var(--text);
}

:root[data-theme="light"] #supportBtn:hover {
  border-color: #a8b0aa;
  background: #e7ebe7;
}

:root[data-theme="light"] .training-set-menu-body button:hover,
:root[data-theme="light"] .training-set-menu-body button:focus-visible {
  background: rgba(22, 130, 89, 0.1);
}

:root[data-theme="light"] .tab.active,
:root[data-theme="light"] .segmented-control button.active {
  color: var(--text-strong);
}

:root[data-theme="light"] .training-combination-notice,
:root[data-theme="light"] .completion-cultivation {
  background: rgba(166, 125, 40, 0.09);
}

:root[data-theme="light"] dialog::backdrop {
  background: rgba(20, 25, 22, 0.5);
}

:root[data-theme="light"] .library-card-media,
:root[data-theme="light"] .workout-share-preview {
  --text: #f3f5f4;
  --text-strong: #ffffff;
  --text-secondary: #b7bcb9;
  --text-tertiary: #8e9591;
  --muted: var(--text-secondary);
  --warn: #e8ca83;
  background: #0b0c0d;
}

:root[data-theme="light"] ::-webkit-scrollbar-track {
  background: #edf0ec;
}

:root[data-theme="light"] ::-webkit-scrollbar-thumb {
  border-color: #edf0ec;
  background: #aeb7b0;
}

@media (max-width: 760px) {
  :root[data-theme="light"] .tabs {
    background: rgba(243, 245, 242, 0.96);
  }

  :root[data-theme="light"] .set-table th:first-child,
  :root[data-theme="light"] .set-table td:first-child {
    background: rgba(255, 255, 255, 0.98);
  }
}

button,
input,
textarea,
select {
  font: inherit;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-tertiary);
  opacity: 1;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

.app-shell {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 20px;
}

.topbar,
.layout,
.hero-row,
.panel-head,
.timer-bar,
.finish-actions,
.top-actions,
.split {
  display: flex;
}

.topbar {
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 0 10px;
}

.topbar .brand-lockup,
.top-actions #exportBtn,
.top-actions #supportBtn {
  display: none;
}

.site-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 32px;
  gap: 18px;
  padding: 3px 0 6px;
  border-bottom: 1px solid rgba(51, 56, 61, 0.72);
}

.brand-home {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: 108px;
  height: 25px;
  flex: 0 0 auto;
  object-fit: contain;
  object-position: left center;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-left: auto;
}

.site-nav a {
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text);
}

.site-topbar-actions,
.display-toggles {
  display: flex;
  align-items: center;
}

.site-topbar-actions {
  min-width: 0;
  gap: 14px;
  margin-left: auto;
}

.site-topbar-actions .site-nav {
  margin-left: 0;
}

.display-toggles {
  gap: 5px;
}

.display-toggle {
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #444a43;
  border-radius: 7px;
  color: #f3f5f4;
  background: #242722;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.display-toggle:hover,
.display-toggle:focus-visible {
  border-color: #c7a956;
  color: #ffffff;
  background: #30342e;
}

.plan-selector {
  display: grid;
  grid-template-columns: minmax(190px, auto) minmax(260px, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: rgba(23, 25, 27, 0.96);
  box-shadow: var(--shadow);
}

.plan-selector-copy {
  display: grid;
  gap: 3px;
}

.plan-selector-copy .eyebrow {
  margin-bottom: 0;
}

.start-training-button {
  min-width: 112px;
}

.plan-catalog {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.plan-catalog-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.plan-catalog-heading h2 {
  margin: 0;
  font-size: 24px;
}

.plan-catalog-heading > p {
  max-width: 360px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  text-align: right;
}

.plan-catalog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.plan-catalog-card {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 11px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(29, 26, 22, 0.98), rgba(20, 18, 16, 0.96));
  box-shadow: var(--shadow);
}

.plan-catalog-card--featured {
  grid-column: 1 / -1;
  border-color: rgba(216, 173, 82, 0.72);
  background: linear-gradient(145deg, rgba(58, 43, 22, 0.92), rgba(23, 25, 27, 0.98));
}

.plan-catalog-card--placeholder {
  min-height: 230px;
  opacity: 0.82;
}

.plan-catalog-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.plan-catalog-index {
  color: var(--accent);
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.plan-catalog-status,
.plan-catalog-placeholder {
  width: max-content;
  max-width: 100%;
  border: 1px solid rgba(216, 173, 82, 0.44);
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.plan-catalog-card--placeholder .plan-catalog-status {
  color: var(--muted);
  border-color: var(--line);
}

.plan-catalog-card .eyebrow {
  margin: 0;
}

.plan-catalog-card h3 {
  margin: 0;
  font-size: 21px;
  line-height: 1.25;
}

.plan-catalog-description {
  min-height: 44px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.plan-catalog-links {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 3px;
}

.plan-catalog-links button {
  min-width: 0;
  min-height: 38px;
  border: 1px solid rgba(216, 173, 82, 0.42);
  border-radius: 7px;
  padding: 8px 10px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.24);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  text-align: left;
}

.plan-catalog-links button:hover,
.plan-catalog-links button:focus-visible {
  border-color: var(--accent);
  background: rgba(216, 173, 82, 0.16);
}

.plan-catalog-placeholder {
  margin-top: auto;
  color: var(--muted);
  border-color: var(--line);
  background: rgba(0, 0, 0, 0.16);
}

.plan-catalog-card--2025 {
  border-color: rgba(54, 194, 138, 0.62);
  background: linear-gradient(145deg, rgba(19, 55, 43, 0.68), rgba(23, 25, 27, 0.98));
}

.plan-catalog-card--2025 .plan-catalog-status {
  border-color: rgba(54, 194, 138, 0.5);
  color: var(--accent-2);
}

.plan-catalog-2025-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.plan-catalog-2025-group {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(58px, 1fr) repeat(2, minmax(64px, auto));
  align-items: center;
  gap: 7px;
  padding: 8px;
  border: 1px solid rgba(54, 194, 138, 0.26);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
}

.plan-catalog-2025-group strong {
  min-width: 0;
  font-size: 14px;
}

.plan-catalog-2025-group button {
  min-width: 0;
  min-height: 36px;
  border: 1px solid rgba(54, 194, 138, 0.38);
  border-radius: 7px;
  padding: 7px 8px;
  color: var(--text);
  background: rgba(54, 194, 138, 0.08);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.plan-catalog-2025-group button:hover,
.plan-catalog-2025-group button:focus-visible {
  border-color: var(--accent-2);
  background: rgba(54, 194, 138, 0.18);
}

.training-mode-screen,
.completion-screen {
  width: min(760px, 100%);
  min-height: calc(100vh - 40px);
  margin: 0 auto;
  padding: 18px 0 28px;
}

.training-mode-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 0 18px;
  border-bottom: 1px solid var(--line);
}

.training-mode-topbar > div {
  display: grid;
  gap: 4px;
}

.training-mode-topbar strong {
  font-size: 17px;
}

.training-mode-actions {
  display: flex;
  gap: 8px;
}

.training-mode-kicker,
.completion-kicker {
  color: var(--warn);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.training-mode-content {
  padding-top: 24px;
}

.training-action-card,
.training-paused-card,
.training-finish-card,
.completion-content {
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid rgba(232, 213, 176, 0.38);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(32, 35, 38, 0.96), rgba(16, 17, 18, 0.98));
  box-shadow: var(--shadow);
}

.training-action-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.training-action-card h1,
.training-paused-card h1,
.training-finish-card h1,
.completion-content h1 {
  margin: 0;
  font-size: clamp(30px, 7vw, 48px);
  line-height: 1.08;
}

.training-set-count {
  margin: -10px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.training-next-step,
.training-rest-notice,
.completion-content > p {
  color: var(--muted);
}

.training-cue,
.training-record,
.training-advanced {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 17, 18, 0.48);
}

.training-cue summary,
.training-record summary,
.training-advanced summary {
  min-height: 46px;
  display: flex;
  align-items: center;
  padding: 0 13px;
  cursor: pointer;
  font-weight: 800;
}

.training-cue p {
  margin: 0;
  padding: 0 13px 14px;
  color: var(--muted);
  line-height: 1.55;
}

.training-record-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 0 13px 13px;
}

.training-record-fields label,
.training-rest-setting {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.training-record-fields input,
.training-rest-setting input {
  width: 100%;
  min-width: 0;
}

.training-set-list {
  display: grid;
  gap: 8px;
  padding: 0 13px 13px;
}

.training-progression-advice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 9px;
  padding: 9px 10px;
  border: 1px solid rgba(216, 173, 82, 0.34);
  border-left: 3px solid var(--warn);
  border-radius: 7px;
  background: rgba(216, 173, 82, 0.06);
}

.training-progression-advice > span,
.training-progression-advice > small {
  color: var(--text-tertiary);
  font-size: 11px;
}

.training-progression-advice > span {
  font-weight: 800;
}

.training-progression-advice > strong {
  min-width: 0;
  color: var(--warn);
  font-size: 13px;
}

.training-progression-advice > p,
.training-progression-advice > small {
  grid-column: 1 / -1;
  margin: 0;
  line-height: 1.45;
}

.training-progression-advice > p {
  color: var(--text-secondary);
  font-size: 12px;
}

.training-set-row {
  display: grid;
  grid-template-columns: minmax(76px, 1fr) minmax(54px, 74px) minmax(48px, 66px) minmax(48px, 62px) 28px;
  gap: 6px;
  align-items: center;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
}

.training-set-row.current-set {
  border-color: rgba(232, 213, 176, 0.7);
  background: rgba(232, 213, 176, 0.08);
}

.training-set-row--done {
  border-color: rgba(54, 194, 138, 0.72);
  background: rgba(54, 194, 138, 0.11);
}

.training-set-row.skipped-set {
  opacity: 0.58;
}

.training-set-row-meta {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.training-set-row-meta-line {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 4px;
}

.training-set-row-meta strong {
  color: var(--text);
  font-size: 12px;
  white-space: nowrap;
}

.training-set-prefill {
  padding: 1px 4px;
  border: 1px solid rgba(216, 173, 82, 0.42);
  border-radius: 4px;
  color: var(--warn);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.training-set-target {
  overflow: hidden;
  color: var(--text-tertiary);
  font-size: 10px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.training-set-field {
  position: relative;
  display: block !important;
  min-width: 0;
}

.training-set-field > span {
  position: absolute;
  top: 4px;
  left: 7px;
  z-index: 1;
  overflow: hidden;
  color: var(--text-tertiary);
  font-size: 11px;
  line-height: 1;
  pointer-events: none;
  white-space: nowrap;
}

.training-set-field input:not([type="checkbox"]) {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 17px 5px 4px;
  text-align: center;
}

.training-set-row--done .training-set-field input:not([type="checkbox"]) {
  border-color: rgba(54, 194, 138, 0.8);
  background: rgba(54, 194, 138, 0.2);
}

.training-set-check {
  display: grid !important;
  justify-items: center;
  align-items: center;
  min-width: 0;
}

.training-set-check input {
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--accent-2);
}

.training-set-menu {
  position: relative;
  min-width: 0;
  border: 0;
  background: transparent;
}

.training-set-menu > summary {
  display: grid;
  width: 28px;
  min-height: 34px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  list-style: none;
}

.training-set-row-meta .training-set-menu {
  margin-left: auto;
}

.training-set-row-meta .training-set-menu > summary {
  width: 22px;
  min-height: 22px;
  font-size: 16px;
}

.training-set-menu > summary::-webkit-details-marker {
  display: none;
}

.training-set-menu-body {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  z-index: 10;
  display: grid;
  min-width: 104px;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #111315;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}

.training-set-menu-body button {
  min-height: 34px;
  padding: 0 8px;
  border: 0;
  border-radius: 5px;
  color: var(--text);
  background: transparent;
  text-align: left;
  white-space: nowrap;
}

.training-set-menu-body button:hover,
.training-set-menu-body button:focus-visible {
  background: rgba(255, 255, 255, 0.08);
}

.training-set-status {
  grid-column: 1 / -1;
  align-self: center;
  color: var(--muted);
}

.training-early-end-button {
  width: 100%;
  min-height: 46px;
}

.training-early-end {
  display: grid;
}

.training-advanced {
  margin: 0 13px 13px;
}

.training-advanced-menu {
  position: relative;
  border: 0;
  background: transparent;
}

.training-advanced-menu {
  margin: 0;
}

.training-advanced-menu > summary {
  display: grid;
  width: 42px;
  min-height: 42px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 19px;
  line-height: 1;
  list-style: none;
}

.training-advanced-menu > summary::-webkit-details-marker {
  display: none;
}

.training-advanced-menu[open] > .training-advanced-body {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  width: min(248px, calc(100vw - 36px));
  margin-top: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111315;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

.training-add-set {
  width: 100%;
}

.training-advanced-body {
  display: grid;
  gap: 12px;
  padding: 0 12px 12px;
}

.training-rest-setting {
  grid-template-columns: 1fr minmax(70px, 96px) auto;
  align-items: center;
}

.training-rest-setting input {
  grid-column: 2;
}

.training-complete-button {
  min-height: 56px;
  font-size: 18px;
}

.training-rest-notice {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 13px;
  border-left: 3px solid var(--warn);
  background: rgba(232, 213, 176, 0.08);
}

.training-rest-notice span,
.training-rest-notice p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.training-rest-notice strong {
  color: var(--warn);
  font-size: 16px;
}

.training-next-step {
  margin: 0;
  font-size: 15px;
}

.training-paused-card,
.training-finish-card {
  min-height: 390px;
  align-content: center;
  text-align: center;
}

.training-paused-card p,
.training-finish-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.training-finish-card .training-record {
  text-align: left;
}

.training-finish-card textarea {
  width: 100%;
  min-height: 104px;
  margin: 0 13px 13px;
  width: calc(100% - 26px);
}

.completion-screen {
  display: block;
}

.completion-content {
  width: 100%;
  gap: 20px;
  justify-items: stretch;
  text-align: left;
}

.completion-topbar,
.completion-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.completion-topbar {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.completion-topbar span,
.completion-section-heading small,
.completion-workout-title > span,
.completion-workout-title p {
  color: var(--muted);
  font-size: 13px;
}

.completion-hero {
  display: grid;
  gap: 7px;
  padding: 18px;
  border-left: 4px solid var(--accent-2);
  background: rgba(54, 194, 138, 0.08);
}

.completion-hero.incomplete {
  border-left-color: var(--warn);
  background: rgba(232, 213, 176, 0.08);
}

.completion-hero h1,
.completion-workout-title h2,
.completion-hero p,
.completion-workout-title p,
.completion-note,
.completion-incomplete-copy {
  margin: 0;
}

.completion-hero h1 {
  font-size: clamp(28px, 6vw, 42px);
}

.completion-hero p,
.completion-incomplete-copy {
  color: var(--muted);
  line-height: 1.55;
}

.completion-workout-title {
  display: grid;
  gap: 5px;
}

.completion-workout-title h2 {
  font-size: 25px;
}

.completion-summary-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.completion-summary-grid div {
  display: grid;
  gap: 5px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 17, 18, 0.7);
}

.completion-summary-grid span {
  color: var(--muted);
  font-size: 13px;
}

.completion-summary-grid strong {
  font-size: 18px;
}

.completion-validity {
  width: fit-content;
  margin: 0;
  padding: 7px 10px;
  border: 1px solid rgba(54, 194, 138, 0.42);
  border-radius: 6px;
  color: var(--accent-2);
  background: rgba(54, 194, 138, 0.08);
  font-size: 14px;
  font-weight: 900;
}

.completion-validity.incomplete {
  border-color: rgba(232, 213, 176, 0.42);
  color: var(--warn);
  background: rgba(232, 213, 176, 0.08);
}

.completion-cultivation {
  display: grid;
  gap: 5px;
  padding: 15px;
  border: 1px solid rgba(232, 213, 176, 0.38);
  border-left: 3px solid var(--warn);
  background: rgba(232, 213, 176, 0.07);
}

.completion-cultivation span,
.completion-cultivation small {
  color: var(--muted);
  font-size: 13px;
}

.completion-cultivation strong {
  color: var(--warn);
  font-size: 22px;
}

.completion-exercises {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.completion-personal-records {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
}

.completion-pr-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.75fr) minmax(0, 1.25fr);
  gap: 12px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.completion-pr-row > div:first-child {
  display: grid;
  gap: 3px;
}

.completion-pr-row small {
  color: var(--text-tertiary);
  font-size: 12px;
}

.completion-pr-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.completion-pr-badges span {
  padding: 5px 7px;
  border: 1px solid rgba(216, 173, 82, 0.34);
  border-radius: 5px;
  color: var(--warn);
  background: rgba(216, 173, 82, 0.07);
  font-size: 12px;
  font-weight: 800;
}

.completion-section-heading {
  padding: 14px 0 8px;
}

.completion-section-heading > span {
  font-weight: 900;
}

.completion-exercise {
  display: grid;
  grid-template-columns: minmax(130px, 0.7fr) minmax(0, 1.3fr);
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.completion-exercise > div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  color: var(--muted);
  font-size: 14px;
}

.completion-empty {
  margin: 0;
  padding: 12px 0;
  color: var(--muted);
}

.completion-progression {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
}

.completion-progression .completion-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.completion-progression .completion-section-heading small {
  color: var(--text-tertiary);
  text-align: right;
}

.completion-progression-exercise {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid rgba(216, 173, 82, 0.28);
  border-radius: 7px;
  background: rgba(216, 173, 82, 0.045);
}

.completion-progression-exercise h3 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
}

.completion-progression-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 9px;
  padding-top: 7px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.completion-progression-row > span {
  color: var(--text-tertiary);
  font-size: 12px;
}

.completion-progression-row > strong {
  color: var(--warn);
  font-size: 13px;
}

.completion-progression-row > p,
.completion-progression-note {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.completion-progression-note {
  color: var(--text-tertiary);
}

.completion-actions {
  display: grid;
  gap: 8px;
}

.completion-actions .primary-button {
  width: 100%;
  min-height: 54px;
  font-size: 17px;
}

.completion-community-link {
  border: 0;
  padding: 4px;
  color: var(--muted);
  background: transparent;
}

body[data-app-screen="training"],
body[data-app-screen="completion"] {
  background: #101112;
}

body[data-app-screen="completion"] .floating-timer {
  display: none;
}

body[data-app-screen="training"] .floating-timer {
  right: max(14px, calc((100vw - 760px) / 2));
  top: auto;
  bottom: 18px;
  transform: none;
  width: min(300px, calc(100vw - 28px));
  aspect-ratio: auto;
}

.plan-selector-copy label {
  font-weight: 900;
  white-space: nowrap;
}

.plan-selector-copy span {
  color: var(--muted);
  font-size: 13px;
}

.plan-selector select {
  min-height: 42px;
  padding: 8px 12px;
  font-weight: 800;
}

.cultivation-panel {
  display: grid;
  grid-template-columns: 72px minmax(170px, 0.8fr) minmax(190px, 1fr) minmax(260px, 1.25fr) minmax(160px, 0.75fr) auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(232, 213, 176, 0.42);
  border-radius: 8px;
  background: #17191b;
  box-shadow: inset 0 0 28px rgba(232, 213, 176, 0.05), var(--shadow);
}

.rank-emblem,
.rank-up-emblem {
  --rank-accent: #f4bc45;
  --rank-angle: 0deg;
  position: relative;
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  isolation: isolate;
  border-radius: 50%;
  background: conic-gradient(var(--rank-accent) var(--rank-angle), #30343a 0deg);
  box-shadow: 0 0 20px color-mix(in srgb, var(--rank-accent) 28%, transparent);
}

.rank-emblem::before,
.rank-up-emblem::before {
  content: "";
  position: absolute;
  inset: 6px;
  z-index: -1;
  clip-path: polygon(50% 0, 92% 24%, 92% 76%, 50% 100%, 8% 76%, 8% 24%);
  background: #101214;
  border: 1px solid var(--rank-accent);
}

.rank-emblem span,
.rank-up-emblem span {
  color: var(--rank-accent);
  font-size: 27px;
  font-weight: 900;
  text-shadow: 0 0 12px color-mix(in srgb, var(--rank-accent) 48%, transparent);
}

.rank-emblem.tier-1,
.rank-up-emblem.tier-1 {
  --rank-accent: #66d8ff;
}

.rank-emblem.tier-2,
.rank-up-emblem.tier-2 {
  --rank-accent: #78e38b;
}

.rank-emblem.tier-3,
.rank-up-emblem.tier-3 {
  --rank-accent: #ff8a65;
}

.rank-emblem.tier-4,
.rank-up-emblem.tier-4 {
  --rank-accent: #c69cff;
}

.rank-emblem.tier-5,
.rank-up-emblem.tier-5 {
  --rank-accent: #ff6574;
}

.rank-emblem.tier-6,
.rank-up-emblem.tier-6 {
  --rank-accent: #fff2a8;
}

.cultivation-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.cultivation-kicker {
  color: var(--warn);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.cultivation-copy strong {
  font-size: 22px;
}

.cultivation-copy em {
  color: var(--muted);
  font-size: 14px;
  font-style: normal;
  font-weight: 700;
}

.cultivation-copy > span:last-child,
.cultivation-progress-head {
  color: var(--muted);
  font-size: 13px;
}

.cultivation-progress {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.cultivation-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.rank-progress-track {
  height: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #0e1012;
}

.rank-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2ee59d 0%, #96f95f 55%, #ffe45c 100%);
  box-shadow: 0 0 14px rgba(86, 240, 151, 0.62);
  transition: width 420ms ease;
}

.rank-progress-track span[data-progress-level="1"] { width: 10%; }
.rank-progress-track span[data-progress-level="2"] { width: 20%; }
.rank-progress-track span[data-progress-level="3"] { width: 30%; }
.rank-progress-track span[data-progress-level="4"] { width: 40%; }
.rank-progress-track span[data-progress-level="5"] { width: 50%; }
.rank-progress-track span[data-progress-level="6"] { width: 60%; }
.rank-progress-track span[data-progress-level="7"] { width: 70%; }
.rank-progress-track span[data-progress-level="8"] { width: 80%; }
.rank-progress-track span[data-progress-level="9"] { width: 90%; }
.rank-progress-track span[data-progress-level="10"] { width: 100%; }

.rank-emblem[data-progress-level="1"] { --rank-angle: 36deg; }
.rank-emblem[data-progress-level="2"] { --rank-angle: 72deg; }
.rank-emblem[data-progress-level="3"] { --rank-angle: 108deg; }
.rank-emblem[data-progress-level="4"] { --rank-angle: 144deg; }
.rank-emblem[data-progress-level="5"] { --rank-angle: 180deg; }
.rank-emblem[data-progress-level="6"] { --rank-angle: 216deg; }
.rank-emblem[data-progress-level="7"] { --rank-angle: 252deg; }
.rank-emblem[data-progress-level="8"] { --rank-angle: 288deg; }
.rank-emblem[data-progress-level="9"] { --rank-angle: 324deg; }
.rank-emblem[data-progress-level="10"] { --rank-angle: 360deg; }

.home-training-heatmap {
  min-width: 160px;
  display: grid;
  gap: 7px;
}

.home-heatmap-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.home-heatmap-head span {
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 800;
}

.home-heatmap-head small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-heatmap-grid {
  display: grid;
  grid-template-columns: repeat(7, 9px);
  grid-template-rows: repeat(5, 9px);
  gap: 3px;
  width: max-content;
  max-width: 100%;
}

.home-heatmap-day {
  width: 9px;
  height: 9px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 2px;
  background: #24282b;
}

.home-heatmap-day[data-level="1"] { background: #1f654c; }
.home-heatmap-day[data-level="2"] { background: #2b9b68; }
.home-heatmap-day[data-level="3"] { background: #40cf83; }
.home-heatmap-day[data-level="4"] {
  background: #7ff2aa;
  box-shadow: 0 0 5px rgba(75, 225, 142, 0.45);
}

.home-heatmap-day.future {
  opacity: 0.28;
}

.hero-mission {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding-left: 16px;
  border-left: 1px solid rgba(232, 213, 176, 0.28);
}

.hero-mission span,
.hero-mission small {
  color: var(--muted);
  font-size: 13px;
}

.hero-mission strong {
  overflow: hidden;
  color: var(--text);
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cultivation-start {
  min-width: 108px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.topbar h1,
.hero-row h2,
.panel h2,
.library-head h2 {
  margin: 0;
}

.topbar h1 {
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.top-actions {
  align-items: center;
  gap: 10px;
}

.support-label-short {
  display: none;
}

#supportBtn {
  border-color: var(--line);
  background: #25282b;
  color: var(--text);
  font-weight: 700;
}

#supportBtn:hover {
  border-color: #555c62;
  background: #30353a;
}

.account-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-status > span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.account-status > span[data-tone="ok"] {
  color: var(--accent-2);
}

.account-status > span[data-tone="warn"],
.account-status > span[data-tone="error"] {
  color: var(--warn);
}

.layout {
  align-items: flex-start;
  gap: 20px;
}

.sidebar {
  position: sticky;
  top: 16px;
  width: 360px;
  display: grid;
  gap: 16px;
}

.workspace {
  flex: 1;
  min-width: 0;
}

.home-screen .sidebar {
  display: none;
}

.cover,
.panel,
.exercise-card,
.history-item,
.timer-bar,
.finish-panel,
.metrics > div,
.session-score,
.library-card,
.pay-wall,
.donation {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(23, 25, 27, 0.94);
  box-shadow: var(--shadow);
}

.cover {
  overflow: hidden;
  padding: 14px;
}

.cover-body {
  margin-top: 12px;
}

.cover img {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
}

.cover-copy,
.panel,
.finish-panel {
  padding: 16px;
}

.cover-copy {
  padding: 14px 0 0;
}

.cover-copy h2 {
  margin: 0 0 8px;
}

.cover-copy p:last-child,
.panel p,
.donation p,
.hero-row p {
  color: var(--muted);
}

.panel-head {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.disclosure-title {
  width: 100%;
  min-height: 34px;
  border: 0;
  padding: 0;
  color: var(--text);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
}

.panel-head .disclosure-title {
  width: auto;
  flex: 1;
}

.disclosure-title span {
  font-size: 20px;
  font-weight: 800;
}

.disclosure-title small {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 13px;
  white-space: nowrap;
}

.collapsible-panel.collapsed #reminderList,
.collapsible-panel.collapsed #repInfoBody,
.collapsible-panel.collapsed #metricsBody,
.collapsible-panel.collapsed .cover-body {
  display: none;
}

.collapsible-panel.collapsed .panel-head {
  margin-bottom: 10px;
}

.collapsible-panel.collapsed {
  gap: 0;
}

.compact {
  display: grid;
  gap: 10px;
}

.checkline {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--muted);
  line-height: 1.45;
}

.checkline input {
  margin-top: 4px;
  accent-color: var(--accent);
}

.tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.tab,
.primary-button,
.secondary-button,
.small-button,
.icon-button,
.file-button,
.segmented-control button {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface-2);
  min-height: 42px;
}

.tab {
  padding: 10px 12px;
  color: var(--muted);
}

.tab.active {
  border-color: rgba(216, 173, 82, 0.72);
  background: rgba(216, 173, 82, 0.14);
  color: var(--text);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.hero-row {
  justify-content: space-between;
  align-items: stretch;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(32, 35, 38, 0.96), rgba(16, 17, 18, 0.96));
}

.hero-row h2 {
  font-size: clamp(26px, 4vw, 42px);
}

.hero-copy {
  min-width: 0;
}

.plan-type {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.hero-facts {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 12px 0 4px;
  color: var(--muted);
  font-size: 15px;
}

.hero-facts strong {
  color: var(--warn);
  font-size: 20px;
}

.hero-row p {
  max-width: 760px;
  line-height: 1.6;
}

.session-score {
  min-width: 138px;
  padding: 18px;
  display: grid;
  place-items: center;
  text-align: center;
}

.hero-actions {
  min-width: 138px;
  display: grid;
  align-content: center;
  gap: 10px;
}

.hero-actions .primary-button {
  width: 100%;
}

.session-score strong {
  font-size: 42px;
  color: var(--accent-2);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.status-panel {
  margin: 16px 0;
}

.metrics > div {
  padding: 14px;
  display: grid;
  gap: 6px;
}

.metrics span,
.timer-bar span,
.session-score span,
.library-card span,
.history-item span,
.pay-wall span {
  color: var(--muted);
  font-size: 14px;
}

.metrics strong {
  font-size: 24px;
}

.timer-bar {
  align-items: center;
  justify-content: flex-start;
  width: max-content;
  max-width: 100%;
  gap: 10px;
  padding: 8px 10px;
  margin-left: auto;
  margin-bottom: 16px;
}

.timer-readout {
  display: flex;
  align-items: baseline;
  gap: 7px;
  white-space: nowrap;
}

.timer-bar strong {
  font-size: 22px;
  color: var(--warn);
}

.timer-actions {
  display: flex;
  gap: 5px;
  flex-wrap: nowrap;
}

.timer-bar .icon-button,
.timer-bar .timer-preset,
.timer-bar .timer-start {
  min-height: 34px;
  padding: 0 10px;
  font-size: 14px;
}

.timer-bar .icon-button {
  min-width: 40px;
}

.primary-button,
.secondary-button,
.small-button,
.icon-button,
.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  text-decoration: none;
}

.primary-button {
  border-color: rgba(216, 173, 82, 0.85);
  background: var(--accent);
  color: var(--text-on-accent);
  font-weight: 800;
}

.secondary-button,
.small-button,
.icon-button,
.file-button {
  background: var(--surface-2);
}

.small-button {
  min-height: 34px;
  font-size: 14px;
}

.icon-button {
  min-width: 42px;
  width: auto;
  padding: 0;
  font-weight: 800;
}

.exercise-list,
.history-list,
.plan-list {
  display: grid;
  gap: 12px;
}

.training-block {
  padding: 0 0 18px;
  border-bottom: 1px solid var(--line);
}

.training-block:last-child {
  border-bottom: 0;
}

.training-block-head {
  width: 100%;
  min-height: 62px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.block-number {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: var(--text-on-accent);
  font-weight: 900;
}

.block-heading {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.block-heading strong {
  font-size: 18px;
}

.block-heading small,
.block-toggle-text {
  color: var(--muted);
  font-size: 13px;
}

.block-toggle-text {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
  white-space: nowrap;
}

.training-block.collapsed .training-block-body {
  display: none;
}

.training-block.complete .block-number {
  background: var(--accent-2);
  color: var(--text-on-success);
}

.training-block-body {
  display: grid;
  gap: 12px;
  padding-left: 54px;
}

.block-description {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.flow-guide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 10px 12px;
  border-left: 3px solid var(--warn);
  background: rgba(232, 213, 176, 0.08);
  color: var(--text);
  line-height: 1.45;
}

.flow-guide.next {
  border-left-color: var(--accent);
  background: rgba(216, 173, 82, 0.08);
}

.flow-guide.complete {
  border-left-color: var(--accent-2);
  background: rgba(54, 194, 138, 0.08);
}

.flow-guide .small-button {
  flex: 0 0 auto;
}

.choice-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.choice-button {
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
}

.choice-button.active {
  border-color: var(--accent);
  background: rgba(216, 173, 82, 0.12);
  color: var(--text);
  font-weight: 800;
}

.block-exercises {
  display: grid;
  gap: 10px;
}

.plan-item {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  padding: 12px;
  text-align: left;
}

.plan-item.active {
  border-color: var(--accent);
}

.plan-item strong,
.plan-item span {
  display: block;
}

.plan-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.exercise-card {
  padding: 13px;
}

.exercise-card.collapsed {
  box-shadow: none;
}

.exercise-card.current-exercise {
  border-color: var(--warn);
}

.current-tag {
  border-color: var(--warn);
  color: var(--warn);
}

.exercise-progress-tag.complete {
  border-color: rgba(54, 194, 138, 0.58);
  color: var(--accent-2);
}

.set-table tr.current-set td {
  background: rgba(232, 213, 176, 0.06);
}

.set-table tr.skipped-set td {
  color: var(--muted);
  background: rgba(148, 156, 166, 0.08);
  text-decoration: line-through;
}

.exercise-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: start;
}

.badge {
  min-width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(216, 173, 82, 0.16);
  color: #ff5364;
  font-weight: 900;
}

.exercise-title h3 {
  margin: 0 0 6px;
  font-size: 20px;
}

.exercise-title p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.exercise-target-summary {
  display: none;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.exercise-card.collapsed .exercise-title > p:not(.exercise-target-summary),
.exercise-card.collapsed .exercise-title .tag-row .tag:not(.exercise-progress-tag):not(.current-tag) {
  display: none;
}

.exercise-card.collapsed .exercise-target-summary {
  display: block;
}

.exercise-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.exercise-details {
  display: none;
}

.exercise-card.expanded .exercise-details {
  display: block;
}

.tag-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.exercise-options {
  position: relative;
}

.exercise-options > summary {
  width: 38px;
  min-height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  list-style: none;
}

.exercise-options > summary::-webkit-details-marker {
  display: none;
}

.exercise-options[open] > summary {
  border-color: var(--accent);
  color: var(--text);
}

.exercise-tools {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #202326;
  box-shadow: var(--shadow);
}

.exercise-tool-row {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

.exercise-unit-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, 36px);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.exercise-unit-switch button {
  min-height: 32px;
  border: 0;
  border-right: 1px solid var(--line);
  background: #111315;
  color: var(--muted);
  cursor: pointer;
}

.exercise-unit-switch button:last-child {
  border-right: 0;
}

.exercise-unit-switch button.active {
  background: var(--accent);
  color: var(--text-on-accent);
}

.exercise-rest-setting {
  white-space: nowrap;
}

.exercise-rest-control {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.exercise-rest-setting input {
  width: 62px;
  min-height: 32px;
  padding: 5px 7px;
  border-radius: 6px;
}

.exercise-history-action {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #17191b;
  color: var(--text);
}

.exercise-history-panel {
  margin-top: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.exercise-history-panel > p {
  margin: 8px 0 0;
  color: var(--muted);
}

.exercise-history-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.exercise-history-session {
  display: grid;
  grid-template-columns: minmax(120px, 0.35fr) 1fr;
  gap: 12px;
  color: var(--muted);
}

.exercise-history-session div {
  display: grid;
  gap: 4px;
}

.exercise-history-session small {
  color: var(--text);
}

.tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--muted);
  font-size: 13px;
}

.set-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
  table-layout: fixed;
}

.set-table .col-done {
  width: 52px;
}

.timed-set-table .col-done {
  width: 86px;
}

.set-table .col-set {
  width: 42px;
}

.set-table .col-target {
  width: 32%;
}

.set-table .col-weight,
.set-table .col-reps {
  width: 82px;
}

.set-table .col-rpe {
  width: 62px;
}

.set-table .col-rest {
  width: 58px;
}

.set-table th,
.set-table td {
  border-top: 1px solid var(--line);
  padding: 9px 5px;
  text-align: left;
  vertical-align: middle;
}

.set-table th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.set-table td:nth-child(3) {
  white-space: normal;
  overflow-wrap: anywhere;
}

.set-table .rest-time {
  color: var(--warn);
  font-size: 13px;
  white-space: nowrap;
}

.set-table input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #101214;
  color: var(--text);
  padding: 7px 6px;
}

.set-table input.field-invalid {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgb(255 43 64 / 18%);
}

.done-check {
  width: 24px;
  height: 24px;
  accent-color: var(--accent-2);
}

.done-confirm {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}

.done-confirm .done-check {
  flex: 0 0 auto;
}

.finish-panel {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111315;
  color: var(--text);
  padding: 12px;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.exercise-notes {
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

.exercise-notes > summary,
.admin-section > summary {
  cursor: pointer;
  padding: 12px 0;
  color: var(--text);
  font-weight: 800;
}

.exercise-notes > summary span {
  margin-left: 6px;
  color: var(--muted);
  font-size: 13px;
}

.note-compose {
  display: grid;
  gap: 9px;
  padding-bottom: 12px;
}

.note-compose textarea {
  min-height: 76px;
}

.note-compose-actions,
.note-meta,
.note-social {
  display: flex;
  align-items: center;
  gap: 8px;
}

.note-compose-actions {
  justify-content: space-between;
}

.compact-check {
  align-items: center;
}

.compact-check input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.cloud-status,
.empty-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.experience-list {
  border-top: 1px solid var(--line);
}

.experience-note {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.experience-note:last-child {
  border-bottom: 0;
}

.experience-note p {
  margin: 10px 0;
  line-height: 1.6;
  white-space: pre-wrap;
}

.note-meta {
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.text-button {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--blue);
  padding: 4px;
  font-size: 13px;
}

.note-social {
  display: grid;
  grid-template-columns: auto 1fr auto;
}

.note-social input {
  padding: 8px 10px;
}

.note-social .small-button.active {
  border-color: var(--accent-2);
  color: var(--accent-2);
}

.note-replies {
  margin: 10px 0 0 16px;
  border-left: 2px solid var(--line);
}

.note-reply {
  display: grid;
  gap: 3px;
  padding: 7px 10px;
  color: var(--muted);
  font-size: 14px;
}

.finish-actions {
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.library-head {
  padding: 6px 0 14px;
}

.library-grid,
.settings-grid,
.history-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.library-card {
  padding: 15px;
  display: grid;
  gap: 8px;
}

.library-card h3 {
  margin: 0;
}

.library-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.community-intro {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.6;
}

.community-feed {
  display: grid;
  gap: 12px;
}

.community-note {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.community-note .note-meta strong {
  color: var(--text);
}

.history-summary {
  margin-bottom: 14px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.history-summary > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface);
}

.history-summary strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
}

.progress-center-head {
  align-items: flex-end;
  gap: 16px;
}

.progress-range {
  display: inline-grid;
  grid-template-columns: repeat(4, auto);
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
}

.progress-range button {
  min-height: 34px;
  padding: 5px 11px;
  border: 0;
  border-radius: 5px;
  color: var(--text-tertiary);
  background: transparent;
  font-weight: 800;
}

.progress-range button.active {
  color: #17140d;
  background: var(--warn);
}

.history-summary > div {
  min-width: 0;
}

.history-summary > div > span,
.history-summary > div > small {
  display: block;
  color: var(--text-tertiary);
  font-size: 12px;
}

.history-summary > div > small {
  min-height: 16px;
  margin-top: 5px;
}

.progress-insight {
  margin: -2px 0 18px;
  padding: 11px 13px;
  border-left: 3px solid var(--warn);
  color: var(--text-secondary);
  background: rgba(216, 173, 82, 0.055);
  font-size: 13px;
  line-height: 1.55;
}

.progress-dashboard {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 22px;
  border-top: 1px solid var(--line);
}

.progress-section {
  min-width: 0;
  padding: 18px 0 20px;
  border-bottom: 1px solid var(--line);
}

.progress-section > header,
.progress-history-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.progress-section > header > div,
.progress-history-head > div {
  display: grid;
  gap: 3px;
}

.progress-section > header span,
.progress-history-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 900;
}

.progress-section > header small,
.progress-section > header > strong,
.progress-history-head p {
  margin: 0;
  color: var(--text-tertiary);
  font-size: 12px;
}

.progress-section > header > strong {
  color: var(--warn);
  white-space: nowrap;
}

.progress-calendar-weekdays,
.progress-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.progress-calendar-weekdays {
  margin: 14px 0 6px;
  color: var(--text-tertiary);
  font-size: 10px;
  text-align: center;
}

.progress-calendar-day {
  position: relative;
  display: grid;
  aspect-ratio: 1;
  min-width: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 5px;
  color: var(--text-tertiary);
  background: rgba(255, 255, 255, 0.025);
}

.progress-calendar-day small {
  font-size: 9px;
}

.progress-calendar-day[data-level="1"] { background: rgba(54, 194, 138, 0.18); }
.progress-calendar-day[data-level="2"] { background: rgba(54, 194, 138, 0.34); }
.progress-calendar-day[data-level="3"] { background: rgba(54, 194, 138, 0.52); color: var(--text); }
.progress-calendar-day[data-level="4"] { background: rgba(54, 194, 138, 0.76); color: #07130e; }

.progress-calendar-day.today {
  border-color: var(--warn);
  box-shadow: inset 0 0 0 1px rgba(216, 173, 82, 0.35);
}

.progress-weekly-chart,
.progress-volume-chart,
.progress-strength-chart {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
  min-height: 150px;
  margin-top: 14px;
}

.progress-chart-column {
  display: grid;
  grid-template-rows: 20px 1fr 18px;
  min-width: 0;
  gap: 4px;
  align-items: end;
  color: var(--text-tertiary);
  text-align: center;
}

.progress-chart-column > strong {
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-chart-column > small {
  overflow: hidden;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-chart-track {
  position: relative;
  height: 100%;
  min-height: 92px;
  border-radius: 4px 4px 2px 2px;
  background: rgba(255, 255, 255, 0.035);
}

.progress-chart-track span {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 0;
  min-height: 0;
  border-radius: 4px 4px 2px 2px;
  background: linear-gradient(180deg, var(--warn), rgba(216, 173, 82, 0.42));
}

.progress-chart-track span[data-level="1"] { height: 10%; }
.progress-chart-track span[data-level="2"] { height: 20%; }
.progress-chart-track span[data-level="3"] { height: 30%; }
.progress-chart-track span[data-level="4"] { height: 40%; }
.progress-chart-track span[data-level="5"] { height: 50%; }
.progress-chart-track span[data-level="6"] { height: 60%; }
.progress-chart-track span[data-level="7"] { height: 70%; }
.progress-chart-track span[data-level="8"] { height: 80%; }
.progress-chart-track span[data-level="9"] { height: 90%; }
.progress-chart-track span[data-level="10"] { height: 100%; }

.progress-volume-chart .progress-chart-track span {
  background: linear-gradient(180deg, var(--accent-2), rgba(54, 194, 138, 0.38));
}

.progress-strength-section select {
  width: min(220px, 48%);
  min-height: 34px;
  padding: 5px 28px 5px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--text-secondary);
  background: var(--surface-2);
  font-size: 12px;
}

.progress-strength-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 10px;
  margin-top: 14px;
}

.progress-strength-summary strong {
  color: var(--text);
  font-size: 15px;
}

.progress-strength-summary span {
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.progress-strength-summary small {
  grid-column: 1 / -1;
  color: var(--text-tertiary);
  font-size: 11px;
}

.progress-strength-chart {
  min-height: 126px;
  margin-top: 10px;
}

.progress-strength-chart .progress-chart-track {
  min-height: 72px;
}

.progress-strength-chart .progress-chart-track span {
  background: linear-gradient(180deg, #ee6a72, rgba(229, 57, 71, 0.38));
}

.progress-muscle-section {
  grid-column: 1 / -1;
}

.progress-muscle-method {
  margin-top: 12px;
  padding: 9px 11px;
  border-left: 3px solid var(--accent-2);
  color: var(--text-secondary);
  background: rgba(85, 201, 149, 0.055);
  font-size: 12px;
  line-height: 1.5;
}

.progress-muscle-volume {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
  margin-top: 12px;
}

.progress-muscle-row {
  display: grid;
  grid-template-columns: minmax(86px, 0.8fr) minmax(90px, 1.2fr) auto;
  gap: 5px 9px;
  align-items: center;
  min-width: 0;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.progress-muscle-row > span {
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-muscle-row > strong {
  color: var(--text);
  font-size: 12px;
  white-space: nowrap;
}

.progress-muscle-row > small {
  grid-column: 2 / -1;
  color: var(--text-tertiary);
  font-size: 10px;
}

.progress-muscle-track {
  height: 7px;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.055);
}

.progress-muscle-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent-2);
}

.progress-muscle-track i[data-level="1"] { width: 10%; }
.progress-muscle-track i[data-level="2"] { width: 20%; }
.progress-muscle-track i[data-level="3"] { width: 30%; }
.progress-muscle-track i[data-level="4"] { width: 40%; }
.progress-muscle-track i[data-level="5"] { width: 50%; }
.progress-muscle-track i[data-level="6"] { width: 60%; }
.progress-muscle-track i[data-level="7"] { width: 70%; }
.progress-muscle-track i[data-level="8"] { width: 80%; }
.progress-muscle-track i[data-level="9"] { width: 90%; }
.progress-muscle-track i[data-level="10"] { width: 100%; }

.progress-muscle-note {
  grid-column: 1 / -1;
  margin: 10px 0 0;
  color: var(--text-tertiary);
  font-size: 11px;
}

.progress-distribution {
  display: grid;
  gap: 10px;
  margin-top: 17px;
}

.progress-distribution-row {
  display: grid;
  grid-template-columns: minmax(72px, 0.8fr) minmax(90px, 1.5fr) auto auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.progress-distribution-row > span {
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-distribution-row > div {
  height: 7px;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.055);
}

.progress-distribution-row i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--warn);
}

.progress-distribution-row i[data-level="1"] { width: 10%; }
.progress-distribution-row i[data-level="2"] { width: 20%; }
.progress-distribution-row i[data-level="3"] { width: 30%; }
.progress-distribution-row i[data-level="4"] { width: 40%; }
.progress-distribution-row i[data-level="5"] { width: 50%; }
.progress-distribution-row i[data-level="6"] { width: 60%; }
.progress-distribution-row i[data-level="7"] { width: 70%; }
.progress-distribution-row i[data-level="8"] { width: 80%; }
.progress-distribution-row i[data-level="9"] { width: 90%; }
.progress-distribution-row i[data-level="10"] { width: 100%; }

.progress-distribution-row > strong,
.progress-distribution-row > small {
  color: var(--text-secondary);
  font-size: 11px;
  white-space: nowrap;
}

.progress-distribution-row > small {
  color: var(--text-tertiary);
}

.progress-empty {
  grid-column: 1 / -1;
  margin: 20px 0 0;
  color: var(--text-tertiary);
  font-size: 13px;
}

.progress-history-archive {
  margin-top: 24px;
}

.progress-history-head {
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.history-item {
  padding: 14px;
}

.history-item h3 {
  margin: 0 0 8px;
}

.history-item p {
  margin: 8px 0 0;
  color: var(--muted);
}

.history-cultivation {
  display: inline-flex !important;
  width: max-content;
  margin-top: 9px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px !important;
  font-weight: 800;
}

.history-cultivation.qualified {
  border-color: rgba(54, 194, 138, 0.56);
  color: var(--accent-2);
}

.history-cultivation.unqualified {
  border-color: rgba(232, 213, 176, 0.48);
  color: var(--warn);
}

.history-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.history-details {
  margin-top: 12px;
  border-top: 1px solid var(--line);
}

.history-details summary {
  padding: 12px 0 4px;
  cursor: pointer;
  color: var(--text);
  font-weight: 800;
}

.history-table-wrap {
  overflow-x: auto;
  margin-top: 10px;
}

.history-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}

.history-table th,
.history-table td {
  padding: 8px 6px;
  border-top: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
}

.history-table th {
  color: var(--muted);
  white-space: nowrap;
}

.form-grid {
  display: grid;
  gap: 10px;
}

.segmented-control {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  width: min(260px, 100%);
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111315;
}

.segmented-control button {
  min-height: 36px;
  color: var(--muted);
}

.segmented-control button.active {
  border-color: var(--accent-2);
  background: rgba(54, 194, 138, 0.14);
  color: var(--text);
}

.admin-panel {
  grid-column: 1 / -1;
}

.admin-section {
  border-top: 1px solid var(--line);
}

.admin-form {
  padding-bottom: 14px;
}

.admin-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.admin-form textarea {
  min-height: 74px;
}

.moderation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
}

.moderation-head p {
  margin: 0;
  color: var(--muted);
}

.moderation-list {
  display: grid;
  gap: 12px;
}

.moderation-item {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.moderation-item p {
  margin: 8px 0;
  line-height: 1.55;
}

.danger-text {
  color: var(--danger);
}

.pay-wall,
.donation {
  padding: 14px;
  margin-top: 12px;
}

.pay-wall {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pay-wall strong,
.pay-wall span {
  display: block;
}

.pay-wall span {
  margin-top: 4px;
}

.file-button {
  position: relative;
  overflow: hidden;
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

dialog {
  width: min(520px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

#supportDialog {
  width: min(620px, calc(100vw - 28px));
}

.dialog-body {
  display: grid;
  gap: 12px;
}

.dialog-body > label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

.auth-mode {
  width: 100%;
}

.form-error {
  margin: 0;
  color: var(--danger);
  font-size: 14px;
}

.account-card {
  display: grid;
  gap: 5px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.account-card span {
  color: var(--muted);
}

.account-card .tag {
  width: max-content;
}

.support-message {
  display: grid;
  gap: 10px;
  margin: 0 0 4px;
  color: var(--muted);
  line-height: 1.7;
}

.support-message p {
  margin: 0;
}

.support-message p:first-child {
  color: var(--text);
}

.support-disclaimer {
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--text-tertiary);
  font-size: 13px;
}

.qr-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.qr-grid figure {
  margin: 0;
  text-align: center;
}

.qr-grid img {
  display: block;
  width: 100%;
  max-width: 250px;
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 4px;
  background: #fff;
  object-fit: contain;
}

.qr-grid figcaption {
  margin-top: 8px;
  font-weight: 800;
}

.floating-timer {
  position: fixed;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  width: 232px;
  border: 1px solid rgba(232, 213, 176, 0.58);
  border-radius: 14px;
  background: rgba(16, 17, 18, 0.96);
  box-shadow: var(--shadow);
  padding: 10px;
  display: grid;
  align-content: center;
  aspect-ratio: 1;
}

.floating-timer[hidden] {
  display: none;
}

.floating-timer span,
.summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.floating-timer-head {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 6px;
}

.floating-timer-head span {
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  white-space: nowrap;
}

.floating-timer strong {
  color: var(--warn);
  font-size: 40px;
  white-space: nowrap;
}

.floating-timer-time {
  border: 0;
  padding: 0;
  color: var(--warn);
  background: transparent;
  font: inherit;
  font-size: 40px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.floating-timer-minimize {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 30px;
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
}

.floating-timer.minimized {
  width: 112px;
  aspect-ratio: auto;
  padding: 12px 10px;
  border-radius: 10px;
}

.floating-timer.minimized .floating-timer-head span,
.floating-timer.minimized .floating-timer-actions,
.floating-timer.minimized .floating-timer-minimize {
  display: none;
}

.floating-timer.minimized .floating-timer-head {
  gap: 0;
}

.training-resume-dock {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 18;
  display: grid;
  gap: 2px;
  min-width: 156px;
  padding: 10px 13px;
  border: 1px solid rgba(232, 213, 176, 0.56);
  border-radius: 8px;
  color: var(--text);
  background: rgba(16, 17, 18, 0.96);
  box-shadow: var(--shadow);
  text-align: left;
}

.training-resume-dock[hidden] {
  display: none;
}

.training-resume-dock span {
  color: var(--warn);
  font-size: 12px;
  font-weight: 900;
}

.training-resume-dock strong {
  max-width: 210px;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.training-plan-overview,
.training-plan-exercise {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 17, 18, 0.66);
}

.training-plan-overview {
  display: grid;
  gap: 9px;
  margin-bottom: 12px;
  padding: 14px;
  border-left: 3px solid var(--accent);
}

.training-plan-overview > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.training-plan-overview > div strong {
  font-size: 20px;
}

.training-plan-overview > p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.training-plan-list {
  display: grid;
  gap: 14px;
}

.training-plan-block {
  display: grid;
  gap: 7px;
}

.training-plan-block-heading {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 7px;
  padding: 0 3px;
}

.training-plan-block-heading span {
  color: var(--warn);
  font-size: 13px;
  font-weight: 900;
}

.training-plan-block-heading small {
  color: var(--muted);
  font-size: 13px;
}

.training-plan-exercise.current-exercise {
  border-color: rgba(232, 213, 176, 0.58);
}

.training-plan-exercise-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 0 12px;
}

.training-plan-exercise-toggle {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 12px 0;
  border: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.training-plan-exercise-code {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--warn);
  font-size: 13px;
  font-weight: 900;
}

.training-plan-exercise-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.training-plan-exercise-copy strong,
.training-plan-exercise-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.training-plan-exercise-copy strong {
  font-size: 16px;
}

.training-plan-exercise-copy small {
  color: var(--muted);
  font-size: 12px;
}

.training-plan-exercise-body {
  display: grid;
  gap: 12px;
  padding: 0 12px 13px;
}

.training-combination-notice {
  margin: 0;
  padding: 11px 12px;
  border-left: 3px solid var(--warn);
  color: var(--warn);
  background: rgba(232, 213, 176, 0.09);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.45;
}

@media (max-width: 760px) {
  .training-resume-dock {
    right: 12px;
    bottom: 12px;
    min-width: 138px;
  }

  .training-plan-exercise-header {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .training-plan-exercise-toggle {
    grid-template-columns: auto minmax(0, 1fr);
  }
}

.floating-timer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1.35fr;
  gap: 5px;
  margin-top: 16px;
}

.floating-timer-actions button {
  min-width: 0;
  min-height: 38px;
  padding: 0 8px;
  font-size: 13px;
}

.toast-region {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 80;
  width: min(380px, calc(100vw - 24px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: #17191b;
  color: var(--text);
  box-shadow: var(--shadow);
  line-height: 1.45;
  animation: toast-in 160ms ease-out;
}

/* Stage 7: workout sharing, community workout posts, and exercise GIF media. */
.library-card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  margin: 0 0 4px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0b0c0d;
}

.library-card-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.library-card-media figcaption {
  position: absolute;
  right: 7px;
  bottom: 7px;
  padding: 3px 6px;
  border-radius: 4px;
  color: #d5d7d8;
  background: rgba(11, 12, 13, 0.84);
  font-size: 10px;
  font-weight: 800;
}

.community-filters {
  display: inline-grid;
  grid-template-columns: repeat(3, auto);
  gap: 3px;
  margin: 0 0 14px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #111315;
}

.community-filters button {
  min-height: 34px;
  border: 0;
  border-radius: 5px;
  padding: 5px 12px;
  color: var(--text-tertiary);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
}

.community-filters button.active {
  color: #17140d;
  background: var(--warn);
}

.community-workout-post {
  border-color: rgba(216, 173, 82, 0.34);
}

.community-workout-summary {
  display: grid;
  gap: 9px;
  margin: 10px 0 12px;
  padding: 14px 0;
  border-top: 1px solid rgba(216, 173, 82, 0.28);
  border-bottom: 1px solid var(--line);
}

.community-workout-summary header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.community-workout-summary header > div {
  min-width: 0;
}

.community-workout-summary header small {
  color: var(--warn);
  font-size: 10px;
  font-weight: 900;
}

.community-workout-summary h3,
.community-workout-summary p,
.community-note-text {
  margin: 0;
}

.community-workout-summary h3 {
  margin-top: 3px;
  font-size: 19px;
}

.community-workout-summary header > strong {
  color: var(--accent-2);
  font-size: 28px;
}

.community-workout-summary > p,
.community-workout-missing {
  color: var(--text-secondary);
  font-size: 13px;
}

.community-workout-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.community-workout-stats > div {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 8px 0;
}

.community-workout-stats span {
  color: var(--text-tertiary);
  font-size: 10px;
}

.community-workout-stats strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-workout-exercises,
.workout-share-exercises {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.community-workout-exercises span,
.workout-share-exercises span {
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: 11px;
}

.workout-share-dialog {
  width: min(620px, calc(100vw - 24px));
}

.workout-share-dialog-body {
  max-height: min(860px, calc(100vh - 28px));
  overflow-y: auto;
}

.workout-share-preview {
  display: grid;
  gap: 9px;
  padding: 20px;
  border: 1px solid rgba(216, 173, 82, 0.48);
  border-left: 5px solid var(--warn);
  border-radius: 7px;
  color: var(--text);
  background: #0b0c0d;
}

.workout-share-preview header,
.workout-share-preview footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.workout-share-preview header > span {
  font-size: 18px;
  font-weight: 950;
}

.workout-share-preview header > span > span,
.workout-share-preview > p {
  color: var(--warn);
}

.workout-share-preview header small,
.workout-share-preview footer,
.workout-share-status {
  color: var(--text-tertiary);
  font-size: 11px;
}

.workout-share-preview > p,
.workout-share-preview h3,
.workout-share-preview > strong,
.workout-share-preview footer {
  margin: 0;
}

.workout-share-preview > p {
  font-size: 10px;
  font-weight: 900;
}

.workout-share-preview h3 {
  font-size: 25px;
}

.workout-share-preview > strong {
  color: var(--text-secondary);
  font-size: 13px;
}

.workout-share-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin: 8px 0;
}

.workout-share-stats > div {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 9px 7px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.workout-share-stats span {
  color: var(--text-tertiary);
  font-size: 10px;
}

.workout-share-stats strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workout-share-preview footer {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.workout-share-preview footer strong {
  color: var(--text-secondary);
}

.workout-share-status {
  min-height: 18px;
  margin: 0;
  line-height: 1.5;
}

.workout-share-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

@media (max-width: 760px) {
  .community-filters {
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .community-filters button {
    padding-inline: 4px;
  }

  .community-workout-stats,
  .workout-share-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workout-share-dialog-body {
    padding: 15px;
  }

  .workout-share-preview {
    padding: 15px;
  }

  .workout-share-preview h3 {
    font-size: 21px;
  }

  .workout-share-preview header {
    align-items: flex-start;
  }

  .workout-share-preview header small {
    max-width: 130px;
    text-align: right;
  }

  .workout-share-actions {
    grid-template-columns: 1fr;
  }
}

.toast-message {
  min-width: 0;
  flex: 1;
}

.toast-action {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(232, 213, 176, 0.5);
  border-radius: 6px;
  background: rgba(232, 213, 176, 0.1);
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
}

.toast-action:hover,
.toast-action:focus-visible {
  border-color: var(--warn);
  background: rgba(232, 213, 176, 0.18);
}

.toast.success {
  border-left-color: var(--accent-2);
}

.toast.warn {
  border-left-color: var(--warn);
}

.toast.error {
  border-left-color: var(--accent);
}

.toast.leaving {
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 180ms ease, transform 180ms ease;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.summary-grid > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 12px;
}

.summary-grid strong {
  display: block;
  margin-top: 5px;
  font-size: 20px;
}

.summary-note {
  margin: 0;
  color: var(--muted);
}

.rank-up-dialog {
  width: min(440px, calc(100vw - 28px));
  border-color: rgba(232, 213, 176, 0.64);
}

.rank-up-body {
  justify-items: center;
  padding: 26px;
  text-align: center;
}

.rank-up-kicker {
  margin: 0;
  color: var(--warn);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.rank-up-emblem {
  width: 112px;
  height: 112px;
  margin: 8px 0;
  --rank-angle: 360deg;
  animation: rank-breakthrough 720ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.rank-up-emblem span {
  font-size: 44px;
}

.rank-up-from,
.rank-up-body > p:last-of-type {
  margin: 0;
  color: var(--muted);
}

.rank-up-body h2 {
  margin: 0;
  font-size: 34px;
}

.rank-up-body .primary-button {
  width: 100%;
  margin-top: 8px;
}

@keyframes rank-breakthrough {
  0% {
    opacity: 0;
    transform: scale(0.62) rotate(-18deg);
  }
  70% {
    transform: scale(1.08) rotate(4deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

@media (max-width: 1050px) {
  .layout {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .workspace {
    order: 1;
    width: 100%;
  }

  .sidebar {
    position: static;
    order: 2;
    width: 100%;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 16px;
  }

  .cover {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 12px;
    overflow-x: clip;
  }

  .training-mode-screen,
  .completion-screen,
  .training-plan-list,
  .training-plan-block,
  .alternating-combination-header,
  .alternating-round,
  .training-set-row {
    min-width: 0;
    max-width: 100%;
  }

  .alternating-combination-title,
  .alternating-combination-title > div,
  .alternating-combination-progress,
  .alternating-action-row,
  .training-set-row > * {
    min-width: 0;
  }

  .training-mode-screen,
  .completion-screen {
    min-height: calc(100vh - 24px);
    padding: 4px 0 18px;
  }

  .training-mode-topbar {
    padding-bottom: 14px;
  }

  .training-mode-topbar .secondary-button {
    min-height: 38px;
    padding: 0 11px;
  }

  .training-mode-content {
    padding-top: 18px;
  }

  .training-action-card,
  .training-paused-card,
  .training-finish-card,
  .completion-content {
    gap: 15px;
    padding: 18px;
  }

  .training-action-card h1,
  .training-paused-card h1,
  .training-finish-card h1,
  .completion-content h1 {
    font-size: 32px;
  }

  .training-record-fields {
    grid-template-columns: 1fr 1fr;
  }

  .completion-exercise {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .completion-progression .completion-section-heading {
    display: grid;
    gap: 3px;
  }

  .completion-progression .completion-section-heading small {
    text-align: left;
  }

  .training-record-fields label:last-child {
    grid-column: 1 / -1;
  }

  .training-set-row {
    grid-template-columns: minmax(68px, 1fr) minmax(50px, 64px) minmax(44px, 58px) minmax(44px, 56px) 24px;
    gap: 4px;
    padding: 6px 5px;
  }

  .training-set-status {
    grid-column: 1 / -1;
  }

  .training-set-row-meta,
  .training-set-check,
  .training-set-menu {
    grid-column: auto;
    min-width: 0;
  }

  .training-set-row-meta strong {
    font-size: 11px;
  }

  .training-set-target {
    font-size: 9px;
  }

  .training-set-field > span {
    left: 5px;
    font-size: 9px;
  }

  .training-set-field input:not([type="checkbox"]) {
    min-height: 40px;
    padding-right: 3px;
    padding-left: 3px;
  }

  .training-set-menu > summary {
    width: 26px;
  }

  .training-set-check input {
    width: 20px;
    height: 20px;
  }

  .training-paused-card,
  .training-finish-card {
    min-height: 340px;
  }

  .completion-summary-grid {
    grid-template-columns: 1fr 1fr;
  }

  body[data-app-screen="training"] .floating-timer {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
  }

  body[data-app-screen="training"] .floating-timer.minimized {
    width: 112px;
  }

  .topbar,
  .hero-row,
  .timer-bar,
  .pay-wall {
    display: grid;
  }

  .topbar {
    min-height: 38px;
    padding: 3px 0 8px;
  }

  .topbar .brand-lockup {
    display: none;
  }

  .top-actions {
    width: auto;
    justify-content: flex-end;
  }

  .top-actions #exportBtn,
  .top-actions #supportBtn {
    display: none;
  }

  .brand-logo {
    width: 86px;
    height: 20px;
  }

  .site-topbar {
    min-height: 27px;
    gap: 12px;
    padding: 2px 0 5px;
  }

  .site-nav {
    justify-content: space-around;
    gap: 11px;
    margin-left: 0;
    font-size: 13px;
  }

  .site-topbar-actions {
    gap: 8px;
  }

  .display-toggles {
    gap: 4px;
  }

  .display-toggle {
    width: 30px;
    min-width: 30px;
    min-height: 30px;
  }

  .plan-selector {
    grid-template-columns: 1fr auto;
  }

  .plan-selector-copy {
    grid-column: 1 / -1;
  }

  .start-training-button {
    grid-column: 1 / -1;
  }

  .cultivation-panel {
    grid-template-columns: 58px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 12px;
  }

  .rank-emblem {
    width: 58px;
    height: 58px;
  }

  .rank-emblem span {
    font-size: 23px;
  }

  .cultivation-copy strong {
    font-size: 19px;
  }

  .cultivation-copy > span:last-child {
    display: none;
  }

  .cultivation-copy strong {
    font-size: 20px;
  }

  .cultivation-copy em {
    font-size: 13px;
  }

  .hero-mission {
    grid-column: 1 / -1;
    grid-row: 3;
    padding: 10px 0 0;
    border-top: 1px solid rgba(232, 213, 176, 0.22);
    border-left: 0;
  }

  .cultivation-progress {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .home-training-heatmap {
    grid-column: 1 / -1;
    grid-row: 4;
    min-width: 0;
    padding-top: 9px;
    border-top: 1px solid rgba(232, 213, 176, 0.16);
  }

  .cultivation-start {
    grid-column: 1 / -1;
    grid-row: 5;
    width: 100%;
  }

  #activePlanDesc {
    display: none;
  }

  .hero-row h2 {
    font-size: 28px;
  }

  .plan-catalog {
    margin-top: 14px;
  }

  .plan-catalog-heading {
    display: grid;
    gap: 8px;
  }

  .plan-catalog-heading > p {
    max-width: none;
    text-align: left;
  }

  .plan-catalog-grid {
    grid-template-columns: 1fr;
  }

  .plan-catalog-card--featured {
    grid-column: auto;
  }

  .plan-catalog-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .plan-catalog-2025-groups {
    grid-template-columns: 1fr;
  }

  .plan-catalog-2025-group {
    grid-template-columns: minmax(64px, 1fr) repeat(2, minmax(72px, auto));
  }

  .plan-catalog-card {
    padding: 15px;
  }

  .plan-catalog-card--placeholder {
    min-height: 0;
  }

  .hero-facts {
    margin-top: 8px;
  }

  .training-block-body {
    padding-left: 0;
  }

  .flow-guide {
    align-items: stretch;
    flex-direction: column;
  }

  .sidebar,
  .metrics,
  .library-grid,
  .settings-grid,
  .history-summary {
    grid-template-columns: 1fr;
  }

  .tabs {
    position: sticky;
    top: 0;
    z-index: 15;
    display: flex;
    overflow-x: auto;
    margin: 0 -12px 12px;
    padding: 4px 12px;
    background: rgba(16, 17, 18, 0.96);
    scrollbar-width: none;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .tab {
    flex: 0 0 auto;
    min-width: 84px;
    min-height: 40px;
    padding: 8px 10px;
  }

  .top-actions {
    width: 100%;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 8px;
  }

  .hero-row {
    padding: 16px;
  }

  .hero-actions {
    grid-template-columns: minmax(0, 1fr) minmax(130px, 0.8fr);
    align-items: center;
  }

  .session-score {
    min-width: 0;
  }

  .account-status {
    min-width: 0;
    justify-content: flex-end;
  }

  .account-status > span {
    max-width: 78px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #accountBtn {
    max-width: 112px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #supportBtn {
    white-space: nowrap;
  }

  .exercise-header {
    grid-template-columns: auto 1fr;
  }

  .exercise-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .exercise-actions .small-button {
    flex: 1;
  }

  .exercise-options > summary {
    width: 44px;
    min-height: 44px;
  }

  .exercise-tools {
    width: min(280px, calc(100vw - 48px));
  }

  .exercise-history-session {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .small-button,
  .icon-button,
  .timer-bar .icon-button,
  .timer-bar .timer-preset,
  .timer-bar .timer-start,
  .floating-timer-actions button {
    min-height: 44px;
  }

  .toast-region {
    top: 12px;
    right: 12px;
  }

  .note-compose-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .moderation-head {
    align-items: stretch;
    flex-direction: column;
  }

  .note-social {
    grid-template-columns: auto 1fr;
  }

  .note-social input {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .history-summary {
    grid-template-columns: 1fr;
  }

  .set-table {
    font-size: 14px;
  }

  .set-table th,
  .set-table td {
    padding: 8px 2px;
  }

  .set-table .col-done {
    width: 42px;
  }

  .timed-set-table .col-done {
    width: 72px;
  }

  .set-table .col-set {
    width: 30px;
  }

  .set-table .col-target {
    width: 34%;
  }

  .set-table .col-weight,
  .set-table .col-reps {
    width: 58px;
  }

  .set-table .col-rpe {
    width: 46px;
  }

  .set-table .col-rest {
    width: 47px;
  }

  .set-table input {
    padding: 6px 4px;
  }

  .floating-timer {
    right: 12px;
    top: 50%;
    bottom: auto;
    width: min(232px, calc(100vw - 24px));
  }

  .timer-bar {
    display: flex;
    width: 100%;
    overflow-x: auto;
  }

  .timer-readout {
    position: sticky;
    left: 0;
    z-index: 1;
    background: rgba(23, 25, 27, 0.98);
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  body[data-app-screen="training"] .app-shell,
  body[data-app-screen="training"] .training-mode-screen,
  body[data-app-screen="training"] .training-mode-content,
  body[data-app-screen="training"] .training-action-card {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  body[data-app-screen="training"] .training-mode-topbar {
    align-items: flex-start;
    gap: 10px;
  }

  body[data-app-screen="training"] .training-mode-topbar > div:first-child {
    min-width: 0;
  }

  body[data-app-screen="training"] .training-mode-topbar strong,
  body[data-app-screen="training"] .training-mode-topbar span {
    overflow-wrap: anywhere;
  }

  body[data-app-screen="training"] .training-mode-actions {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }

  body[data-app-screen="training"] .training-mode-actions .secondary-button {
    min-width: 0;
    min-height: 36px;
    padding: 0 9px;
    white-space: nowrap;
  }

  body[data-app-screen="training"] .training-action-card,
  body[data-app-screen="training"] .training-paused-card,
  body[data-app-screen="training"] .training-finish-card {
    padding: 14px;
  }

  body[data-app-screen="training"] .training-action-meta {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 6px 12px;
  }

  body[data-app-screen="training"] .training-action-card h1 {
    font-size: 28px;
    overflow-wrap: anywhere;
  }

  body[data-app-screen="training"] .training-set-list {
    padding: 0 6px 8px;
  }

  body[data-app-screen="training"] .training-set-row {
    grid-template-columns: minmax(68px, 1fr) minmax(46px, 58px) minmax(44px, 56px) minmax(38px, 48px) 30px;
    gap: 4px;
    padding: 7px 5px;
  }

  body[data-app-screen="training"] .training-set-prefill {
    padding-inline: 3px;
    font-size: 8px;
  }

  body[data-app-screen="training"] .training-set-row label,
  body[data-app-screen="training"] .training-set-row input {
    min-width: 0;
  }

  body[data-app-screen="training"] .floating-timer {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    box-sizing: border-box;
  }

  body[data-app-screen="training"] .floating-timer.minimized {
    width: 104px;
    max-width: calc(100vw - 24px);
  }
}

@media (max-width: 380px) {
  .account-status > span {
    display: none;
  }

  .support-label-full {
    display: none;
  }

  .support-label-short {
    display: inline;
  }

  .top-actions {
    justify-content: space-between;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rank-progress-track span,
  .toast.leaving {
    transition: none;
  }

  .toast,
  .rank-up-emblem {
    animation: none;
  }
}

/* Final training-mode overrides: keep the recovery timer compact on every viewport. */
body[data-app-screen="training"] .floating-timer {
  right: 14px;
  bottom: 16px;
  width: 156px;
  max-width: calc(100vw - 28px);
  aspect-ratio: 1;
  padding: 10px;
}

body[data-app-screen="training"] .floating-timer.minimized {
  width: 82px;
  min-height: 0;
  aspect-ratio: 1;
  padding: 8px;
}

body[data-app-screen="training"] .floating-timer.minimized .floating-timer-time {
  font-size: 24px;
}

@media (max-width: 760px) {
  body[data-app-screen="training"] .floating-timer {
    right: 12px;
    bottom: 12px;
    width: 142px;
    max-width: calc(100vw - 24px);
    aspect-ratio: 1;
  }

  body[data-app-screen="training"] .floating-timer.minimized {
    width: 78px;
    max-width: 78px;
  }
}

/* ============================================================
   BODYUPLAB BRAND REFRESH · 2026-08
   纯视觉覆盖层：不改 DOM / 不改 JS / 不改逻辑。
   回滚方式：删除本段即可恢复旧版外观。
   ============================================================ */

/* ─── 字体体系（与主站一致） ─── */
body {
  font-family:
    "Microsoft YaHei", "微软雅黑", "PingFang SC", Arial, sans-serif;
}

/* 大数字统一用 Bebas Neue（CJK 自动回退 Noto Sans SC） */
.timer-bar strong,
.floating-timer-time,
.floating-timer strong,
.cultivation-total strong,
.session-score strong,
.hero-facts strong,
.summary-grid strong,
.history-summary strong,
.metrics strong,
.block-number,
.badge,
.completion-summary-grid strong {
  font-family: "Bebas Neue", "Barlow Condensed", "Noto Sans SC", sans-serif;
  letter-spacing: 0.04em;
}

/* ─── 选中色 / 滚动条 ─── */
::selection {
  background: var(--accent);
  color: #16130e;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #000000;
}

::-webkit-scrollbar-thumb {
  background: #2e2c29;
  border-radius: 6px;
  border: 2px solid #000000;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* ─── 按钮：统一过渡 + 金色悬停 ─── */
.tab,
.primary-button,
.secondary-button,
.small-button,
.icon-button,
.file-button,
.segmented-control button {
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.primary-button:hover {
  background: var(--warn);
  border-color: var(--warn);
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(216, 173, 82, 0.25);
}

.primary-button:active {
  transform: translateY(0);
  box-shadow: none;
}

.secondary-button:hover,
.small-button:hover,
.icon-button:hover,
.file-button:hover {
  border-color: var(--accent);
  color: var(--text);
  transform: translateY(-1px);
}

/* ─── Tab 栏：金色药丸激活态 ─── */
.tab {
  font-weight: 700;
  letter-spacing: 0.06em;
}

.tab:hover {
  color: var(--text);
  border-color: rgba(216, 173, 82, 0.4);
}

.tab.active {
  border-color: rgba(216, 173, 82, 0.75);
  background: rgba(216, 173, 82, 0.14);
  color: var(--text-strong);
  box-shadow: inset 0 0 18px rgba(216, 173, 82, 0.06);
}

/* ─── 卡片：圆角放大 + 悬停浮起 ─── */
.cover,
.panel,
.exercise-card,
.history-item,
.timer-bar,
.finish-panel,
.metrics > div,
.session-score,
.library-card,
.pay-wall,
.donation,
.home-training-preview,
.plan-selector,
.training-action-card,
.training-paused-card,
.training-finish-card,
.completion-content {
  border-radius: 12px;
}

.library-card,
.exercise-card,
.history-item,
.plan-item {
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.library-card:hover,
.exercise-card:hover,
.history-item:hover,
.plan-item:hover {
  transform: translateY(-2px);
  border-color: rgba(216, 173, 82, 0.4);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

/* ─── 金底元素配深色文字 ─── */
.block-number {
  color: var(--text-on-accent);
}

.training-history-button {
  width: 100%;
}

#exerciseHistoryDialog {
  width: min(620px, calc(100vw - 28px));
}

.exercise-history-dialog-body {
  max-height: min(82vh, 720px);
  overflow-y: auto;
}

.exercise-history-dialog-body .exercise-history-panel {
  margin-top: 0;
}

/* 首页任务与自建方案管理 */
.hero-mission > span {
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.3;
}

.cultivation-start,
.cultivation-start:hover {
  background: #ad873d;
  border-color: #c09a4d;
  color: #17130d;
  box-shadow: none;
}

.cultivation-start:hover {
  background: #b99145;
}

.cultivation-start.needs-setup {
  background: #98763a;
  color: #fff7e6;
}

.settings-toggle {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  cursor: pointer;
}

.settings-toggle input {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--warn);
}

.settings-toggle span,
.custom-plan-manager > div:first-child {
  display: grid;
  gap: 4px;
}

.settings-toggle strong,
.custom-plan-manager strong {
  color: var(--text);
}

.settings-toggle small,
.custom-plan-manager span,
.custom-plan-manager small,
.settings-status,
.dialog-context {
  color: var(--muted);
}

.settings-status,
.dialog-context {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.55;
}

.custom-plan-manager {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.custom-plan-manager .finish-actions {
  margin: 0;
}

.custom-plan-manager .danger-text {
  border-color: rgba(255, 115, 125, 0.36);
  color: #f0a1a7;
}

.custom-plan-manager .danger-text:hover {
  border-color: var(--danger);
  color: #ffd9dc;
}

.dialog-field {
  display: grid;
  gap: 7px;
}

.dialog-field > span {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.dialog-field > small,
.replacement-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.dialog-field select {
  width: 100%;
  min-width: 0;
}

.replacement-note {
  margin: 0;
  padding: 10px 12px;
  border-left: 3px solid rgba(216, 173, 82, 0.55);
  background: rgba(216, 173, 82, 0.06);
}

.training-replace-exercise,
.training-restore-exercise {
  width: 100%;
}

.training-restore-exercise {
  color: var(--muted);
}

.training-plan-exercise-copy small {
  overflow-wrap: anywhere;
}

.completion-exercise strong small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

@media (max-width: 760px) {
  .hero-mission > span {
    font-size: 15px;
  }

  .custom-plan-manager .finish-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .custom-plan-manager button {
    min-width: 0;
  }
}

.badge {
  color: var(--text-secondary);
}

/* ─── 分段控件：金色激活 ─── */
.segmented-control {
  border-radius: 10px;
  background: #000000;
}

.segmented-control button.active {
  border-color: var(--accent);
  background: rgba(216, 173, 82, 0.16);
  color: var(--text-strong);
}

/* ─── 修炼体系：金 → 红 段位色阶 ─── */
.rank-emblem,
.rank-up-emblem {
  --rank-accent: #c2a05f;
}

.rank-emblem.tier-1,
.rank-up-emblem.tier-1 { --rank-accent: #d8ad52; }

.rank-emblem.tier-2,
.rank-up-emblem.tier-2 { --rank-accent: #e8c98a; }

.rank-emblem.tier-3,
.rank-up-emblem.tier-3 { --rank-accent: #e0a45c; }

.rank-emblem.tier-4,
.rank-up-emblem.tier-4 { --rank-accent: #d9834a; }

.rank-emblem.tier-5,
.rank-up-emblem.tier-5 { --rank-accent: #cf5a3c; }

.rank-emblem.tier-6,
.rank-up-emblem.tier-6 { --rank-accent: #fff2a8; }

/* 境界徽章脉冲光环 */
.rank-emblem {
  animation: rank-pulse 3.2s ease-in-out infinite;
}

@keyframes rank-pulse {
  0%, 100% {
    box-shadow: 0 0 16px color-mix(in srgb, var(--rank-accent) 22%, transparent);
  }
  50% {
    box-shadow: 0 0 30px color-mix(in srgb, var(--rank-accent) 45%, transparent);
  }
}

/* 升级进度条：高亮成长色 */
.rank-progress-track span {
  background: linear-gradient(90deg, #2ee59d 0%, #96f95f 55%, #ffe45c 100%);
  box-shadow: 0 0 14px rgba(86, 240, 151, 0.62);
}

/* ─── 今日修炼面板：暖金氛围 ─── */
.cultivation-panel {
  background:
    radial-gradient(circle at 12% 0%, rgba(216, 173, 82, 0.07), transparent 24rem),
    #000000;
}

/* ─── 对话框：毛玻璃遮罩 ─── */
dialog::backdrop {
  background: rgba(5, 5, 5, 0.72);
  backdrop-filter: blur(6px);
}

dialog {
  border-radius: 14px;
}

/* ─── 入场动效（纯 CSS，不动 JS） ─── */
@keyframes brand-card-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cultivation-panel,
.home-training-preview,
.tab-panel.active {
  animation: brand-card-in 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.cultivation-panel { animation-delay: 0.05s; }
.home-training-preview { animation-delay: 0.15s; }

/* ─── 顶部导航链接：金色下划线 ─── */
.site-nav a {
  position: relative;
  transition: color 160ms ease;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after {
  transform: scaleX(1);
}

/* ─── 移动端细节 ─── */
@media (max-width: 760px) {
  .cultivation-panel,
  .home-training-preview,
  .tab-panel.active {
    animation-duration: 0.3s;
  }

  .primary-button:hover,
  .secondary-button:hover,
  .small-button:hover,
  .icon-button:hover,
  .library-card:hover,
  .exercise-card:hover,
  .history-item:hover,
  .plan-item:hover {
    transform: none;
  }
}

/* ─── 减少动态偏好 ─── */
@media (prefers-reduced-motion: reduce) {
  .rank-emblem,
  .cultivation-panel,
  .home-training-preview,
  .tab-panel.active {
    animation: none !important;
  }

  .tab,
  .primary-button,
  .secondary-button,
  .small-button,
  .icon-button,
  .file-button,
  .segmented-control button,
  .library-card,
  .exercise-card,
  .history-item,
  .plan-item {
    transition: none !important;
  }
}

/* ============================================================
   修炼面板 · 中间断点修复（窄桌面/平板防溢出）
   根因：6 列桌面布局最小需 ~1030px，但堆叠布局 760px 才生效，
   761~1030px 区间按钮与进度条溢出。回滚删除本段即可。
   ============================================================ */

/* 防溢出保险（所有宽度生效） */
.cultivation-copy,
.hero-mission,
.cultivation-progress {
  min-width: 0;
}

.today-mission-plan {
  max-width: 100%;
  min-width: 0;
}

.cultivation-progress-head {
  flex-wrap: wrap;
}

/* 平板 / 窄桌面：上 4 列 + 下两行通栏 */
@media (max-width: 1100px) {
  .cultivation-panel {
    grid-template-columns: 58px minmax(0, 1fr) auto auto;
    gap: 10px 14px;
    padding: 12px 14px;
  }

  .cultivation-panel .rank-emblem {
    width: 58px;
    height: 58px;
  }

  .cultivation-panel .rank-emblem span {
    font-size: 23px;
  }

  .hero-mission {
    grid-column: 1 / -1;
    grid-row: 3;
    padding: 10px 0 0;
    border-top: 1px solid rgba(232, 213, 176, 0.22);
    border-left: 0;
  }

  .cultivation-progress {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .cultivation-total {
    grid-column: 3;
    grid-row: 1;
    min-width: 68px;
  }

  .cultivation-start {
    grid-column: 4;
    grid-row: 1;
  }
}

/* 手机：恢复 3 列 + 全宽开始按钮（须置于 1100px 规则之后） */
@media (max-width: 760px) {
  .cultivation-panel {
    grid-template-columns: 58px minmax(0, 1fr) auto;
    padding: 12px;
  }

  .cultivation-start {
    grid-column: 1 / -1;
    grid-row: 4;
    width: 100%;
  }
}

/* ============================================================
   TRAINING BLOCK REFACTOR · 2026-08-05
   训练单元（Block）一级展示重构
   纯视觉覆盖层：不改 DOM 逻辑 / 不改 JS 数据层。
   回滚方式：删除本段即可恢复旧版外观。
   ============================================================ */

/* ─── 组合训练单元容器 ─── */
.training-plan-block--combination {
  border: 1px solid rgba(216, 173, 82, 0.25);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(216, 173, 82, 0.03);
}

.training-plan-block--combination.block-active {
  border-color: rgba(216, 173, 82, 0.5);
}

.training-plan-block--combination.block-complete {
  border-color: rgba(54, 194, 138, 0.3);
  opacity: 0.85;
}

.training-plan-block--single {
  display: grid;
  gap: 7px;
}

/* ─── 组合 block 头部 ─── */
.training-block-header {
  display: grid;
  gap: 0;
  padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(216, 173, 82, 0.15);
}

.training-block-header[data-training-block-toggle] {
  cursor: pointer;
}

.training-plan-block--combination.is-collapsed .training-block-header {
  border-bottom-color: transparent;
}

.training-block-header-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.training-block-code {
  display: grid;
  place-items: center;
  min-width: 36px;
  height: 36px;
  padding: 0 6px;
  border: 1px solid rgba(216, 173, 82, 0.5);
  border-radius: 8px;
  color: var(--warn);
  font-family: "Bebas Neue", "Barlow Condensed", "Noto Sans SC", sans-serif;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.training-block-title {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.training-block-title strong {
  font-size: 16px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.training-block-title small {
  font-size: 13px;
  color: var(--text-tertiary);
}

.training-block-status {
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.training-block-status--active {
  background: rgba(216, 173, 82, 0.18);
  color: var(--warn);
}

.training-block-status--complete {
  background: rgba(54, 194, 138, 0.15);
  color: var(--accent-2);
}

.training-block-status--pending {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-tertiary);
}

/* ─── 黄色加粗警告条 ─── */
.training-block-warning {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-left: 3px solid var(--warn);
  background: rgba(216, 173, 82, 0.1);
  color: var(--warn);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.5;
  border-radius: 0 6px 6px 0;
}

/* ─── 树状动作列表 ─── */
.training-block-tree {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 2px;
}

.tree-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: default;
  transition: background 150ms ease;
}

.tree-item:hover {
  background: rgba(216, 173, 82, 0.05);
}

.tree-item--current {
  background: rgba(216, 173, 82, 0.12);
}

.tree-item--done {
  opacity: 0.6;
}

.tree-connector {
  color: var(--text-tertiary);
  font-size: 14px;
  font-family: monospace;
  user-select: none;
  flex-shrink: 0;
}

.tree-code {
  color: var(--warn);
  font-size: 13px;
  font-weight: 900;
  min-width: 24px;
  flex-shrink: 0;
}

.tree-name {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-status {
  font-size: 12px;
  color: var(--text-tertiary);
  white-space: nowrap;
  flex-shrink: 0;
}

.tree-item--current .tree-status {
  color: var(--warn);
  font-weight: 700;
}

.tree-item--done .tree-status {
  color: var(--accent-2);
}

/* ─── 组合动作轮次顺序 ─── */
.training-round-guide {
  margin: 10px 0 8px;
  padding: 10px;
  border: 1px solid rgba(216, 173, 82, 0.18);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.24);
}

.training-round-guide-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.training-round-guide-heading strong {
  color: var(--warn);
  font-size: 13px;
}

.training-round-guide-heading span {
  color: var(--text-tertiary);
  font-size: 12px;
}

.training-round-rows {
  display: grid;
  gap: 6px;
}

.training-round-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
}

.training-round-row--current {
  background: rgba(216, 173, 82, 0.08);
  box-shadow: inset 2px 0 var(--warn);
}

.training-round-label {
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.training-round-steps {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.training-round-step {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 4px;
  min-width: 0;
  flex: 1 1 0;
  padding: 6px 7px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
}

.training-round-step strong {
  color: var(--text);
  font-size: 12px;
}

.training-round-step > span:not(.training-round-step-icon) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.training-round-step small {
  grid-column: 2 / -1;
  color: var(--text-tertiary);
  font-size: 11px;
}

.training-round-step-icon {
  color: var(--muted);
  font-weight: 900;
}

.training-round-step--current {
  border-color: rgba(216, 173, 82, 0.6);
  background: rgba(216, 173, 82, 0.14);
  color: var(--warn);
}

.training-round-step--current strong,
.training-round-step--current .training-round-step-icon {
  color: var(--warn);
}

.training-round-step--done {
  opacity: 0.62;
}

.training-round-step--done .training-round-step-icon {
  color: var(--accent-2);
}

.training-round-arrow {
  flex: 0 0 auto;
  color: var(--warn);
  font-size: 14px;
  font-weight: 900;
}

/* ─── 双动作交替组合卡 ─── */
.training-plan-block--alternating {
  overflow: hidden;
  border: 1px solid rgba(216, 173, 82, 0.28);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.32);
}

.alternating-combination-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid rgba(216, 173, 82, 0.18);
}

.alternating-combination-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.alternating-combination-title .training-block-code {
  flex: 0 0 auto;
}

.alternating-combination-title strong {
  color: var(--warn);
  font-size: 16px;
}

.alternating-combination-title p {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.alternating-action-heading strong {
  color: var(--text);
  font-size: 18px;
  font-weight: 850;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.alternating-combination-progress {
  display: grid;
  gap: 3px;
  flex: 0 0 auto;
  text-align: right;
}

.alternating-combination-progress span {
  color: var(--text-tertiary);
  font-size: 12px;
}

.alternating-combination-progress strong {
  color: var(--warn);
  font-size: 14px;
}

.alternating-combination-warning {
  margin: 0;
  padding: 10px 16px;
  border-bottom: 2px solid var(--warn);
  background: rgba(216, 173, 82, 0.12);
  color: var(--warn);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.alternating-round-list {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.alternating-round {
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
}

.alternating-round--current {
  border-color: rgba(216, 173, 82, 0.6);
  background: rgba(216, 173, 82, 0.08);
  box-shadow: 0 0 0 1px rgba(216, 173, 82, 0.1);
}

.alternating-round--done {
  opacity: 0.58;
}

.alternating-round--partial {
  border-color: rgba(216, 173, 82, 0.35);
}

.alternating-round-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.alternating-round-header strong {
  color: var(--text);
  font-size: 14px;
}

.alternating-round-header span {
  color: var(--text-tertiary);
  font-size: 12px;
}

.alternating-action-row + .alternating-action-row {
  margin-top: 8px;
}

.alternating-action-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.alternating-action-tools {
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
  align-items: center;
}

.alternating-action-menu > summary {
  width: 30px;
  min-height: 30px;
}

.alternating-action-heading strong {
  color: var(--text);
  font-size: 13px;
}

.alternating-action-row--current .alternating-action-heading strong {
  color: var(--warn);
}

.alternating-action-row--done {
  opacity: 0.72;
}

.alternating-link-label {
  color: var(--warn);
  font-size: 11px;
  font-weight: 800;
}

.alternating-set-row {
  margin: 0;
}

.alternating-round-missing {
  display: block;
  margin-top: 6px;
  color: var(--warn);
  font-size: 12px;
  font-weight: 700;
}

/* ─── 嵌套动作卡 ─── */
.training-block-body--nested {
  display: grid;
  gap: 6px;
  padding: 8px 14px 14px;
}

/* ─── 当前执行区（仅当前动作操作卡）─── */
.training-block-body--execution {
  display: grid;
  gap: 6px;
  padding: 10px 14px 14px;
  border-top: 1px solid rgba(216, 173, 82, 0.25);
  background: rgba(216, 173, 82, 0.06);
}

.training-block-body--execution .training-plan-exercise--nested {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(216, 173, 82, 0.4);
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(216, 173, 82, 0.08), 0 6px 18px rgba(0, 0, 0, 0.4);
}

.training-block-body--execution .training-plan-exercise--nested::before {
  background: var(--warn);
  box-shadow: 0 0 8px rgba(216, 173, 82, 0.35);
}

.training-plan-exercise--nested {
  position: relative;
}

.training-plan-exercise--nested::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(216, 173, 82, 0.3);
  border-radius: 1px;
}

.training-plan-exercise--nested.current-exercise::before {
  background: var(--warn);
  box-shadow: 0 0 8px rgba(216, 173, 82, 0.3);
}

/* ─── 本轮组合完成横幅 ─── */
.training-round-complete {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 8px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(216, 173, 82, 0.18), rgba(216, 173, 82, 0.08));
  border: 1px solid rgba(216, 173, 82, 0.35);
}

.round-complete-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--warn);
  color: var(--text-on-accent);
  font-size: 16px;
  font-weight: 900;
  flex-shrink: 0;
}

.training-round-complete strong {
  display: block;
  font-size: 15px;
  color: var(--warn);
}

.training-round-complete small {
  font-size: 13px;
  color: var(--text-tertiary);
}


/* ─── 移动端适配 ─── */
@media (max-width: 760px) {
  .training-block-header {
    padding: 10px 10px 8px;
  }

  .training-block-header-row {
    flex-wrap: wrap;
    gap: 8px;
  }

  .training-block-code {
    min-width: 30px;
    height: 30px;
    font-size: 15px;
  }

  .training-block-title strong {
    font-size: 14px;
  }

  .training-block-title small {
    font-size: 12px;
  }

  .training-block-status {
    font-size: 12px;
    padding: 3px 8px;
  }

  .training-block-warning {
    font-size: 13px;
    padding: 8px 10px;
  }

  .tree-item {
    padding: 6px 8px;
    gap: 6px;
  }

  .tree-code {
    font-size: 12px;
    min-width: 20px;
  }

  .tree-name {
    font-size: 13px;
  }

  .tree-status {
    font-size: 12px;
  }

  .training-round-guide {
    margin: 8px 0 6px;
    padding: 8px;
  }

  .training-round-guide-heading {
    display: block;
  }

  .training-round-guide-heading span {
    display: block;
    margin-top: 3px;
    font-size: 12px;
  }

  .training-round-row {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 5px;
    padding: 5px;
  }

  .training-round-steps {
    display: grid;
    gap: 4px;
  }

  .training-round-arrow {
    display: none;
  }

  .training-round-step {
    grid-template-columns: auto auto minmax(0, 1fr);
    padding: 5px 6px;
  }

  .training-round-step small {
    font-size: 11px;
  }

  .alternating-combination-header {
    display: grid;
    gap: 10px;
    padding: 12px 10px;
  }

  .alternating-combination-title {
    align-items: flex-start;
    gap: 8px;
  }

  .alternating-combination-title strong {
    font-size: 14px;
  }

  .alternating-combination-title p {
    font-size: 16px;
    overflow-wrap: anywhere;
  }

  .alternating-combination-progress {
    grid-template-columns: 1fr 1fr;
    text-align: left;
  }

  .alternating-combination-warning {
    padding: 8px 10px;
    font-size: 12px;
  }

  .alternating-round-list {
    padding: 8px;
  }

  .alternating-round {
    padding: 8px;
  }

  .alternating-action-heading strong {
    font-size: 16px;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }

  .training-block-body--nested {
    padding: 6px 10px 10px;
  }

  .training-round-complete {
    padding: 10px 12px;
    gap: 10px;
  }

  .round-complete-icon {
    width: 26px;
    height: 26px;
    font-size: 13px;
  }

  .training-round-complete strong {
    font-size: 14px;
  }

  .training-round-complete small {
    font-size: 12px;
  }
}

/* ─── 减少动态偏好 ─── */
@media (prefers-reduced-motion: reduce) {
  .tree-item {
    transition: none !important;
  }
}

@media (max-width: 760px) {
  .progress-center-head {
    align-items: stretch;
    flex-direction: column;
  }

  .progress-range {
    width: 100%;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .progress-range button {
    min-width: 0;
    padding-inline: 5px;
  }

  #historyPanel .history-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  #historyPanel .history-summary > div {
    padding: 11px;
  }

  #historyPanel .history-summary strong {
    font-size: 18px;
    overflow-wrap: anywhere;
  }

  .progress-dashboard {
    grid-template-columns: 1fr;
  }

  .progress-calendar-day small {
    font-size: 8px;
  }

  .progress-weekly-chart,
  .progress-volume-chart,
  .progress-strength-chart {
    gap: 4px;
  }

  .progress-strength-section > header {
    align-items: stretch;
    flex-direction: column;
  }

  .progress-strength-section select {
    width: 100%;
  }

  .progress-strength-summary {
    grid-template-columns: 1fr;
  }

  .progress-strength-summary span {
    text-align: left;
  }

  .progress-muscle-volume {
    grid-template-columns: 1fr;
  }

  .progress-muscle-row {
    grid-template-columns: minmax(78px, 0.8fr) minmax(72px, 1.2fr) auto;
    gap-inline: 6px;
  }

  .completion-pr-row {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .completion-pr-badges {
    justify-content: flex-start;
  }

  .progress-distribution-row {
    grid-template-columns: minmax(68px, 0.8fr) minmax(70px, 1.3fr) auto;
    gap: 6px;
  }

  .progress-distribution-row > small {
    display: none;
  }

  .progress-history-head {
    align-items: flex-start;
  }

  .progress-history-head .small-button {
    flex: 0 0 auto;
  }
}

/* ============================================================
   HOME HEATMAP FINAL LAYOUT · 2026-08-17
   Keep the 30-day activity grid in the cultivation card header.
   ============================================================ */
@media (max-width: 1100px) {
  .home-training-heatmap {
    grid-column: 3;
    grid-row: 1;
    min-width: 126px;
    justify-self: end;
  }
}

@media (max-width: 760px) {
  .cultivation-panel {
    grid-template-columns: 58px minmax(0, 1fr) minmax(96px, 0.82fr);
  }

  .home-training-heatmap {
    grid-column: 3;
    grid-row: 1;
    width: 100%;
    min-width: 0;
    align-self: center;
    justify-self: stretch;
    gap: 5px;
    padding: 0;
    border-top: 0;
  }

  .home-heatmap-head {
    display: grid;
    justify-items: end;
    gap: 1px;
  }

  .home-heatmap-head small {
    max-width: 100%;
    font-size: 9px;
  }

  .home-heatmap-grid {
    grid-template-columns: repeat(7, 10px);
    grid-template-rows: repeat(5, 10px);
    justify-self: end;
  }

  .home-heatmap-day {
    width: 10px;
    height: 10px;
  }

  .cultivation-start {
    grid-column: 1 / -1;
    grid-row: 4;
  }
}

@media (min-width: 480px) and (max-width: 760px) {
  .cultivation-panel {
    grid-template-columns: 82px minmax(0, 1fr) minmax(150px, 0.9fr);
  }

  .home-heatmap-grid {
    grid-template-columns: repeat(7, 12px);
    grid-template-rows: repeat(5, 12px);
    gap: 4px;
  }

  .home-heatmap-day {
    width: 12px;
    height: 12px;
  }
}

/* Stage 6: reusable plan templates, ordered cycles, and session snapshots. */
.home-cycle-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 5px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.home-cycle-status[hidden] {
  display: none;
}

.home-cycle-status > span {
  min-width: 0;
  overflow: hidden;
  color: var(--accent-2);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-cycle-status .text-button {
  flex: 0 0 auto;
  padding: 2px 0;
  color: var(--accent);
  font-size: 11px;
}

.completion-cycle-source,
.history-cycle-source {
  display: block;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 700;
}

.cycle-builder {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.cycle-plan-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  max-height: 250px;
  overflow-y: auto;
}

.cycle-plan-choice {
  min-width: 0;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 7px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
}

.cycle-plan-choice.selected {
  border-color: rgba(54, 194, 138, 0.62);
  background: rgba(54, 194, 138, 0.1);
}

.cycle-plan-choice input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent-2);
}

.cycle-plan-choice span {
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cycle-plan-choice strong {
  color: var(--accent-2);
  text-align: center;
}

.cycle-builder-footer,
.training-cycle-row header,
.cycle-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cycle-builder-footer small,
.training-cycle-row header span,
.training-cycle-row header small {
  color: var(--muted);
  font-size: 11px;
}

.training-cycle-list {
  display: grid;
  gap: 0;
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

.training-cycle-row {
  display: grid;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.training-cycle-row.active {
  border-left: 3px solid var(--accent-2);
  padding-left: 10px;
}

.training-cycle-row header > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.training-cycle-row header strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cycle-steps {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 3px;
}

.cycle-step {
  flex: 0 0 auto;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 9px;
  color: var(--muted);
  background: #111315;
  font-size: 11px;
}

.cycle-step span {
  color: var(--text-tertiary);
  font-weight: 800;
}

.cycle-step.current {
  border-color: var(--accent-2);
  color: var(--text-strong);
  background: rgba(54, 194, 138, 0.12);
}

@media (max-width: 760px) {
  .cycle-plan-choices {
    grid-template-columns: 1fr;
    max-height: 220px;
  }

  .cycle-builder-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .cycle-builder-footer .primary-button {
    width: 100%;
  }
}

/* Searchable training-plan picker keeps the home mission compact as the catalog grows. */
.today-mission-trigger {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface-2);
  text-align: left;
}

.today-mission-trigger:hover,
.today-mission-trigger:focus-visible {
  border-color: var(--accent);
}

.today-mission-trigger strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-mission .today-mission-trigger-action {
  color: var(--warn);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.plan-picker-dialog {
  width: min(720px, calc(100vw - 28px));
  max-height: min(84vh, 760px);
  padding: 0;
  overflow: hidden;
}

.plan-picker-body {
  gap: 14px;
  padding: 18px;
  max-height: inherit;
  overflow-y: auto;
}

.plan-picker-view {
  display: grid;
  gap: 14px;
  min-width: 0;
}

#planPickerSchedule > p {
  margin: 0;
  font-size: 14px;
}

#planPickerSchedule a {
  color: var(--accent-strong);
}

.plan-picker-head h2,
.plan-picker-section-head h3,
.plan-picker-group h4 {
  margin: 0;
}

.plan-picker-search input {
  min-height: 46px;
  padding-left: 14px;
}

.plan-picker-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.plan-picker-filters button {
  flex: 1 0 auto;
  padding: 6px 10px;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
}

.plan-picker-filters button.active {
  border-color: rgba(216, 173, 82, 0.5);
  color: var(--text-strong);
  background: rgba(216, 173, 82, 0.14);
}

.arms22-schedule {
  min-width: 0;
  color: var(--text);
}

.arms22-schedule summary {
  padding: 12px 0;
  cursor: pointer;
  font-weight: 700;
}

.arms22-schedule a {
  color: var(--accent-strong);
}

.arms22-day {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 4px 8px;
  align-items: center;
  width: 100%;
  min-height: 52px;
  padding: 10px 4px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  text-align: left;
  color: var(--text);
  background: transparent;
  font-size: 14px;
}

.arms22-day strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.arms22-day small {
  grid-column: 2;
  color: var(--text-secondary);
}

.arms22-rest,
.arms22-day > span {
  color: var(--text-secondary);
}

button.arms22-day:hover,
button.arms22-day[aria-pressed="true"] {
  background: var(--surface-2);
  color: var(--accent-strong);
}

.plan-picker-scroll {
  max-height: min(55vh, 500px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.plan-picker-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 2px 9px;
}

.plan-picker-section-head h3 {
  font-size: 15px;
}

.plan-picker-section-head span {
  color: var(--muted);
  font-size: 12px;
}

.plan-picker-recent {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.plan-picker-recent-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.plan-picker-list,
.plan-picker-group,
.plan-picker-group > div {
  display: grid;
}

.plan-picker-list {
  gap: 15px;
}

.plan-picker-group {
  gap: 6px;
}

.plan-picker-group h4 {
  padding: 0 2px;
  color: var(--warn);
  font-size: 12px;
}

.plan-picker-group > div {
  border-top: 1px solid var(--line);
}

.plan-picker-option {
  width: 100%;
  min-width: 0;
  min-height: 54px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  background: transparent;
  text-align: left;
}

.plan-picker-option:hover,
.plan-picker-option:focus-visible {
  background: rgba(216, 173, 82, 0.08);
}

.plan-picker-option.active {
  background: rgba(54, 194, 138, 0.09);
}

.plan-picker-option-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.plan-picker-option-copy strong,
.plan-picker-option-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-picker-option-copy strong {
  color: var(--text);
  font-size: 14px;
}

.plan-picker-option-copy small {
  color: var(--muted);
  font-size: 11px;
}

.plan-picker-option-state {
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 900;
}

.plan-picker-option.active .plan-picker-option-state {
  color: var(--accent-2);
}

.plan-picker-option.compact {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.plan-picker-empty {
  margin: 0;
  padding: 32px 12px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 760px) {
  .plan-picker-dialog {
    width: 100%;
    max-width: none;
    max-height: 88dvh;
    margin: auto 0 0;
    border-width: 1px 0 0;
    border-radius: 8px 8px 0 0;
  }

  .plan-picker-body {
    padding: 14px 12px calc(14px + env(safe-area-inset-bottom));
  }

  .plan-picker-scroll {
    max-height: 58dvh;
  }

  .plan-picker-recent-list {
    display: flex;
    overflow-x: auto;
    gap: 7px;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .plan-picker-recent-list::-webkit-scrollbar {
    display: none;
  }

  .plan-picker-option.compact {
    flex: 0 0 min(230px, 76vw);
  }
}
