.panel--workout {
  background: rgba(8, 16, 28, 0.92);
  border-color: rgba(34, 197, 94, 0.35);
}
* {
  box-sizing: border-box;
}

body.app-body {
  margin: 0;
  min-height: 100vh;
  background: #0f172a;
  color: #e2e8f0;
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
  line-height: 1.5;
}

.hidden {
  display: none !important;
}

.app-container {
  margin: 0 auto;
  padding: 50px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.section-block {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.section-header__group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.section-header__group--right {
  margin-left: auto;
  text-align: right;
  align-items: flex-end;
}

.section-header__title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
}

.section-header__subtitle {
  margin: 0;
  color: #94a3b8;
  font-size: 0.9rem;
}

.section-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.card-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin: 0 16px;
}

.routine-card {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid #334155;
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.35);
  min-height: 220px;
}

.routine-card:hover {
  border-color: #60a5fa;
}

.routine-card__title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
}

.routine-card__focus {
  display: inline-flex;
  margin-top: 4px;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
}

.routine-card__description {
  margin: 0;
  color: #cbd5f5;
  font-size: 0.9rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  text-overflow: ellipsis;
}

.routine-card__meta {
  font-size: 0.8rem;
  color: #94a3b8;
  margin: 4px 0 12px;
}

.routine-card__actions {
  display: flex;
  gap: 8px;
  align-items: stretch;
  min-width: 0;
  margin-top: auto;
}

.routine-card__action {
  flex: 0 0 auto;
  white-space: nowrap;
}

.routine-card__action--primary {
  flex: 1 1 160px;
}

.card-empty {
  border: 1px dashed #475569;
  border-radius: 16px;
  padding: 24px 20px;
  background: rgba(15, 23, 42, 0.45);
  color: #94a3b8;
  text-align: center;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-empty__text {
  margin: 0;
  font-size: 0.95rem;
}

.card-create {
  border: 1px dashed #475569;
  border-radius: 16px;
  padding: 28px 20px;
  background: rgba(15, 23, 42, 0.45);
  color: #94a3b8;
  text-align: center;
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
}

.card-create:hover {
  border-color: #60a5fa;
  color: #60a5fa;
}

.card-create__icon {
  font-size: 2.1rem;
  line-height: 1;
}

.card-create__label {
  font-size: 0.85rem;
}

.btn {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 0.9rem;
  background: #1f2937;
  color: #e2e8f0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}


.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn--primary {
  background: #10b981;
  border-color: #10b981;
  color: #06281a;
}

.btn--primary:hover:not(:disabled) {
  background: #34d399;
}

.btn--outline {
  background: transparent;
  border-color: #475569;
}

.btn--outline:hover:not(:disabled) {
  border-color: #60a5fa;
  color: #60a5fa;
  background: rgba(255, 255, 255, 0.15);
}

.btn--success {
  border-color: #10b981;
  color: #10b981;
}

.btn--success:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
}

.btn--warning {
  border-color: #f97316;
  color: #f97316;
}

.btn--warning:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
}

.btn--danger {
  background: #ef4444;
  border-color: #ef4444;
  color: #fff;
}

.btn--danger:hover:not(:disabled) {
  background: #ef4444;
  border-color: #ef4444;
}

.btn--light {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

.btn--light:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}

.btn--block {
  width: 100%;
}

.btn-icon {
  border: 1px solid #475569;
  background: rgba(15, 23, 42, 0.6);
  color: #cbd5f5;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.btn-icon:hover {
  border-color: #60a5fa;
  color: #60a5fa;
}

.btn-icon--copy:hover {
  border-color: #10b981;
  color: #10b981;
}

.btn-icon--danger {
  border-color: #f87171;
  color: #f87171;
}

.btn-icon--danger:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-icon__svg {
  width: 1rem;
  height: 1rem;
}

.btn-icon--drag {
  border-style: dashed;
  cursor: grab;
}

.btn-icon--drag:active {
  cursor: grabbing;
}

.btn-icon--dragging {
  border-color: #60a5fa;
  color: #60a5fa;
  cursor: grabbing;
}

