:root {
  color-scheme: dark;
  --bg: #090b16;
  --bg-alt: #12172b;
  --fg: #f5f1f7;
  --muted: rgba(245, 241, 247, 0.7);
  --accent: #d662f1;
  --accent-strong: #fcb564;
  --card-bg: rgba(18, 23, 43, 0.72);
  --border: rgba(214, 98, 241, 0.35);
  --shadow: rgba(1, 4, 12, 0.5);
  --glow: rgba(214, 98, 241, 0.35);
  font-family: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  position: relative;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(9, 11, 22, 0.68), rgba(9, 11, 22, 0.78) 45%, rgba(12, 17, 32, 0.88)),
    url("assets/valaris-city-of-starlight.jpg") center / cover fixed no-repeat;
  pointer-events: none;
  z-index: -3;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 10% 15%, rgba(214, 98, 241, 0.16), transparent 45%),
    radial-gradient(circle at 80% 75%, rgba(252, 181, 100, 0.12), transparent 52%),
    url("data:image/svg+xml,%3Csvg width='160' height='160' viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='10' cy='10' r='1.5'/%3E%3Ccircle cx='70' cy='40' r='1'/%3E%3Ccircle cx='120' cy='90' r='1.2'/%3E%3Ccircle cx='30' cy='110' r='1'/%3E%3Ccircle cx='90' cy='150' r='1.3'/%3E%3C/g%3E%3C/svg%3E") repeat;
  pointer-events: none;
  opacity: 0.28;
  z-index: -2;
}

.sparkle-field {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 15%, rgba(252, 246, 255, 0.25) 0, transparent 45%),
    radial-gradient(circle at 78% 25%, rgba(191, 219, 254, 0.28) 0, transparent 50%),
    radial-gradient(circle at 40% 50%, rgba(165, 180, 252, 0.22) 0, transparent 55%),
    radial-gradient(circle at 85% 60%, rgba(252, 246, 255, 0.2) 0, transparent 48%),
    radial-gradient(circle at 20% 75%, rgba(191, 219, 254, 0.24) 0, transparent 52%),
    radial-gradient(circle at 65% 85%, rgba(165, 180, 252, 0.18) 0, transparent 50%);
  mix-blend-mode: screen;
  opacity: 0.45;
  z-index: -2;
}

.shooting-stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: -1;
}

.shooting-stars span {
  position: absolute;
  width: 3px;
  height: 3px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.9), rgba(214, 98, 241, 0.5));
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.8), 0 0 12px rgba(214, 98, 241, 0.4);
  animation: twinkleStar 3s ease-in-out infinite;
}

.shooting-stars span:nth-child(1) {
  top: 15%;
  left: 12%;
  animation-duration: 4s;
  animation-delay: 0s;
  width: 2px;
  height: 2px;
}

.shooting-stars span:nth-child(2) {
  top: 35%;
  left: 28%;
  animation-duration: 5s;
  animation-delay: 1.5s;
  width: 3px;
  height: 3px;
}

.shooting-stars span:nth-child(3) {
  top: 60%;
  left: 55%;
  animation-duration: 4.5s;
  animation-delay: 2.8s;
  width: 4px;
  height: 4px;
}

.shooting-stars span:nth-child(4) {
  top: 25%;
  left: 78%;
  animation-duration: 3.8s;
  animation-delay: 0.8s;
  width: 2px;
  height: 2px;
}

.shooting-stars span:nth-child(5) {
  top: 80%;
  left: 88%;
  animation-duration: 4.2s;
  animation-delay: 3.5s;
  width: 3px;
  height: 3px;
}

.shooting-stars span:nth-child(6) {
  top: 45%;
  left: 15%;
  animation-duration: 3.5s;
  animation-delay: 1.2s;
  width: 2px;
  height: 2px;
}

.shooting-stars span:nth-child(7) {
  top: 70%;
  left: 35%;
  animation-duration: 4.8s;
  animation-delay: 2.5s;
  width: 3px;
  height: 3px;
}

.shooting-stars span:nth-child(8) {
  top: 20%;
  left: 45%;
  animation-duration: 3.2s;
  animation-delay: 0.5s;
  width: 4px;
  height: 4px;
}

.shooting-stars span:nth-child(9) {
  top: 50%;
  left: 70%;
  animation-duration: 4.5s;
  animation-delay: 1.8s;
  width: 2px;
  height: 2px;
}

.shooting-stars span:nth-child(10) {
  top: 10%;
  left: 65%;
  animation-duration: 3.8s;
  animation-delay: 3.2s;
  width: 3px;
  height: 3px;
}

.shooting-stars span:nth-child(11) {
  top: 85%;
  left: 60%;
  animation-duration: 4.3s;
  animation-delay: 2.1s;
  width: 2px;
  height: 2px;
}

.shooting-stars span:nth-child(12) {
  top: 40%;
  left: 92%;
  animation-duration: 3.6s;
  animation-delay: 1.4s;
  width: 3px;
  height: 3px;
}

@keyframes twinkle {
  0%, 100% {
    opacity: 0.2;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.08);
  }
}

@keyframes drift {
  0% {
    transform: translate3d(-5%, 0, 0);
  }
  100% {
    transform: translate3d(5%, -60px, 0);
  }
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 40px -12px rgba(214, 98, 241, 0.55);
  }
  50% {
    box-shadow: 0 0 55px -10px rgba(252, 181, 100, 0.65);
  }
}

@keyframes twinkleStar {
  0%, 100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.3);
  }
}


.app-header {
  padding: 3rem 1.5rem 1.5rem;
  text-align: center;
  position: relative;
}

.app-header h1 {
  margin: 0.5rem 0 0;
  font-size: 2.75rem;
  font-family: "Cinzel", "Times New Roman", serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-sigil {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(214, 98, 241, 0.35), rgba(252, 181, 100, 0.2));
  border: 1px solid var(--border);
  box-shadow: 0 0 40px -12px var(--glow);
  position: relative;
  overflow: hidden;
  animation: pulseGlow 6.5s ease-in-out infinite;
}

