:root {
  color-scheme: dark;
  --brand-rgb: 56, 189, 248;
  --accent-rgb: 34, 197, 94;
  --bg-darker: #070d14;
  --bg-card: #111c2c;
  --bg-input: #0a1524;
  --accent: #22c55e;
  --text-main: #d1dae6;
  --text-dim: #8b9cb3;
  --border: rgba(var(--brand-rgb), 0.12);
  --primary-blue: #38bdf8;
  --danger: #f87171;
  --ring-track: rgba(255,255,255,.08);
  --ring-rest: var(--primary-blue);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --shadow-soft: 0 4px 24px rgba(0, 0, 0, 0.35);
  --shadow-lift: 0 12px 40px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 0 1px rgba(var(--brand-rgb), 0.12), 0 0 48px rgba(var(--brand-rgb), 0.08);
  --font-display: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  --header-bg: rgba(17, 28, 44, 0.92);
  --surface-nav: rgba(7, 13, 20, 0.88);
  --surface-nav-link: rgba(255, 255, 255, 0.03);
  --surface-nav-link-hover: rgba(255, 255, 255, 0.06);
  --surface-nav-link-hover-border: rgba(255, 255, 255, 0.06);
  --text-on-primary: #ffffff;
  --text-strong: #ffffff;
  --input-text: #ffffff;
  --card-title-soft-color: rgba(255, 255, 255, 0.55);
  --app-title-color: #ffffff;
  --app-kicker-dim: rgba(255, 255, 255, 0.38);
  --divider-subtle: rgba(255, 255, 255, 0.06);
  --hero-stat-surface: rgba(0, 0, 0, 0.2);
  --hero-stat-border: rgba(255, 255, 255, 0.05);
  --progress-track-bg: #30363d;
  --card-shine: rgba(255, 255, 255, 0.04);
  --checklist-item-hover-bg: #1c2128;
  --cta-secondary-bg: rgba(255, 255, 255, 0.04);
  --cta-secondary-border: rgba(255, 255, 255, 0.1);
  --cta-secondary-active-bg: rgba(255, 255, 255, 0.07);
  --trench-bg: rgba(0, 0, 0, 0.45);
  --trench-border: rgba(255, 255, 255, 0.1);
  --trench-inset: rgba(0, 0, 0, 0.35);
  --modal-backdrop: rgba(0, 0, 0, 0.55);
  --modal-backdrop-glass: rgba(4, 8, 14, 0.72);
  --surface-scrim: rgba(0, 0, 0, 0.22);
  --surface-scrim-light: rgba(0, 0, 0, 0.18);
  --surface-scrim-muted: rgba(0, 0, 0, 0.15);
  --link-on-strong: #ffffff;
  --link-on-strong-underline: rgba(255, 255, 255, 0.35);
  --summary-shine: rgba(255, 255, 255, 0.04);
  --summary-border: rgba(255, 255, 255, 0.05);
  --card-log-border: rgba(255, 255, 255, 0.12);
  --diagram-canvas: #ffffff;
  --preset-ex-bg: rgba(0, 0, 0, 0.22);
  --preset-ex-border: rgba(255, 255, 255, 0.08);
  --preset-card-bg: rgba(0, 0, 0, 0.2);
  --card-keyline: rgba(0, 0, 0, 0.2);
  --page-gradient:
    radial-gradient(120% 80% at 50% -20%, rgba(var(--brand-rgb), 0.09), transparent 55%),
    radial-gradient(90% 60% at 100% 0%, rgba(var(--accent-rgb), 0.05), transparent 45%),
    var(--bg-darker);
}
body.theme-her {
  --bg-darker: #19141a;
  --bg-card: #2a212b;
  --bg-input: #1f1820;
  --accent: #cf5a84;
  --text-main: #f6edf4;
  --text-dim: #d3a9bf;
  --border: #5b4656;
  --primary-blue: #d38fae;
  --ring-rest: var(--primary-blue);
  --brand-rgb: 211, 143, 174;
  --accent-rgb: 207, 90, 132;
  --header-bg: rgba(35, 28, 38, 0.92);
  --app-kicker-dim: rgba(246, 237, 244, 0.42);
}
body.theme-her .xp-rank-track-fill,
body.theme-her .train-xp-track-fill {
  background: linear-gradient(90deg, var(--primary-blue), var(--accent));
}
* {
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  transition: background .25s, color .25s;
  -webkit-tap-highlight-color: transparent;
}
body {
  background: var(--page-gradient);
  color: var(--text-main);
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
  font-family: var(--font-display);
}
.top-nav,
.app-tab-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: max(10px, env(safe-area-inset-top)) 12px 10px;
  background: var(--surface-nav);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
  scrollbar-width: thin;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.top-nav a,
.app-tab-bar a {
  text-decoration: none;
  color: var(--text-dim);
  border: 1px solid transparent;
  background: var(--surface-nav-link);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 0.78rem;
  white-space: nowrap;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}
.top-nav a:hover,
.app-tab-bar a:hover {
  color: var(--text-main);
  background: var(--surface-nav-link-hover);
  border-color: var(--surface-nav-link-hover-border);
}
.top-nav a.active,
.app-tab-bar a.active {
  color: var(--text-on-primary);
  background: linear-gradient(135deg, rgba(var(--brand-rgb), 0.35), rgba(var(--brand-rgb), 0.12));
  border-color: rgba(var(--brand-rgb), 0.35);
  box-shadow: 0 0 24px rgba(var(--brand-rgb), 0.2);
  font-weight: 800;
}
.stats-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.text-dim { color: var(--text-dim); }
.stat-val { font-weight: 900; color: var(--text-strong); }
.btn-header {
  background: var(--primary-blue);
  border: none;
  color: var(--text-on-primary);
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-size: .75rem;
  touch-action: manipulation;
  font-weight: 900;
  transition: transform 0.14s cubic-bezier(0.33, 1, 0.68, 1), filter 0.14s ease, box-shadow 0.14s ease;
}
.btn-header:active {
  transform: scale(0.94);
  filter: brightness(0.92);
}
.btn-header.danger { background: var(--danger); }
.btn-header.btn-ghost { background: var(--bg-input); border: 1px solid var(--border); }
main {
  flex: 1;
  overflow: auto;
  padding: 20px 16px 28px;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}
