/* Conservative Level-1 refactor generated from style_cleaned_final.css.
   Keeps existing selectors and visual design intact.
   Removes a few duplicate/conflicting rules and scopes generic image styling. */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --ui-gap: clamp(8px, 1.8vw, 14px);
  --card-pad: clamp(10px, 2vw, 16px);
  --set-label-w: clamp(52px, 10vw, 58px);
  --control-size: 32px;
  --nav-height: 52px;
  --page-top-gap: 18px;
}

html,
body {
  width: 100%;
  overflow-x: hidden;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
}

.workout-area,
#workoutScreen,
#currentWorkout,
.live-exercise-card,
.set,
.set-left,
.workout-actions,
.workout-name-wrap,
.nav,
.bottomNav {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

input,
textarea,
select {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

button,
.live-exercise-card,
.set,
.remove-exercise-btn,
.remove-set,
.exercise-move-btn,
.inline-rest-reset,
.clear-workout-name-btn {
  -webkit-touch-callout: none;
}

body {
  margin: 0;
  padding: 42px 0 0;
  font-family: Arial, sans-serif;
  color: #e5e7eb;
  display: flex;
  flex-direction: column;
  align-items: center;
  background:
    linear-gradient(rgba(2, 6, 23, 0.85), rgba(2, 6, 23, 0.95)),
    url("/gymphoto.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  padding: var(--nav-height) 0 80px;
}

a {
  color: #22c55e;
  text-decoration: none;
  font-weight: 500;
}

a:hover {
  text-decoration: underline;
}

h3 {
  color: #22c55e;
}

.app-container {
  width: min(100%, 1300px);
  margin: 0 auto;
}

.container {
  width: 100%;
  display: flex;
  gap: 20px;
  margin-top: 0px;
}

input,
select {
  width: 100%;
  margin: 5px 0;
  padding: 8px;
  color: white;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 6px;
}

input {
  font-size: 16px;
}

select {
  font-size: 16px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='20' viewBox='0 0 24 24' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
}

button {
  width: 100%;
  max-width: 100%;
  /* margin-top: 10px; */
  padding: 10px 15px;
  color: #022c22;
  background: #22c55e;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
}

button::not(#editDisplayNameBtn):not(#openSignInModalBtn):not(
    #signUpHeaderBtn
  ):not(#logoutBtn):hover:not(#authModalSwitchBtn):hover {
  background: #16a34a;
  transform: translateY(-1px);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.4);
}

button.exercise-move-btn {
  all: unset;
  box-sizing: border-box;

  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #f9fafb;

  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;

  cursor: pointer;

  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;

  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    opacity 0.18s ease;
}

button.remove-exercise-btn {
  box-sizing: border-box;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: auto;
  max-width: none;
  min-width: 0;
  margin: 0;
  padding: 10px 14px;

  border: 1px solid #ef4444;
  border-radius: 12px;
  background: transparent;
  color: #ef4444;

  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;

  cursor: pointer;

  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;

  box-shadow: none;
  transform: none;

  transition:
    background-color 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease;
}

#addWorkoutBtn {
  background: #3b82f6;
  color: white;
}

#clearDataBtn {
  background: #dc2626;
  color: white;
}

#addSetBtn {
  background: #2563eb;
  color: white;
}

#finishWorkout {
  background: #22c55e;
}

#resetWorkout {
  background: #444;
}

#unitToggle,
#progressDiv button {
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
  color: #9ca3af;
}

.workout-area,
.workout-display,
.hero,
.top-section,
.main-row,
.card,
.square,
#weeksContainer,
#progressPage,
#recentWorkouts,
.sessions-row,
#currentWorkout,
#lastWorkout,
#workoutSummary,
.live-exercise-card {
  min-width: 0;
}

.card,
.square,
.input-panel,
#historyContainer > *.card {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 12px;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.unit-toggle-btn {
  padding: 6px 10px;
  border-radius: 8px;

  font-size: 12px;
  font-weight: 700;

  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);

  color: #cbd5e1;

  transition: all 0.18s ease;
}

@media (hover: hover) {
  .unit-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.08);
  }
}

.unit-toggle-btn.active {
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.4);
}

.card {
  position: relative;
  z-index: 1;
  flex: 1 1 0;
  padding: 16px;
  transition: transform 0.2s ease;
}

.square,
.input-panel,
#historyContainer > *.card {
  padding: 16px;
}

.square {
  width: 100%;
  flex: 1;
}

.card:hover,
.square:hover,
.week:hover,
#historyContainer > *.card:hover {
  border-color: #22c55e;
  box-shadow: 0 0 15px rgba(34, 197, 94, 0.2);
}

#historyContainer > *.card,
#historyContainer > *.card:hover {
  transform: none;
}

.workoutInput,
.card .instructions,
.card,
.instructions {
  max-width: 100%;
  box-sizing: border-box;
}

.empty,
.placeholder {
  opacity: 0.6;
  font-style: italic;
  color: #6b7280;
}

.progress-info,
.workout-date,
.tip,
.tagline {
  font-size: 12px;
  opacity: 0.7;
}

.workout-date {
  margin: 12px 0 8px;
}

.tagline {
  opacity: 0.6;
}

.summary-suggestion {
  margin-top: 8px;
  font-weight: bold;
  opacity: 0.9;
}

.summary-item {
  margin-bottom: 16px;
}

.summary-item strong {
  display: block;
  margin-bottom: 8px;
  font-size: 16px;
}

.summary-item p {
  margin: 3px 0;
  padding-left: 12px;
  font-size: 13px;
  opacity: 0.85;
}

.summary-item:not(:last-child) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.summary-item p::before {
  content: "• ";
  opacity: 0.5;
}

.main-row {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 16px;
  width: 100%;
  /* padding-top: 4px; */
  margin-bottom: 24px;
  overflow: visible;
}

.main-row > .card {
  flex: 1 1 0;
  min-width: 0;
}

#weeksContainer {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 20px;
  margin-bottom: 10px;
}

#weeksContainer .card {
  flex: 1;
}

#weeksContainer .card > * {
  margin-bottom: 10px;
}

#lastWorkout strong {
  display: block;
  margin-top: 8px;
  color: #f3f4f6;
  font-weight: 700;
}

#lastWorkout li {
  font-size: 13px;
  opacity: 0.8;
}

.chart-container {
  position: relative;
  width: 100%;
  height: 350px;
  min-height: 350px;
  flex: 1;
  margin: 0 auto;
  margin-bottom: 18px;
}

#progressChart {
  width: 100% !important;
  height: 100% !important;
}

#chartPlaceholder,
.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #aaa;
  font-size: 14px;
}

#chartPlaceholder {
  position: absolute;
  inset: 0;
}

.empty-state {
  height: 100%;
}

#historyContainer {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 20px;
  overflow-x: auto;
}

#historyContainer > div {
  flex: 1 1 150px;
  min-width: 140px;
}

#progressPage {
  display: flex;
  flex-direction: column;
  gap: 24px !important;
  width: 100%;
  padding: var(--page-top-gap) 16px 80px;
}

#progressPage .square {
  width: 100%;
}

.sessions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
  scroll-padding-left: 10px;
  scroll-padding-right: 10px;
}