.hero-sigil::after {
  content: "";
  position: absolute;
  inset: 10%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.75) 0, rgba(255, 255, 255, 0) 70%);
  opacity: 0.4;
  animation: twinkle 5s ease-in-out infinite;
}

.tagline {
  margin: 1rem auto 0.35rem;
  font-size: 1.05rem;
  max-width: 32rem;
  color: var(--fg);
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.subtagline {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.content {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 1.5rem 3.5rem;
  display: grid;
  gap: 2.25rem;
}

.day-selector,
.workouts,
.history {
  background: var(--card-bg);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 1.25rem;
  padding: 1.75rem;
  box-shadow: 0 25px 40px -30px var(--shadow);
  backdrop-filter: blur(12px);
}

.day-selector h2,
.workouts h2,
.history h2 {
  margin-top: 0;
  font-family: "Cinzel", "Times New Roman", serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 1.35rem;
}

.workout-list {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.workout-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.workout-header h2 {
  margin: 0;
}

.copy-day-button {
  padding: 0.65rem 1.2rem;
  border-radius: 0.9rem;
  border: 2px solid transparent;
  background:
    linear-gradient(var(--card-bg), var(--card-bg)) padding-box,
    linear-gradient(135deg, rgba(214, 98, 241, 0.8), rgba(252, 181, 100, 0.8)) border-box;
  color: #f5fbff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: none;
  letter-spacing: 0.03em;
  box-shadow: 0 4px 20px rgba(214, 98, 241, 0.2), 0 0 40px rgba(214, 98, 241, 0.1);
}

.copy-day-button:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow:
    0 8px 30px rgba(214, 98, 241, 0.4),
    0 0 60px rgba(214, 98, 241, 0.2);
  border-color: rgba(214, 98, 241, 0.6);
}

.copy-day-button:active {
  transform: translateY(0) scale(0.98);
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.history-actions {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 280px;
}

.month-filter {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(221, 238, 255, 0.72);
}

.month-filter span {
  font-size: 0.7rem;
}

.custom-select {
  position: relative;
  width: 100%;
  min-width: 180px;
}

.custom-select-trigger {
  width: 100%;
  padding: 0.55rem 0.85rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(147, 197, 253, 0.35);
  background: rgba(14, 28, 52, 0.72);
  color: rgba(232, 248, 255, 0.88);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  font-size: 1rem;
  font-family: "Manrope", sans-serif;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.custom-select-trigger:hover {
  border-color: rgba(147, 197, 253, 0.55);
  background: rgba(23, 43, 78, 0.82);
}

.custom-select-trigger:focus {
  outline: 2px solid rgba(94, 234, 255, 0.45);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.25);
}

.custom-select-arrow {
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.custom-select.open .custom-select-arrow {
  transform: rotate(180deg);
}

.custom-select-dropdown {
  position: fixed;
  max-height: 300px;
  overflow-y: auto;
  background: rgba(14, 28, 52, 0.95);
  border: 1px solid rgba(147, 197, 253, 0.35);
  border-radius: 0.65rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 999999999;
  display: none;
  backdrop-filter: blur(8px);
}

.custom-select.open .custom-select-dropdown {
  display: block;
}

.custom-select-option {
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  color: rgba(232, 248, 255, 0.88);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.95rem;
  transition: all 0.15s ease;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: "Manrope", sans-serif;
}

.custom-select-option:hover {
  background: rgba(147, 197, 253, 0.15);
  color: #f5fbff;
}

.custom-select-option.selected {
  background: rgba(147, 197, 253, 0.25);
  color: #f5fbff;
  font-weight: 600;
}

.day-buttons {
  display: grid;
  grid-template-columns: repeat(7, minmax(100px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
  justify-items: stretch;
}

.day-button {
  padding: 0.95rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(147, 197, 253, 0.18);
  background: linear-gradient(140deg, rgba(34, 30, 72, 0.92), rgba(21, 65, 104, 0.78));
  cursor: pointer;
  font-size: 1rem;
  letter-spacing: 0.06em;
  color: rgba(220, 242, 255, 0.78);
  transition: box-shadow 0.12s ease, border-color 0.12s ease, color 0.12s ease;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
}

.day-button:hover {
  border-color: rgba(148, 240, 255, 0.55);
  color: #f4fbff;
  box-shadow: 0 16px 32px -20px rgba(56, 189, 248, 0.65);
}

.day-button.active {
  border-color: rgba(147, 197, 253, 0.72);
  color: #f8fbff;
  box-shadow: 0 20px 42px -22px rgba(56, 189, 248, 0.7);
  transform: translateY(-2px);
  background: linear-gradient(140deg, rgba(108, 90, 255, 0.7), rgba(43, 166, 255, 0.65));
}

.day-button::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background-image: url("data:image/svg+xml,%3Csvg width='160' height='160' viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.22'%3E%3Ccircle cx='18' cy='22' r='1.2'/%3E%3Ccircle cx='90' cy='40' r='1.6'/%3E%3Ccircle cx='140' cy='18' r='1'/%3E%3Ccircle cx='60' cy='90' r='1.4'/%3E%3Ccircle cx='18' cy='120' r='1'/%3E%3Ccircle cx='120' cy='140' r='1.5'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 130px 130px;
  pointer-events: none;
  opacity: 0.45;
}

.day-button:hover::before,
.day-button.active::before {
  opacity: 0.7;
}

.day-button:active {
  transform: translateY(1px);
}

.create-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding: 1.1rem 1.3rem;
  border: 1px solid rgba(147, 197, 253, 0.18);
  border-radius: 0.9rem;
  background: linear-gradient(140deg, rgba(34, 30, 72, 0.92), rgba(21, 65, 104, 0.78));
  position: relative;
  overflow: visible;
  box-shadow: 0 16px 32px -20px rgba(56, 189, 248, 0.4);
  transition: box-shadow 0.12s ease, border-color 0.12s ease;
}

.create-form:hover {
  border-color: rgba(148, 240, 255, 0.35);
  box-shadow: 0 20px 38px -22px rgba(56, 189, 248, 0.55);
}

.create-form::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background-image: url("data:image/svg+xml,%3Csvg width='160' height='160' viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.22'%3E%3Ccircle cx='18' cy='22' r='1.2'/%3E%3Ccircle cx='90' cy='40' r='1.6'/%3E%3Ccircle cx='140' cy='18' r='1'/%3E%3Ccircle cx='60' cy='90' r='1.4'/%3E%3Ccircle cx='18' cy='120' r='1'/%3E%3Ccircle cx='120' cy='140' r='1.5'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 130px 130px;
  pointer-events: none;
  opacity: 0.45;
  z-index: 0;
}

.create-form:hover::before {
  opacity: 0.65;
}

.create-form::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 30%, rgba(94, 234, 255, 0.25), transparent 58%);
  opacity: 0.6;
  animation: none;
  pointer-events: none;
  z-index: 0;
  border-radius: 0.9rem;
  overflow: hidden;
}

.form-group {
  flex: 1 1 210px;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  position: relative;
  z-index: 1;
}

.form-group .custom-select {
  position: relative;
  z-index: 10000;
}

.form-group .custom-select-dropdown {
  z-index: 999999999;
  pointer-events: auto;
}

.form-group .custom-select-option {
  position: relative;
  z-index: 100000;
  pointer-events: auto;
  cursor: pointer;
}

.form-group input,
.form-group select {
  padding: 0.6rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.65rem;
  font-size: 1rem;
  color: var(--fg);
  background: rgba(13, 16, 31, 0.85);
  font-family: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23f5f1f7' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-group select option {
  background: rgba(13, 16, 31, 1);
  color: var(--fg);
  padding: 0.5rem;
}

.form-group input::placeholder {
  color: rgba(245, 241, 247, 0.55);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.create-button {
  flex: 1 1 160px;
  padding: 0.75rem 1.3rem;
  border-radius: 1rem;
  border: 2px solid transparent;
  background:
    linear-gradient(var(--card-bg), var(--card-bg)) padding-box,
    linear-gradient(135deg, rgba(214, 98, 241, 0.8), rgba(252, 181, 100, 0.8)) border-box;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #f5fbff;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(214, 98, 241, 0.2), 0 0 40px rgba(214, 98, 241, 0.1);
}

.create-button::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(214, 98, 241, 0.15), rgba(252, 181, 100, 0.15));
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.create-button::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3), transparent 70%);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
  pointer-events: none;
}