@media (min-width: 900px) {
  main {
    max-width: 820px;
    padding: 24px 20px 32px;
  }
}
.screen { display: none; max-width: 1100px; margin: 0 auto; gap: 16px; flex-direction: column; }
.screen.active { display: flex; }
.screen.active.screen--enter {
  animation: app-screen-enter 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes app-screen-enter {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .screen.active.screen--enter {
    animation: none;
  }
}
.screen-top { display: flex; justify-content: flex-start; align-items: center; }
.screen-top--split {
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.disclosure-preview-line {
  margin: 0 0 8px;
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.35;
  padding: 0 2px;
}
.train-progress-chip {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-main);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.04) 0%, transparent 42%), var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 18px 20px;
  box-shadow: var(--shadow-soft);
  transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
}
.card:hover {
  border-color: rgba(var(--brand-rgb), 0.18);
  box-shadow: var(--shadow-lift);
}
.card-title {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-dim);
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.card-title--soft {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--card-title-soft-color);
}
.section-lede {
  margin: -4px 0 16px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-dim);
  line-height: 1.45;
}
.section-lede--tight {
  margin-bottom: 12px;
  font-size: 0.8rem;
}
.small-text { font-weight: normal; font-size: .72rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 10px; }
@media (max-width: 900px) {
  .grid-2,
  .grid-3 { grid-template-columns: 1fr; }
}
select, input, textarea {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--input-text);
  padding: 8px;
  border-radius: 12px;
  width: 100%;
  font-size: .92rem;
  outline: none;
}
.dash-box { border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: var(--bg-input); }
.dash-title { font-size: .78rem; color: var(--text-dim); margin-bottom: 8px; font-weight: 900; }
.dash-value { font-size: 1.15rem; font-weight: 900; }
.timer-shell {
  position: relative;
  width: min(320px, 100%);
  margin: 6px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.timer-shell--main {
  min-height: 220px;
  margin: 20px auto 16px;
  transition: filter 0.35s ease, transform 0.35s ease;
  filter: drop-shadow(0 16px 40px rgba(0, 0, 0, 0.5));
}
.timer-shell--main::before {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: min(280px, 92vw);
  height: min(280px, 92vw);
  max-height: 260px;
  max-width: 260px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 136, 62, 0.12) 0%, transparent 62%);
  pointer-events: none;
  z-index: 0;
  opacity: 0.9;
}
.timer-shell--warn::before {
  background: radial-gradient(circle, rgba(251, 191, 36, 0.38) 0%, rgba(251, 191, 36, 0.12) 42%, transparent 68%);
  opacity: 0.85;
  animation: timer-warn-halo 1.5s ease-in-out infinite alternate;
}
.timer-shell--crit::before {
  background: radial-gradient(circle, rgba(251, 113, 133, 0.52) 0%, rgba(251, 113, 133, 0.18) 40%, transparent 68%);
  opacity: 1;
  animation: timer-crit-halo 0.55s ease-in-out infinite alternate;
}
.timer-shell--warn.timer-shell--main {
  filter:
    drop-shadow(0 16px 40px rgba(0, 0, 0, 0.5))
    drop-shadow(0 0 32px rgba(251, 191, 36, 0.32));
}
.timer-shell--crit.timer-shell--main {
  filter:
    drop-shadow(0 16px 40px rgba(0, 0, 0, 0.55))
    drop-shadow(0 0 40px rgba(251, 113, 133, 0.48))
    drop-shadow(0 0 64px rgba(251, 113, 133, 0.22));
}
.timer-shell--warn .timer-display {
  color: #fcd34d;
  text-shadow:
    0 0 28px rgba(251, 191, 36, 0.55),
    0 0 52px rgba(251, 191, 36, 0.28),
    0 2px 20px rgba(0, 0, 0, 0.5);
  animation: timer-warn-drum 1.8s ease-in-out infinite;
}
.timer-shell--crit .timer-display {
  color: #fda4af;
  text-shadow:
    0 0 32px rgba(251, 113, 133, 0.65),
    0 0 56px rgba(251, 113, 133, 0.35),
    0 2px 22px rgba(0, 0, 0, 0.55);
}
.timer-shell--pulse .timer-display {
  animation: timer-display-pulse 0.85s ease-in-out infinite;
}
.timer-shell--crit.timer-shell--pulse .timer-display {
  animation: timer-display-pulse-crit 0.62s ease-in-out infinite;
}
.timer-shell--warn .ring .progress {
  stroke: #fbbf24;
  filter: drop-shadow(0 0 16px rgba(251, 191, 36, 0.55));
}
.timer-shell--crit .ring .progress {
  stroke: #fb7185;
  filter: drop-shadow(0 0 18px rgba(251, 113, 133, 0.75));
}
.timer-shell--crit .ring .track {
  stroke: rgba(251, 113, 133, 0.22);
}
@keyframes timer-warn-halo {
  0% {
    opacity: 0.55;
    transform: translate(-50%, -50%) scale(0.9);
  }
  100% {
    opacity: 0.95;
    transform: translate(-50%, -50%) scale(1.06);
  }
}
@keyframes timer-crit-halo {
  0% {
    opacity: 0.75;
    transform: translate(-50%, -50%) scale(0.92);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.14);
  }
}
@keyframes timer-warn-drum {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.12);
  }
}
@keyframes timer-display-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.04); opacity: 0.92; }
}
@keyframes timer-display-pulse-crit {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: 0.9; }
}
.timer-display {
  font-size: clamp(3.25rem, 10vw, 4rem);
  font-weight: 900;
  color: #f0883e;
  text-align: center;
  margin: 10px 0 6px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1;
  position: relative;
  z-index: 2;
  text-shadow:
    0 2px 24px rgba(0, 0, 0, 0.45),
    0 0 40px rgba(240, 136, 62, 0.22);
  transition: color 0.35s ease, transform 0.35s ease, text-shadow 0.35s ease, filter 0.35s ease;
}
@media (prefers-reduced-motion: reduce) {
  .timer-shell--warn::before,
  .timer-shell--crit::before {
    animation: none;
  }
  .timer-shell--warn .timer-display {
    animation: none;
  }
  .timer-shell--pulse .timer-display,
  .timer-shell--crit.timer-shell--pulse .timer-display {
    animation: none;
  }
}
.ring {
  position: absolute;
  inset: -6px;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1;
  pointer-events: none;
}
.ring svg { width: min(260px, 100%); height: auto; max-height: 260px; }
.ring .track { stroke: var(--ring-track); stroke-width: 10; fill: none; }
.ring .progress {
  stroke: var(--ring-rest);
  stroke-width: 11;
  fill: none;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  stroke-dasharray: 0 9999;
  stroke-dashoffset: 0;
  filter: drop-shadow(0 0 14px rgba(var(--brand-rgb), 0.35));
}
.ring-label {
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  font-size: .75rem;
  color: var(--text-dim);
  z-index: 2;
  display: none;
}
.progress-container { height: 8px; background: var(--progress-track-bg); border-radius: 4px; overflow: hidden; margin-bottom: 12px; }
.progress-bar { height: 100%; background: var(--primary-blue); width: 0%; transition: width .25s; }
.btn-group { display: flex; gap: 10px; }
.btn-main {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 900;
  font-size: 1rem;
  touch-action: manipulation;
}
.btn-start { background: var(--primary-blue); color: var(--text-on-primary); }
.btn-next { background: var(--bg-input); color: var(--input-text); border: 1px solid var(--border); }
.btn-done {
  background: var(--accent);
  color: var(--text-on-primary);
  width: 100%;
  margin-top: 10px;
  border: none;
  border-radius: 12px;
  padding: 12px;
  font-weight: 900;
  cursor: pointer;
  touch-action: manipulation;
}
.checklist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  font-size: .88rem;
  gap: 10px;
  background: var(--bg-input);
}
.checklist-item:hover { background: var(--checklist-item-hover-bg); }
.checklist-check {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}
.move-link {
  color: var(--link-on-strong);
  text-decoration: none;
  border-bottom: 1px dashed var(--link-on-strong-underline);
}
.move-link:hover {
  color: var(--primary-blue);
  border-bottom-color: var(--primary-blue);
}
.tag {
  font-size: 0.65rem;
  font-weight: 900;
  padding: 5px 10px;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
  letter-spacing: 0.04em;
}
.tag-work {
  background: rgba(var(--accent-rgb), 0.16);
  color: #86efac;
  border-color: rgba(var(--accent-rgb), 0.55);
  box-shadow: 0 0 14px rgba(var(--accent-rgb), 0.12);
}
.tag-skill {
  background: rgba(245, 158, 11, 0.14);
  color: #fde68a;
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.1);
}
.tag-rest {
  background: rgba(148, 163, 184, 0.14);
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.45);
}
.tag-shoulder {
  background: rgba(167, 139, 250, 0.16);
  color: #ddd6fe;
  border-color: rgba(167, 139, 250, 0.55);
  box-shadow: 0 0 14px rgba(167, 139, 250, 0.12);
}
.chip-container { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.chip {
  background: var(--bg-input);
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-size: .85rem;
  touch-action: manipulation;
}
.diagram-box {
  background: var(--diagram-canvas);
  border-radius: 14px;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  overflow: hidden;
}
.diagram-box img { max-width: 100%; max-height: 160px; }
.calendar-row { display: flex; gap: 5px; margin-top: 10px; }
.day-tile {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  text-align: center;
  padding: 8px 4px;
  border-radius: 12px;
  font-size: .72rem;
  cursor: pointer;
  touch-action: manipulation;
}
.day-tile.today { border-color: var(--primary-blue); background: var(--bg-card); }
.day-tile.done { color: var(--accent); font-weight: 900; }
.creator-credit {
  font-size: .75rem;
  color: var(--text-dim);
  text-align: center;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--modal-backdrop);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 14px;
}
.modal-backdrop--glass {
  background: var(--modal-backdrop-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: backdrop-fade 0.28s ease-out;
}
@keyframes backdrop-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal {
  width: min(520px, 100%);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, transparent 40%), var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lift), var(--shadow-glow);
  padding: 22px 20px 20px;
  animation: modal-rise 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes modal-rise {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal--result-premium {
  text-align: center;
}
.modal--verse-premium {
  border-radius: var(--radius-xl);
}
.modal h3 { margin: 0 0 8px; font-size: 1.0rem; }
.modal p { margin: 0 0 10px; color: var(--text-main); line-height: 1.4; }
.modal .ref { color: var(--text-dim); font-size: .85rem; margin-top: 6px; }
.modal-actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.btn-small {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--input-text);
  cursor: pointer;
  font-weight: 900;
  touch-action: manipulation;
}
.btn-small.primary { background: var(--primary-blue); border: none; }
.modal--result .modal-result-title {
  margin: 0 0 12px;
  font-size: 1.1rem;
  color: var(--primary-blue);
}
.modal-result-xp {
  font-size: 2.35rem;
  font-weight: 900;
  color: var(--text-strong);
  letter-spacing: 0.02em;
  line-height: 1.1;
  text-shadow: 0 6px 32px rgba(var(--brand-rgb), 0.45);
}
.modal-result-xp-num {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}
.modal-result-xp-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-dim);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
#session-result-modal.modal-result--open .modal-result-xp-num {
  animation: modal-xp-num-pop 0.78s cubic-bezier(0.22, 1, 0.36, 1) both;
}
#session-result-modal.modal-result--open .modal-result-xp {
  animation: modal-xp-aura 1.15s ease-out 0.05s both;
}
#session-result-modal.modal-result--open .modal-result-sub {
  animation: modal-result-fade-up 0.42s ease-out 0.12s both;
}
#session-result-modal.modal-result--open .modal-result-row--streak {
  animation: modal-result-fade-up 0.42s ease-out 0.2s both;
}
#session-result-modal.modal-result--open .modal-result-row--pb {
  animation: modal-result-fade-up 0.42s ease-out 0.28s both;
}
@keyframes modal-xp-num-pop {
  0% {
    transform: scale(0.45) rotate(-5deg);
    opacity: 0;
    filter: blur(6px);
  }
  58% {
    transform: scale(1.1) rotate(1deg);
    opacity: 1;
    filter: blur(0);
  }
  100% {
    transform: scale(1) rotate(0);
    opacity: 1;
    filter: blur(0);
  }
}
@keyframes modal-xp-aura {
  0% {
    text-shadow: 0 0 0 transparent;
    filter: brightness(1);
  }
  35% {
    text-shadow:
      0 0 28px rgba(var(--brand-rgb), 0.75),
      0 0 48px rgba(74, 222, 128, 0.35);
    filter: brightness(1.15);
  }
  100% {
    text-shadow: 0 6px 32px rgba(var(--brand-rgb), 0.45);
    filter: brightness(1);
  }
}
@keyframes modal-result-fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes modal-xp-aura-her {
  0% {
    text-shadow: 0 0 0 transparent;
    filter: brightness(1);
  }
  35% {
    text-shadow:
      0 0 28px rgba(211, 143, 174, 0.7),
      0 0 48px rgba(207, 90, 132, 0.32);
    filter: brightness(1.12);
  }
  100% {
    text-shadow: 0 6px 28px rgba(211, 143, 174, 0.4);
    filter: brightness(1);
  }
}
body.theme-her #session-result-modal.modal-result--open .modal-result-xp {
  animation-name: modal-xp-aura-her;
}
@media (prefers-reduced-motion: reduce) {
  body.theme-her #session-result-modal.modal-result--open .modal-result-xp-num,
  body.theme-her #session-result-modal.modal-result--open .modal-result-xp,
  #session-result-modal.modal-result--open .modal-result-xp-num,
  #session-result-modal.modal-result--open .modal-result-xp,
  #session-result-modal.modal-result--open .modal-result-sub,
  #session-result-modal.modal-result--open .modal-result-row--streak,
  #session-result-modal.modal-result--open .modal-result-row--pb {
    animation: none;
  }
}
.modal-result-sub {
  margin: 12px 0 0;
  font-size: 0.88rem;
  color: var(--text-main);
}
.modal-result-row {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  line-height: 1.4;
}
.modal-result-row--pb {
  border-color: rgba(167, 139, 250, 0.45);
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.12), rgba(var(--brand-rgb), 0.06));
}
.hint { margin-top: 8px; font-size: 0.78rem; color: var(--text-dim); line-height: 1.35; }
.hidden { display: none !important; }