.btn-icon--info {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(71, 85, 105, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.btn-icon--info:hover {
  background: rgba(71, 85, 105, 0.9);
  border-color: rgba(96, 165, 250, 0.6);
}

.btn-icon__text {
  font-size: 0.75rem;
  font-weight: 600;
  color: #e2e8f0;
  line-height: 1;
}

.builder-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.builder-bar__back {
  background: none;
  border: none;
  color: #94a3b8;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 1.3rem;
}

.builder-bar__back:hover {
  color: #ffffff;
}

.builder-bar__titles {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.builder-bar__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.builder-bar__meta {
  margin: 0;
  color: #facc15;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.builder-bar__subtitle {
  margin: 0;
  color: #94a3b8;
  font-size: 0.88rem;
}

.editable-text {
  position: relative;
  display: inline-block;
  padding: 4px 32px 4px 10px;
  border-bottom: 1px solid transparent;
}

.editable-text[contenteditable="true"] {
  cursor: text;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 4px;
  border-bottom-color: rgba(255, 255, 255, 0.3);
}

.editable-text[contenteditable="false"] {
  cursor: default;
  padding-right: 0;
  padding-left: 0;
  background: transparent;
  border-bottom-color: transparent;
}

.editable-text[contenteditable="true"]:focus {
  outline: none;
  border-bottom-color: rgba(255, 255, 255, 0.75);
}

.editable-text[contenteditable="true"]:empty::before {
  content: attr(data-placeholder);
  color: #64748b;
  font-style: italic;
}

.editable-text[contenteditable="true"]::after {
  content: "✎";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  color: #94a3b8;
  pointer-events: none;
  opacity: 0.9;
}

.layout-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  align-items: start;
  margin: 0 16px;
}

.workout-view__host {
  display: contents;
}

.edit-view__container {
  padding: 16px;
  max-width: 100%;
}

.edit-routine-table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  background: rgba(15, 23, 42, 0.85);
  border-radius: 8px;
  overflow-x: auto;
  overflow-y: visible;
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.3);
}

.edit-routine-table thead {
  background: rgba(30, 41, 59, 0.9);
}

.edit-routine-table th {
  padding: 12px 8px;
  text-align: left;
  font-weight: 600;
  font-size: 0.9rem;
  color: #e2e8f0;
  border-bottom: 2px solid rgba(148, 163, 184, 0.2);
}

.edit-routine-table th:first-child {
  width: 1%;
  text-align: center;
}

.edit-routine-table th:nth-child(2) {
  width: 1%;
  text-align: center;
}

.edit-routine-table th:nth-child(3) {
  min-width: 200px;
}

.edit-routine-table th:nth-child(4) {
  width: 50px;
  text-align: center;
}

.edit-routine-table th:nth-child(5) {
  width: 100px;
}

.edit-routine-table th:nth-child(6),
.edit-routine-table th:nth-child(7),
.edit-routine-table th:nth-child(8) {
  width: 100px;
}

.edit-routine-table__row {
  border-bottom: none;
}

.edit-routine-table__row:nth-child(even) {
  background: rgba(30, 41, 59, 0.4);
}

.edit-routine-table__row:nth-child(odd) {
  background: transparent;
}

.edit-routine-table__row:hover {
  background: rgba(255, 255, 255, 0.1) !important;
}

.edit-routine-table__cell--number {
  text-align: center;
  color: #94a3b8;
  font-weight: 500;
  user-select: none;
}

.edit-routine-table__cell--actions {
  padding: 4px;
  text-align: center;
}

.edit-routine-table__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  width: 44px;
}

.edit-routine-table__action-btn {
  width: 20px;
  height: 20px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 3px;
  color: #e2e8f0;
  cursor: pointer;
}

.edit-routine-table__action-btn:hover {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(148, 163, 184, 0.4);
}

.edit-routine-table__action-btn--drag {
  cursor: grab;
}

.edit-routine-table__action-btn--drag:active {
  cursor: grabbing;
}

.edit-routine-table__action-btn--delete:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.6);
  color: #fca5a5;
}

.edit-routine-table__action-icon {
  width: 12px;
  height: 12px;
}

.edit-routine-table__action-btn--add:hover {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.6);
  color: #86efac;
}

.edit-routine-table__cell--info {
  text-align: center;
  padding: 4px;
}