.create-button:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow:
    0 8px 30px rgba(214, 98, 241, 0.4),
    0 0 60px rgba(214, 98, 241, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border-color: rgba(214, 98, 241, 0.6);
}

.create-button:hover::before {
  opacity: 1;
}

.create-button:hover::after {
  width: 300px;
  height: 300px;
  opacity: 0;
}

.create-button:active {
  transform: translateY(0) scale(0.98);
}

.exercise-collection {
  display: grid;
  gap: 2.5rem;
  margin-top: 1.5rem;
}

.focus-group {
  display: grid;
  gap: 1.35rem;
}

.focus-group-header {
  font-family: "Cinzel", "Times New Roman", serif;
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(214, 98, 241, 0.95);
  margin: 0 0 0.75rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid rgba(214, 98, 241, 0.3);
  text-shadow: 0 0 10px rgba(214, 98, 241, 0.4);
}


.workout-card {
  border: 1px solid rgba(147, 197, 253, 0.18);
  border-radius: 0.9rem;
  padding: 1.35rem 1.55rem;
  margin-bottom: 0;
  background: linear-gradient(140deg, rgba(34, 30, 72, 0.92), rgba(21, 65, 104, 0.78));
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  position: relative;
  box-shadow: 0 8px 16px -8px rgba(56, 189, 248, 0.3);
  transition: box-shadow 0.12s ease, border-color 0.12s ease;
  isolation: isolate;
}

.workout-card:hover {
  border-color: rgba(148, 240, 255, 0.35);
  box-shadow: 0 20px 38px -22px rgba(56, 189, 248, 0.55);
}

.workout-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 0.9rem;
  background-image: url("data:image/svg+xml,%3Csvg width='160' height='160' viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.22'%3E%3Ccircle cx='18' cy='22' r='1.2'/%3E%3Ccircle cx='90' cy='40' r='1.6'/%3E%3Ccircle cx='140' cy='18' r='1'/%3E%3Ccircle cx='60' cy='90' r='1.4'/%3E%3Ccircle cx='18' cy='120' r='1'/%3E%3Ccircle cx='120' cy='140' r='1.5'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 130px 130px;
  pointer-events: none;
  opacity: 0.45;
  z-index: 0;
  overflow: hidden;
}

.workout-card:hover::before {
  opacity: 0.65;
}


.workout-header {
  display: grid;
  grid-template-columns: 1fr auto auto;
  column-gap: 0.75rem;
  align-items: center;
  position: relative;
  z-index: 1;
}

.workout-title {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: "Cinzel", "Times New Roman", serif;
}

.target-chip {
  padding: 0.4rem 0.85rem;
  background: rgba(252, 181, 100, 0.18);
  border-radius: 999px;
  color: var(--accent-strong);
  font-size: 0.82rem;
  border: 1px solid rgba(252, 181, 100, 0.6);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  justify-self: end;
}

.remove-exercise {
  border: 1px solid rgba(147, 197, 253, 0.38);
  background: linear-gradient(145deg, rgba(33, 56, 106, 0.7), rgba(64, 118, 168, 0.68));
  color: rgba(232, 248, 255, 0.9);
  border-radius: 999px;
  width: 2rem;
  height: 2rem;
  font-size: 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0;
  position: relative;
  overflow: hidden;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.remove-exercise::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.22'%3E%3Ccircle cx='12' cy='18' r='1.1'/%3E%3Ccircle cx='58' cy='30' r='1.5'/%3E%3Ccircle cx='82' cy='12' r='1'/%3E%3Ccircle cx='30' cy='65' r='1.3'/%3E%3Ccircle cx='18' cy='88' r='1.1'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 80px 80px;
  opacity: 0.4;
  pointer-events: none;
}