/* —— App shell & navigation —— */
header.app-header,
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
  flex-shrink: 0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.app-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-left: auto;
}
.app-header-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.app-title {
  font-weight: 900;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: var(--app-title-color);
}
.app-subtitle {
  font-size: 0.72rem;
  color: var(--text-dim);
}
.app-identity-line {
  margin: 6px 0 0;
  padding: 0;
  font-size: 0.62rem;
  font-weight: 700;
  font-style: italic;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--app-kicker-dim);
  line-height: 1.3;
  max-width: 22em;
}
/* —— Home hero —— */
.hero-card {
  padding: 26px 22px 28px;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(100% 80% at 0% 0%, rgba(var(--brand-rgb), 0.12), transparent 55%),
    linear-gradient(175deg, var(--card-shine) 0%, transparent 50%),
    var(--bg-card);
  border: 1px solid rgba(var(--brand-rgb), 0.15);
  box-shadow: var(--shadow-lift), 0 0 0 1px var(--card-keyline);
}
.hero-card:hover {
  border-color: rgba(var(--brand-rgb), 0.22);
}
.hero-rank-panel {
  margin-bottom: 24px;
  padding: 6px 4px 24px;
  border-bottom: 1px solid var(--divider-subtle);
  position: relative;
}
.hero-rank-panel::before {
  content: "";
  position: absolute;
  inset: -4px -8px auto;
  height: 120px;
  border-radius: var(--radius-lg);
  background: radial-gradient(80% 100% at 50% 0%, rgba(var(--brand-rgb), 0.14), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.hero-rank-panel > * {
  position: relative;
  z-index: 1;
}
.hero-mission--hero {
  margin-bottom: 24px;
}
.hero-actions--primary {
  margin-bottom: 22px;
}
.btn-cta--hero {
  font-size: 1.15rem;
  padding: 18px 22px;
  letter-spacing: 0.04em;
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 40px rgba(var(--brand-rgb), 0.35);
}
.btn-cta--hero:active {
  box-shadow: 0 6px 22px rgba(var(--brand-rgb), 0.22);
}
.hero-stats--signal {
  margin-top: 4px;
  padding-top: 16px;
  border-top: 1px solid var(--divider-subtle);
}
.hero-stats--signal .hero-stat {
  background: var(--hero-stat-surface);
  border: 1px solid var(--hero-stat-border);
}
.rank-hero-kicker {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary-blue);
  margin-bottom: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(var(--brand-rgb), 0.12);
  border: 1px solid rgba(var(--brand-rgb), 0.28);
}
.rank-hero-title {
  font-size: clamp(1.85rem, 5.5vw, 2.15rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--text-strong);
  line-height: 1.08;
  text-shadow: 0 2px 28px rgba(0, 0, 0, 0.45);
}
.rank-hero-sub {
  margin: 10px 0 18px;
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.xp-rank-track {
  height: 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(var(--brand-rgb), 0.06),
    0 4px 22px rgba(var(--brand-rgb), 0.14);
  position: relative;
  animation: xp-track-aura 2.8s ease-in-out infinite alternate;
}
.xp-rank-track-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary-blue), #4ade80);
  box-shadow:
    0 0 16px rgba(var(--brand-rgb), 0.55),
    0 0 28px rgba(74, 222, 128, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.38);
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
  animation: xp-fill-glow 2.2s ease-in-out infinite;
}
.xp-rank-track-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 40%;
  background: linear-gradient(
    105deg,
    transparent,
    rgba(255, 255, 255, 0.22),
    transparent
  );
  transform: translateX(-120%);
  animation: xp-bar-sheen 3.2s ease-in-out infinite;
}
@keyframes xp-bar-sheen {
  0%,
  55% {
    transform: translateX(-120%);
  }
  75%,
  100% {
    transform: translateX(320%);
  }
}
@keyframes xp-track-aura {
  0% {
    box-shadow:
      inset 0 2px 6px rgba(0, 0, 0, 0.35),
      0 0 0 1px rgba(var(--brand-rgb), 0.05),
      0 2px 14px rgba(var(--brand-rgb), 0.1);
  }
  100% {
    box-shadow:
      inset 0 2px 6px rgba(0, 0, 0, 0.35),
      0 0 0 1px rgba(var(--brand-rgb), 0.12),
      0 6px 28px rgba(var(--brand-rgb), 0.22);
  }
}
@keyframes xp-fill-glow {
  0%,
  100% {
    box-shadow:
      0 0 12px rgba(var(--brand-rgb), 0.45),
      0 0 22px rgba(74, 222, 128, 0.2),
      inset 0 1px 0 rgba(255, 255, 255, 0.35);
    filter: brightness(1);
  }
  50% {
    box-shadow:
      0 0 24px rgba(var(--brand-rgb), 0.75),
      0 0 36px rgba(74, 222, 128, 0.38),
      inset 0 1px 0 rgba(255, 255, 255, 0.48);
    filter: brightness(1.06);
  }
}
@keyframes xp-track-aura-violet {
  0% {
    box-shadow:
      inset 0 2px 5px rgba(0, 0, 0, 0.35),
      0 0 0 1px rgba(167, 139, 250, 0.06),
      0 2px 12px rgba(167, 139, 250, 0.1);
  }
  100% {
    box-shadow:
      inset 0 2px 5px rgba(0, 0, 0, 0.35),
      0 0 0 1px rgba(167, 139, 250, 0.14),
      0 6px 26px rgba(var(--brand-rgb), 0.18);
  }
}
@keyframes xp-fill-glow-violet {
  0%,
  100% {
    box-shadow:
      0 0 12px rgba(var(--brand-rgb), 0.42),
      0 0 22px rgba(167, 139, 250, 0.22),
      inset 0 1px 0 rgba(255, 255, 255, 0.32);
    filter: brightness(1);
  }
  50% {
    box-shadow:
      0 0 26px rgba(167, 139, 250, 0.55),
      0 0 34px rgba(var(--brand-rgb), 0.32),
      inset 0 1px 0 rgba(255, 255, 255, 0.45);
    filter: brightness(1.08);
  }
}
.xp-rank-meta {
  margin-top: 12px;
  font-size: 0.8rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.72);
}
@media (prefers-reduced-motion: reduce) {
  .xp-rank-track-fill::after,
  .train-xp-track-fill::after {
    animation: none;
  }
  .xp-rank-track,
  .train-xp-track {
    animation: none;
  }
  .xp-rank-track-fill,
  .train-xp-track-fill {
    animation: none;
  }
}
body.theme-her .rank-hero-kicker {
  background: rgba(211, 143, 174, 0.14);
  border-color: rgba(211, 143, 174, 0.35);
}
.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
.hero-stats--compact {
  margin-bottom: 0;
}
.hero-stat-value--sm {
  font-size: 0.92rem;
}
@media (max-width: 520px) {
  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}