.sessions-row > div {
  box-sizing: border-box;
  flex: 1 1 180px;
  min-width: 180px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

.nav {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  width: 100%;
  box-sizing: border-box;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;

  backdrop-filter: blur(12px);
  padding: 12px 14px;
  background: #111;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-left {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
}

.nav-left h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1;
  white-space: nowrap;
}

.nav-left img {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}

.nav-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  min-width: 0;
}

.nav-side {
  display: flex;
  flex: 1;
  align-items: center;
}

.nav-side:first-child {
  justify-content: flex-start;
}

.nav-side:last-child {
  justify-content: flex-end;
}

.nav img {
  width: 32px;
  height: 32px;
  cursor: pointer;
  opacity: 0.8;
  filter: invert(1);
  transition: 0.2s;
}

.nav img:hover {
  opacity: 1;
}

.nav img.active {
  opacity: 1;
  transform: scale(1.1);
}

.right-img,
img.svg-right {
  transform: scaleX(-1);
}

img.svg-left:hover {
  transform: scaleX(-1);
  filter: invert(1);
  transition: -0.2;
}

#authControls button,
#logoutBtn {
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 8px;
  box-shadow: none;
  transform: none;
}

#signInBtn {
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #86efac;
}

#signUpBtn {
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #93c5fd;
}

#logoutBtn {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

@media (hover: hover) {
  #signInBtn:hover,
  #signUpBtn:hover,
  #logoutBtn:hover {
    box-shadow: none;
    transform: none;
    filter: brightness(1.05);
  }
}

#signInBtn:active,
#signInBtn:focus,
#signInBtn:focus-visible,
#signUpBtn:active,
#signUpBtn:focus,
#signUpBtn:focus-visible,
#logoutBtn:active,
#logoutBtn:focus,
#logoutBtn:focus-visible {
  outline: none;
  box-shadow: none;
  transform: none;
}

#authBarTop {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  flex: 0 0 auto;
}

#authStatusText {
  display: block;
  min-width: 40px;
  max-width: 72px;
  flex: 0 1 auto;

  font-size: 10px;
  font-weight: 600;
  line-height: 1.1;

  color: #cbd5e1;
  opacity: 0.88;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}

#openSignInModalBtn,
#editDisplayNameBtn,
#signUpHeaderBtn,
#logoutBtn {
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 6px 9px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  border-radius: 999px;
  box-shadow: none;
  transform: none;
  flex-shrink: 0;
}

#editDisplayNameBtn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #e5e7eb;
}

#openSignInModalBtn {
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #86efac;
}

#logoutBtn {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

#signUpHeaderBtn {
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #93c5fd;
}

#signInBtn,
#signUpBtn {
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 8px;
  box-shadow: none;
  transform: none;
}

#signInBtn {
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #86efac;
}

#signUpBtn {
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #93c5fd;
}

@media (max-width: 768px) {
  .nav {
    padding: 12px 14px 12px 16px;
    gap: 8px;
  }
  #authBarTop {
    gap: 5px;
  }

  #authStatusText {
    min-width: 48px;
    max-width: 96px;
    font-size: 10px;
  }

  #openSignInModalBtn,
  #editDisplayNameBtn,
  #signUpHeaderBtn,
  #logoutBtn {
    padding: 5px 8px;
    font-size: 9px;
  }
}

#openSignInModalBtn:hover,
#editDisplayNameBtn:hover,
#signUpHeaderBtn:hover,
#logoutBtn:hover,
#openSignInModalBtn:active,
#editDisplayNameBtn:active,
#signUpHeaderBtn:active,
#logoutBtn:active,
#openSignInModalBtn:focus,
#editDisplayNameBtn:focus,
#signUpHeaderBtn:focus,
#logoutBtn:focus,
#openSignInModalBtn:focus-visible,
#editDisplayNameBtn:focus-visible,
#signUpHeaderBtn:focus-visible,
#logoutBtn:focus-visible {
  box-shadow: none;
  transform: none;
  outline: none;
}

.hidden {
  display: none;
  opacity: 0;
  pointer-events: none;
}

.page {
  transition: opacity 0.3s ease;
}

#workoutPage {
  display: flex;
  flex-direction: column;
}

.section-start-cta,
.section-recent,
.section-workspace,
.section-weeks {
  width: 100%;
}

#recentWorkouts {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  margin-bottom: 10px;
  padding: 10px;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scroll-padding-left: 10px;
  scroll-padding-right: 10px;
}

#recentWorkouts .card {
  box-sizing: border-box;
  flex: 0 0 calc(50% - 6px);
  min-width: calc(50% - 6px);
  max-width: calc(50% - 6px);
  padding: 14px;
  scroll-snap-align: start;
}

#recentWorkouts .card h4 {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.2;
  color: #f3f4f6;
  opacity: 1;
}

#recentWorkouts::after,
#recentWorkouts::before {
  content: "";
  position: absolute;
  top: 0;
  height: 100%;
  pointer-events: none;
}

#recentWorkouts .card .workout-date {
  margin-bottom: 8px;
  font-size: 12px;
  line-height: 1.3;
  color: #cbd5e1;
  opacity: 0.72;
}

#recentWorkouts .card strong {
  display: block;
  margin-top: 10px;
  margin-bottom: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  color: #d1d5db;
}

#recentWorkouts .card ul {
  margin: 0 0 8px;
  padding-left: 18px;
}

#recentWorkouts .card li {
  margin-bottom: 2px;
  font-size: 12px;
  line-height: 1.3;
  opacity: 0.82;
}

#recentWorkouts .card .card-actions {
  margin-bottom: 10px;
}

#recentWorkouts .card .card-actions button {
  padding: 6px 10px;
  font-size: 11px;
}

.recent-header h3 {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 700;
  color: #f3f4f6;
}

.recent-header .ui-hint {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
  opacity: 0.72;
}

#recentWorkouts .card strong:first-of-type {
  margin-top: 0;
}

#recentWorkouts .card .workout-date:last-of-type {
  color: #86efac;
  font-weight: 600;
}

#recentWorkouts::after {
  right: 0;
  width: 40px;
  /* background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 1)
  ); */
}

#recentWorkouts::before {
  left: 0;
  width: 20px;
  /* background: linear-gradient(
    to left,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 1)
  ); */
}

.recent-wrapper,
.recent-wrappers {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
}

.recent-header {
  display: flex;
  flex-direction: column;
  padding: 0 10px;
  margin-top: 10px;
}

#recentWorkouts .card h3,
#recentWorkouts .card ul {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
}

#recentWorkouts .card h3 {
  -webkit-line-clamp: 2;
}

#recentWorkouts .card ul {
  -webkit-line-clamp: 4;
}

.scroll-dots {
  position: relative;
  z-index: 5;
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
}

.scroll-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #999;
  opacity: 0.6;
  transition: all 0.3s ease;
}

.scroll-dots span.active {
  background: #000;
  opacity: 1;
  transform: scale(1.2);
}

#recentDots {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
}

.picker-section {
  margin-bottom: 14px;
}

.picker-label {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0.8;
}

.category-buttons,
.exercise-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-btn,
.exercise-btn {
  width: auto;
  min-width: 0;
  margin-top: 0;
  padding: 10px 14px;
  color: #f9fafb;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 999px;
  box-sizing: border-box;
  font-size: 13px;
  font-weight: 600;
}

.category-btn:hover,
.exercise-btn:hover {
  background: #273449;
  box-shadow: none;
  transform: none;
}