.edit-routine-table__info-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 4px;
  color: #e2e8f0;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.edit-routine-table__info-btn:hover:not(:disabled) {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(148, 163, 184, 0.4);
  color: #60a5fa;
}

.edit-routine-table__info-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.edit-routine-table__info-icon {
  width: 16px;
  height: 16px;
}

/* Exercise Info Modal */
.exercise-info-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.exercise-info-modal.hidden {
  display: none;
}

.exercise-info-modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}

.exercise-info-modal__content {
  position: relative;
  background: rgba(15, 23, 42, 0.95);
  border-radius: 12px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  z-index: 1;
}

.exercise-info-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 6px;
  color: #e2e8f0;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  z-index: 10;
}

.exercise-info-modal__close:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.6);
  color: #fca5a5;
}

.exercise-info-modal__video-wrapper {
  width: 100%;
  background: #000;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
}

.exercise-info-modal__video {
  width: 100%;
  height: auto;
  display: block;
}

.exercise-info-modal__details {
  padding: 24px;
}

.exercise-info-modal__name {
  margin: 0 0 16px 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: #e2e8f0;
}

.exercise-info-modal__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.exercise-info-modal__tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgb(148 163 184);
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(71, 85, 105, 0.7);
  border-radius: 999px;
  padding: 3px 8px;
  white-space: nowrap;
}

.exercise-info-modal__tag--region {
  color: #0f172a;
  font-weight: 600;
}

.exercise-info-modal__tag--region[data-region="lower-body"] {
  color: rgba(134, 239, 172, 0.85);
  border-color: rgba(34, 197, 94, 0.8);
  background: rgba(34, 197, 94, 0.18);
}

.exercise-info-modal__tag--region[data-region="upper-body"] {
  color: rgba(191, 219, 254, 0.85);
  border-color: rgba(59, 130, 246, 0.8);
  background: rgba(59, 130, 246, 0.18);
}

.exercise-info-modal__tag--region[data-region="core"] {
  color: rgba(253, 230, 138, 0.85);
  border-color: rgba(234, 179, 8, 0.8);
  background: rgba(234, 179, 8, 0.2);
}

.exercise-info-modal__tag--region[data-region="full-body"] {
  color: rgba(252, 202, 202, 0.85);
  border-color: rgba(239, 68, 68, 0.75);
  background: rgba(239, 68, 68, 0.18);
}

.exercise-info-modal__tag--empty {
  color: #64748b;
  font-style: italic;
}

.exercise-info-modal__description {
  margin: 0;
  color: #cbd5e1;
  line-height: 1.6;
  font-size: 0.95rem;
}

.edit-routine-table__row--dragging {
  opacity: 0.5;
  background: rgba(96, 165, 250, 0.2) !important;
}

.edit-routine-table__row--drop-before {
  border-top: 2px solid rgba(96, 165, 250, 0.8);
}

.edit-routine-table__row--drop-after {
  border-bottom: 2px solid rgba(96, 165, 250, 0.8);
}

.edit-routine-table__cell {
  padding: 2px;
  vertical-align: middle;
  border: none;
}

.edit-routine-table__cell--number {
  text-align: center;
  color: #94a3b8;
  font-weight: 500;
  cursor: grab;
  user-select: none;
}

.edit-routine-table__cell--number:active {
  cursor: grabbing;
}

.edit-routine-table__cell--name {
  position: relative;
}

.edit-routine-table__name-wrapper {
  position: relative;
}

.edit-routine-table__name-input {
  width: 100%;
  padding: 8px 12px;
  background: rgba(30, 41, 59, 0.6);
  border: none;
  border-radius: 4px;
  color: #e2e8f0;
  font-size: 0.95rem;
}

.edit-routine-table__name-input:focus {
  outline: none;
  border-color: #60a5fa;
  background: rgba(30, 41, 59, 0.8);
}

.edit-routine-table__name-input::placeholder {
  color: #64748b;
}

.edit-routine-table__dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 4px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.edit-routine-table__dropdown-item {
  padding: 6px 10px;
  cursor: pointer;
  color: #e2e8f0;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.edit-routine-table__dropdown-item:hover {
  background: rgba(96, 165, 250, 0.2);
}

.edit-routine-table__dropdown-name {
  font-weight: 500;
  color: #e2e8f0;
}