.remove-exercise:hover {
  background: linear-gradient(145deg, rgba(51, 92, 150, 0.8), rgba(92, 166, 211, 0.75));
  color: #f5fbff;
}

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

.target-chip {
  padding: 0.4rem 0.85rem;
  background: rgba(252, 181, 100, 0.18);
  border-radius: 999px;
  color: var(--accent-strong);
  font-size: 0.82rem;
  border: 1px solid rgba(252, 181, 100, 0.6);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.log-date-input {
  flex: 1 1 160px;
  min-width: 150px;
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.65rem;
  font-size: 0.9rem;
  color: var(--fg);
  background: rgba(13, 16, 31, 0.85);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.log-date-input::-webkit-calendar-picker-indicator {
  filter: invert(0.8);
  cursor: pointer;
}

.log-date-input:focus {
  outline: 1px solid rgba(214, 98, 241, 0.65);
  box-shadow: 0 0 0 3px rgba(214, 98, 241, 0.15);
}

.tracking-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.9rem;
  align-items: end;
  position: relative;
  z-index: 1;
}

.tracking-form label {
  display: flex;
  flex-direction: column;
  font-size: 0.92rem;
  gap: 0.35rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  min-width: 120px;
}

.tracking-form input {
  padding: 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.65rem;
  font-size: 1rem;
  color: var(--fg);
  background: rgba(13, 16, 31, 0.85);
}

.tracking-form input:focus {
  outline: 1px solid rgba(214, 98, 241, 0.65);
  box-shadow: 0 0 0 3px rgba(214, 98, 241, 0.15);
}

.tracking-form button {
  padding: 0.75rem 1.3rem;
  border-radius: 1rem;
  border: 2px solid transparent;
  background:
    linear-gradient(var(--card-bg), var(--card-bg)) padding-box,
    linear-gradient(135deg, rgba(214, 98, 241, 0.8), rgba(252, 181, 100, 0.8)) border-box;
  color: #f5fbff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(214, 98, 241, 0.2), 0 0 40px rgba(214, 98, 241, 0.1);
}

.tracking-form button::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(214, 98, 241, 0.15), rgba(252, 181, 100, 0.15));
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.tracking-form button::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3), transparent 70%);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
  pointer-events: none;
}

.tracking-form button:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow:
    0 8px 30px rgba(214, 98, 241, 0.4),
    0 0 60px rgba(214, 98, 241, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border-color: rgba(214, 98, 241, 0.6);
}

.tracking-form button:hover::before {
  opacity: 1;
}

.tracking-form button:hover::after {
  width: 300px;
  height: 300px;
  opacity: 0;
}

.tracking-form button:active {
  transform: translateY(0) scale(0.98);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.6rem;
  grid-column: 1 / -1;
  flex-wrap: wrap;
}

.copy-last {
  padding: 0.75rem 1.1rem;
  border-radius: 1rem;
  border: 2px solid transparent;
  background:
    linear-gradient(var(--card-bg), var(--card-bg)) padding-box,
    linear-gradient(135deg, rgba(147, 197, 253, 0.6), rgba(96, 165, 250, 0.6)) border-box;
  color: rgba(232, 248, 255, 0.92);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(96, 165, 250, 0.15), 0 0 40px rgba(96, 165, 250, 0.08);
}

.copy-last::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(147, 197, 253, 0.15), rgba(96, 165, 250, 0.15));
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.copy-last::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3), transparent 70%);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
  pointer-events: none;
}

.copy-last:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow:
    0 8px 30px rgba(96, 165, 250, 0.3),
    0 0 60px rgba(96, 165, 250, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border-color: rgba(96, 165, 250, 0.6);
  color: #f5fbff;
}

.copy-last:hover::before {
  opacity: 1;
}

.copy-last:hover::after {
  width: 300px;
  height: 300px;
  opacity: 0;
}

.copy-last:active {
  transform: translateY(0) scale(0.98);
}

.copy-last:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.copy-last.copy-last--empty {
  opacity: 0.55;
}

.rest-toast-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  gap: 1.5rem;
  z-index: 9999;
  pointer-events: none;
}

.rest-toast {
  display: inline-flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.7rem 2.2rem;
  border-radius: 0.9rem;
  background: linear-gradient(140deg, rgba(34, 30, 72, 0.92), rgba(21, 65, 104, 0.78));
  border: 1px solid rgba(147, 197, 253, 0.18);
  box-shadow: 0 16px 32px -20px rgba(56, 189, 248, 0.4);
  color: #f5fbff;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transform: translateY(24px) scale(0.92);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  pointer-events: auto;
  backdrop-filter: blur(8px);
  position: relative;
  overflow: hidden;
}

.rest-toast::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background-image: url("data:image/svg+xml,%3Csvg width='160' height='160' viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.22'%3E%3Ccircle cx='18' cy='22' r='1.2'/%3E%3Ccircle cx='90' cy='40' r='1.6'/%3E%3Ccircle cx='140' cy='18' r='1'/%3E%3Ccircle cx='60' cy='90' r='1.4'/%3E%3Ccircle cx='18' cy='120' r='1'/%3E%3Ccircle cx='120' cy='140' r='1.5'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 130px 130px;
  pointer-events: none;
  opacity: 0.45;
  z-index: 0;
}

.rest-toast--visible {
  transform: translateY(0) scale(1);
  opacity: 1;
  border-color: rgba(148, 240, 255, 0.35);
  box-shadow: 0 20px 38px -22px rgba(56, 189, 248, 0.55);
}