.category-btn.active,
.exercise-btn.active {
  color: #052e16;
  background: #22c55e;
  border-color: #22c55e;
}

.selected-exercise-display {
  margin: 8px 0 12px;
  min-height: 28px;
}

.selected-exercise-badge {
  display: inline-block;
  padding: 8px 12px;
  color: #22c55e;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.4);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

#workoutHeader {
  margin-bottom: 12px;
}

#workoutNameInput {
  width: 100%;
  padding: 10px 12px;
  color: #f9fafb;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 8px;
  box-sizing: border-box;
  font-size: 18px;
  font-weight: 700;
}

#workoutNameInput:focus {
  outline: none;
  border-color: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.15);
}

.live-exercise-card {
  margin-bottom: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
}

.live-exercise-header,
.live-exercise-footer {
  display: flex;
  gap: var(--ui-gap);
}

.live-exercise-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--ui-gap);
  margin-bottom: 10px;
}

.live-exercise-footer {
  margin-top: 10px;
  justify-content: flex-end;
}

.mini-add-set-btn,
.remove-exercise-btn {
  width: auto;
  margin-top: 0;
  padding: 8px 12px;
  font-size: 12px;
  box-sizing: border-box;
}

button.mini-add-set-btn {
  background: transparent;
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.45);

  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;

  border-radius: 10px;

  cursor: pointer;

  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.12s ease;
}

@media (hover: hover) {
  button.mini-add-set-btn:hover {
    background: rgba(31, 41, 55, 0.95);
    border-color: rgba(34, 197, 94, 0.6);
    color: #22c55e;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.35);
  }
}

.remove-exercise-btn {
  background: transparent;
  color: #ef4444;
  border: 1px solid #ef4444;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease;
}

.remove-exercise-btn:active {
  transform: scale(0.98);
}

@media (hover: hover) {
  .remove-exercise-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border-color: #f87171;
  }
}

.remove-set-disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

.remove-set-disabled:hover {
  background: transparent;
}

.complete-set-btn {
  color: #9ca3af;
  background: transparent;
  border: 1px solid #374151;
  font-weight: 700;
  flex-shrink: 0;
}

.complete-set-btn:hover {
  transform: none;
  box-shadow: none;
  background: #1f2937;
}

.complete-set-btn.active {
  color: #052e16;
  background: #22c55e;
  border-color: #22c55e;
}

.timer-card {
  margin: 16px 0 14px;
  padding: 18px;
  text-align: center;
  background: #111;
  border-radius: 14px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.timer-header {
  margin-bottom: 8px;
  font-size: 14px;
  opacity: 0.6;
}

.timer-display {
  margin-bottom: 12px;
  font-size: 42px;
  font-weight: bold;
  letter-spacing: 1px;
}

.timer-select {
  width: 100%;
  margin-bottom: 12px;
  padding: 10px;
  color: white;
  background: #1a1a1a;
  border: none;
  border-radius: 8px;
  font-size: 14px;
}

.timer-buttons {
  display: flex;
  gap: 10px;
}

.timer-start,
.timer-reset {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 10px;
  color: white;
  font-size: 15px;
  cursor: pointer;
}

.timer-start {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  font-weight: bold;
}

.timer-reset {
  background: #333;
}

.timer-start:active,
.timer-reset:active {
  transform: scale(0.97);
}

.workout-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.rest-settings {
  margin: 10px 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.rest-settings-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rest-settings-label {
  font-size: 13px;
  font-weight: 600;
  color: #e5e7eb;
  opacity: 0.85;
  white-space: nowrap;
}

.rest-duration-select {
  width: auto;
  min-width: 84px;
  margin: 0;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #374151;
  background: #1f2937;
  color: #f9fafb;
  font-size: 13px;
  font-weight: 600;
}

.rest-settings-hint {
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 1.35;
  color: #9ca3af;
  opacity: 0.75;
}

.workout-total-volume {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  color: #86efac;
}

.exercise-volume {
  font-size: 12px;
  opacity: 0.75;
  margin-bottom: 6px;
}

.next-weight-suggestion {
  font-size: 12px;
  font-weight: 600;
  color: #facc15;
  margin-bottom: 6px;
}

.weekly-volume-label {
  font-size: 12px;
  opacity: 0.7;
  margin-bottom: 6px;
}

.muscle-breakdown {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.05),
    rgba(255, 255, 255, 0.025)
  );
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.muscle-breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  padding: 6px 0;
}

.muscle-breakdown-row:not(:last-child) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.muscle-breakdown-group {
  color: #d1d5db;
  opacity: 0.88;
  font-weight: 500;
}

.muscle-breakdown-volume {
  color: #86efac;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.weekly-volume-label {
  font-size: 12px;
  opacity: 0.78;
  margin-bottom: 8px;
  color: #cbd5e1;
}

.muscle-breakdown-row:first-child .muscle-breakdown-group,
.muscle-breakdown-row:first-child .muscle-breakdown-volume {
  color: #bbf7d0;
}

.collapsible-header {
  width: 100%;
  margin: 0 0 10px;
  padding: 4px 0 6px;

  background: transparent;
  border: none;

  display: flex;
  align-items: center;
  justify-content: space-between;

  font-size: 22px;
  font-weight: 800;

  letter-spacing: 0.01em;

  color: #22c55e;

  text-align: left;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 8px;
}

.collapsible-header:hover {
  background: transparent;
  box-shadow: none;
  transform: none;
}

.collapsible-icon {
  font-size: 14px;
  opacity: 0.7;
  position: absolute;
  right: 12px;
}

.start-workout-btn {
  width: auto;
  min-width: 180px;
  margin: 0;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
}

.card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 8px;
}

.card-actions button {
  width: auto;
  margin-top: 0;
  padding: 6px 10px;
  font-size: 11px;
  border-radius: 8px;
}

.delete-workout-btn {
  background: transparent;
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.35);
}

.delete-workout-btn:hover {
  background: rgba(248, 113, 113, 0.12);
  color: #fca5a5;
  box-shadow: none;
  transform: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(10px);
  background: rgba(17, 24, 39, 0.96);
  color: #f9fafb;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  z-index: 10000;
  font-size: 13px;
  font-weight: 600;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.onboarding-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 10001;
}

.onboarding-card {
  width: 100%;
  max-width: 420px;
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.onboarding-card h3 {
  margin-top: 0;
  margin-bottom: 14px;
}

.onboarding-card p {
  margin: 0 0 10px;
  color: #d1d5db;
  line-height: 1.5;
  font-size: 14px;
}

#closeOnboardingBtn {
  margin-top: 8px;
}

.ui-hint {
  font-size: 11px;
  color: #9ca3af;
  opacity: 0.75;
  margin: 6px 0 10px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
}

.modal-content {
  position: relative;
  width: 90%;
  max-width: 500px;
  padding: 20px;
  background: #111;
  border-radius: 12px;
}

.close-modal,
.close-btn {
  color: #888;
  background: none;
  border: none;
  cursor: pointer;
}

.close-btn {
  margin-top: 10px;
}

.close-btn:hover {
  color: #cccccc;
}

.close-modal {
  top: 10px;
  right: 10px;
  justify-content: right;
  font-size: 18px;
  color: white;
}

.paywall-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.75);
}