.edit-routine-table__tags {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.edit-routine-table__tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgb(148 163 184);
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(71, 85, 105, 0.7);
  border-radius: 999px;
  padding: 2px 6px;
  white-space: nowrap;
}

.edit-routine-table__tag--region {
  color: #0f172a;
  font-weight: 600;
}

.edit-routine-table__tag--region[data-region="lower-body"] {
  color: rgba(134, 239, 172, 0.85);
  border-color: rgba(34, 197, 94, 0.8);
  background: rgba(34, 197, 94, 0.18);
}

.edit-routine-table__tag--region[data-region="upper-body"] {
  color: rgba(191, 219, 254, 0.85);
  border-color: rgba(59, 130, 246, 0.8);
  background: rgba(59, 130, 246, 0.18);
}

.edit-routine-table__tag--region[data-region="core"] {
  color: rgba(253, 230, 138, 0.85);
  border-color: rgba(234, 179, 8, 0.8);
  background: rgba(234, 179, 8, 0.2);
}

.edit-routine-table__tag--region[data-region="full-body"] {
  color: rgba(252, 202, 202, 0.85);
  border-color: rgba(239, 68, 68, 0.75);
  background: rgba(239, 68, 68, 0.18);
}

.edit-routine-table__dropdown-item:first-child {
  border-radius: 6px 6px 0 0;
}

.edit-routine-table__dropdown-item:last-child {
  border-radius: 0 0 6px 6px;
}

.edit-routine-table__type-select {
  width: 100%;
  padding: 8px 12px;
  background: rgba(30, 41, 59, 0.6);
  border: none;
  border-radius: 4px;
  color: #e2e8f0;
  font-size: 0.95rem;
  cursor: pointer;
}

.edit-routine-table__type-select:focus {
  outline: none;
  border-color: #60a5fa;
  background: rgba(30, 41, 59, 0.8);
}

.edit-routine-table__input {
  width: 100%;
  padding: 8px 12px;
  background: rgba(30, 41, 59, 0.6);
  border: none;
  border-radius: 4px;
  color: #e2e8f0;
  font-size: 0.95rem;
}

.edit-routine-table__input:focus {
  outline: none;
  border-color: #60a5fa;
  background: rgba(30, 41, 59, 0.8);
}

.edit-routine-table__input::-webkit-inner-spin-button,
.edit-routine-table__input::-webkit-outer-spin-button {
  opacity: 1;
}

.edit-routine-table__input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: rgba(30, 41, 59, 0.3);
}

.panel {
  background: rgba(15, 23, 42, 0.85);
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.3);
}

.panel__header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.panel__header-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
  width: 100%;
}

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

.panel__title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
}

.panel__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.panel__status {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
}

.panel__empty {
  margin: 0;
  font-size: 0.9rem;
  color: #94a3b8;
}

.stats-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 16px;
  padding: 20px 22px;
}

.stats-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.stats-search {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stats-toolbar__clear {
  margin-left: auto;
}

.stats-table-wrapper {
  overflow: auto;
  border-radius: 12px;
  border: 1px solid rgba(71, 85, 105, 0.5);
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
  background: rgba(15, 23, 42, 0.85);
}

.stats-table thead {
  background: rgba(30, 41, 59, 0.95);
}

.stats-table th,
.stats-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(71, 85, 105, 0.35);
  text-align: left;
  font-size: 0.9rem;
  color: #e2e8f0;
  vertical-align: top;
}

.stats-table tbody tr:nth-child(odd) {
  background: rgba(15, 23, 42, 0.7);
}

.stats-table tbody tr:hover {
  background: rgba(59, 130, 246, 0.08);
}

.stats-sort {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 0;
}

.stats-sort::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 6px solid rgba(148, 163, 184, 0.6);
  opacity: 0;
}

.stats-sort[data-sort="asc"]::after {
  opacity: 1;
  transform: rotate(180deg);
}

.stats-sort[data-sort="desc"]::after {
  opacity: 1;
}

.stats-cell--muted {
  color: #94a3b8;
}

.stats-cell--tag {
  vertical-align: top;
  padding-top: 8px;
  padding-bottom: 8px;
}

.stats-tag-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  margin: 0;
  padding: 0;
}

