.routine-variants {
  display: grid;
  gap: clamp(16px, 3vw, 26px);
}

.routines-page .routine-tabs {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.routine-jumps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: .9rem;
  line-height: 1.4;
}

.routine-jumps a, .routine-description a, .steps a {
  color: var(--wine);
}

.steps p + p {
  margin-top: .6rem;
}

.routine-variant-title { display: block; font-weight: 600; }
.routines-page .routine-intro .routine-variant-title {
  margin-bottom: 4px;
  font-size: .875rem;
}

.routine-photos, .pair-photo-list {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px;
  padding: 0;
  list-style: none;
}

.routine-photos {
  padding: 16px clamp(14px, 3vw, 24px);
  margin: 0;
  border-bottom: 1px solid var(--line);
}

.routine-photos > li, .pair-photo-list > li {
  --photo-width: calc(var(--photo-height, 124px) * var(--photo-ratio, 1));
  width: min(100%, max(5.25rem, var(--photo-width)));
}
.routine-photos figure, .pair-photo-list figure { margin: 0; }
.product-photo-frame {
  display: block;
  width: min(100%, var(--photo-width));
  cursor: zoom-in;
  background: var(--photo-paper, #fff);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.product-photo-frame img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: var(--photo-ratio, auto);
}
.product-photo-frame:focus-visible { outline-offset: 2px; }
.product-photo-frame:hover { border-color: var(--wine); }

.routine-shelf-group { border-top: 1px solid var(--line); }
.routine-shelf-group summary {
  cursor: pointer;
  font-weight: 600;
  padding: 12px clamp(14px, 3vw, 24px);
}
.routine-shelf-group .routine-description { padding-bottom: 16px; }
.routine-source { margin: 0; padding: 0 clamp(14px, 3vw, 24px) 16px; }
.pair-photo-more { margin-top: 12px; }
.pair-photo-more summary { cursor: pointer; font-size: .875rem; color: var(--wine); }

.site-dialog.product-viewer { width: min(690px, calc(100% - 24px)); }
.product-viewer h2 { margin: 0; font-size: clamp(1rem, 3.8vw, 1.35rem); }
.product-viewer-actions { display: flex; gap: 8px; }
.product-viewer .site-dialog-header { flex: none; }
.product-viewer-content { background: var(--photo-paper, #fff); }
.product-viewer-content img {
  display: block;
  margin-inline: auto;
  max-height: min(72vh, 690px);
  max-width: 100%;
  object-fit: contain;
}
.product-viewer-content.is-zoomed img {
  width: auto;
  max-width: none;
  max-height: none;
  margin: 0;
}

.routine-photos figcaption, .pair-photo-list figcaption {
  margin-top: 5px;
  font-size: .8125rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.routine-description {
  margin: 0;
  padding: 14px clamp(14px, 3vw, 24px) 0;
  color: var(--quiet);
  line-height: 1.5;
}

.match-layout > * { min-width: 0; }
.match-result .pair-photo-examples { margin-top: 20px; }
.pair-photo-examples h3 { margin: 0 0 4px; font-size: .96rem; }
.pair-photo-examples p { margin: 0; color: var(--quiet); font-size: .875rem; }
.pair-photo-examples .pair-photo-empty { margin-top: 5px; }
.pair-photo-list {
  --photo-height: 104px;
  max-width: 470px;
  margin: 12px 0 0;
}

.pair-photo-list .pair-photo-ingredients {
  display: block;
  margin-top: 4px;
  color: var(--quiet);
}

@media (max-width: 480px) {
  .routine-photos, .pair-photo-list { --photo-height: 92px; gap: 8px; }
  .routine-photos figcaption, .pair-photo-list figcaption { font-size: .8rem; }
}

/* Colours sampled from the original photo edges. */
[data-product-photo="medicube-booster-pro"] { --photo-paper: linear-gradient(#e5e1de, #ede9e3, #d4d2d1); }
[data-product-photo="medicube-jelly-cream"] { --photo-paper: linear-gradient(#c6c7c6, #b8bbbb, #e9d7cf); }
[data-product-photo="anua-rice-toner"] { --photo-paper: linear-gradient(#c8c5c2, #ccd0d3, #e5e2de); }
[data-product-photo="anua-heartleaf-toner"] { --photo-paper: linear-gradient(#a7a4a2, #b3b1ae, #d5d0ce); }
[data-product-photo="anua-pdrn-cream"] { --photo-paper: linear-gradient(#b1afae, #a9a6a0, #d7d8d5); }
[data-product-photo="medicube-wrapping-mask"] { --photo-paper: linear-gradient(#979897, #8d8d8b, #beb7b4); }
[data-product-photo="cosrx-5-pdrn-serum"] { --photo-paper: linear-gradient(#b8b6b4, #b1afaa, #e2d2cb); }
[data-product-photo="cosrx-rice-mask"] { --photo-paper: linear-gradient(#a8a5a3, #9d9994, #97938e); }
[data-product-photo="her-hyness-pore-refine-cream"] { --photo-paper: linear-gradient(#bbbbbe, #b1b0b2, #e1dedc); }
[data-product-photo="srichand-pdrn-essence"] { --photo-paper: linear-gradient(#aaa8a9, #a1a2a1, #d8c8cb); }
[data-product-photo="srichand-pdrn-serum"] { --photo-paper: linear-gradient(#8a8783, #8b8b89, #baacab); }
[data-product-photo="mediheal-collagen-snail-cream"] { --photo-paper: linear-gradient(#cbc7c4, #c1c1be, #d6cecd); }
[data-product-photo="cosrx-niacinamide-serum"] { --photo-paper: linear-gradient(#b8b4b0, #a6a19c, #d7d3d0); }
[data-product-photo="vt-pdrn-reedle-cream"] { --photo-paper: linear-gradient(#95918e, #b1ada9, #cbcecc); }
[data-product-photo="vt-pdrn-and-reedle"] { --photo-paper: linear-gradient(#b0aca7, #9d9894, #d8d5d4); }
[data-product-photo="pinnara-coconut-oil"] { --photo-paper: linear-gradient(#afaead, #adafb1, #d0cdc8); }
[data-product-photo="medicube-exosome-shots"] { --photo-paper: linear-gradient(#cccac7, #c3c0ba, #d9d2d7); }
[data-product-photo="laneige-grapefruit-mask"] { --photo-paper: linear-gradient(#bbbcb9, #c9cbcd, #dcd0d1); }
[data-product-photo="medicube-zero-pore-serum"] { --photo-paper: linear-gradient(#c9c5c0, #c1bbb5, #cbcacb); }
[data-product-photo="mediheal-pdrn-squalane"] { --photo-paper: linear-gradient(#d7d4cf, #d3cdc7, #e9e7e7); }
[data-product-photo="realbarrier-pdrn-serum"] { --photo-paper: linear-gradient(#c8c4bf, #b5b3af, #e8e6e7); }
[data-product-photo="medipeel-super-nine"] { --photo-paper: linear-gradient(#8f8a8a, #84807a, #cccbcb); }
[data-product-photo="vc100-multi-stick"] { --photo-paper: linear-gradient(#a09e9e, #918d8d, #cac9b6); }
[data-product-photo="medipeel-melanon-x"] { --photo-paper: linear-gradient(#b4aba9, #c9bbbb, #d1c9c4); }
[data-product-photo="boots-vitamin-c-serum"] { --photo-paper: linear-gradient(#969794, #8d8a87, #b6afae); }
[data-product-photo="anua-niacinamide-txa-serum"] { --photo-paper: linear-gradient(#d3d1d0, #c4c1bb, #e7e5e6); }
[data-product-photo="gua-sha-and-roller"] { --photo-paper: linear-gradient(#cdcac7, #dedcda, #e9e6e6); }
[data-product-photo="numbuzin-no-9-essence"] { --photo-paper: linear-gradient(#b4b5b0, #a5a298, #e6e4e6); }
[data-product-photo="anua-pdrn-serum"] { --photo-paper: linear-gradient(#a19f9d, #98928f, #d2d1d1); }
[data-product-photo="anua-pdrn-mist"] { --photo-paper: linear-gradient(#bbb7b4, #b5adab, #e2e5e6); }
[data-product-photo="her-hyness-prebio-serum"] { --photo-paper: linear-gradient(#b8b4b2, #b1ada9, #dedddd); }
[data-product-photo="matsukiyo-lucido-hair-sprays"] { --photo-paper: linear-gradient(#e1e0e0, #dcdde1, #d4cecd); }
[data-product-photo="anua-double-cleansing"] { --photo-paper: linear-gradient(#9d9d99, #a5a0a2, #bdbbb9); }
[data-product-photo="suisai-enzyme-wash"] { --photo-paper: linear-gradient(#9b9695, #a09c99, #acacac); }
[data-product-photo="sulwhasoo-cleansing-foam"] { --photo-paper: linear-gradient(#cdc9c7, #c7cbcd, #e2d8d3); }
[data-product-photo="theratis-loreal-hair-oils"] { --photo-paper: linear-gradient(#c9c5c1, #c8c4bf, #ddd9d8); }
[data-product-photo="detclear-enzymatic-powder"] { --photo-paper: linear-gradient(#b0aead, #ababab, #dcd9d1); }
[data-product-photo="melano-cc-enzyme-wash"] { --photo-paper: linear-gradient(#878380, #87703e, #b7b7b7); }
[data-product-photo="detclear-peeling-jelly"] { --photo-paper: linear-gradient(#9b9a9b, #b0aba8, #cbcbc9); }
[data-product-photo="sunplay-skin-aqua-spf"] { --photo-paper: linear-gradient(#dcd2ca, #dfd8cc, #e5ddd4); }

/* Aspect ratios of the uploaded photos. */
[data-product-photo="medicube-booster-pro"] { --photo-ratio: 0.9661458; }
[data-product-photo="medicube-jelly-cream"] { --photo-ratio: 1.3763441; }
[data-product-photo="anua-rice-toner"] { --photo-ratio: 1.1162791; }
.routine-photos > [data-product-photo="anua-rice-toner"],
.pair-photo-list > [data-product-photo="anua-rice-toner"] {
  --photo-height: clamp(128px, 15vw, 160px);
}

.product-viewer:has([data-product-photo="anua-rice-toner"]) {
  width: min(1040px, calc(100% - 24px));
}

.product-viewer-content[data-product-photo="anua-rice-toner"]:not(.is-zoomed) img {
  max-height: 80vh;
}
[data-product-photo="anua-heartleaf-toner"] { --photo-ratio: 1.0801688; }
[data-product-photo="anua-pdrn-cream"] { --photo-ratio: 0.8899740; }
[data-product-photo="medicube-wrapping-mask"] { --photo-ratio: 1.0681502; }
[data-product-photo="cosrx-5-pdrn-serum"] { --photo-ratio: 0.8600260; }
[data-product-photo="cosrx-rice-mask"] { --photo-ratio: 0.9179688; }
[data-product-photo="her-hyness-pore-refine-cream"] { --photo-ratio: 1.1851852; }
[data-product-photo="srichand-pdrn-essence"] { --photo-ratio: 0.9375000; }
[data-product-photo="srichand-pdrn-serum"] { --photo-ratio: 0.7246094; }
[data-product-photo="mediheal-collagen-snail-cream"] { --photo-ratio: 0.8515625; }
[data-product-photo="cosrx-niacinamide-serum"] { --photo-ratio: 1.2056515; }
[data-product-photo="vt-pdrn-reedle-cream"] { --photo-ratio: 1.1454139; }
[data-product-photo="vt-pdrn-and-reedle"] { --photo-ratio: 1.3356522; }
[data-product-photo="pinnara-coconut-oil"] { --photo-ratio: 0.7044271; }
[data-product-photo="medicube-exosome-shots"] { --photo-ratio: 1.1842714; }
[data-product-photo="laneige-grapefruit-mask"] { --photo-ratio: 1.3450088; }
[data-product-photo="medicube-zero-pore-serum"] { --photo-ratio: 0.8854167; }
[data-product-photo="mediheal-pdrn-squalane"] { --photo-ratio: 0.7708333; }
[data-product-photo="realbarrier-pdrn-serum"] { --photo-ratio: 0.7923177; }
[data-product-photo="medipeel-super-nine"] { --photo-ratio: 0.9420573; }
[data-product-photo="vc100-multi-stick"] { --photo-ratio: 0.8457031; }
[data-product-photo="medipeel-melanon-x"] { --photo-ratio: 0.6477865; }
[data-product-photo="boots-vitamin-c-serum"] { --photo-ratio: 0.8645833; }
[data-product-photo="anua-niacinamide-txa-serum"] { --photo-ratio: 0.9817708; }
[data-product-photo="gua-sha-and-roller"] { --photo-ratio: 1.0246831; }
[data-product-photo="numbuzin-no-9-essence"] { --photo-ratio: 0.9589844; }
[data-product-photo="anua-pdrn-serum"] { --photo-ratio: 0.8561198; }
[data-product-photo="anua-pdrn-mist"] { --photo-ratio: 0.6842448; }
[data-product-photo="her-hyness-prebio-serum"] { --photo-ratio: 0.7727865; }
[data-product-photo="matsukiyo-lucido-hair-sprays"] { --photo-ratio: 1.0199203; }
[data-product-photo="anua-double-cleansing"] { --photo-ratio: 0.8671875; }
[data-product-photo="suisai-enzyme-wash"] { --photo-ratio: 0.7102865; }
[data-product-photo="sulwhasoo-cleansing-foam"] { --photo-ratio: 0.9401042; }
[data-product-photo="theratis-loreal-hair-oils"] { --photo-ratio: 0.9505208; }
[data-product-photo="detclear-enzymatic-powder"] { --photo-ratio: 0.8333333; }
[data-product-photo="melano-cc-enzyme-wash"] { --photo-ratio: 0.8001302; }
[data-product-photo="detclear-peeling-jelly"] { --photo-ratio: 0.7591146; }
[data-product-photo="sunplay-skin-aqua-spf"] { --photo-ratio: 1.0000000; }

.pair-photo-examples h4 {
  margin: 16px 0 0;
  font-size: .875rem;
}

.pair-photo-more {
  margin-top: 8px;
  font-size: .875rem;
}

.pair-photo-more summary, .device-routine-notes summary {
  color: var(--wine);
  cursor: pointer;
  font-weight: 600;
}

.device-routine-notes {
  display: grid;
  gap: 10px;
  padding: 0 clamp(14px, 3vw, 24px) 14px;
  font-size: .9rem;
  line-height: 1.55;
}

.device-routine-notes p, .device-routine-notes ul {
  margin: 0;
}

.device-routine-notes ul {
  margin-top: 8px;
  padding-inline-start: 22px;
}

#booster-pro-routine .routine-description {
  padding-bottom: 4px;
}

/* Keep products on one shelf, including at narrow widths. */
.routine-variants, .routine-variants > *, .routine-panel { min-width: 0; }
.routine-photos {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(5.5rem, 13%, 7rem);
  align-items: start;
  overflow-x: auto;
}
.routine-photos > li, .routine-photos .product-photo-frame { width: 100%; }
.routine-photos .product-photo-frame { aspect-ratio: 4 / 5; }
.routine-photos .product-photo-frame img { width: 100%; height: 100%; object-fit: contain; }
.spicule-options, .spicule-note { margin: 1rem clamp(14px, 3vw, 24px); }
.spicule-options details { border-bottom: 1px solid var(--line); }
.spicule-options summary { cursor: pointer; padding: .9rem 0; color: var(--wine); font-weight: 600; }
.spicule-options small { font-size: .85em; font-weight: 400; }
.spicule-note { font-size: .9rem; line-height: 1.5; }

/* Each step keeps its instructions and product photos together. */
.routine-variants { gap: 1rem; }
.routines-page .routine-intro { padding: .75rem 1rem; }
.routines-page .routine-intro h2 { margin: 0; font-size: clamp(1.15rem, 2vw, 1.45rem); }
.routines-page .routine-description { padding: .65rem 1rem 0; }
.routines-page .steps > li {
  grid-template-columns: 1.5rem minmax(0, 1fr);
  gap: .55rem;
  padding: .7rem 1rem;
}
.routines-page .steps .step-number { width: 1.5rem; height: 1.5rem; font-size: .85rem; }
.steps > li > div { min-width: 0; }
.routines-page .steps h3 { font-size: 1.05rem; }
.routines-page .steps p { margin: 0; }
.step-photos { display: flex; flex-wrap: wrap; gap: .4rem .8rem; margin-top: .45rem; }
.step-photos figure {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr);
  align-items: center;
  gap: .45rem;
  width: min(100%, 12rem);
  margin: 0;
}
.step-photos .product-photo-frame { width: 100%; aspect-ratio: 1; }
.step-photos img { width: 100%; height: 100%; object-fit: contain; }
.step-photos figcaption { font-size: .8125rem; line-height: 1.3; overflow-wrap: anywhere; }
.routines-page .spicule-options { margin: .55rem 1rem; }
.routines-page .spicule-options summary { padding: .65rem 0; }
@media (min-width: 760px) {
  .steps > li > div { display: grid; grid-template-columns: minmax(0, 1fr) 12rem; column-gap: 1.25rem; align-content: start; }
  .steps > li > div > :is(h3, p) { grid-column: 1; }
  .step-photos { grid-column: 2; grid-row: 1 / span 2; align-self: start; margin: 0; }
}
@media (max-width: 480px) {
  .routines-page .steps > li { padding: .65rem .75rem; }
  .step-photos figure { grid-template-columns: 2.875rem minmax(0, 1fr); }
}

.pair-photo-examples .pair-example-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(6.4rem, calc((100% - 36px) / 4), 8rem);
  align-items: start;
  gap: 12px;
  max-width: 100%;
  margin: 12px 0 0;
  padding: 3px 2px 8px;
  overflow-x: auto;
}
.pair-example-row > li, .pair-example-row .product-photo-frame { width: 100%; }
.pair-example-row .product-photo-frame { aspect-ratio: 1; }
.pair-example-row .product-photo-frame img { width: 100%; height: 100%; object-fit: contain; }
.pair-example-label { display: block; margin-top: .35rem; font-size: .8rem; color: var(--wine); }

.routines-page .page-intro > p:last-child,
.page-intro.ingredient-intro > p:last-child { max-width: none; }
