.routine-page-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  width: min(820px, 100%);
  margin: 0 auto 28px;
}

.routine-page-actions button,
.routine-create,
.routine-complete {
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 15px;
  font-size: 18px;
  font-weight: 600;
}

.routine-reset {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 9px 24px rgba(71, 50, 44, .035);
}

.routine-new,
.routine-create,
.routine-complete {
  border-color: transparent !important;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 84%, var(--soft)), color-mix(in srgb, var(--accent) 70%, var(--ink)));
  color: #fff;
}

.routine-library,
.routine-detail-card {
  width: min(820px, 100%);
  margin-inline: auto;
  padding: clamp(26px, 5vw, 42px);
}

.routine-library > h2 {
  margin: 12px 0 28px;
  font-size: clamp(34px, 5vw, 46px);
  line-height: 1.05;
}

.routine-create {
  min-height: 58px;
  padding: 0 25px;
}

.routine-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin: 22px 0 26px;
}

.routine-filters button {
  min-height: 46px;
  padding: 0 19px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font-size: 17px;
  font-weight: 600;
}

.routine-filters button.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 24%, transparent);
}

.routine-showcase-list {
  display: grid;
  gap: 18px;
}

.routine-showcase {
  position: relative;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  border-radius: 27px;
  background:
    radial-gradient(circle at 90% 72%, color-mix(in srgb, var(--soft) 80%, transparent), transparent 35%),
    linear-gradient(140deg, var(--paper), color-mix(in srgb, var(--soft) 62%, var(--paper)));
  box-shadow: 0 16px 34px rgba(75, 52, 45, .06);
}

.routine-card-open {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 272px;
  padding: 34px 28px 24px;
  flex-direction: column;
  align-items: flex-start;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.routine-card-open:hover strong {
  color: var(--accent);
}

.routine-card-open:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -4px;
}

.routine-mark {
  color: color-mix(in srgb, var(--accent) 72%, var(--ink));
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .12em;
}

.routine-meta {
  margin-top: 28px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.routine-card-open > strong {
  max-width: 66%;
  margin-top: 10px;
  font: 600 clamp(31px, 5vw, 43px)/1.06 "Playfair Display", serif;
  transition: color .2s ease;
}

.routine-status {
  max-width: 62%;
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}

.routine-progress,
.routine-detail-progress {
  display: block;
  height: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: color-mix(in srgb, var(--line) 85%, var(--paper));
}

.routine-progress {
  width: 62%;
  margin-top: 20px;
}

.routine-progress i,
.routine-detail-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.routine-bottles {
  position: absolute;
  right: 30px;
  bottom: 10px;
  display: flex;
  height: 150px;
  align-items: flex-end;
  gap: 7px;
  opacity: .9;
  filter: drop-shadow(0 12px 12px rgba(81, 55, 50, .09));
}

.routine-bottles i {
  position: relative;
  display: block;
  width: 48px;
  height: 113px;
  border-radius: 8px 8px 13px 13px;
  background: color-mix(in srgb, var(--accent) 68%, var(--soft));
}

.routine-bottles i::before {
  position: absolute;
  top: -17px;
  left: 12px;
  width: 24px;
  height: 20px;
  border-radius: 5px 5px 0 0;
  background: color-mix(in srgb, var(--accent) 74%, var(--ink));
  content: "";
}

.routine-bottles i::after {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 18px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  content: "";
}

.routine-bottles i:first-child {
  width: 62px;
  height: 55px;
  border-radius: 30px 30px 14px 14px;
}

.routine-bottles i:first-child::before,
.routine-bottles i:first-child::after {
  display: none;
}

.routine-bottles i:last-child {
  height: 132px;
  background: color-mix(in srgb, var(--soft) 76%, var(--paper));
}

.routine-card-actions {
  display: flex;
  gap: 9px;
  padding: 0 24px 22px;
}

.routine-card-actions button,
.routine-back {
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 5px 14px rgba(67, 47, 41, .04);
}

.routine-empty {
  padding: 42px 24px;
  border: 1px dashed var(--line);
  border-radius: 22px;
  text-align: center;
}

.routine-empty h3 {
  font: 600 27px "Playfair Display", serif;
}

.routine-empty p {
  color: var(--muted);
}

.routine-detail-card {
  position: relative;
  padding-top: 30px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--soft) 45%, var(--paper)), var(--paper) 34%);
}

.routine-back {
  position: absolute;
  top: 26px;
  left: 26px;
  font-size: 17px;
}