.stats-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  border: 1px solid rgba(96, 165, 250, 0.5);
  background: rgba(59, 130, 246, 0.15);
  color: rgba(191, 219, 254, 0.95);
  padding: 2px 8px;
  font-size: 0.75rem;
  cursor: pointer;
}

.stats-tag:hover,
.stats-tag:focus-visible {
  border-color: rgba(96, 165, 250, 0.9);
  background: rgba(37, 99, 235, 0.3);
  color: #f8fafc;
  outline: none;
}

.stats-tag--active {
  border-color: rgba(34, 197, 94, 0.8);
  background: rgba(34, 197, 94, 0.25);
  color: rgba(240, 253, 244, 0.95);
}

.stats-tag--region {
  border-color: rgba(71, 85, 105, 0.6);
  background: rgba(15, 23, 42, 0.6);
  color: rgba(148, 163, 184, 0.95);
}

.stats-tag--region[data-region="lower-body"],
.stats-tag--region[data-region="upper-body"],
.stats-tag--region[data-region="core"],
.stats-tag--region[data-region="full-body"] {
  background: rgba(15, 23, 42, 0.6);
}

.stats-tag--empty {
  border: none;
  background: none;
  color: #94a3b8;
  padding: 0;
  gap: 0;
  cursor: default;
}

.stats-tag--empty:hover,
.stats-tag--empty:focus-visible {
  border: none;
  background: none;
  color: #94a3b8;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.filter-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 2px;
  margin-bottom: 6px;
}

.filter-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-count {
  font-size: 0.8rem;
  font-weight: 600;
  color: #cbd5f5;
  letter-spacing: 0.04em;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid rgba(96, 165, 250, 0.6);
  background: rgba(37, 99, 235, 0.18);
  color: rgb(191 219 254);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  appearance: none;
}

.filter-chip:hover,
.filter-chip:focus-visible {
  background: rgba(37, 99, 235, 0.3);
  border-color: rgb(59 130 246);
  color: rgb(226 232 240);
  outline: none;
}


.filter-chip__close {
  font-size: 0.9em;
  line-height: 1;
}

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

.field--inline {
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
  border: none;
  padding: 0;
  margin: 0;
}

.field--split {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.field__label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #cbd5f5;
}

.field__input {
  background: #0b1220;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.9rem;
  color: #e2e8f0;
}

.field__input:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.25);
  outline: none;
}

.field__input--textarea {
  min-height: 120px;
  resize: vertical;
}

.field__selection {
  font-size: 0.85rem;
  font-weight: 600;
  color: #facc15;
}

.field__selection span {
  color: inherit;
}

.option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: #e2e8f0;
}

.option__input {
  accent-color: #60a5fa;
}

.library {
  display: flex;
  flex-direction: column;
  gap: 12px;
}


.library__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.library__empty {
  font-size: 0.8rem;
  color: #94a3b8;
  margin: 0;
}

.routine-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.routine-finished {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid #334155;
  border-radius: 14px;
  text-align: center;
  padding: 44px 16px;
  font-size: 1.5rem;
  font-weight: 600;
  color: #e2e8f0;
}

.routine-entry {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid #334155;
  border-radius: 14px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
  position: relative;
}

.routine-entry--active {
  border-color: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.18);
}

.routine-entry::before,
.routine-entry::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  border-top: 2px dashed transparent;
  pointer-events: none;
}

.routine-entry::before {
  top: 4px;
}

.routine-entry::after {
  bottom: 4px;
}

.routine-entry--dragging {
  opacity: 0.55;
}

.routine-entry--drop-before::before {
  border-color: rgba(96, 165, 250, 0.95);
}

.routine-entry--drop-after::after {
  border-color: rgba(96, 165, 250, 0.95);
}

.routine-entry__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.routine-entry__text {
  flex: 1;
  min-width: 0;
}

.routine-entry__title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.routine-entry__meta {
  margin-top: 2px;
  font-size: 0.78rem;
  color: #94a3b8;
}

.routine-entry__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.routine-entry__icons {
  display: flex;
  gap: 6px;
}

.routine-entry__details {
  display: none;
}

.routine-entry--expanded .routine-entry__details {
  display: block;
}

.routine-entry__description-text {
  margin-top: 12px;
  font-size: 0.85rem;
  color: #cbd5f5;
  line-height: 1.4;
}