.rest-toast--visible::before {
  opacity: 0.65;
}

.rest-toast-icon {
  font-size: 2.4rem;
}

.rest-toast-avatar {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid rgba(191, 219, 254, 0.7);
  box-shadow: 0 12px 32px -20px rgba(34, 84, 151, 0.9);
  position: relative;
  z-index: 1;
}

.rest-toast-text {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
  z-index: 1;
}

.rest-toast-message {
  font-size: 1.64rem;
  font-weight: 600;
}

/* Toast Notification */
.toast-notification {
  position: fixed;
  top: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  padding: 1.2rem 2rem;
  border-radius: 0.75rem;
  background: linear-gradient(140deg, rgba(34, 30, 72, 0.95), rgba(21, 65, 104, 0.85));
  border: 1px solid rgba(147, 197, 253, 0.3);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  color: #f5fbff;
  font-size: 1rem;
  letter-spacing: 0.02em;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  z-index: 2147483647;
  pointer-events: none;
  backdrop-filter: blur(10px);
  max-width: 90vw;
  text-align: center;
}

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

.rest-panel {
  margin-top: 1.35rem;
  margin-bottom: 1.5rem;
  padding: 1.15rem 1.3rem;
  border-radius: 1.1rem;
  border: 1px solid rgba(147, 197, 253, 0.22);
  background: linear-gradient(150deg, rgba(19, 32, 68, 0.82), rgba(32, 72, 112, 0.75));
  box-shadow: 0 24px 48px -30px rgba(34, 84, 151, 0.45);
  display: grid;
  gap: 0.85rem;
}

.rest-title {
  margin: 0;
  font-family: "Cinzel", "Times New Roman", serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(224, 242, 255, 0.88);
  font-size: 1rem;
}

.rest-controls {
  margin-top: 0;
  padding: 0.75rem 0.9rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(147, 197, 253, 0.18);
  background: linear-gradient(140deg, rgba(34, 30, 72, 0.92), rgba(21, 65, 104, 0.78));
  display: grid;
  gap: 0.55rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 16px 32px -20px rgba(56, 189, 248, 0.4);
  transition: box-shadow 0.12s ease, border-color 0.12s ease;
}

.rest-controls:hover {
  border-color: rgba(148, 240, 255, 0.35);
  box-shadow: 0 20px 38px -22px rgba(56, 189, 248, 0.55);
}

.rest-controls::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background-image: url("data:image/svg+xml,%3Csvg width='160' height='160' viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.22'%3E%3Ccircle cx='18' cy='22' r='1.2'/%3E%3Ccircle cx='90' cy='40' r='1.6'/%3E%3Ccircle cx='140' cy='18' r='1'/%3E%3Ccircle cx='60' cy='90' r='1.4'/%3E%3Ccircle cx='18' cy='120' r='1'/%3E%3Ccircle cx='120' cy='140' r='1.5'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 130px 130px;
  pointer-events: none;
  opacity: 0.45;
  z-index: 0;
}

.rest-controls:hover::before {
  opacity: 0.65;
}

.rest-label {
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(221, 238, 255, 0.82);
  position: relative;
  z-index: 1;
}

.history-actions .export-report {
  padding: 0.75rem 1.3rem;
  border-radius: 1rem;
  border: 2px solid transparent;
  background:
    linear-gradient(var(--card-bg), var(--card-bg)) padding-box,
    linear-gradient(135deg, rgba(214, 98, 241, 0.8), rgba(252, 181, 100, 0.8)) border-box;
  color: #f5fbff;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  min-width: 200px;
  box-shadow: 0 4px 20px rgba(214, 98, 241, 0.2), 0 0 40px rgba(214, 98, 241, 0.1);
}

.history-actions .export-report::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(214, 98, 241, 0.15), rgba(252, 181, 100, 0.15));
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.history-actions .export-report::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3), transparent 70%);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
  pointer-events: none;
}

.history-actions .export-report:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow:
    0 8px 30px rgba(214, 98, 241, 0.4),
    0 0 60px rgba(214, 98, 241, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border-color: rgba(214, 98, 241, 0.6);
}

.history-actions .export-report:hover::before {
  opacity: 1;
}

.history-actions .export-report:hover::after {
  width: 300px;
  height: 300px;
  opacity: 0;
}

.history-actions .export-report:active {
  transform: translateY(0) scale(0.98);
}

.rest-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  position: relative;
  z-index: 1;
}

.rest-duration,
.rest-cancel {
  padding: 0.55rem 0.85rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(147, 197, 253, 0.35);
  background: rgba(23, 43, 78, 0.72);
  color: rgba(232, 248, 255, 0.88);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: background 0.15s ease, transform 0.12s ease, color 0.15s ease;
}

.rest-duration::before,
.rest-cancel::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background-image: url("data:image/svg+xml,%3Csvg width='140' height='140' viewBox='0 0 140 140' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.22'%3E%3Ccircle cx='16' cy='18' r='1.1'/%3E%3Ccircle cx='70' cy='30' r='1.4'/%3E%3Ccircle cx='110' cy='16' r='1'/%3E%3Ccircle cx='48' cy='82' r='1.3'/%3E%3Ccircle cx='24' cy='118' r='1.1'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 110px 110px;
  opacity: 0.42;
  pointer-events: none;
}

.rest-duration:hover,
.rest-cancel:hover {
  transform: translateY(-1px);
  background: rgba(51, 92, 150, 0.78);
  color: #f5fbff;
}

.rest-duration:active,
.rest-cancel:active {
  transform: translateY(1px);
}

.rest-display {
  font-size: 0.85rem;
  color: rgba(221, 238, 255, 0.78);
  letter-spacing: 0.08em;
  padding: 0.45rem 0.6rem;
  border-radius: 0.6rem;
  background: rgba(12, 24, 48, 0.55);
  position: relative;
  z-index: 1;
}

.history-list {
  display: grid;
  gap: 0.85rem;
  margin-top: 1.25rem;
}

