/* ═══════════════════════════════════════════════════════════
   HOME PAGE
═══════════════════════════════════════════════════════════ */
.home-hero {
  background: linear-gradient(135deg, var(--gold-900) 0%, #1E1A10 55%, var(--dark) 100%);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  animation: riseIn 0.45s var(--ease-precise) both;
}

.home-hero::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 150, 62, 0.16) 0%, transparent 70%);
}

.home-hero::after {
  content: '';
  position: absolute;
  bottom: -60px;
  left: -40px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(125, 90, 34, 0.18) 0%, transparent 65%);
}

.hero-greeting {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 4px;
}

.hero-name {
  font-family: var(--font-display);
  font-size: 38px;
  letter-spacing: 2px;
  line-height: 1;
  color: var(--text);
}

.hero-name span {
  color: var(--gold);
}

.hero-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.5;
}

/* Today Card — the one thing on Home that earns structural depth: it's the workout the user is about to do. */
.today-card {
  background: var(--card-raised);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-molten);
  animation: riseIn 0.45s var(--ease-precise) 0.06s both;
}

.today-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.today-title {
  font-family: var(--font-condensed);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 1px;
}

.today-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--gold-dim);
  color: var(--gold);
  border: 1px solid var(--gold-border);
}

.workout-preview {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.preview-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}

.preview-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
}

.preview-name {
  color: var(--text);
  font-weight: 500;
}

.today-rest-note {
  font-size: 13px;
  color: var(--muted);
  padding: 4px 0;
}

/* Conditioning card — sits alongside the run card, same visual weight. */
.conditioning-card {
  background: rgba(200, 150, 62, 0.05);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 10px;
}

.conditioning-card-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 4px;
}

.conditioning-card-desc {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}

/* Today's Session — compact stack (2+ shown programs, all but the hero) */
.today-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.today-stack-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color var(--transition), transform 0.1s;
}

.today-stack-row:hover {
  border-color: rgba(200, 150, 62, 0.3);
  transform: translateY(-1px);
}

.today-stack-row:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

.today-stack-row--active {
  border-color: var(--gold-border);
}

.today-stack-row--finished .today-stack-row-status,
.today-stack-row--done .today-stack-row-status {
  color: var(--green);
}

.today-stack-row-info {
  min-width: 0;
  flex: 1;
}

.today-stack-row-name {
  font-family: var(--font-condensed);
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-stack-row-status {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.today-stack-row-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.today-stack-row-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--gold-dim);
  color: var(--gold);
  border: 1px solid var(--gold-border);
  white-space: nowrap;
}

.today-stack-row-btn {
  font-family: var(--font-condensed);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gold-border);
  background: transparent;
  color: var(--gold);
  pointer-events: none; /* click handled by the row itself */
}

/* Today's Session — empty state (0 shown programs) */
.today-empty {
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  margin-bottom: 20px;
  text-align: center;
}

.today-empty-title {
  font-family: var(--font-condensed);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

.today-empty-sub {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 16px;
}

/* ═══════════════════════════════════════════════════════════
   PROGRAMS PAGE
═══════════════════════════════════════════════════════════ */
.prog-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: border-color var(--transition), transform 0.1s;
  position: relative;
  overflow: hidden;
}

.prog-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

.prog-card:hover {
  border-color: rgba(200, 150, 62, 0.3);
  transform: translateY(-1px);
}

.prog-card:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

/* The active program is the one card that earns structural depth — see the Earned Depth Rule in DESIGN.md. */
.prog-card:has(.tag-active) {
  background: var(--card-raised);
  border-color: var(--gold-border);
  box-shadow: var(--shadow-molten);
}

.prog-card--locked {
  opacity: 0.5;
  cursor: default;
}

.prog-card--locked:hover {
  transform: none;
  border-color: var(--border);
}

/* The primary program is the one card that earns structural depth — same rule as the old single-active-program treatment. */
.prog-card--primary {
  background: var(--card-raised);
  border-color: var(--gold-border);
  box-shadow: var(--shadow-molten);
}