.hero-stat {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
}
.hero-stat-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.hero-stat-value {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
}
.hero-mission {
  margin-bottom: 16px;
}
.mission-kicker {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--primary-blue);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.mission-title {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-strong);
  margin-bottom: 8px;
}
.mission-lead {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.4;
}
.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* —— Primary CTAs —— */
.btn-cta {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 16px 18px;
  font-size: 1.05rem;
  font-weight: 900;
  cursor: pointer;
  touch-action: manipulation;
  letter-spacing: 0.02em;
  transition:
    transform 0.14s cubic-bezier(0.33, 1, 0.68, 1),
    box-shadow 0.16s ease,
    filter 0.14s ease,
    background 0.2s ease,
    border-color 0.2s ease;
}
.btn-cta:active {
  transform: scale(0.965);
  filter: brightness(0.93);
}
.btn-cta-primary {
  background: linear-gradient(135deg, #4ac8ff, var(--primary-blue));
  color: var(--text-on-primary);
  box-shadow: 0 8px 28px rgba(var(--brand-rgb), 0.22);
}
.btn-cta-primary:active {
  box-shadow: 0 4px 16px rgba(var(--brand-rgb), 0.2);
}
.btn-cta-secondary {
  background: var(--cta-secondary-bg);
  color: var(--text-strong);
  border: 1px solid var(--cta-secondary-border);
}
.btn-cta-secondary:active {
  background: var(--cta-secondary-active-bg);
}
.btn-cta-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px dashed var(--border);
  padding: 12px 16px;
  font-size: 0.92rem;
}
.btn-cta-accent {
  background: var(--accent);
  color: var(--text-on-primary);
  margin-top: 4px;
}
.train-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 6px;
}
.train-controls #btn-start {
  grid-column: 1 / -1;
  border-radius: var(--radius-lg);
  padding: 17px 20px;
  font-size: 1.08rem;
  box-shadow:
    0 10px 32px rgba(var(--brand-rgb), 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.train-controls .btn-cta-secondary {
  font-size: 0.95rem;
  font-weight: 800;
  padding: 14px 12px;
  border-radius: var(--radius-md);
}
@media (min-width: 480px) {
  .train-controls {
    grid-template-columns: 1.15fr 1fr 1fr;
  }
  .train-controls #btn-start {
    grid-column: auto;
  }
}

