.routine-list {
  padding: 4px 2px 16px;
  box-sizing: border-box;
  max-height: 400px;
  overflow-y: auto;
}

/* Scrollbar Polish */
.routine-list::-webkit-scrollbar {
  width: 6px;
}

.routine-list::-webkit-scrollbar-track {
  background: transparent;
}

.routine-list::-webkit-scrollbar-thumb {
  background-color: rgba(14, 165, 233, 0.3);
  border-radius: 3px;
}

.routine-list::-webkit-scrollbar-thumb:hover {
  background-color: rgba(14, 165, 233, 0.5);
}

.routine-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.routine-toolbar__btn {
  border-radius: 12px;
  border: 2px solid rgba(14, 165, 233, 0.35);
  background: rgba(255, 255, 255, 0.95);
  color: #0ea5e9;
  font-weight: 600;
  font-size: 13px;
  padding: 12px 16px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(14, 165, 233, 0.15);
}

.routine-toolbar__btn--add {
  border-style: dashed;
  flex: 0 0 180px;
  min-width: 160px;
}

.routine-toolbar__btn--calendar {
  flex: 1;
  min-width: 180px;
  color: #0c4a6e;
  border-style: solid;
  background: rgba(255, 255, 255, 0.98);
}

.routine-toolbar__btn:is(:hover, :focus-visible) {
  border-color: rgba(14, 165, 233, 0.8);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.25);
  transform: translateY(-1px);
}

.routine-toolbar__btn.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.routine-limit-msg {
  font-size: 12px;
  color: #ef4444;
  padding: 8px;
  background: #fef2f2;
  border-radius: 8px;
  width: 100%;
  text-align: center;
}

/* Grouping Styles */
.routine-group {
  margin-bottom: 20px;
}

.routine-group__header {
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 10px;
  padding-left: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 4px;
}

.routine-group__header.is-completed {
  color: #059669;
}

.routine-group__status {
  font-size: 10px;
  background: #d1fae5;
  color: #065f46;
  padding: 2px 8px;
  border-radius: 99px;
  font-weight: 600;
}

.routine-card {
  border: 1px solid rgba(14, 165, 233, 0.25);
  border-left: 5px solid #0ea5e9;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 4px 14px rgba(15, 118, 212, 0.08);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.routine-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(15, 118, 212, 0.16);
}

.routine-card--completed {
  border-color: rgba(16, 185, 129, 0.35);
  border-left-color: #10b981;
  background: linear-gradient(130deg, #ecfdf5 0%, #d1fae5 100%);
}

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

.routine-card__title-block {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.routine-card__title {
  font-size: 15px;
  font-weight: 650;
  color: #082f49;
  line-height: 1.3;
  word-break: break-word;
}

.routine-card__subtitle {
  font-size: 12px;
  color: #2563eb;
  font-weight: 600;
}

.routine-card--completed .routine-card__subtitle {
  color: #059669;
}

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

.routine-card__action {
  border: none;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

/* Polished Buttons */
.routine-card__action--focus {
  background: #e0f2fe;
  color: #0284c7;
}

.routine-card__action--focus:hover {
  background: #bae6fd;
}

.routine-card__action--edit {
  background: #f1f5f9;
  color: #475569;
}

.routine-card__action--edit:hover {
  background: #e2e8f0;
}

.routine-card__action--delete {
  background: transparent;
  color: #ef4444;
  border: 1px solid transparent;
}

.routine-card__action--delete:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}

.routine-card__action:is(:hover, :focus-visible) {
  transform: translateY(-1px);
}

.routine-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: #475569;
}

.routine-card__meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.routine-card__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

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

.routine-pill {
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 11px;
  font-weight: 650;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
  white-space: nowrap;
}

/* Button Animations */
@keyframes pop {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(0.9);
  }

  100% {
    transform: scale(1);
  }
}

.routine-pill.is-animating {
  animation: pop 0.3s ease;
}

.routine-pill--complete {
  border-color: rgba(14, 165, 233, 0.65);
  background: #e0f2fe;
  color: #0369a1;
}

.routine-pill--pass {
  border-color: rgba(245, 158, 11, 0.65);
  background: #fef3c7;
  color: #b45309;
}

.routine-pill--pass.is-active {
  background: #f59e0b;
  color: #fff;
  border-color: #d97706;
}

.routine-pill--complete.is-active {
  background: #0ea5e9;
  color: #fff;
  border-color: #0284c7;
}

.routine-pill:is(:hover, :focus-visible) {
  transform: translateY(-1px);
}

.routine-pill.is-disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
}

.routine-card__today-label {
  font-size: 12px;
  font-weight: 600;
  color: #0f172a;
}

.routine-card--completed .routine-card__today-label {
  color: #047857;
}

.routine-empty {
  text-align: center;
  padding: 24px 16px;
  border: 2px dashed rgba(14, 165, 233, 0.35);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.85);
  color: #0f172a;
  font-size: 13px;
  line-height: 1.5;
}

.routine-empty__icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.routine-empty strong {
  display: block;
  font-size: 14px;
  margin-bottom: 6px;
}

.routine-form {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 18px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.routine-form__label {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 4px;
}

.routine-form__input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

.routine-form__input:focus {
  outline: none;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.routine-form__presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.routine-preset-btn {
  padding: 4px 10px;
  font-size: 11px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: #475569;
  cursor: pointer;
}

.routine-preset-btn:hover {
  background: #e2e8f0;
}

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

.routine-form__day-input {
  display: none;
}

.routine-form__day-label {
  padding: 6px 12px;
  border: 2px solid #d1d5db;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #fff;
}

.routine-form__day-input:checked+.routine-form__day-label {
  border-color: #3b82f6;
  background: #eff6ff;
  color: #1d4ed8;
}

.routine-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.routine-form__btn {
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
}

.routine-form__btn--secondary {
  background: #fff;
  border-color: #cbd5f5;
  color: #475569;
}

.routine-form__btn--primary {
  background: #3b82f6;
  color: #fff;
  border-color: #3b82f6;
}

@media (max-width: 600px) {
  .routine-toolbar__btn--add {
    flex: 1 1 100%;
  }

  .routine-card__actions {
    width: 100%;
    justify-content: flex-start;
  }

  .routine-card__footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .routine-card__today-label {
    width: 100%;
  }
}