.routine-detail-head {
  display: grid;
  justify-items: center;
  padding: 12px 40px 24px;
  text-align: center;
}

.routine-detail-mark {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  border-radius: 50%;
  background: var(--soft);
  color: var(--paper);
  font-size: 13px;
  font-weight: 600;
}

.routine-detail-head p {
  margin: 26px 0 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.routine-detail-head h2 {
  margin: 0;
  font-size: clamp(37px, 6vw, 54px);
  line-height: 1.05;
}

.routine-detail-head > strong {
  margin-top: 14px;
  font-size: 16px;
  font-weight: 500;
}

.routine-detail-progress {
  margin: 0 0 34px;
}

.routine-step-list {
  display: grid;
  gap: 13px;
}

.routine-step-row {
  display: grid;
  grid-template-columns: 30px 68px 1fr;
  gap: 18px;
  align-items: center;
  min-height: 112px;
  margin: 0;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  cursor: pointer;
}

.routine-step-row input {
  width: 25px;
  height: 25px;
  margin: 0;
  accent-color: var(--accent);
}

.routine-product {
  position: relative;
  display: block;
  width: 60px;
  height: 64px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-radius: 24px 24px 15px 15px;
  background: linear-gradient(145deg, var(--paper), var(--soft));
}

.routine-product::before {
  position: absolute;
  top: -5px;
  left: 19px;
  width: 22px;
  height: 8px;
  border-radius: 4px 4px 0 0;
  background: var(--line);
  content: "";
}

.routine-product.product-1 {
  border-radius: 13px 13px 22px 22px;
  background: linear-gradient(to bottom, var(--paper) 24%, color-mix(in srgb, var(--accent) 70%, var(--soft)) 24%);
}

.routine-product.product-2 {
  border-radius: 30px 30px 15px 15px;
}

.routine-product.product-3 {
  background: linear-gradient(145deg, color-mix(in srgb, var(--paper) 65%, var(--soft)), var(--soft));
}

.routine-step-row > span:last-child {
  display: grid;
  gap: 5px;
}

.routine-step-row strong {
  font-size: 19px;
}

.routine-step-row small {
  color: var(--muted);
  font-size: 15px;
  font-weight: 400;
}

.routine-step-row:has(input:checked) {
  background: color-mix(in srgb, var(--soft) 34%, var(--paper));
}

.routine-step-row:has(input:checked) strong {
  text-decoration: line-through;
  opacity: .62;
}

.routine-complete {
  width: 100%;
  margin-top: 24px;
}

html[data-theme="midnight"] .routine-new,
html[data-theme="midnight"] .routine-create,
html[data-theme="midnight"] .routine-complete,
html[data-theme="midnight"] .routine-filters button.active {
  color: #1d1b1a;
}

@media (max-width: 580px) {
  .routine-page-actions {
    gap: 12px;
    margin-bottom: 24px;
  }

  .routine-page-actions button {
    min-height: 58px;
    padding: 0 8px;
    font-size: 17px;
  }

  .routine-library,
  .routine-detail-card {
    padding: 28px 20px;
    border-radius: 18px;
  }

  .routine-library > h2 {
    font-size: 36px;
  }

  .routine-filters {
    gap: 7px;
  }

  .routine-filters button {
    min-height: 44px;
    padding: 0 14px;
    font-size: 16px;
  }

  .routine-showcase {
    border-radius: 25px;
  }

  .routine-card-open {
    min-height: 270px;
    padding: 32px 26px 22px;
  }

  .routine-card-open > strong {
    max-width: 72%;
    font-size: 34px;
  }

  .routine-status,
  .routine-progress {
    max-width: 66%;
  }

  .routine-bottles {
    right: 19px;
    transform: scale(.83);
    transform-origin: bottom right;
  }

  .routine-card-actions {
    padding: 0 20px 20px;
  }

  .routine-card-actions button {
    padding: 0 11px;
  }

  .routine-detail-card {
    padding-top: 28px;
  }

  .routine-back {
    top: 24px;
    left: 20px;
  }

  .routine-detail-head {
    padding: 14px 22px 24px;
  }

  .routine-detail-head h2 {
    font-size: 39px;
  }

  .routine-step-row {
    grid-template-columns: 26px 58px 1fr;
    gap: 14px;
    min-height: 104px;
    padding: 14px 16px;
  }

  .routine-product {
    width: 54px;
    height: 60px;
  }

  .routine-step-row strong {
    font-size: 17px;
  }

  .routine-step-row small {
    font-size: 14px;
  }
}