/* —— Train screen —— */
.train-focus-card {
  padding: 22px 18px 22px;
}
.train-layout-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: min(72vh, 640px);
}
.train-top-stats {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 18px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--divider-subtle);
}
.train-rank-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.train-rank-label {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}
.train-rank-name {
  font-size: 0.95rem;
  font-weight: 900;
  color: var(--text-strong);
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(var(--brand-rgb), 0.1);
  border: 1px solid rgba(var(--brand-rgb), 0.28);
  letter-spacing: 0.02em;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}
.train-xp-strip-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: 0.04em;
}
.train-xp-track {
  height: 12px;
  border-radius: 999px;
  background: var(--trench-bg);
  overflow: hidden;
  border: 1px solid var(--trench-border);
  box-shadow:
    inset 0 2px 5px var(--trench-inset),
    0 0 0 1px rgba(var(--brand-rgb), 0.06),
    0 4px 20px rgba(167, 139, 250, 0.12);
  position: relative;
  animation: xp-track-aura-violet 2.8s ease-in-out infinite alternate;
}
.train-xp-track-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary-blue), #a78bfa);
  box-shadow:
    0 0 14px rgba(var(--brand-rgb), 0.45),
    0 0 26px rgba(167, 139, 250, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.32);
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
  animation: xp-fill-glow-violet 2.2s ease-in-out infinite;
}
.train-xp-track-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 35%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.18), transparent);
  transform: translateX(-130%);
  animation: xp-bar-sheen 3.6s ease-in-out infinite;
  animation-delay: 0.6s;
}
body.theme-her .train-rank-name {
  background: rgba(211, 143, 174, 0.12);
  border-color: rgba(211, 143, 174, 0.32);
}
.train-center-stack {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  padding: 12px 0 18px;
}
.train-session-track {
  max-width: 420px;
  width: 100%;
  margin: 0 auto 0;
}
.train-exercise-block {
  text-align: center;
  margin-bottom: 16px;
  padding: 6px 0 10px;
}
.train-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.train-exercise-name {
  font-size: clamp(1.4rem, 4.2vw, 1.65rem);
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.35);
}
.train-exercise-note {
  font-size: 0.84rem;
  color: var(--text-dim);
  margin-top: 8px;
  line-height: 1.4;
}
.train-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-dim);
  margin-bottom: 18px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.train-meta-row span {
  flex: 1;
  text-align: center;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.72);
}
.train-bottom-deck > .btn-cta-accent {
  margin-top: 8px;
  border-radius: var(--radius-md);
  font-weight: 900;
  box-shadow: 0 6px 22px rgba(var(--accent-rgb), 0.25);
}
body.theme-her .train-bottom-deck > .btn-cta-accent {
  box-shadow: 0 6px 22px rgba(207, 90, 132, 0.28);
}
.train-keys-hint {
  margin-top: 12px;
  margin-bottom: 0;
  text-align: center;
}