.prog-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.prog-star {
  background: transparent;
  border: none;
  font-size: 18px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 2px;
  transition: color var(--transition), transform 0.1s;
}

.prog-star:hover {
  color: var(--gold);
  transform: scale(1.1);
}

.prog-star.active {
  color: var(--gold);
}

.prog-star:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-radius: var(--radius-sm);
}

.prog-card-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.prog-card-toggle-label {
  font-size: 13px;
  color: var(--muted);
}

.prog-empty-note {
  font-size: 13px;
  color: var(--muted);
  padding: 12px 0;
}

.prog-card-unlock-btn {
  width: 100%;
  margin-top: 10px;
  padding: 10px 0;
  font-size: 13px;
}

.prog-overview {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

.prog-overview h4 {
  font-family: var(--font-display);
  font-size: 19px;
  letter-spacing: 1px;
  color: var(--gold);
  margin: 20px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.prog-overview h4:first-child {
  margin-top: 0;
}

.prog-overview h5 {
  font-family: var(--font-condensed);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text);
  margin: 12px 0 4px;
}

.prog-overview p {
  margin-bottom: 8px;
}

.prog-overview ul {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
}

.prog-overview li {
  position: relative;
  margin-bottom: 6px;
  padding-left: 16px;
}

.prog-overview li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.6em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
}

.prog-overview strong {
  color: var(--text);
}

.prog-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
}

.prog-card-title {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 2px;
}

.prog-card-subtitle {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-condensed);
  letter-spacing: 1px;
  margin-top: 2px;
}

.prog-card-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 12px;
}

.prog-card-tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

.tag-active  { background: rgba(76,175,118,0.15); color: var(--green); border: 1px solid rgba(76,175,118,0.3); }
.tag-coming  { background: rgba(74,144,217,0.10); color: var(--blue);  border: 1px solid rgba(74,144,217,0.2); }
.tag-locked  { background: rgba(255,255,255,0.05); color: var(--muted); border: 1px solid var(--border); }

.prog-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.prog-meta-item {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.prog-meta-item span {
  color: var(--text);
  font-weight: 500;
}

/* Detail view */
.detail-view {
  display: none;
}

.detail-view.active {
  display: block;
}

.detail-back {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  margin-bottom: 16px;
  background: transparent;
  border: none;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--muted);
  transition: color var(--transition);
}

.detail-back:hover {
  color: var(--gold);
}

.detail-back:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-radius: var(--radius-sm);
}

.prog-hero {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  display: flex;
  gap: 16px;
  align-items: center;
}

.prog-hero-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.prog-hero-title {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 2px;
}

.prog-hero-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.prog-hero-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.prog-pill {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid var(--gold-border);
  color: var(--gold);
}

/* Week tabs */
.week-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.week-tab {
  font-family: var(--font-condensed);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  transition: all var(--transition);
  letter-spacing: 1px;
}

.week-tab.active {
  background: var(--gold-900);
  color: var(--gold);
  border-color: var(--gold-border);
}

.week-tab:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

/* Day cards — open state earns depth (it's the row the user is actively reading). */
.day-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  overflow: hidden;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.day-card.open {
  background: var(--card-raised);
  border-color: var(--gold-border);
  box-shadow: var(--shadow-molten);
}

.day-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  cursor: pointer;
  transition: background var(--transition);
}

.day-card-header:hover {
  background: rgba(255, 255, 255, 0.02);
}

.day-label-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.day-number {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--gold);
  min-width: 52px;
  line-height: 1;
}