.routine-entry__body {
  padding: 0;
  opacity: 0;
  visibility: hidden;
}

.routine-entry--expanded .routine-entry__body {
  max-height: 500px;
  padding-top: 10px;
  opacity: 1;
  visibility: visible;
}

/* In workout view and editor view, show fields by default, hide when expanded */
#workoutView .routine-entry__fields--split,
#workoutView .routine-entry__fields,
#editView .routine-entry__fields--split,
#editView .routine-entry__fields {
  opacity: 1;
  visibility: visible;
}

#workoutView .routine-entry--expanded .routine-entry__fields--split,
#workoutView .routine-entry--expanded .routine-entry__fields,
#editView .routine-entry--expanded .routine-entry__fields--split,
#editView .routine-entry--expanded .routine-entry__fields {
  opacity: 0;
  visibility: hidden;
  max-height: 0;
  padding: 0;
  margin: 0;
}

.routine-entry__fields {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 14px;
}

.routine-entry__fields--split {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
  width: 100%;
}

.routine-entry__fields--split .value-field {
  flex: 1;
}

.value-field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  position: relative;
  flex: 1 1 0;
}

.value-field__label {
  font-size: 1rem;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.value-field__input-wrapper {
  display: flex;
  align-items: center;
}

.value-field__input {
  background: #0b1220;
  border: 1px solid #1e293b;
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
  padding: 3px 4px;
  width: 100%;
  text-align: center;
  color: #e2e8f0;
  font-size: 2.5rem;
}

.value-field__input::-webkit-outer-spin-button,
.value-field__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}

.value-field__input[type=number] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.value-field__input:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.25);
  outline: none;
}

.value-field__steps {
  display: flex;
  flex-direction: column;
  border: 1px solid #1e293b;
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
  min-width: 48px;
  overflow: hidden;
  background: #111827;
}

.value-field__step {
  border: none;
  background: transparent;
  color: #e2e8f0;
  padding: 0px;
  font-weight: 600;
  font-size: 1.46rem;
  cursor: pointer;
  flex: 1;
}

.value-field__step:hover {
  background: rgba(96, 165, 250, 0.2);
  color: #60a5fa;
}

.value-field__step--down {
  border-top: 1px solid #1e293b;
}

.toggle-switch {
  border: 1px solid #334155;
  border-radius: 999px;
  background: #10182a;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  width: auto;
}

.routine-entry__toggle-wrapper {
  display: flex;
  justify-content: flex-start;
  margin-top: 8px;
}

.routine-entry__controls-row {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  margin-top: 8px;
}

.toggle-switch__label {
  font-weight: 600;
  font-size: 0.7rem;
  color: #94a3b8;
}

.toggle-switch--time .toggle-switch__label--time {
  color: #fbbf24;
}

.toggle-switch--reps .toggle-switch__label--reps {
  color: #fb923c;
}

.toggle-switch__track {
  position: relative;
  width: 36px;
  height: 18px;
  border-radius: 999px;
  background: #1e293b;
  display: inline-flex;
  align-items: center;
}

.toggle-switch__thumb {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #fbbf24;
  top: 2px;
  left: 2px;
}

.toggle-switch--reps .toggle-switch__thumb {
  transform: translateX(18px);
  background: #fb923c;
}

.toggle-switch:hover {
  border-color: #60a5fa;
}

.session-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 14px;
}

.session-info__label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
}

.session-info__primary {
  font-size: 1.05rem;
  font-weight: 600;
  margin-top: 2px;
}

.session-info__secondary {
  font-size: 0.86rem;
  color: #cbd5f5;
}