/* —— Form cues (disclosure) —— */
.form-cues-panel {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin-top: 10px;
}
.form-cues-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}
.form-cues-title {
  font-weight: 900;
  font-size: 0.98rem;
}
.form-cues-tag {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-align: right;
}
.form-cues-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  font-size: 0.82rem;
  margin-bottom: 12px;
}
.form-cues-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 600px) {
  .form-cues-columns {
    grid-template-columns: 1fr;
  }
}
.form-cues-sub {
  font-size: 0.78rem;
  font-weight: 900;
  margin-bottom: 6px;
  color: var(--text-dim);
}
.form-cues-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text-main);
  font-size: 0.86rem;
  line-height: 1.4;
}
.form-cues-list--dim {
  color: var(--text-dim);
  font-size: 0.82rem;
}

/* —— Progressive disclosure —— */
.disclosure-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.disclosure-card > summary {
  list-style: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-dim);
  padding: 16px 18px;
  background: linear-gradient(90deg, var(--summary-shine), transparent);
  border-bottom: 1px solid var(--summary-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  transition: background 0.2s ease, color 0.2s ease;
}
.disclosure-summary-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-strong);
  letter-spacing: 0.02em;
}
.disclosure-summary-hint {
  font-size: 0.62rem;
  font-weight: 800;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  flex-shrink: 0;
}
.disclosure-card > summary::-webkit-details-marker {
  display: none;
}
.disclosure-card[open] > summary {
  color: var(--text-main);
  background: rgba(var(--brand-rgb), 0.06);
  border-bottom-color: rgba(var(--brand-rgb), 0.15);
}
.disclosure-card--sheet {
  border-radius: var(--radius-xl);
}
.disclosure-preview-line--sheet {
  margin-bottom: 10px;
  padding: 0 4px;
  font-weight: 600;
}
.run-sheet-block {
  margin-bottom: 4px;
}
.disclosure-card .hint,
.disclosure-card #checklist-container,
.disclosure-card .disclosure-actions {
  padding: 0 16px;
}
.disclosure-card .hint {
  padding-top: 12px;
}
.disclosure-actions {
  margin: 10px 0 6px;
}
.disclosure-card #checklist-container {
  padding-bottom: 16px;
  padding-top: 4px;
}
.disclosure-card--tight > summary {
  font-size: 0.88rem;
}
.disclosure-card--profile {
  margin-bottom: 4px;
  border-radius: var(--radius-lg);
}

.card--snapshot,
.card--calendar,
.card--quests {
  border-radius: var(--radius-xl);
}
.card--plan-studio {
  border-radius: var(--radius-lg);
}
.card--train-session {
  border-radius: var(--radius-xl);
  border-color: rgba(var(--brand-rgb), 0.18);
  box-shadow: var(--shadow-lift), 0 0 60px rgba(var(--brand-rgb), 0.06);
}
.train-secondary-panel {
  margin-top: 8px;
  padding-top: 8px;
}
.card--log {
  border-style: dashed;
  border-color: var(--card-log-border);
  background: var(--surface-scrim-muted);
  box-shadow: none;
}
.card--log:hover {
  border-color: rgba(var(--brand-rgb), 0.25);
}
.btn-cta--log {
  font-weight: 800;
}
.train-progress-chip {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}
.train-next-preview {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-dim);
  min-height: 2.75em;
}
.train-bottom-deck {
  margin-top: auto;
  padding-top: 16px;
  background: rgba(0, 0, 0, 0.12);
  margin-left: -18px;
  margin-right: -18px;
  margin-bottom: -20px;
  padding-left: 18px;
  padding-right: 18px;
  padding-bottom: 18px;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.checklist-item {
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.day-tile {
  border-radius: var(--radius-md);
  transition: transform 0.15s ease, border-color 0.2s ease, background 0.2s ease;
}
.day-tile:active {
  transform: scale(0.97);
}
.day-tile.today {
  box-shadow: 0 0 0 1px rgba(var(--brand-rgb), 0.35);
}
select:focus,
input:focus,
textarea:focus {
  border-color: rgba(var(--brand-rgb), 0.45);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.12);
}
.card--profile-muted {
  opacity: 0.92;
}
.progress-profile-body .card-title,
#progress-profile-body .card-title {
  letter-spacing: 0.06em;
  font-size: 0.72rem;
}

/* —— Plan / profile forms —— */
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}
@media (max-width: 640px) {
  .field-grid {
    grid-template-columns: 1fr;
  }
}
.field-span-2 {
  grid-column: span 2;
}
@media (max-width: 640px) {
  .field-span-2 {
    grid-column: span 1;
  }
}
.field-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-dim);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.plan-builder-shell {
  background: var(--bg-input);
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
}
.plan-builder-kicker {
  font-size: 0.8rem;
  font-weight: 900;
  margin-bottom: 10px;
}
.plan-builder-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.sync-toggle {
  font-size: 0.78rem;
  margin-top: 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.35;
  color: var(--text-dim);
}
.sync-toggle input {
  width: auto;
  margin-top: 3px;
}

.toggle-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}
.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
}
.toggle-row input {
  width: auto;
}