.paywall-container {
  width: 90%;
  max-width: 420px;
  padding: 28px;
  color: white;
  text-align: center;
  background: #111;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  animation: fadeIn 0.25s ease;
}

.paywall-header .icon {
  margin-bottom: 10px;
  font-size: 40px;
}

.paywall-features {
  margin: 20px 0;
}

.feature {
  margin: 8px 0;
  color: #ddd;
  font-size: 14px;
}

.pricing-options {
  display: flex;
  gap: 10px;
  margin: 20px 0;
}

.plan-card {
  position: relative;
  flex: 1;
  padding: 14px;
  background: #1a1a1a;
  border: 2px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.plan-card:hover {
  border-color: #555;
}

.plan-card.selected {
  background: #162d1f;
  border-color: #22c55e;
}

.plan-card h3 {
  margin-bottom: 6px;
}

.plan-card .price,
.price {
  font-size: 18px;
  font-weight: bold;
}

.plan-card .price span,
.price span {
  font-size: 12px;
  color: #aaa;
  opacity: 0.6;
}

.badge {
  position: absolute;
  top: -8px;
  right: -8px;
  display: inline-block;
  margin-bottom: 4px;
  padding: 2px 6px;
  color: black;
  background: #22c55e;
  border-radius: 6px;
  font-size: 10px;
}

.save {
  color: #22c55e;
  font-size: 12px;
}

.upgrade-btn {
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  color: black;
  background: #22c55e;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
}

.upgrade-btn:hover {
  background: #16a34a;
}

.trust {
  margin-top: 12px;
  color: #666;
  font-size: 12px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* =========================
   FINAL SET ROW LAYOUT
========================= */

.set-item {
  margin-bottom: 10px;
}

.set-item .set {
  margin-bottom: 0;
}

.set-item.has-feedback .set {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.set {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  align-items: center;
  column-gap: 8px;
  min-width: 0;
  margin-bottom: 8px;
  padding: 10px 12px;
  background: #1a1f2b;
  border-radius: 10px;
  transition:
    transform 0.15s ease,
    background 0.15s ease;
  background: rgba(26, 31, 43, 0.85);
}

.set:hover {
  transform: translateY(-1px);
  background: #202638;
}

.set.completed {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.set.completed .label,
.set.completed label,
.set.completed .unit {
  opacity: 0.85;
}

.set.completed input {
  border-color: rgba(34, 197, 94, 0.35);
}

.set-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.set-left .label {
  min-width: 48px;
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
  opacity: 0.9;
}

.input-group {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  flex-shrink: 0;
}

.input-group label {
  min-width: 32px;
  white-space: nowrap;
  font-size: 11px;
  color: #888;
  opacity: 0.7;
  flex-shrink: 0;
}

.unit {
  min-width: 18px;
  white-space: nowrap;
  font-size: 11px;
  color: #888;
  opacity: 0.7;
  flex-shrink: 0;
}

.complete-set-btn,
.remove-set {
  width: var(--control-size);
  height: var(--control-size);
  min-width: var(--control-size);
  padding: 0;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.weightInput,
.repInput {
  padding: 4px 6px;
  text-align: center;
  line-height: 1.2;
}

.weightInput {
  width: 72px;
  min-width: 72px;
  max-width: 72px;
}

.repInput {
  width: 52px;
  min-width: 52px;
  max-width: 52px;
}

.remove-set {
  grid-column: 2;
  margin: 0 0 0 4px;
  position: relative;
  z-index: 1;
  line-height: 1;
  font-size: 15px;
}

.set-feedback-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 0 44px;
  padding: 8px 10px;
  border-radius: 0 0 10px 10px;
  background: rgba(22, 163, 74, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
  border-top: none;
  width: fit-content;
  max-width: calc(100% - 44px);
}

.set-pr-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(249, 115, 22, 0.14);
  border: 1px solid rgba(249, 115, 22, 0.35);
  color: #fb923c;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.inline-rest-timer-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.inline-rest-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #86efac;
  opacity: 0.9;
}

.inline-rest-value {
  font-size: 16px;
  font-weight: 700;
  color: #f9fafb;
  min-width: 44px;
  text-align: right;
}

.inline-rest-reset {
  width: auto;
  margin-top: 0;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #f9fafb;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.inline-rest-reset:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: none;
  box-shadow: none;
}

@media (min-width: 1024px) {
  .main-row {
    flex-direction: row;
  }

  .main-row > .card {
    flex: 1 1 0;
  }

  .sessions-row {
    flex-wrap: wrap;
    overflow: visible;
  }

  .sessions-row > div {
    flex: 1 1 220px;
    min-width: 220px;
    max-width: none;
  }

  #recentWorkouts .card {
    flex: 0 0 220px;
    min-width: 220px;
    max-width: 220px;
  }
}

@media (min-width: 769px) {
  .sessions-row + .scroll-dots {
    display: none;
  }

  .set-left {
    gap: 7px;
  }

  .input-group {
    gap: 3px;
  }

  .input-group label {
    min-width: 30px;
  }

  .unit {
    min-width: 16px;
  }

  .weightInput {
    width: 68px;
    min-width: 68px;
    max-width: 68px;
  }

  .repInput {
    width: 50px;
    min-width: 50px;
    max-width: 50px;
  }
}

@media (max-width: 1023px) {
  .sessions-row {
    position: relative;
    z-index: 1;
    flex-wrap: nowrap;
    flex-direction: row;
    align-items: stretch;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    padding: 10px;
    margin-bottom: 10px;
  }

  .sessions-row > div,
  #recentWorkouts .card {
    flex: 0 0 calc(50% - 6px);
    min-width: calc(50% - 6px);
    max-width: calc(50% - 6px);
    scroll-snap-align: start;
  }
}

@media (max-width: 768px) {
  .section-start-cta {
    order: 1;
  }
}

.section-workspace {
  order: 2;
}
.section-recent {
  order: 3;
}
.section-weeks {
  order: 4;
}

.main-row {
  flex-direction: column;
  align-items: stretch;
}

.main-row > .card,
#weeksContainer .card,
#progressPage .square,
.card,
.live-exercise-card {
  width: 100% !important;
  flex: 0 0 auto;
  min-width: 0 !important;
}

#weeksContainer {
  flex-direction: column !important;
  align-items: stretch;
}

.nav {
  padding: 10px;
}

.nav-center h1 {
  font-size: 18px;
}

.nav img {
  width: 20px;
  height: 20px;
}

.sessions-row > div,
#historyContainer > div,
#recentWorkouts .card {
  min-width: 0;
}

.live-exercise-header {
  align-items: flex-start;
}

.category-buttons,
.exercise-buttons {
  gap: 6px;
}

.category-btn,
.exercise-btn {
  padding: 9px 12px;
  font-size: 12px;
}

.start-workout-btn {
  width: 100%;
}

.set {
  grid-template-columns: minmax(0, 1fr) 30px;
}

.weightInput {
  width: 64px;
  min-width: 64px;
  max-width: 64px;
}

.repInput {
  width: 48px;
  min-width: 48px;
  max-width: 48px;
}

.remove-set {
  width: 30px;
  height: 30px;
  min-width: 30px;
}