.history-week {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  padding: 0.95rem 1.1rem 1.1rem;
  background: rgba(13, 17, 31, 0.78);
  box-shadow: 0 18px 35px -30px var(--shadow);
  display: grid;
  gap: 0.75rem;
  position: relative;
}

.history-week-title {
  margin: 0;
  font-family: "Cinzel", "Times New Roman", serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.95rem;
  color: var(--accent-strong);
  padding-right: 4.5rem;
}

.history-week-focus {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(245, 241, 247, 0.65);
}

.history-week-entries {
  display: grid;
  gap: 0.6rem;
}

.history-list p,
.empty-state {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
}

.history-notice {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.history-entry {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.9rem;
  padding: 0.85rem 1.1rem;
  background: rgba(15, 19, 35, 0.85);
  display: grid;
  gap: 0.5rem;
  font-size: 0.98rem;
}

.history-entry strong {
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.history-entry .meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.history-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  color: rgba(236, 242, 255, 0.92);
}

.history-set-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.history-set-item {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 0.55rem;
}

.history-set-detail {
  letter-spacing: 0.04em;
}

.history-set-time {
  color: rgba(245, 241, 247, 0.7);
  font-size: 0.85rem;
  justify-self: start;
}

.history-set-badge {
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(214, 98, 241, 0.2);
  color: var(--accent);
  justify-self: start;
}

.history-set-badge--pending-sync {
  background: rgba(214, 98, 241, 0.28);
}

.history-set-badge--local-only {
  background: rgba(252, 181, 100, 0.18);
  color: var(--accent-strong);
}

.history-set-edit,
.history-set-remove {
  border: 1px solid rgba(147, 197, 253, 0.38);
  background: linear-gradient(145deg, rgba(33, 56, 106, 0.68), rgba(64, 118, 168, 0.66));
  color: rgba(232, 248, 255, 0.9);
  border-radius: 999px;
  width: 1.9rem;
  height: 1.9rem;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
  justify-self: end;
}

.history-set-remove {
  grid-column: -1;
}

.history-set-edit::before,
.history-set-remove::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background-image: url("data:image/svg+xml,%3Csvg width='90' height='90' viewBox='0 0 90 90' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.22'%3E%3Ccircle cx='12' cy='20' r='1.1'/%3E%3Ccircle cx='50' cy='12' r='1.4'/%3E%3Ccircle cx='72' cy='32' r='1.2'/%3E%3Ccircle cx='36' cy='60' r='1.1'/%3E%3Ccircle cx='18' cy='78' r='1.3'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 70px 70px;
  opacity: 0.38;
  pointer-events: none;
}

.history-set-edit:hover,
.history-set-remove:hover {
  background: linear-gradient(145deg, rgba(51, 92, 150, 0.8), rgba(92, 166, 211, 0.76));
  color: #f5fbff;
}

.history-set-edit:active,
.history-set-remove:active {
  transform: scale(0.94);
}

.history-set-edit:disabled,
.history-set-remove:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.history-entry--removing {
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.history-hint {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.app-footer {
  text-align: center;
  padding: 1.75rem;
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app-footer code {
  color: var(--accent-strong);
}

@media (max-width: 720px) {
  .app-header h1 {
    font-size: 2.2rem;
  }

  .tagline {
    letter-spacing: 0.12em;
    font-size: 0.9rem;
  }

  .tracking-form {
    grid-template-columns: repeat(3, 1fr) auto;
    gap: 0.5rem;
  }

  .tracking-form label {
    min-width: 0;
    font-size: 0.75rem;
    gap: 0.25rem;
  }

  .tracking-form input {
    padding: 0.5rem 0.4rem;
    font-size: 0.9rem;
  }

  .tracking-form button {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
  }

  .log-date-input {
    grid-column: 1 / -1;
    margin-bottom: 0.25rem;
  }

  .workout-card {
    padding: 1rem 1.1rem;
    gap: 0.85rem;
    box-shadow: 0 4px 12px -6px rgba(56, 189, 248, 0.25);
  }

  .workout-card:hover {
    box-shadow: 0 8px 16px -8px rgba(56, 189, 248, 0.35);
  }

  .form-actions {
    gap: 0.5rem;
    margin-top: 0.25rem;
  }

  .create-form {
    flex-direction: column;
    gap: 0.65rem;
    padding: 1rem;
  }

  .form-group {
    flex: 1 1 auto;
    min-width: 0;
  }

  .create-button {
    width: 100%;
    flex: 1 1 auto;
  }

  .copy-last {
    width: 100%;
  }

  .history-entry {
    padding: 0.75rem 0.9rem;
    font-size: 0.9rem;
  }

  .history-entry-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .history-set-list {
    gap: 0.6rem;
  }

  .history-set-item {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: 0.4rem;
    font-size: 0.85rem;
    position: relative;
    padding-right: 4rem;
    padding-top: 0.25rem;
    min-height: 2rem;
  }

  .history-set-detail {
    grid-column: 1;
    grid-row: 1;
  }

  .history-set-time {
    display: none;
  }

  .history-set-badge {
    justify-self: start;
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    margin-top: 0.35rem;
  }

  .history-set-edit,
  .history-set-remove {
    width: 1.7rem;
    height: 1.7rem;
    font-size: 0.8rem;
    position: absolute;
    top: 0;
  }

  .history-set-edit {
    right: 2rem;
  }

  .history-set-remove {
    right: 0;
  }

  .history-week-entries {
    gap: 0.5rem;
  }

  .rest-buttons {
    gap: 0.35rem;
  }

  .rest-duration,
  .rest-cancel {
    padding: 0.45rem 0.5rem;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    flex: 1 1 auto;
    min-width: 0;
  }

  .rest-display {
    font-size: 0.75rem;
  }

  .logout-button {
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.3rem 0.5rem;
    font-size: 0.6rem;
    letter-spacing: 0.03em;
  }

  .day-selector h2 {
    font-size: 1rem;
    letter-spacing: 0.04em;
  }

  .rest-toast-container {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 2rem);
    max-width: 500px;
  }

  .rest-toast {
    justify-content: center;
  }

  .history-actions {
    width: 100%;
    justify-content: stretch;
    flex-direction: column;
  }

  .month-filter {
    width: 100%;
  }

  .month-filter span {
    font-size: 0.75rem;
  }

  .history-actions .export-report,
  .history-actions .custom-select {
    width: 100%;
    min-width: 0;
  }

  .history {
    backdrop-filter: none;
    transform: none;
    overflow: visible !important;
    position: static !important;
  }

  .history-header {
    overflow: visible !important;
    position: static !important;
  }

  .history-actions {
    transform: none;
    overflow: visible !important;
    position: static !important;
  }

  .month-filter {
    transform: none;
    will-change: auto;
    overflow: visible !important;
    position: static !important;
  }


  .history-week-title {
    padding-right: 0;
    margin-bottom: 0.5rem;
  }

  .history-week-focus {
    position: static;
    display: block;
    margin-top: 0.35rem;
    font-size: 0.7rem;
  }
}

@media (max-width: 1024px) {
  .day-buttons {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }
}

@media (max-width: 640px) {
  .day-buttons {
    grid-template-columns: repeat(7, 1fr);
    gap: 0.3rem;
  }

  .day-button {
    padding: 0.7rem 0.2rem;
    font-size: 0.7rem;
    letter-spacing: 0.01em;
    min-width: 0;
  }
}

/* Authentication Screen */
.auth-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg);
  z-index: 10000;
}

.auth-container {
  max-width: 400px;
  width: 90%;
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-header .hero-sigil {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.auth-header h1 {
  font-family: "Cinzel", serif;
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: var(--fg);
}

.auth-header .tagline {
  font-size: 0.95rem;
  color: var(--muted);
}

.auth-form {
  padding: 2rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(147, 197, 253, 0.18);
  background: linear-gradient(140deg, rgba(34, 30, 72, 0.92), rgba(21, 65, 104, 0.78));
  box-shadow: 0 16px 32px -20px rgba(56, 189, 248, 0.4);
  position: relative;
  overflow: hidden;
}

.auth-form::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background-image: url("data:image/svg+xml,%3Csvg width='160' height='160' viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.22'%3E%3Ccircle cx='18' cy='22' r='1.2'/%3E%3Ccircle cx='90' cy='40' r='1.6'/%3E%3Ccircle cx='140' cy='18' r='1'/%3E%3Ccircle cx='60' cy='90' r='1.4'/%3E%3Ccircle cx='18' cy='120' r='1'/%3E%3Ccircle cx='120' cy='140' r='1.5'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 130px 130px;
  pointer-events: none;
  opacity: 0.45;
  z-index: 0;
}

.auth-form h2 {
  font-family: "Cinzel", serif;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--fg);
  position: relative;
  z-index: 1;
  text-align: center;
}

.google-sign-in {
  width: 100%;
  padding: 0.75rem 1.3rem;
  border-radius: 1rem;
  border: 2px solid transparent;
  background:
    linear-gradient(var(--card-bg), var(--card-bg)) padding-box,
    linear-gradient(135deg, rgba(66, 133, 244, 0.6), rgba(52, 168, 83, 0.6)) border-box;
  color: #f5fbff;
  font-weight: 600;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(66, 133, 244, 0.2), 0 0 40px rgba(66, 133, 244, 0.1);
  font-family: "Manrope", sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  position: relative;
  z-index: 1;
  font-size: 0.95rem;
}

.google-sign-in:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow:
    0 8px 30px rgba(66, 133, 244, 0.4),
    0 0 60px rgba(66, 133, 244, 0.2);
  border-color: rgba(66, 133, 244, 0.6);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  position: relative;
  z-index: 1;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(147, 197, 253, 0.2);
}

.auth-divider span {
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.auth-input {
  width: 100%;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(147, 197, 253, 0.3);
  background: rgba(13, 16, 31, 0.85);
  color: var(--fg);
  font-size: 1rem;
  font-family: "Manrope", sans-serif;
  position: relative;
  z-index: 1;
}

.auth-input:focus {
  outline: 1px solid rgba(214, 98, 241, 0.65);
  box-shadow: 0 0 0 3px rgba(214, 98, 241, 0.15);
}

.auth-buttons {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  position: relative;
  z-index: 1;
}

.auth-button {
  flex: 1;
  padding: 0.75rem 1.3rem;
  border-radius: 1rem;
  border: 2px solid transparent;
  background:
    linear-gradient(var(--card-bg), var(--card-bg)) padding-box,
    linear-gradient(135deg, rgba(214, 98, 241, 0.8), rgba(252, 181, 100, 0.8)) border-box;
  color: #f5fbff;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(214, 98, 241, 0.2), 0 0 40px rgba(214, 98, 241, 0.1);
  font-family: "Manrope", sans-serif;
}

.auth-button:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow:
    0 8px 30px rgba(214, 98, 241, 0.4),
    0 0 60px rgba(214, 98, 241, 0.2);
  border-color: rgba(214, 98, 241, 0.6);
}

.auth-button-secondary {
  background:
    linear-gradient(var(--card-bg), var(--card-bg)) padding-box,
    linear-gradient(135deg, rgba(147, 197, 253, 0.6), rgba(96, 165, 250, 0.6)) border-box;
  box-shadow: 0 4px 20px rgba(96, 165, 250, 0.15), 0 0 40px rgba(96, 165, 250, 0.08);
}

.auth-button-secondary:hover {
  box-shadow:
    0 8px 30px rgba(96, 165, 250, 0.3),
    0 0 60px rgba(96, 165, 250, 0.15);
  border-color: rgba(96, 165, 250, 0.6);
}

.auth-error {
  color: #f87171;
  font-size: 0.875rem;
  margin-top: 1rem;
  min-height: 1.25rem;
  position: relative;
  z-index: 1;
}

.header-content {
  position: static;
}

.app-header {
  position: relative;
}

.logout-button {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(147, 197, 253, 0.35);
  background: rgba(23, 43, 78, 0.72);
  color: rgba(232, 248, 255, 0.88);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: "Manrope", sans-serif;
}

.logout-button:hover {
  transform: translateY(-1px);
  background: rgba(51, 92, 150, 0.78);
  color: #f5fbff;
}

/* Edit Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 11, 22, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-container {
  max-width: 500px;
  width: 90%;
  border-radius: 0.9rem;
  border: 1px solid rgba(147, 197, 253, 0.18);
  background: linear-gradient(140deg, rgba(34, 30, 72, 0.92), rgba(21, 65, 104, 0.78));
  box-shadow: 0 16px 32px -20px rgba(56, 189, 248, 0.4);
  position: relative;
  overflow: visible;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { 
    opacity: 0;
    transform: translateY(20px);
  }
  to { 
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-container::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background-image: url("data:image/svg+xml,%3Csvg width='160' height='160' viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.22'%3E%3Ccircle cx='18' cy='22' r='1.2'/%3E%3Ccircle cx='90' cy='40' r='1.6'/%3E%3Ccircle cx='140' cy='18' r='1'/%3E%3Ccircle cx='60' cy='90' r='1.4'/%3E%3Ccircle cx='18' cy='120' r='1'/%3E%3Ccircle cx='120' cy='140' r='1.5'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 130px 130px;
  pointer-events: none;
  opacity: 0.45;
  z-index: 0;
}

.modal-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid rgba(147, 197, 253, 0.15);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1;
}

.modal-header h2 {
  font-family: "Cinzel", serif;
  font-size: 1.5rem;
  color: var(--fg);
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  color: rgba(232, 248, 255, 0.7);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: #f5fbff;
}

.modal-body {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
  z-index: 1;
  overflow: visible;
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.modal-field label {
  font-size: 0.9rem;
  color: rgba(220, 242, 255, 0.85);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.modal-field input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(147, 197, 253, 0.3);
  background: rgba(13, 16, 31, 0.85);
  color: var(--fg);
  font-size: 1rem;
  font-family: "Manrope", sans-serif;
}

.modal-field input:focus {
  outline: 1px solid rgba(214, 98, 241, 0.65);
  box-shadow: 0 0 0 3px rgba(214, 98, 241, 0.15);
}

.modal-field select {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(147, 197, 253, 0.3);
  background: rgba(13, 16, 31, 0.85);
  color: var(--fg);
  font-size: 1rem;
  font-family: "Manrope", sans-serif;
  cursor: pointer;
}

.modal-field select:focus {
  outline: 1px solid rgba(214, 98, 241, 0.65);
  box-shadow: 0 0 0 3px rgba(214, 98, 241, 0.15);
}

/* Custom dropdown in modal */
.modal-field .custom-select {
  width: 100%;
  min-width: 0;
  position: relative;
  z-index: 10000;
}

.modal-field .custom-select-trigger {
  background: rgba(13, 16, 31, 0.85);
  border-color: rgba(147, 197, 253, 0.3);
  position: relative;
  z-index: 10001;
}

.modal-field .custom-select-trigger:hover {
  border-color: rgba(214, 98, 241, 0.5);
}

.modal-field .custom-select-dropdown {
  background: rgba(13, 16, 31, 0.95);
  border-color: rgba(147, 197, 253, 0.35);
  z-index: 999999999;
  max-height: 200px;
  pointer-events: auto;
}

.modal-field .custom-select-option {
  position: relative;
  z-index: 100000;
  pointer-events: auto;
  cursor: pointer;
}

.modal-field .custom-select-option:hover {
  background: rgba(214, 98, 241, 0.15);
}

.modal-body {
  position: relative;
  z-index: 1;
}

.modal-footer {
  position: relative;
  z-index: 1;
}

.modal-description {
  color: rgba(220, 242, 255, 0.75);
  font-size: 0.95rem;
  margin: 0 0 0.5rem 0;
}

.modal-description strong {
  color: rgba(214, 98, 241, 0.95);
  font-weight: 600;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: rgba(220, 242, 255, 0.85);
  font-size: 0.95rem;
  text-transform: none;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  cursor: pointer;
  accent-color: rgba(214, 98, 241, 0.8);
}

.modal-footer {
  padding: 1.5rem 2rem;
  border-top: 1px solid rgba(147, 197, 253, 0.15);
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  position: relative;
  z-index: 1;
}

.modal-button {
  padding: 0.75rem 1.3rem;
  border-radius: 1rem;
  border: 2px solid transparent;
  background:
    linear-gradient(var(--card-bg), var(--card-bg)) padding-box,
    linear-gradient(135deg, rgba(214, 98, 241, 0.8), rgba(252, 181, 100, 0.8)) border-box;
  color: #f5fbff;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(214, 98, 241, 0.2), 0 0 40px rgba(214, 98, 241, 0.1);
  font-family: "Manrope", sans-serif;
  font-size: 0.9rem;
}

.modal-button:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow:
    0 8px 30px rgba(214, 98, 241, 0.4),
    0 0 60px rgba(214, 98, 241, 0.2);
  border-color: rgba(214, 98, 241, 0.6);
}

.modal-button-secondary {
  background:
    linear-gradient(var(--card-bg), var(--card-bg)) padding-box,
    linear-gradient(135deg, rgba(147, 197, 253, 0.6), rgba(96, 165, 250, 0.6)) border-box;
  box-shadow: 0 4px 20px rgba(96, 165, 250, 0.15), 0 0 40px rgba(96, 165, 250, 0.08);
}

.modal-button-secondary:hover {
  box-shadow:
    0 8px 30px rgba(96, 165, 250, 0.3),
    0 0 60px rgba(96, 165, 250, 0.15);
  border-color: rgba(96, 165, 250, 0.6);
}