/* —— Library —— */
.library-toolbar {
  margin-bottom: 12px;
}
.library-search-placeholder {
  opacity: 0.65;
  margin-bottom: 8px;
}
.library-filter-placeholder {
  margin-top: 0;
}
.library-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.library-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  gap: 14px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.04) 0%, transparent 42%), var(--bg-input);
  font-size: 0.88rem;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.2);
  transition:
    transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    background 0.22s ease;
}
.library-card:hover {
  transform: translateY(-3px);
  border-color: rgba(var(--brand-rgb), 0.45);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(var(--brand-rgb), 0.15),
    0 0 36px rgba(var(--brand-rgb), 0.12);
}
.library-card:active {
  transform: translateY(-1px) scale(0.99);
}
body.theme-her .library-card:hover {
  border-color: rgba(211, 143, 174, 0.5);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(211, 143, 174, 0.18),
    0 0 36px rgba(207, 90, 132, 0.12);
}

/* —— Progression (session log + snapshots) —— */
.session-result-card .progress-quality-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.progress-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}
.progress-chip input {
  width: auto;
  margin: 0;
}
.progress-snapshot-host {
  font-size: 0.86rem;
}
.progress-snapshot-grid-inner {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 520px) {
  .progress-snapshot-grid-inner {
    grid-template-columns: repeat(4, 1fr);
  }
}
.progress-snapshot-item {
  background: var(--surface-scrim);
  border: 1px solid var(--divider-subtle);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.progress-snapshot-item .text-dim {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.progress-snapshot-item strong {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
}
.progress-snapshot-pb {
  margin-top: 14px;
  padding: 12px 14px;
  font-size: 0.82rem;
  line-height: 1.45;
  border-radius: var(--radius-md);
  background: rgba(167, 139, 250, 0.06);
  border: 1px solid rgba(167, 139, 250, 0.18);
}
.progress-profile-stats > div {
  padding: 14px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--divider-subtle);
  background: var(--surface-scrim-light);
}
.progress-profile-stats > div .text-dim {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.progress-profile-stats .progress-stat-num {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-strong);
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
.progress-recent-list,
.progress-pb-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.82rem;
}
.progress-recent-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--divider-subtle);
  background: var(--surface-scrim-light);
}
.progress-pb-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(167, 139, 250, 0.2);
  background: rgba(167, 139, 250, 0.06);
}
.progress-recent-date {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary-blue);
}
.progress-recent-main {
  font-size: 0.84rem;
  color: var(--text-dim);
  line-height: 1.35;
}
.progress-recent-xp {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--accent);
  margin-top: 2px;
}
.progress-pb-row strong {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-strong);
}
.progress-pb-row .text-dim {
  font-size: 0.78rem;
  line-height: 1.45;
}
textarea#prog-notes {
  width: 100%;
  resize: vertical;
  min-height: 56px;
}

.card--home-preset .home-preset-banner {
  margin-top: 6px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(var(--brand-rgb), 0.28);
  background: linear-gradient(135deg, rgba(var(--brand-rgb), 0.12), rgba(var(--accent-rgb), 0.06));
  box-shadow: var(--shadow-glow);
}
body.theme-her .card--home-preset .home-preset-banner {
  border-color: rgba(211, 143, 174, 0.35);
  background: linear-gradient(135deg, rgba(211, 143, 174, 0.14), rgba(207, 90, 132, 0.08));
}
.home-preset-body .section-lede a {
  color: var(--primary-blue);
}
.import-backup-label {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}
.plan-builder-actions--backup {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

/* --- Presets (custom workouts) --- */
.presets-root {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0 12px 24px;
  max-width: 720px;
  margin: 0 auto;
}
.card--presets-hero .preset-today-banner {
  margin-top: 10px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(var(--brand-rgb), 0.28);
  background: linear-gradient(135deg, rgba(var(--brand-rgb), 0.12), rgba(var(--accent-rgb), 0.06));
  box-shadow: var(--shadow-glow);
}
.preset-today-name {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.preset-today-meta {
  font-size: 0.82rem;
  margin-top: 4px;
}
.preset-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 560px) {
  .preset-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.preset-card {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--preset-card-bg);
}
.preset-card--default {
  border-color: rgba(var(--brand-rgb), 0.22);
}
.preset-card-kicker {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary-blue);
  margin-bottom: 6px;
}
.preset-card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}
.preset-card-cat {
  font-size: 0.78rem;
  margin-top: 4px;
}
.preset-card-stats {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 8px;
}
.preset-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.preset-weekday-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.preset-day-chip {
  font-size: 0.72rem;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.preset-builder-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.preset-ex-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}
.preset-ex-row {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--preset-ex-border);
  background: var(--preset-ex-bg);
}
.preset-ex-row-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.preset-ex-row-head .btn-header {
  padding: 4px 10px;
  font-size: 0.72rem;
}
body.theme-her .card--presets-hero .preset-today-banner {
  border-color: rgba(211, 143, 174, 0.35);
  background: linear-gradient(135deg, rgba(211, 143, 174, 0.14), rgba(207, 90, 132, 0.08));
}

/* --- Theme switcher (shared class names with marketing site) --- */
.jg-theme-switch {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  padding: 3px;
  gap: 2px;
  flex-shrink: 0;
}
.jg-theme-switch__btn {
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 7px 11px;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--font-display);
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.jg-theme-switch__btn[aria-pressed="true"] {
  background: rgba(var(--brand-rgb), 0.22);
  color: var(--text-main);
  box-shadow: 0 1px 10px rgba(var(--brand-rgb), 0.15);
}
html[data-theme="sunlit"] .jg-theme-switch__btn[aria-pressed="true"] {
  background: rgba(var(--brand-rgb), 0.2);
  color: var(--text-strong);
}