@media (max-width: 600px) {
  .app-container,
  .hero,
  .top-section,
  .main-row,
  .card,
  .square {
    width: 100%;
    max-width: 100%;
  }

  #recentWorkouts {
    gap: 8px;
    padding: 8px;
    margin-bottom: 4px;
  }

  #recentDots {
    width: 100%;
    max-width: 100vw;
    margin-top: 8px;
    left: 0;
    transform: none;
  }

  .rest-settings-top {
    gap: 8px;
  }

  .rest-settings-label {
    font-size: 12px;
  }

  .rest-duration-select {
    min-width: 76px;
    font-size: 12px;
  }

  .set-feedback-row {
    margin-left: 36px;
    gap: 8px;
    padding: 7px 8px;
    max-width: calc(100% - 36px);
  }

  .set-pr-badge {
    font-size: 10px;
    padding: 3px 6px;
  }

  .inline-rest-timer-inline {
    gap: 6px;
  }

  .inline-rest-value {
    font-size: 14px;
    min-width: 38px;
  }

  .inline-rest-reset {
    padding: 5px 8px;
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  :root {
    --ui-gap: 8px;
    --card-pad: 10px;
    --set-label-w: 52px;
    --control-size: 30px;
  }

  .set {
    padding: 8px 10px;
  }

  .set-left {
    gap: 6px;
  }

  .input-group {
    gap: 3px;
  }

  .input-group label,
  .unit {
    font-size: 10px;
  }

  #recentWorkouts .card {
    flex: 0 0 78%;
    min-width: 78%;
    max-width: 78%;
  }

  .sessions-row > div {
    flex: 0 0 84%;
    min-width: 84%;
    max-width: 84%;
  }
}

.sessions-row > div strong:first-of-type {
  display: block;
  margin-bottom: 4px;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.2;
  color: #f3f4f6;
}

.sessions-row > div .workout-date:last-of-type {
  color: #86efac;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 12px;
  opacity: 0.72;
  line-height: 1.25;
}
.sessions-row > div strong:not(:first-of-type) {
  color: #cbd5e1;
  font-weight: 600;
  line-height: 1.2;
  display: block;
  margin-top: 10px;
  margin-bottom: 4px;
  font-size: 0.9rem;
}

.sessions-row > div ul {
  margin: 0 0 8px;
  padding-left: 18px;
}

.sessions-row > div li {
  margin-bottom: 2px;
  font-size: 12px;
  line-height: 1.3;
  opacity: 0.82;
}

.sessions-row > div strong:first-of-type {
  margin-bottom: 6px;
}

.sessions-row > div ul + strong {
  margin-top: 12px;
}

.sessions-row > div .card-actions {
  margin-bottom: 6px;
}

.sessions-row > div .workout-date + .workout-date {
  margin-top: -2px;
  margin-bottom: 8px;
}

.sessions-row > div {
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  padding: 12px;
  background: rgba(10, 18, 35, 0.35);
}

.sessions-row > div li {
  opacity: 0.78;
}

@media (max-width: 480px) {
  .sessions-row > div {
    padding: 10px;
  }

  .sessions-row > div strong:first-of-type {
    font-size: 0.95rem;
  }

  .sessions-row > div strong {
    font-size: 0.86rem;
  }

  .sessions-row > div li {
    font-size: 11.5px;
    line-height: 1.28;
  }
}

button.remove-set {
  box-sizing: border-box;

  grid-column: 2;
  margin: 0 0 0 4px;
  position: relative;
  z-index: 1;
  line-height: 1;

  width: var(--control-size);
  height: var(--control-size);
  min-width: var(--control-size);
  min-height: var(--control-size);

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 0;

  border-radius: 999px;
  border: 1px solid rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;

  font-size: 15px;
  font-weight: 700;
  text-align: center;

  cursor: pointer;

  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;

  box-shadow: none;
  transform: none;

  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    opacity 0.18s ease;
}

@media (hover: hover) {
  button.remove-set:hover:not(.remove-set-disabled) {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.6);
    color: #fca5a5;
    box-shadow: none;
    transform: none;
  }
}

button.remove-set:active,
button.remove-set:focus,
button.remove-set:focus-visible {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.45);
  color: #f87171;
  outline: none;
  box-shadow: none;
  transform: none;
}

.start-workout-btn {
  font-size: 16px;
  letter-spacing: 0.6px;
  box-shadow: 0 6px 18px rgba(34, 197, 94, 0.25);
}

.recent-header h3 {
  font-size: 18px;
  font-weight: 700;
}

.ui-hint {
  opacity: 0.55;
}

.card h2 {
  margin-bottom: 14px;
}

.live-exercise-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--ui-gap);
  margin-bottom: 10px;
}

.live-exercise-header h4 {
  flex: 1 1 220px;
  min-width: 0;
  margin: 0;
}

.exercise-header-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
  flex: 0 0 auto;
}

@media (max-width: 480px) {
  .exercise-header-controls {
    width: 100%;
    justify-content: flex-end;
  }
}

.collapsible-header {
  font-size: 20px;
}

.week-card h3 {
  font-size: 18px;
}

.weekly-volume-label {
  opacity: 0.6;
}

.set.completed {
  transition: all 0.15s ease;
  background: rgba(22, 163, 74, 0.22);
  border: 1px solid rgba(34, 197, 94, 0.55);
}

.bottomNav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px 20px;
  background: #111;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 1000;
  gap: 36px;
}

.nav-side,
.nav-center {
  background: none;
  border: none;
  color: white;
  font-size: 1.4rem;
  cursor: pointer;
}

.bottomNav .nav-side,
.bottomNav .nav-center {
  flex: 0 0 auto;
}

.nav img,
.bottomNav img {
  width: 28px;
  height: 28px;
  opacity: 0.8;
  filter: invert(1);
  transition: all 0.2s ease;
  color: white;
}

#workoutPage {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 8px 16px 80px;
}

.heroCard,
.sectionCard {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.heroCard {
  padding: 16px 18px;
}

.heroCard h1 {
  margin: 0 0 8px;
  font-size: 1.8rem;
}

.heroCard p {
  margin: 0 0 12px;
  opacity: 0.8;
  line-height: 1.4;
}

.section-start-cta {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 26px 22px;
  margin: 0 0 8px;
  border-radius: 24px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.08),
    rgba(255, 255, 255, 0.03)
  );
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hero-label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  opacity: 0.6;
}

.section-start-cta h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.05;
}

.section-start-cta p {
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.8;
  line-height: 1.4;
}

.start-workout-btn.primary {
  width: 100%;
  height: 54px;
  border-radius: 16px;
  font-size: 1rem;
  font-weight: 700;
}

.home-card {
  border-radius: 22px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.06),
    rgba(255, 255, 255, 0.02)
  );
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px);
}

.section-recent {
  /* margin: 14px 0; */
  padding: 18px;
  margin-bottom: 4px;
}

.recent-header {
  margin-bottom: 14px;
}

.recent-header h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 700;
}

.recent-header .ui-hint {
  margin: 0;
  opacity: 0.75;
  line-height: 1.4;
}

.main-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 768px) {
  .main-row {
    grid-template-columns: 1fr 1fr;
  }
}

.collapsible-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 18px;
  background: transparent;
  border: none;
  font: inherit;
}

.collapsible-header span:first-child {
  font-size: 1rem;
  font-weight: 700;
}

.collapsible-icon {
  transition: transform 0.2s ease;
}