.timer {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.timer__display {
  font-size: 1.85rem;
  font-family: "Roboto Mono", monospace;
  letter-spacing: 0.08em;
}

.session-controls {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.session-controls__btn {
  min-width: 200px;
}

/* Existing exercise library styles */
:root {
  color-scheme: dark;
}

.exercise-section__title {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgb(148 163 184);
}

.exercise-group__title {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgb(165 180 195);
  text-transform: uppercase;
}

.exercise-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.exercise-item {
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgb(51 65 85);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.exercise-item__info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1 1 auto;
  min-width: 0;
}

.exercise-item__name {
  font-weight: 600;
  color: rgb(226 232 240);
}

.exercise-item__meta {
  font-size: 0.75rem;
  color: rgb(148 163 184);
}

.exercise-item__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.exercise-item__description {
  display: none;
  margin-top: 6px;
  font-size: 0.78rem;
  color: rgb(203 213 225);
  line-height: 1.3;
}

.exercise-item:hover .exercise-item__description,
.exercise-item:focus-within .exercise-item__description {
  display: block;
}

.exercise-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgb(148 163 184);
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(71, 85, 105, 0.7);
  border-radius: 999px;
  padding: 3px 8px;
  cursor: pointer;
  appearance: none;
}

.exercise-tag:hover,
.exercise-tag:focus-visible {
  outline: none;
  background: rgba(96, 165, 250, 0.18);
  border-color: rgba(96, 165, 250, 0.6);
  color: rgb(226 232 240);
}


.exercise-tag--active {
  background: rgba(96, 165, 250, 0.3);
  border-color: rgba(96, 165, 250, 0.85);
  color: rgb(248 250 252);
}

.exercise-tag--region {
  color: #0f172a;
  font-weight: 600;
}

.exercise-tag--region[data-region="lower-body"],
.stats-tag--region[data-region="lower-body"] {
  color: rgba(134, 239, 172, 0.85);
  border-color: rgba(34, 197, 94, 0.8);
  background: rgba(34, 197, 94, 0.18);
}

.exercise-tag--region[data-region="upper-body"],
.stats-tag--region[data-region="upper-body"] {
  color: rgba(191, 219, 254, 0.85);
  border-color: rgba(59, 130, 246, 0.8);
  background: rgba(59, 130, 246, 0.18);
}

.exercise-tag--region[data-region="core"],
.stats-tag--region[data-region="core"] {
  color: rgba(253, 230, 138, 0.85);
  border-color: rgba(234, 179, 8, 0.8);
  background: rgba(234, 179, 8, 0.2);
}

.exercise-tag--region[data-region="full-body"],
.stats-tag--region[data-region="full-body"] {
  color: rgba(252, 202, 202, 0.85);
  border-color: rgba(239, 68, 68, 0.75);
  background: rgba(239, 68, 68, 0.18);
}

.exercise-item__add {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(59, 130, 246, 0.6);
  background: rgba(37, 99, 235, 0.15);
  color: rgb(96, 165, 250);
  font-size: 1.25rem;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: 0 0 34px;
}

.exercise-item:hover {
  border-color: rgb(59 130 246);
  background-color: rgba(15, 23, 42, 0.85);
}

.exercise-item__add:hover,
.exercise-item__add:focus-visible {
  background: rgba(37, 99, 235, 0.3);
  border-color: rgb(59 130 246);
  color: rgb(191 219 254);
  outline: none;
}

.routine-entry--active {
  border-color: rgb(16 185 129);
  background-color: rgba(16, 185, 129, 0.12);
}

.routine-entry--completed {
  border-color: rgb(59 130 246);
  background-color: rgba(59, 130, 246, 0.12);
}

#exerciseList ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

#exerciseList li {
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Global Navbar Styles */
.workout-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 4px;
  background: rgba(8, 16, 28, 0.98);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  max-width: 100%;
}

.workout-nav__back {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: #e2e8f0;
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 8px;
  justify-self: start;
}

.workout-nav__back:hover {
  background: rgba(255, 255, 255, 0.1);
}

.workout-nav__back.hidden {
  visibility: hidden;
}

.workout-nav__back span:first-child {
  font-size: 1.2rem;
}

.workout-nav__title {
  grid-column: 2;
  text-align: center;
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  padding: 0 20px;
}

.workout-nav__menu {
  grid-column: 3;
  justify-self: end;
  position: relative;
}

.workout-nav__menu-btn {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 10px 8px;
  gap: 4px;
  border-radius: 4px;
}

.workout-nav__menu-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.workout-nav__menu-btn[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.15);
}

.workout-nav__menu-icon {
  width: 100%;
  height: 2px;
  background: #e2e8f0;
  border-radius: 2px;
}

.workout-nav__menu-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(51, 65, 85, 0.6);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  min-width: 160px;
  overflow: hidden;
  z-index: 1000;
  display: none;
}