/* ========== Sunlit (light) appearance ========== */
html[data-theme="sunlit"] {
  color-scheme: light;
  --bg-darker: #ebe4d8;
  --bg-card: #faf7f0;
  --bg-input: #fffcf7;
  --accent: #0f766e;
  --accent-rgb: 15, 118, 110;
  --text-main: #1a2d3d;
  --text-dim: #3d556b;
  --border: rgba(120, 100, 70, 0.22);
  --primary-blue: #1b6fa8;
  --brand-rgb: 27, 111, 168;
  --danger: #b91c1c;
  --ring-track: rgba(27, 111, 168, 0.12);
  --ring-rest: #1b6fa8;
  --shadow-soft: 0 6px 26px rgba(26, 45, 61, 0.06);
  --shadow-lift: 0 16px 44px rgba(26, 45, 61, 0.1);
  --shadow-glow: 0 0 0 1px rgba(27, 111, 168, 0.1), 0 0 42px rgba(255, 210, 140, 0.28);

  --header-bg: rgba(255, 252, 247, 0.94);
  --surface-nav: rgba(255, 252, 247, 0.94);
  --surface-nav-link: rgba(27, 111, 168, 0.06);
  --surface-nav-link-hover: rgba(27, 111, 168, 0.1);
  --surface-nav-link-hover-border: rgba(27, 111, 168, 0.14);
  --text-on-primary: #ffffff;
  --text-strong: #0f1729;
  --input-text: #142433;
  --card-title-soft-color: rgba(15, 23, 41, 0.52);
  --app-title-color: #0f1729;
  --app-kicker-dim: rgba(30, 50, 65, 0.48);
  --divider-subtle: rgba(120, 100, 70, 0.14);
  --hero-stat-surface: rgba(255, 255, 255, 0.75);
  --hero-stat-border: rgba(120, 100, 70, 0.2);
  --progress-track-bg: #cdd9e4;
  --card-shine: rgba(255, 255, 255, 0.92);
  --checklist-item-hover-bg: #eef2f8;
  --cta-secondary-bg: rgba(27, 111, 168, 0.07);
  --cta-secondary-border: rgba(27, 111, 168, 0.18);
  --cta-secondary-active-bg: rgba(27, 111, 168, 0.12);
  --trench-bg: rgba(27, 60, 90, 0.08);
  --trench-border: rgba(27, 111, 168, 0.14);
  --trench-inset: rgba(15, 35, 55, 0.06);
  --modal-backdrop: rgba(15, 23, 41, 0.38);
  --modal-backdrop-glass: rgba(250, 247, 240, 0.82);
  --surface-scrim: rgba(255, 255, 255, 0.72);
  --surface-scrim-light: rgba(255, 255, 255, 0.55);
  --surface-scrim-muted: rgba(255, 252, 247, 0.92);
  --link-on-strong: var(--text-strong);
  --link-on-strong-underline: rgba(27, 111, 168, 0.42);
  --summary-shine: rgba(255, 220, 160, 0.2);
  --summary-border: rgba(120, 100, 70, 0.14);
  --card-log-border: rgba(27, 111, 168, 0.22);
  --diagram-canvas: #fffcf7;
  --preset-ex-bg: rgba(255, 255, 255, 0.65);
  --preset-ex-border: rgba(120, 100, 70, 0.16);
  --preset-card-bg: rgba(255, 255, 255, 0.55);
  --card-keyline: rgba(26, 45, 61, 0.06);

  --page-gradient:
    radial-gradient(130% 90% at 8% -8%, rgba(255, 220, 150, 0.55), transparent 52%),
    radial-gradient(95% 70% at 92% 5%, rgba(140, 200, 255, 0.35), transparent 48%),
    linear-gradient(180deg, #fbf7ef 0%, #f3efe6 42%, #ebe4d8 100%);
}

html[data-theme="sunlit"] body.theme-her {
  --bg-darker: #efe8ec;
  --bg-card: #fbf7f9;
  --bg-input: #fffafd;
  --accent: #b8456e;
  --accent-rgb: 184, 69, 110;
  --text-main: #2a1f28;
  --text-dim: #5c4654;
  --border: rgba(180, 120, 150, 0.28);
  --primary-blue: #a8557a;
  --brand-rgb: 168, 85, 122;
  --danger: #b91c1c;
  --ring-track: rgba(168, 85, 122, 0.12);
  --ring-rest: var(--primary-blue);
  --header-bg: rgba(255, 250, 252, 0.94);
  --surface-nav: rgba(255, 250, 252, 0.94);
  --surface-nav-link: rgba(168, 85, 122, 0.08);
  --surface-nav-link-hover: rgba(168, 85, 122, 0.13);
  --surface-nav-link-hover-border: rgba(168, 85, 122, 0.2);
  --text-strong: #231820;
  --input-text: #271c24;
  --card-title-soft-color: rgba(35, 24, 32, 0.52);
  --app-title-color: #231820;
  --app-kicker-dim: rgba(60, 40, 52, 0.48);
  --divider-subtle: rgba(170, 120, 145, 0.2);
  --hero-stat-surface: rgba(255, 255, 255, 0.78);
  --hero-stat-border: rgba(180, 120, 150, 0.22);
  --progress-track-bg: #e5d3dc;
  --card-shine: rgba(255, 255, 255, 0.9);
  --checklist-item-hover-bg: #f5eaef;
  --cta-secondary-bg: rgba(168, 85, 122, 0.08);
  --cta-secondary-border: rgba(168, 85, 122, 0.2);
  --cta-secondary-active-bg: rgba(168, 85, 122, 0.14);
  --trench-bg: rgba(168, 85, 122, 0.1);
  --trench-border: rgba(168, 85, 122, 0.18);
  --trench-inset: rgba(80, 40, 60, 0.06);
  --surface-scrim: rgba(255, 252, 254, 0.78);
  --surface-scrim-light: rgba(255, 250, 252, 0.6);
  --surface-scrim-muted: rgba(255, 252, 254, 0.9);
  --link-on-strong-underline: rgba(168, 85, 122, 0.45);
  --summary-shine: rgba(255, 200, 220, 0.35);
  --summary-border: rgba(170, 120, 145, 0.2);
  --preset-ex-bg: rgba(255, 255, 255, 0.7);
  --preset-ex-border: rgba(170, 120, 145, 0.18);
  --preset-card-bg: rgba(255, 255, 255, 0.58);
  --card-keyline: rgba(42, 31, 40, 0.07);
  --shadow-soft: 0 6px 26px rgba(42, 31, 40, 0.06);
  --shadow-lift: 0 16px 44px rgba(42, 31, 40, 0.09);
  --shadow-glow: 0 0 0 1px rgba(168, 85, 122, 0.12), 0 0 40px rgba(255, 200, 210, 0.35);

  --page-gradient:
    radial-gradient(125% 85% at 10% -5%, rgba(255, 210, 225, 0.55), transparent 50%),
    radial-gradient(90% 70% at 95% 0%, rgba(255, 228, 180, 0.4), transparent 50%),
    linear-gradient(180deg, #fcf8fa 0%, #efe8ec 100%);
}