#lastWorkoutContent,
#workoutSummaryContent {
  padding: 0 18px 18px;
}

#lastWorkout strong:first-of-type {
  display: block;
  margin-bottom: 6px;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.2;
  color: #f3f4f6;
}

#lastWorkout .workout-date {
  margin-bottom: 8px;
  font-size: 12px;
  line-height: 1.3;
  color: #cbd5e1;
  opacity: 0.72;
}

#lastWorkout strong:not(:first-of-type) {
  display: block;
  margin-top: 10px;
  margin-bottom: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  color: #d1d5db;
}

#lastWorkout ul {
  margin: 0 0 8px;
  padding-left: 18px;
}

#lastWorkout li {
  margin-bottom: 2px;
  font-size: 12px;
  line-height: 1.3;
  opacity: 0.82;
}

.quick-stats-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0px 24px;
}

h4 {
  margin: 0;
  margin-bottom: 6px;
}

.quick-stat-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-height: 92px;
  padding: 16px 14px;
  border-radius: 18px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.07),
    rgba(255, 255, 255, 0.03)
  );
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.quick-stat-value {
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1;
  color: #ffffff;
}

.quick-stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  opacity: 0.72;
}

@media (max-width: 640px) {
  .quick-stats-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .quick-stat-card {
    min-height: 80px;
  }
}

.section-start-cta .start-workout-btn.primary {
  width: 100%;
  min-height: 54px;
  padding: 0 24px;
  border-radius: 16px;
  font-size: 1rem;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  color: #ffffff;
  box-shadow:
    0 10px 24px rgba(37, 99, 235, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    filter 0.18s ease;
}

.section-start-cta .start-workout-btn.primary:hover {
  transform: translateY(-1px);
  box-shadow:
    0 14px 28px rgba(37, 99, 235, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  filter: brightness(1.03);
}

.section-start-cta .start-workout-btn.primary:active {
  transform: translateY(0);
}

@media (min-width: 768px) {
  .section-start-cta .start-workout-btn.primary {
    width: auto;
    min-width: 220px;
    max-width: 320px;
    align-self: flex-start;
  }
}

.footer-nav-icon {
  opacity: 0.35;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    filter 0.18s ease;
}

.footer-nav-icon.active-nav-icon {
  opacity: 1;
  transform: scale(1.08);
}

@media (hover: hover) {
  .footer-nav-icon:hover {
    transform: scale(1.12);
    opacity: 0.75;
  }
}

#workoutScreen.card {
  margin: var(--page-top-gap);
}

@media (min-width: 900px) {
  #workoutScreen {
    max-width: 760px;
    margin: 0 auto;
  }
}

.workout-name-wrap {
  position: relative;
  width: 100%;
}

#workoutNameInput {
  width: 100%;
  box-sizing: border-box;
  padding-right: 42px;
}

.clear-workout-name-btn {
  position: absolute;
  top: calc(50% - 12px);
  right: 10px;
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  margin: 0;
  padding: 0;
  border: 1px solid #ef4444;
  border-radius: 50%;
  background: #1f2937;
  color: #ef4444;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  transition:
    opacity 0.18s ease,
    background-color 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.hidden-clear-btn {
  opacity: 0;
  pointer-events: none;
}

.exercise-header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.exercise-move-btn {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #f9fafb;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    opacity 0.18s ease,
    transform 0.18s ease;
}

.exercise-move-btn-disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

@media (hover: hover) {
  .exercise-move-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
  }
}

.exercise-move-btn:active:not(:disabled) {
  transform: scale(0.96);
}

@media (max-width: 640px) {
  .set {
    display: grid;
    grid-template-columns: 32px 54px minmax(78px, 1fr) minmax(52px, 0.8fr) 28px;
    grid-template-rows: auto auto;
    grid-template-areas:
      ". . weight-label reps-label ."
      "check set weight-row reps-row remove";
    column-gap: 8px;
    row-gap: 4px;
    align-items: center;
  }

  .set-left {
    display: contents;
  }

  .complete-set-btn {
    grid-area: check;
    align-self: center;
    justify-self: center;
    margin: 0;
  }

  .label {
    grid-area: set;
    align-self: center;
    justify-self: start;
    white-space: nowrap;
    margin: 0;
  }

  .set-inputs-cluster {
    display: contents;
  }

  .weight-group {
    display: contents;
  }

  .reps-group {
    display: contents;
  }

  .weight-group label {
    grid-area: weight-label;
    align-self: end;
    justify-self: start;
    font-size: 0.72rem;
    opacity: 0.75;
    margin: 0;
    line-height: 1.1;
  }

  .reps-group label {
    grid-area: reps-label;
    align-self: end;
    justify-self: start;
    font-size: 0.72rem;
    opacity: 0.75;
    margin: 0;
    line-height: 1.1;
  }

  .weight-group .weightInput {
    grid-area: weight-row;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    align-self: center;
  }

  .weight-group .unit {
    grid-area: weight-row;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    align-self: center;
    margin-left: 64px;
    padding-left: 6px;
    font-size: 0.72rem;
    opacity: 0.75;
    pointer-events: none;
  }

  .reps-group .repInput {
    grid-area: reps-row;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    align-self: center;
  }

  .remove-set {
    grid-column: remove;
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    margin: 0;
    align-self: right;
    justify-self: right;
  }
}

@media (max-width: 640px) {
  .weightInput {
    padding-right: 14px;
  }
}

button.remove-set {
  grid-column: 5;
  grid-row: 2;
}

@media (min-width: 641px) {
  .set {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .set-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
  }

  .set-inputs-cluster {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
  }

  .weight-group,
  .reps-group {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
  }

  .weight-group label,
  .reps-group label {
    font-size: inherit;
    opacity: inherit;
    margin: 0;
  }

  .weight-group .weightInput,
  .reps-group .repInput {
    width: auto;
    min-width: 0;
  }

  .weight-group .unit {
    margin-left: 0;
    padding-left: 0;
    font-size: inherit;
    opacity: inherit;
    align-self: center;
  }

  .remove-set {
    align-self: center;
    justify-self: auto;
    margin: 0;
  }
}

.weightInput:focus::placeholder,
.repInput:focus::placeholder {
  opacity: 0;
  color: transparent;
  transition: opacity 0.12s ease;
}