.day-focus {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.chevron {
  width: 16px;
  height: 16px;
  color: var(--muted);
  transition: transform 0.2s;
  flex-shrink: 0;
  stroke-width: 2;
}

.day-card.open .chevron {
  transform: rotate(180deg);
}

.day-body {
  display: none;
  padding: 0 16px 14px;
  border-top: 1px solid var(--border);
}

.day-card.open .day-body {
  display: block;
}

/* Exercise table */
.ex-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.ex-table th {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  padding: 0 8px 8px 0;
  border-bottom: 1px solid var(--border);
}

.ex-table td {
  font-size: 13px;
  color: var(--text);
  padding: 8px 8px 8px 0;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.ex-table tr:last-child td {
  border-bottom: none;
}

.ex-name {
  font-weight: 500;
}

.ex-note {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.ex-load {
  font-size: 11px;
  color: var(--muted);
}

/* ═══════════════════════════════════════════════════════════
   LOG PAGE
═══════════════════════════════════════════════════════════ */
.log-entry {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 10px;
}

.log-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.log-entry-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.log-entry-date {
  font-size: 11px;
  color: var(--muted);
}

.log-entry-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.log-meta-item {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.log-meta-item span {
  color: var(--gold);
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════
   PROFILE PAGE
═══════════════════════════════════════════════════════════ */
.profile-header {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  display: flex;
  gap: 16px;
  align-items: center;
}

.profile-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}
.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--gold-dim);
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--gold);
  overflow: hidden;
  transition: all 0.15s;
}
.profile-avatar:hover,
.profile-avatar:focus-visible {
  box-shadow: var(--shadow-focus);
  border-color: var(--gold);
  opacity: 0.85;
  outline: none;
}
.profile-avatar-remove {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--red, #e05252);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s;
  z-index: 1;
}
.profile-avatar-remove:hover { background: #c43e3e; }

.profile-name {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: 2px;
}

.profile-level {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.profile-since {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

.settings-list {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
}

.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}

.settings-item:last-child {
  border-bottom: none;
}

.settings-item:hover {
  background: rgba(255, 255, 255, 0.02);
}

.settings-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.settings-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--gold-dim);
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-label {
  font-size: 14px;
  color: var(--text);
}

.settings-value {
  font-size: 13px;
  color: var(--muted);
}

/* ─── PROFILE EDIT FORM ─────────────────────────────────────────────────────── */
.prof-form {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.prof-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.prof-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.prof-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.prof-input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 9px 12px;
  outline: none;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.15s;
  -webkit-appearance: none;
}

.prof-input:focus {
  border-color: var(--gold);
  box-shadow: var(--shadow-focus);
}

.prof-input option { background: var(--card); }

/* Scoped override, not a global .prof-input change: any input under 16px
   triggers iOS Safari's auto-zoom-on-focus, which is especially disruptive
   inside the program-unlock bottom sheet (js/programs.js). */
#progUnlockVoucher { font-size: 16px; }

.prof-save-btn {
  background: var(--gold);
  color: var(--dark);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-condensed);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 12px;
  cursor: pointer;
  transition: opacity var(--transition), background var(--transition), transform 0.25s var(--ease-precise);
  margin-top: 4px;
  width: 100%;
}

.prof-save-btn:hover  { opacity: 0.85; transform: translateY(-4px); }
.prof-save-btn:active { opacity: 0.7;  }
.prof-save-btn:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

.prof-save-msg {
  text-align: center;
  font-size: 13px;
  color: #4CAF76;
  font-weight: 500;
  padding: 4px 0;
}

/* ─── DAILY QUOTE ────────────────────────────────────────────────────────────── */
.daily-quote-card {
  position: relative;
  margin-top: 16px;
  padding: 22px 20px 18px;
  background: radial-gradient(circle at 50% 0%, rgba(200, 150, 62, 0.06) 0%, var(--card) 70%);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-align: center;
  overflow: hidden;
  animation: riseIn 0.45s var(--ease-precise) 0.12s both;
}

.daily-quote-card::before {
  content: '\201C';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  font-family: Georgia, serif;
  font-size: 64px;
  line-height: 1;
  color: var(--gold-700);
  opacity: 0.5;
  pointer-events: none;
}

.quote-text {
  position: relative;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text);
  font-style: italic;
}

.quote-author {
  position: relative;
  font-size: 11px;
  color: var(--gold);
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-top: 8px;
}