.workout-nav__menu-dropdown:not(.hidden) {
  display: block;
}

.workout-nav__menu-item {
  display: block;
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  border: none;
  color: #e2e8f0;
  font-size: 0.95rem;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.workout-nav__menu-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.workout-nav__menu-item:first-child {
  border-top: none;
}

.workout-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 16px;
}

.workout-info {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  max-height: calc(100vh - 112px);
}

#workoutView .routine-list {
  padding-bottom: 50vh;
}

.workout-video {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 112px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.workout-video__player {
  width: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  max-height: calc(100vh - 112px);
  object-fit: contain;
}

.workout-video__player[src]:not([hidden]) {
  display: block;
}

.workout-exercise-stats {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  padding: 20px;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

.workout-exercise-stats--graph-view {
  overflow: visible;
}

.workout-exercise-stats__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-shrink: 0;
}

.workout-exercise-stats__header-left {
  flex: 1;
}

.workout-exercise-stats__title {
  margin: 0 0 4px 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #e2e8f0;
}

.workout-exercise-stats__count {
  margin: 0;
  font-size: 0.875rem;
  color: #94a3b8;
}

.workout-exercise-stats__toggles {
  display: flex;
  gap: 4px;
}

.workout-exercise-stats__toggle {
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: #94a3b8;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
}

.workout-exercise-stats__toggle:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
}

.workout-exercise-stats__toggle--active {
  background: rgba(96, 165, 250, 0.3);
  border-color: rgba(96, 165, 250, 0.5);
  color: #60a5fa;
}

.workout-exercise-stats__graph {
  width: 100%;
  max-width: 100%;
  height: auto;
  min-height: 250px;
  max-height: 400px;
  aspect-ratio: 4 / 3;
  display: block;
  box-sizing: border-box;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .workout-exercise-stats__graph {
    min-height: 180px;
    max-height: 30vh;
  }
}

.workout-exercise-stats__content {
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.workout-exercise-stats__list {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.workout-exercise-stats__entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  background: rgba(255, 255, 255, 0);
}

.workout-exercise-stats__entry:nth-child(even) {
  background: rgba(255, 255, 255, 0.05);
}

.workout-exercise-stats__value {
  font-size: 1rem;
  font-weight: 600;
  color: #e2e8f0;
}

.workout-exercise-stats__date {
  font-size: 0.875rem;
  color: #94a3b8;
}

.workout-exercise-stats__empty {
  text-align: center;
  padding: 40px 20px;
  color: #94a3b8;
  font-size: 0.95rem;
}

.workout-nav__menu-item--active {
  background: rgba(96, 165, 250, 0.2);
  border-left: 3px solid #60a5fa;
}

.workout-bottom-controls {
  position: fixed;
  padding: 4px;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(8, 16, 28, 0.98);
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 100;
}

.workout-bottom-controls__top {
  display: flex;
  align-items: center;
  gap: 4px;
}

.workout-bottom-controls__timer {
  flex: 2 1 0;
  padding: 4px 16px;
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  color: #e2e8f0;
}

.workout-bottom-controls__bottom {
  display: flex;
  align-items: center;
  gap: 4px;
}

.workout-bottom-controls__btn {
  flex: 1 1 0;
  min-width: 0;
  padding: 16px;
  font-size: 1.25rem;
  font-weight: 600;
  border-radius: 4px;
}

.workout-bottom-controls__top .workout-bottom-controls__btn {
  flex: 1 1 0;
  min-width: 0;
}

@media (max-width: 640px) {
  .app-container {
    padding-left: 0;
    padding-right: 0;
  }

  .routine-entry__fields {
    gap: 12px;
  }
  .workout-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    gap: 4px;
  }
  
  .workout-video {
    position: relative;
    top: 0;
    grid-row: 1;
    max-height: 50vh;
  }
  
  .workout-video__player {
    max-height: 50vh;
    object-fit: contain;
  }
  
  .workout-exercise-stats {
    max-height: 50vh;
  }
  
  .workout-info {
    grid-row: 2;
  }
  
  .workout-nav__spacer {
    width: 80px;
  }
  
  .workout-nav__title {
    font-size: 1.25rem;
  }
}