.remove-exercise-btn,
.clear-workout-name-btn,
.remove-set {
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.remove-exercise-btn:active,
.remove-exercise-btn:focus,
.remove-exercise-btn:focus-visible,
.clear-workout-name-btn:active,
.clear-workout-name-btn:focus,
.clear-workout-name-btn:focus-visible,
.remove-set:active,
.remove-set:focus,
.remove-set:focus-visible {
  background: transparent;
  outline: none;
  box-shadow: none;
}

.remove-exercise-btn:active,
.remove-exercise-btn:focus,
.remove-exercise-btn:focus-visible {
  background: transparent;
  color: #ef4444;
  border-color: #ef4444;
}

.remove-set:active,
.remove-set:focus,
.remove-set:focus-visible {
  outline: none;
  box-shadow: none;
}

.remove-exercise-btn,
.clear-workout-name-btn,
.remove-set {
  touch-action: manipulation;
}

.exercise-move-btn {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

button.exercise-move-btn:active,
button.exercise-move-btn:focus,
button.exercise-move-btn:focus-visible {
  background: rgba(255, 255, 255, 0.04);
  color: #f9fafb;
  border-color: rgba(255, 255, 255, 0.12);
  outline: none;
  box-shadow: none;
}

.clear-workout-name-btn {
  -webkit-tap-highlight-color: transparent;
  appearance: none;
  -webkit-appearance: none;
}

@media (hover: hover) {
  .clear-workout-name-btn:hover {
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
    border-color: #ef4444;
    outline: none;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.18);
    /* transform: translateY(-50%); */
  }
}

.clear-workout-name-btn:active,
.clear-workout-name-btn:focus,
.clear-workout-name-btn:focus-visible {
  background: var(--card-bg, #1f2937);
  color: #ef4444;
  border-color: #ef4444;
  outline: none;
  box-shadow: none;
  /* transform: translateY(-50%); */
}

@media (hover: hover) {
  .unit-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    box-shadow: none;
    transform: none;
  }
}

.unit-toggle-btn {
  width: auto;
  min-width: 58px;
  padding: 6px 10px;
  margin: 0;

  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;

  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;

  box-shadow: none;
  transform: none;
}

.unit-toggle-btn:active,
.unit-toggle-btn:focus,
.unit-toggle-btn:focus-visible {
  outline: none;
  box-shadow: none;
  transform: none;
}

@media (max-width: 480px) {
  .nav {
    padding: 10px 12px;
  }

  .brand-center h1 {
    font-size: 18px;
  }

  .nav img {
    width: 20px;
    height: 20px;
  }

  .unit-toggle-btn {
    min-width: 52px;
    padding: 5px 9px;
    font-size: 10px;
  }
}

.progress-stats-row {
  margin: 0 0 0px;
}

.progress-stats-row .quick-stat-card {
  min-height: 84px;
}

.progress-stats-row .quick-stat-value {
  font-size: 1.25rem;
}

.progress-stats-row .quick-stat-label {
  font-size: 0.75rem;
}

.chart-title {
  font-size: 14px;
  font-weight: 600;
  opacity: 0.85;
  margin: 8px 0 10px;
  color: #f3f4f6;
}

.exercise-summary-row {
  margin: 0 0 14px;
}

.exercise-summary-row .quick-stat-card {
  min-height: 78px;
}

.exercise-summary-row .quick-stat-value {
  font-size: 1.1rem;
}

.exercise-summary-row .quick-stat-label {
  font-size: 0.72rem;
}

.progress-insight-card {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 14px;
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.06),
    rgba(255, 255, 255, 0.025)
  );
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.progress-insight-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.progress-insight-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.65;
  color: #cbd5e1;
}

.progress-insight-value {
  font-size: 1rem;
  font-weight: 800;
  color: #f3f4f6;
  line-height: 1.2;
}

.progress-insight-volume {
  flex-shrink: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: #86efac;
}

@media (max-width: 480px) {
  .progress-insight-card {
    padding: 12px 14px;
  }

  .progress-insight-value {
    font-size: 0.95rem;
  }

  .progress-insight-volume {
    font-size: 0.82rem;
  }
}

.progress-history-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 10px;
}

.progress-history-subtext {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.6;
}

.chart-title {
  margin: 6px 0 8px;
}

.exercise-summary-row {
  margin: 0 0 10px;
  margin-top: 18px;
  margin-bottom: 10px;
}

.progress-insight-card {
  margin: 0 0 10px;
}

#unitToggleMetricBtn,
#metricToggleBtn,
.progress-metric-toggle {
  margin: 0 0 10px;
}

.progress-filter-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.68;
  margin: 0 0 6px;
}

#progressExerciseSelect {
  margin-bottom: 10px;
}

.metricToggleBtn {
  margin: 0 0 10px;
}

.progress-insight-card + .progress-insight-card {
  margin-top: 10px;
}

@media (max-width: 480px) {
  .exercise-summary-row {
    margin-top: 22px;
  }
}

#progressSection h2 {
  font-size: 20px;
  opacity: 0.9;
}

.exercise-e1rm {
  font-size: 12px;
  font-weight: 700;
  color: #93c5fd;
  opacity: 0.95;
  margin-bottom: 6px;
}

#workoutPage.app-container {
  padding-top: 0;
}

.weeks-header {
  margin-bottom: 8px;
  padding-left: 4px;
}

.weeks-header h3 {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 700;
  color: #f3f4f6;
}

.weeks-header .ui-hint {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
  opacity: 0.72;
}

#progressSection {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.weeks-header {
  margin-bottom: 4px;
  padding-left: 4px;
}

button.exercise-move-btn:hover,
button.exercise-move-btn:active,
button.exercise-move-btn:focus,
button.exercise-move-btn:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: #f9fafb;
  border-color: rgba(255, 255, 255, 0.12);
  outline: none;
  box-shadow: none;
  transform: none;
}

button.exercise-move-btn.exercise-move-btn-disabled,
button.exercise-move-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

button.remove-exercise-btn:hover,
button.remove-exercise-btn:active,
button.remove-exercise-btn:focus,
button.remove-exercise-btn:focus-visible {
  background: transparent;
  color: #ef4444;
  border-color: #ef4444;
  outline: none;
  box-shadow: none;
  transform: none;
}

@media (hover: hover) {
  button.remove-exercise-btn:hover {
    background: rgba(239, 68, 68, 0.08);
    color: #f87171;
    border-color: #f87171;
  }
}

button.remove-exercise-btn:active,
button.remove-exercise-btn:focus,
button.remove-exercise-btn:focus-visible {
  background: transparent;
  color: #ef4444;
  border-color: #ef4444;
  outline: none;
  box-shadow: none;
  transform: none;
}

@media (max-width: 768px) {
  #authPanel {
    width: min(240px, calc(100vw - 16px)) !important;
  }
}

#workoutPage {
  padding-top: 40px !important;
}

/* =========================
   AUTH MODAL OVERLAY
========================= */

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;

  display: none;
  align-items: center;
  justify-content: center;
}

.auth-modal.show {
  display: flex;
}

/* dark background overlay */

.auth-modal-backdrop {
  position: absolute;
  inset: 0;

  background: rgba(6, 8, 15, 0.65);
  backdrop-filter: blur(4px);
}

/* =========================
   MODAL CARD
========================= */

/* =========================
   CLOSE BUTTON
========================= */

.auth-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;

  background: transparent;
  border: none;

  font-size: 16px;
  color: rgba(255, 255, 255, 0.6);

  cursor: pointer;
}

.auth-modal-close:hover {
  color: white;
}

/* =========================
   HEADER
========================= */

.auth-modal-eyebrow {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.6;
}

/* =========================
   BODY
========================= */

.auth-modal-label {
  font-size: 11px;
  opacity: 0.7;
}

.auth-modal-input {
  width: 100%;
  padding: 10px 12px;

  border-radius: 10px;

  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);

  color: white;
  font-size: 14px;
}

.auth-modal-input:focus {
  outline: none;

  border-color: rgba(96, 165, 250, 0.6);
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.18);
}

/* =========================
   PRIMARY BUTTON
========================= */

.auth-modal-primary-btn {
  margin-top: 8px;

  padding: 11px;

  border-radius: 12px;

  font-size: 14px;
  font-weight: 600;

  background: linear-gradient(180deg, #4ade80, #22c55e);

  border: none;
  color: #04120a;

  cursor: pointer;
}

.auth-modal-primary-btn:hover {
  transform: translateY(-1px);
}

/* =========================
   FOOTER SWITCH MODE
========================= */

.auth-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;

  width: 100%;
  padding: 4px 2px 0;

  font-size: 12px;
  opacity: 0.75;

  white-space: nowrap;
}

.auth-modal-switch-btn {
  background: transparent;
  border: none;

  color: #60a5fa;

  font-weight: 600;
  cursor: pointer;
}

#authModalSwitchText {
  text-align: left;
}

#openSignInModalBtn,
#editDisplayNameBtn,
#signUpHeaderBtn,
#logoutBtn {
  background-clip: padding-box;
}

#openSignInModalBtn:active,
#editDisplayNameBtn:active,
#signUpHeaderBtn:active,
#logoutBtn:active {
  background-image: none;
  filter: none;
}

#signUpHeaderBtn:focus-visible,
#editDisplayNameBtn:focus-visible,
#openSignInModalBtn:focus-visible,
#logoutBtn:focus-visible {
  outline: none;
  box-shadow: none;
}

#signUpHeaderBtn {
  -webkit-tap-highlight-color: transparent;
}

#signUpHeaderBtn:active {
  background: rgba(59, 130, 246, 0.14);
}

#signUpHeaderBtn:hover,
#signUpHeaderBtn:active,
#signUpHeaderBtn:focus,
#signUpHeaderBtn:focus-visible {
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(59, 130, 246, 0.5);
  color: #bfdbfe;
  box-shadow: none;
  transform: none;
  outline: none;
  filter: none;
}

#openSignInModalBtn:hover,
#openSignInModalBtn:active,
#openSignInModalBtn:focus,
#openSignInModalBtn:focus-visible {
  background: rgba(34, 197, 94, 0.22);
  border-color: rgba(34, 197, 94, 0.5);
  color: #bbf7d0;
  box-shadow: none;
  transform: none;
  outline: none;
  filter: none;
}

#logoutBtn:hover,
#logoutBtn:active,
#logoutBtn:focus,
#logoutBtn:focus-visible {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.5);
  color: #fecaca;
  box-shadow: none;
  transform: none;
  outline: none;
  filter: none;
}

#authModalSwitchBtn,
#authModalSwitchBtn:hover,
#authModalSwitchBtn:active,
#authModalSwitchBtn:focus,
#authModalSwitchBtn:focus-visible {
  background: transparent;
  border: none;
  color: #60a5fa;
  font-weight: 600;
  box-shadow: none;
  transform: none;
  outline: none;
  filter: none;
}

#authModalSwitchBtn {
  padding: 0 4px;

  background: transparent;
  border: none;

  color: #60a5fa;
  font-weight: 600;

  cursor: pointer;

  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
}

#authModalSwitchBtn:hover {
  color: #93c5fd;
}

.settings-btn {
  background: none;
  border: none;
  padding: 4px;
  margin: 0;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;
  flex: 0 0 auto;
  color: #cbd5e1;
  opacity: 0.9;
}

.settings-icon {
  width: 18px;
  height: 18px;
  display: block;
  flex: 0 0 auto;
}

.settings-btn:hover,
.settings-btn:focus,
.settings-btn:focus-visible,
.settings-btn:active {
  opacity: 0.75;
  outline: none;
  box-shadow: none;
  transform: none;
}

.settings-logout-btn {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
  font-size: 14px;
  font-weight: 600;
}

.auth-modal-backdrop {
  z-index: 0;
}

.auth-modal-card {
  position: relative;
  z-index: 1;
  pointer-events: auto;

  width: min(360px, calc(100vw - 56px));
  padding: 26px 22px 20px;

  border-radius: 20px;
  background: #0a0e19;
  border: 1px solid rgba(255, 255, 255, 0.08);

  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);

  display: flex;
  flex-direction: column;
  gap: 18px;
}

@media (max-width: 768px) {
  .auth-modal-input {
    font-size: 16px;
  }
}

.history-month-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: transparent;
  border: none;
  padding: 0;
  margin-bottom: 12px;
  cursor: pointer;
  text-align: left;
}

.history-month-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.history-month-title {
  margin: 0;
}

.history-month-icon {
  font-size: 16px;
  opacity: 0.8;
  flex-shrink: 0;
}

.history-month-content {
  display: block;
}

.history-week-label {
  margin: 10px 0 8px;
  font-size: 14px;
  opacity: 0.82;
}

.settings-secondary-btn {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #e5e7eb;
  font-size: 14px;
  font-weight: 600;
}

.settings-btn {
  /* prevent inheritance from global button rules */
  width: auto !important;
  min-width: unset !important;
  max-width: unset !important;

  padding: 4px;
  margin: 0;

  background: none;
  border: none;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  flex: 0 0 auto;

  cursor: pointer;
}

.settings-delete-btn {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.18);
  color: #fecaca;
  font-size: 14px;
  font-weight: 600;
}

.settings-version-label {
  margin-top: 18px;
  font-size: 12px;
  opacity: 0.6;
  text-align: center;
  letter-spacing: 0.4px;
}

.settings-help-block {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-help-text {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(203, 213, 225, 0.78);
}

.unlock-pro-btn {
  all: unset;

  display: inline-block;
  margin-top: 6px;
  padding: 8px 14px;

  border-radius: 10px;
  background: #4ade80;
  color: #022c22;

  font-weight: 600;
  font-size: 13px;
  cursor: pointer;

  text-align: center;
}

.unlock-pro-btn:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

.settings-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

.settings-link {
  text-decoration: none;
  font-size: 14px;
  color: var(--muted);
  padding: 6px 2px;
}

.settings-link:hover {
  color: var(--text);
}

.exercise-load-type-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.exercise-load-type-row label {
  font-size: 14px;
  font-weight: 600;
  color: #cbd5e1;
}

.exercise-load-type-select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #e5e7eb;
  font-size: 14px;
  background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='20' viewBox='0 0 24 24' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}

.exercise-load-type-row label {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.8;
}

#bodyweightInput {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #e5e7eb;
  font-size: 14px;
}

.onboarding-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 16px 0 10px;
}

.onboarding-dots span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.onboarding-dots span.active {
  background: #4ade80;
}

.app-splash {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at top, rgba(74, 222, 128, 0.08), transparent 36%),
    linear-gradient(180deg, #0b1120 0%, #0a0f1d 100%);
  opacity: 1;
  visibility: visible;
  transition:
    opacity 0.28s ease,
    visibility 0.28s ease;
}

.app-splash.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.app-splash-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  padding: 28px 24px;
}

.app-splash-mark {
  font-size: 32px;
  line-height: 1;
  transform: translateY(0);
  animation: splashFloat 1.8s ease-in-out infinite;
}

.app-splash-logo {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #e5e7eb;
}

.app-splash-text {
  margin: 0;
  font-size: 14px;
  color: #94a3b8;
}

.app-splash-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
}

.app-splash-loader span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(74, 222, 128, 0.9);
  animation: splashPulse 1.2s infinite ease-in-out;
}

.app-splash-loader span:nth-child(2) {
  animation-delay: 0.15s;
}

.app-splash-loader span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes splashPulse {
  0%,
  80%,
  100% {
    opacity: 0.28;
    transform: scale(0.85);
  }
  40% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes splashFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}
