:root {
  --pattern-stage-bg: rgba(255, 255, 255, 0.65);
  /* Reader text size (☰ Default / Large / Huge) — scales reading surfaces only. */
  --pattern-text-scale: 1;
  --pattern-text-lh: 1.55;
}

html[data-text-size="large"],
body[data-text-size="large"] {
  --pattern-text-scale: 1.2;
  --pattern-text-lh: 1.62;
}

html[data-text-size="huge"],
body[data-text-size="huge"] {
  --pattern-text-scale: 1.4;
  --pattern-text-lh: 1.68;
}

/* Written instructions & setup copy — Montserrat on this route only (see pattern/index.html body) */
body.pattern-page {
  font-family: "Montserrat", system-ui, sans-serif;
  /* Match /pattern-progress/ light gray canvas. */
  background: #f7f8fa;
  --pattern-tile-radius: 4px;
  --pattern-tile-icon-radius: 2px;
  --pattern-tile-wash: #eef1f0;
  --pattern-tile-wash-teal: #e8f0f1;
  --pattern-tile-wash-navy: #e9edf3;
  --pattern-tile-wash-mint: #ecf1ee;
  --pattern-tile-wash-coral: #f0eeec;
}

/* Root canvas must match — html keeps --dc-page-bg mint, which shows below short pages. */
html:has(body.pattern-page) {
  background: #f7f8fa;
}

/* Header wordmark color is shared via css/app.css */

.pattern-main {
  width: min(560px, 100%);
  margin: 0 auto;
  padding: 1rem 1.25rem;
  padding-left: max(1.25rem, env(safe-area-inset-left, 0px));
  padding-right: max(1.25rem, env(safe-area-inset-right, 0px));
  display: block;
}

/* Mobile-first: right-panel becomes the whole app UI */
.pattern-stage-wrap {
  display: none;
}

body[data-view="home"] .pattern-stage-wrap {
  display: block;
  margin-bottom: 12px;
}

body[data-view="home"].pattern-page--hue-no-stage .pattern-stage-wrap {
  display: none;
  margin-bottom: 0;
}

body[data-view="home"][data-hue-section="setup"]:not(.pattern-page--colorway-embed)
  .pattern-stage-wrap {
  display: none;
  margin-bottom: 0;
}

body[data-view="setup"].pattern-page--chroma-setup-overview .pattern-stage-wrap {
  display: none;
  margin-bottom: 0;
}

body[data-view="setup"].pattern-page--colorway-embed .pattern-stage-wrap {
  display: block;
  margin-bottom: 12px;
}

body.pattern-page--colorway-embed .pattern-stage-wrap,
body[data-view="home"].pattern-page--colorway-embed .pattern-stage-wrap,
body[data-view="home"].pattern-page--hue-no-stage.pattern-page--colorway-embed .pattern-stage-wrap {
  display: block;
  margin-bottom: 12px;
}

body.pattern-page--colorway-embed .pattern-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: min(42vh, 320px);
  min-height: 180px;
}

body.pattern-page--colorway-embed .pattern-stage:not(.svg-stage--moon-tide) svg {
  width: 100%;
  height: auto;
  max-height: min(38vh, 300px);
}

body.pattern-page--colorway-embed .pattern-stage.svg-stage--stripe-map,
body.pattern-page--colorway-embed .pattern-stage.svg-stage--stripe-map-centered {
  align-items: center;
  justify-content: center;
  max-height: min(58vh, 480px);
  overflow-y: auto;
}

body.pattern-page--colorway-embed .pattern-stage.svg-stage--stripe-map svg,
body.pattern-page--colorway-embed .pattern-stage:not(.svg-stage--moon-tide) svg.colorway-stripe-map {
  width: min(100%, 320px);
  max-height: none;
  margin-inline: auto;
  display: block;
}

body.pattern-page--colorway-embed .pattern-stage.svg-stage--stash-map {
  max-height: min(72vh, 600px);
  overflow: visible;
}

body.pattern-page--colorway-embed .pattern-stage.svg-stage--stash-map svg,
body.pattern-page--colorway-embed .pattern-stage svg.colorway-stash-map {
  width: min(100%, 280px);
  height: auto;
  max-height: min(68vh, 560px);
}

/* Finished-object colorway schematics: scale to fit, never crop under nameplate. */
body.pattern-page--colorway-embed .pattern-stage.svg-stage--fo-schematic {
  --fo-schematic-max-h: clamp(280px, 52vh, 440px);
  align-items: center;
  justify-content: center;
  max-height: none;
  min-height: 0;
  overflow: visible;
  padding: 8px 8px 0;
}

body.pattern-page--colorway-embed .pattern-stage.svg-stage--fo-schematic svg,
body.pattern-page--colorway-embed .pattern-stage svg.colorway-fo-schematic {
  width: min(100%, calc(var(--fo-schematic-max-h, 440px) * var(--fo-schematic-aspect, 1)));
  height: auto;
  max-width: 100%;
  max-height: var(--fo-schematic-max-h, 440px);
  margin-inline: auto;
  display: block;
}

/* —— Stash Colorway: mobile immersive (schematic + dock + sheet) —— */
.cw-colorway-flow {
  display: none;
}

.cw-colorway-dock {
  display: none;
}

.cw-colorway-sell-strip {
  display: none;
}

.cw-colorway-sheet-backdrop {
  display: none;
}

.cw-colorway-sheet-chrome {
  display: none;
}

.cw-colorway-sheet-footer {
  display: none;
}

/* Sheet-only plan hosts — shown on mobile when a dock sheet is open. */
.cw-stash-sheet-panel {
  display: none;
}

@media (max-width: 599px) {
  body.pattern-page--colorway-immersive.pattern-page--stash-colorway {
    /* One flow panel visible at a time (+ tabs). */
    --cw-immersive-flow: 11.5rem;
    --cw-scarf-max-h: min(
      68dvh,
      calc(
        100dvh - 3.5rem - var(--cw-immersive-setup-nav, 0px) -
          var(--cw-immersive-flow, 11.5rem) - 3.25rem
      )
    );
  }

  body.pattern-page--colorway-immersive.pattern-page--stash-colorway[data-cw-flow="kits"] {
    --cw-immersive-flow: 12.25rem;
  }

  body.pattern-page--colorway-immersive.pattern-page--stash-colorway[data-cw-flow="custom"] {
    --cw-immersive-flow: 10.5rem;
  }

  body.pattern-page--colorway-immersive.pattern-page--stash-colorway.pattern-page--with-setup-nav {
    /* Dock sits above setup nav; sheet clears both. */
    --cw-immersive-setup-nav: calc(5.75rem + env(safe-area-inset-bottom, 0px));
  }

  /* While a Colors/Order/Sequence sheet is open, hide setup CTAs so only sheet footer shows. */
  body.pattern-page--colorway-sheet-open.pattern-page--with-setup-nav {
    --cw-immersive-setup-nav: 0px;
  }

  body.pattern-page--colorway-sheet-open .pattern-setup-nav-bar {
    visibility: hidden;
    pointer-events: none;
    opacity: 0;
  }

  body.pattern-page--colorway-immersive.pattern-page--stash-colorway .pattern-main {
    display: flex;
    flex-direction: column;
    width: min(560px, 100%);
    min-height: calc(100dvh - 3.5rem);
    max-height: calc(100dvh - 3.5rem);
    padding-top: 0.2rem;
    padding-bottom: 0;
    box-sizing: border-box;
    overflow: hidden;
  }

  body.pattern-page--colorway-immersive.pattern-page--stash-colorway.pattern-page--with-setup-nav
    .pattern-main {
    min-height: calc(100dvh - 3.5rem - var(--cw-immersive-setup-nav, 5.75rem));
    max-height: calc(100dvh - 3.5rem - var(--cw-immersive-setup-nav, 5.75rem));
    padding-bottom: 0;
  }

  /* Keep Terminology / Progress above immersive chrome and fully on-screen. */
  body.pattern-page--colorway-immersive.pattern-page--with-setup-nav .pattern-setup-nav-bar {
    z-index: 40;
  }

  body.pattern-page--colorway-immersive.pattern-page--with-setup-nav
    .pattern-setup-nav-bar__inner {
    padding-bottom: max(0.85rem, calc(0.5rem + env(safe-area-inset-bottom, 0px)));
  }

  body.pattern-page--colorway-immersive.pattern-page--stash-colorway .pattern-stage-wrap,
  body.pattern-page--colorway-immersive.pattern-page--stash-colorway.pattern-page--colorway-embed
    .pattern-stage-wrap {
    /* Hug the schematic — leftover viewport stays page gray below the card. */
    flex: 0 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: 100%;
    width: 100%;
    margin: 0;
    border-radius: var(--pattern-tile-radius, 4px);
  }

  body.pattern-page--colorway-immersive.pattern-page--stash-colorway
    .pattern-stage-wrap--nameplate {
    overflow: visible;
  }

  body.pattern-page--colorway-immersive.pattern-page--stash-colorway .pattern-stage,
  body.pattern-page--colorway-immersive.pattern-page--stash-colorway
    .pattern-stage.svg-stage--stash-map,
  body.pattern-page--colorway-immersive.pattern-page--stash-colorway
    .pattern-stage.svg-stage--stripe-map {
    flex: 0 1 auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    max-height: var(--cw-scarf-max-h);
    height: auto;
    overflow: visible;
    padding: 0;
  }

  body.pattern-page--colorway-immersive.pattern-page--stash-colorway
    .pattern-stage-wrap--nameplate
    .pattern-stage {
    padding: 0;
  }

  /*
   * Size by aspect so the SVG box matches the drawing.
   * Aspect comes from --cw-scarf-aspect when set (viewBox), else stash default
   * including optional Row-1 gutter (272×304).
   */
  body.pattern-page--colorway-immersive.pattern-page--stash-colorway
    .pattern-stage.svg-stage--stash-map
    > svg,
  body.pattern-page--colorway-immersive.pattern-page--stash-colorway
    .pattern-stage
    > svg.colorway-stash-map {
    position: static;
    left: auto;
    top: auto;
    transform: none;
    box-sizing: border-box;
    display: block;
    margin: 0 auto;
    padding: 0;
    width: min(
      100%,
      calc(var(--cw-scarf-max-h) * var(--cw-scarf-aspect, 272 / 304))
    );
    height: auto;
    max-width: 100%;
    max-height: var(--cw-scarf-max-h);
  }

  /* Compact in-flow nameplate (match Terminology / Progress strip — not 20% overlay). */
  body.pattern-page--colorway-immersive.pattern-page--stash-colorway
    .pattern-hue-setup-hero__nameplate-band--overlay,
  body.pattern-page--colorway-immersive.pattern-page--stash-colorway
    #pattern-colorway-nameplate.pattern-hue-setup-hero__nameplate-band--overlay {
    --nameplate-mark-size: 32px;
    --nameplate-mark-inset: 10px;
    position: relative;
    inset: auto;
    left: auto;
    right: auto;
    bottom: auto;
    z-index: auto;
    flex: 0 0 auto;
    height: auto;
    min-height: 44px;
    padding: 6px calc(var(--nameplate-mark-inset) + var(--nameplate-mark-size) + 8px);
    background: #f7f8fa;
    border-top: 1px solid rgba(12, 41, 90, 0.08);
  }

  body.pattern-page--colorway-immersive.pattern-page--stash-colorway
    .pattern-hue-setup-hero__nameplate-band--overlay
    .pattern-hue-setup-hero__nameplate-title {
    font-size: 0.98rem;
    line-height: 1.2;
  }

  body.pattern-page--colorway-immersive.pattern-page--stash-colorway
    .cw-colorway-flow {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
    flex: 0 0 auto;
    margin: 0.25rem 0 0.3rem;
    padding: 0.4rem 0.5rem 0.45rem;
    border-radius: 12px;
    background: #fff;
    border: 1px solid rgba(12, 41, 90, 0.1);
    box-sizing: border-box;
  }

  .cw-colorway-flow__tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem;
    padding: 0.15rem;
    border-radius: 9px;
    background: rgba(12, 41, 90, 0.06);
  }

  .cw-colorway-flow__tabs:has(.cw-colorway-flow__tab:only-child) {
    grid-template-columns: 1fr;
  }

  .cw-colorway-flow__tab {
    margin: 0;
    padding: 0.45rem 0.5rem;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: rgba(12, 41, 90, 0.7);
    font: 700 0.78rem/1.2 Lexend, system-ui, sans-serif;
    letter-spacing: 0.02em;
    cursor: pointer;
  }

  .cw-colorway-flow__tab:focus-visible {
    outline: 2px solid var(--dc-teal, #1b9aaa);
    outline-offset: 1px;
  }

  .cw-colorway-flow__tab--active {
    background: #fff;
    color: var(--dc-navy, #0c295a);
    box-shadow: 0 0 0 1px rgba(12, 41, 90, 0.1);
  }

  body.pattern-page--colorway-immersive.pattern-page--stash-colorway
    .cw-colorway-sell-strip {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    flex: 0 0 auto;
    margin: 0;
    padding: 0.15rem 0 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-sizing: border-box;
  }

  body.pattern-page--colorway-immersive.pattern-page--stash-colorway
    .cw-colorway-sell-strip[hidden] {
    display: none !important;
  }

  .cw-colorway-sell-strip__label {
    margin: 0;
    font: 700 0.72rem/1.2 Lexend, system-ui, sans-serif;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: rgba(12, 41, 90, 0.72);
  }

  .cw-colorway-sell-strip__lead {
    margin: 0;
    font: 500 0.78rem/1.35 Lexend, system-ui, sans-serif;
    color: rgba(12, 41, 90, 0.72);
    max-width: 36rem;
  }

  .cw-colorway-sell-strip__scroll {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.4rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.05rem;
  }

  .cw-colorway-sell-strip__scroll::-webkit-scrollbar {
    display: none;
  }

  .cw-colorway-sell-strip__kit {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.28rem;
    min-width: 5.75rem;
    max-width: 7.5rem;
    margin: 0;
    padding: 0.4rem 0.5rem;
    border: 1px solid rgba(12, 41, 90, 0.12);
    border-radius: 8px;
    background: #f7f8fa;
    color: var(--dc-navy, #0c295a);
    cursor: pointer;
    text-align: left;
  }

  .cw-colorway-sell-strip__kit:focus-visible {
    outline: 2px solid var(--dc-teal, #1b9aaa);
    outline-offset: 2px;
  }

  .cw-colorway-sell-strip__kit--selected {
    border-color: var(--dc-teal, #1b9aaa);
    background: rgba(27, 154, 170, 0.08);
    box-shadow: inset 0 0 0 1px rgba(27, 154, 170, 0.35);
  }

  .cw-colorway-sell-strip__swatches {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
  }

  .cw-colorway-sell-strip__dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1.5px solid #fff;
    box-shadow: 0 0 0 1px rgba(12, 41, 90, 0.18);
    margin-left: -5px;
  }

  .cw-colorway-sell-strip__dot:first-child {
    margin-left: 0;
  }

  .cw-colorway-sell-strip__name {
    font: 700 0.76rem/1.2 Lexend, system-ui, sans-serif;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .cw-colorway-sell-strip__kit--pressing {
    transform: scale(0.97);
    background: rgba(27, 154, 170, 0.16);
  }

  .cw-colorway-sell-strip__tip {
    margin: 0;
    font: 500 0.66rem/1.3 Lexend, system-ui, sans-serif;
    color: rgba(12, 41, 90, 0.62);
  }

  .cw-colorway-dock {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: stretch;
    gap: 0.4rem;
    flex: 0 0 auto;
    margin: 0;
    padding: 0.15rem 0 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-sizing: border-box;
  }

  body.pattern-page--colorway-immersive.pattern-page--stash-colorway
    .cw-colorway-dock[hidden] {
    display: none !important;
  }

  .cw-colorway-dock__heading {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
  }

  .cw-colorway-dock__title {
    margin: 0;
    font: 700 0.72rem/1.2 Lexend, system-ui, sans-serif;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: rgba(12, 41, 90, 0.72);
  }

  .cw-colorway-dock__lead {
    margin: 0;
    font: 500 0.78rem/1.35 Lexend, system-ui, sans-serif;
    color: rgba(12, 41, 90, 0.72);
    max-width: 36rem;
  }

  .cw-colorway-dock__primary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.35rem;
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
  }

  .cw-colorway-dock__action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.28rem;
    margin: 0;
    min-height: 3.75rem;
    min-width: 0;
    padding: 0.45rem 0.25rem 0.4rem;
    border: none;
    border-radius: 10px;
    background: rgba(12, 41, 90, 0.05);
    color: var(--dc-navy, #0c295a);
    cursor: pointer;
    text-align: center;
  }

  .cw-colorway-dock__action:hover,
  .cw-colorway-dock__action:focus-visible {
    background: rgba(12, 41, 90, 0.1);
  }

  .cw-colorway-dock__action--reset:hover,
  .cw-colorway-dock__action--reset:focus-visible {
    background: rgba(27, 154, 170, 0.14);
  }

  body[data-cw-sheet="colors"] .cw-colorway-dock__action[data-cw-dock="colors"],
  body[data-cw-sheet="order"] .cw-colorway-dock__action[data-cw-dock="order"],
  body[data-cw-sheet="sequence"] .cw-colorway-dock__action[data-cw-dock="sequence"],
  body[data-cw-sheet="count"] .cw-colorway-dock__action[data-cw-dock="count"],
  body[data-cw-sheet="kits"] .cw-colorway-dock__action[data-cw-dock="kits"],
  body[data-cw-sheet="hue"] .cw-colorway-dock__action[data-cw-dock="hue"] {
    background: #0c295a;
    border-color: #0c295a;
    color: #fff;
  }

  body[data-cw-sheet="colors"]
    .cw-colorway-dock__action[data-cw-dock="colors"]
    .cw-colorway-dock__action-icon,
  body[data-cw-sheet="order"]
    .cw-colorway-dock__action[data-cw-dock="order"]
    .cw-colorway-dock__action-icon,
  body[data-cw-sheet="sequence"]
    .cw-colorway-dock__action[data-cw-dock="sequence"]
    .cw-colorway-dock__action-icon,
  body[data-cw-sheet="count"]
    .cw-colorway-dock__action[data-cw-dock="count"]
    .cw-colorway-dock__action-icon,
  body[data-cw-sheet="kits"]
    .cw-colorway-dock__action[data-cw-dock="kits"]
    .cw-colorway-dock__action-icon,
  body[data-cw-sheet="hue"]
    .cw-colorway-dock__action[data-cw-dock="hue"]
    .cw-colorway-dock__action-icon {
    color: #fff;
  }

  .cw-colorway-dock__action-icon {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    line-height: 0;
    color: var(--dc-teal, #1b9aaa);
  }

  .cw-colorway-dock__action-icon svg {
    display: block;
    width: 20px;
    height: 20px;
  }

  .cw-colorway-dock__action-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    min-width: 0;
    width: 100%;
  }

  .cw-colorway-dock__action-label {
    font: 700 0.84rem/1.15 Lexend, system-ui, sans-serif;
  }

  .cw-colorway-dock__action-meta {
    font: 500 0.68rem/1.2 Lexend, system-ui, sans-serif;
    opacity: 0.72;
    max-width: 100%;
    min-height: 0.82rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .cw-colorway-dock__btn {
    min-height: 44px;
    padding: 0.35rem 0.55rem;
    font-size: 0.78rem;
    flex: 0 0 auto;
  }

  .cw-colorway-dock__btn--icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    min-width: 44px;
    padding: 0;
    font-size: 1rem;
    line-height: 0;
  }

  .cw-colorway-dock__btn--icon svg {
    display: block;
  }

  /* Panel becomes the slide-up sheet; keep it out of flex flow when closed. */
  body.pattern-page--colorway-immersive.pattern-page--stash-colorway .pattern-panel {
    flex: 0 0 0;
    min-height: 0;
    height: 0;
    overflow: visible;
    margin: 0;
    padding: 0;
    border: none;
  }

  body.pattern-page--colorway-immersive.pattern-page--stash-colorway
    .pattern-hue-home--color-scheme,
  body.pattern-page--colorway-immersive.pattern-page--stash-colorway
    .pattern-chroma-setup--colorway {
    position: fixed;
    left: 0;
    right: 0;
    bottom: var(--cw-immersive-setup-nav, 0px);
    z-index: 18;
    max-height: min(70dvh, 520px);
    margin: 0;
    padding: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    border-radius: 16px 16px 0 0;
    border: 1px solid rgba(12, 41, 90, 0.12);
    border-bottom: none;
    box-shadow: 0 -8px 28px rgba(12, 41, 90, 0.14);
    transform: translateY(110%);
    transition: transform 0.22s ease;
    pointer-events: none;
    display: flex;
    flex-direction: column;
  }

  body.pattern-page--colorway-immersive.pattern-page--stash-colorway.pattern-page--colorway-sheet-open
    .pattern-hue-home--color-scheme,
  body.pattern-page--colorway-immersive.pattern-page--stash-colorway.pattern-page--colorway-sheet-open
    .pattern-chroma-setup--colorway {
    transform: translateY(0);
    pointer-events: auto;
  }

  /* Sheet tips live at the top of each tab — hide the panel footer hint. */
  body.pattern-page--colorway-immersive.pattern-page--stash-colorway.pattern-page--colorway-sheet-open
    .cw-embedded-colorway-hint {
    display: none;
  }

  body.pattern-page--colorway-immersive.pattern-page--stash-colorway
    .pattern-hue-home--color-scheme
    > .pattern-card--setup-step,
  body.pattern-page--colorway-immersive.pattern-page--stash-colorway
    .pattern-chroma-setup--colorway
    > .pattern-card--setup-step {
    margin: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0.75rem 1rem 1rem;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
  }

  body.pattern-page--colorway-immersive.pattern-page--stash-colorway
    .pattern-hue-home--color-scheme
    .pattern-hue-setup-back,
  body.pattern-page--colorway-immersive.pattern-page--stash-colorway
    .pattern-hue-home--color-scheme
    > .pattern-card--setup-step
    > .pattern-hue-text-back,
  body.pattern-page--colorway-immersive.pattern-page--stash-colorway
    .pattern-colorway-panel__heading {
    display: none;
  }

  /* Sheet panels: show only the active section on mobile. */
  body.pattern-page--colorway-immersive.pattern-page--stash-colorway
    .cw-stash-sheet-panel,
  body.pattern-page--colorway-immersive.pattern-page--stash-colorway
    .cw-colorway-panel-host,
  body.pattern-page--colorway-immersive.pattern-page--stash-colorway
    .cw-stash-plan-host {
    display: none;
  }

  body.pattern-page--colorway-immersive.pattern-page--stash-colorway[data-cw-sheet="sequence"]
    .cw-stash-sheet-panel--sequence,
  body.pattern-page--colorway-immersive.pattern-page--stash-colorway[data-cw-sheet="colors"]
    .cw-colorway-panel-host,
  body.pattern-page--colorway-immersive.pattern-page--stash-colorway[data-cw-sheet="order"]
    .cw-colorway-panel-host,
  body.pattern-page--colorway-immersive.pattern-page--stash-colorway[data-cw-sheet="kits"]
    .cw-colorway-panel-host,
  body.pattern-page--colorway-immersive.pattern-page--stash-colorway[data-cw-sheet="hue"]
    .cw-colorway-panel-host {
    display: block;
  }

  /* Stitch chart below Color Scheme is a patternupload showChart option —
     hide it in immersive so it doesn't sit under Colors / Order / pick-bar. */
  body.pattern-page--colorway-immersive.pattern-page--stash-colorway
    .pattern-colorway-stitch-chart,
  body.pattern-page--colorway-immersive.pattern-page--stash-colorway
    .pattern-colorway-chart-unlock {
    display: none !important;
  }

  body.pattern-page--colorway-immersive.pattern-page--stash-colorway
    .cw-stash-sheet-panel
    > .cw-section-title {
    display: none;
  }

  /* Colors sheet: Featured kits stay compact so chips stay above the fold. */
  body.pattern-page--colorway-immersive.pattern-page--stash-colorway[data-cw-sheet="colors"]
    .featured-colorways,
  body.pattern-page--colorway-immersive.pattern-page--stash-colorway[data-cw-sheet="kits"]
    .featured-colorways,
  body.pattern-page--colorway-immersive.pattern-page--stash-colorway[data-cw-sheet="hue"]
    .featured-colorways {
    margin-top: 0.55rem;
    margin-bottom: 0.65rem;
  }

  body.pattern-page--colorway-immersive.pattern-page--stash-colorway[data-cw-sheet="colors"]
    .featured-colorways__title {
    margin-bottom: 0.35rem;
    font-size: 0.95rem;
  }

  body.pattern-page--colorway-immersive.pattern-page--stash-colorway[data-cw-sheet="colors"]
    .featured-colorways__scroll {
    gap: 0.5rem;
    padding-bottom: 0.25rem;
  }

  body.pattern-page--colorway-immersive.pattern-page--stash-colorway[data-cw-sheet="colors"]
    .featured-colorway-card--compact {
    flex: 0 0 auto;
    width: min(15.5rem, 78vw);
    scroll-snap-align: start;
    padding: 0.35rem 0.4rem 0.4rem;
    gap: 0.2rem;
  }

  body.pattern-page--colorway-immersive.pattern-page--stash-colorway[data-cw-sheet="colors"]
    .featured-colorway-card__preview--compact {
    display: grid;
    grid-template-columns: 2.75rem minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 0.25rem 0.55rem;
    align-items: center;
    width: 100%;
    margin: 0;
    padding: 0.45rem 0.55rem;
    border: 1px solid rgba(12, 41, 90, 0.12);
    border-radius: 10px;
    background: #fff;
    text-align: left;
    cursor: pointer;
  }

  body.pattern-page--colorway-immersive.pattern-page--stash-colorway[data-cw-sheet="colors"]
    .featured-colorway-card__photo--thumb {
    grid-row: 1 / span 2;
    width: 2.75rem;
    height: 2.75rem;
    object-fit: cover;
    border-radius: 6px;
  }

  body.pattern-page--colorway-immersive.pattern-page--stash-colorway[data-cw-sheet="colors"]
    .featured-colorway-card__preview--compact
    .featured-colorway-card__swatches {
    grid-column: 2;
    display: flex;
    gap: 0.2rem;
    margin: 0;
  }

  body.pattern-page--colorway-immersive.pattern-page--stash-colorway[data-cw-sheet="colors"]
    .featured-colorway-card__preview--compact
    .featured-colorway-card__dot {
    width: 0.7rem;
    height: 0.7rem;
  }

  body.pattern-page--colorway-immersive.pattern-page--stash-colorway[data-cw-sheet="colors"]
    .featured-colorway-card__copy {
    grid-column: 2;
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    min-width: 0;
  }

  body.pattern-page--colorway-immersive.pattern-page--stash-colorway[data-cw-sheet="colors"]
    .featured-colorway-card__preview--compact
    .featured-colorway-card__name {
    font-size: 0.82rem;
    line-height: 1.2;
  }

  body.pattern-page--colorway-immersive.pattern-page--stash-colorway[data-cw-sheet="colors"]
    .featured-colorway-card__preview--compact
    .featured-colorway-card__creator {
    font-size: 0.7rem;
    opacity: 0.75;
  }

  body.pattern-page--colorway-immersive.pattern-page--stash-colorway[data-cw-sheet="colors"]
    .featured-colorway-card__shop-row {
    margin-top: 0.25rem;
    padding-left: 0.15rem;
  }

  body.pattern-page--colorway-immersive.pattern-page--stash-colorway[data-cw-sheet="colors"]
    .featured-colorway-card__preview--active,
  body.pattern-page--colorway-immersive.pattern-page--stash-colorway[data-cw-sheet="colors"]
    .featured-colorway-card__preview[aria-pressed="true"],
  body.pattern-page--colorway-immersive.pattern-page--stash-colorway[data-cw-sheet="kits"]
    .featured-colorway-card__preview--active,
  body.pattern-page--colorway-immersive.pattern-page--stash-colorway[data-cw-sheet="kits"]
    .featured-colorway-card__preview[aria-pressed="true"],
  body.pattern-page--colorway-immersive.pattern-page--stash-colorway[data-cw-sheet="hue"]
    .featured-colorway-card__preview--active,
  body.pattern-page--colorway-immersive.pattern-page--stash-colorway[data-cw-sheet="hue"]
    .featured-colorway-card__preview[aria-pressed="true"] {
    box-shadow: 0 0 0 2px var(--dc-teal, #1b9aaa);
  }

  .cw-color-count-stepper {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0.15rem 0 0.45rem;
    padding: 0.2rem;
    border-radius: 999px;
    background: rgba(12, 41, 90, 0.06);
  }

  .cw-color-count-stepper__btn {
    width: 2.1rem;
    height: 2.1rem;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: #fff;
    color: var(--dc-navy, #0c295a);
    font: 700 1.15rem/1 Lexend, system-ui, sans-serif;
    cursor: pointer;
    box-shadow: 0 0 0 1px rgba(12, 41, 90, 0.12);
  }

  .cw-color-count-stepper__btn:disabled {
    opacity: 0.35;
    cursor: default;
  }

  .cw-color-count-stepper__label {
    min-width: 5.5rem;
    text-align: center;
    font: 600 0.9rem/1.2 Lexend, system-ui, sans-serif;
    color: var(--dc-navy, #0c295a);
  }

  body.pattern-page--colorway-immersive.pattern-page--stash-colorway[data-cw-sheet="colors"]
    .cw-section--build-colors {
    margin-top: 0.15rem;
  }

  body.pattern-page--colorway-immersive.pattern-page--stash-colorway[data-cw-sheet="colors"]
    .cw-section--build-colors
    .cw-tip {
    margin: 0 0 0.45rem;
    font-size: 0.8rem;
  }

  .cw-yarn-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0 0 0.35rem;
    padding: 0;
    max-width: 100%;
  }

  .cw-yarn-palette__chip {
    width: 2rem;
    height: 2rem;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(12, 41, 90, 0.16);
    border-radius: 999px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
    cursor: pointer;
    flex: 0 0 auto;
  }

  .cw-yarn-palette__chip:hover,
  .cw-yarn-palette__chip:focus-visible {
    outline: 2px solid var(--dc-teal, #1b9aaa);
    outline-offset: 2px;
  }

  .cw-photo-inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    margin: 0 0 0.55rem;
  }

  .cw-photo-inline-actions__link {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--dc-teal, #1b9aaa);
    font: 600 0.8rem/1.2 Lexend, system-ui, sans-serif;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
  }

  .cw-photo-inline-status {
    color: var(--dc-navy, #0c295a);
    opacity: 0.8;
  }

  /* Order sheet: chrome already says Color order — keep slots compact. */
  body.pattern-page--colorway-immersive.pattern-page--stash-colorway[data-cw-sheet="order"]
    .cw-section--stripe-yarns
    .cw-section-title,
  body.pattern-page--colorway-immersive.pattern-page--stash-colorway[data-cw-sheet="order"]
    .cw-section--stripe-yarns
    .cw-tip {
    display: none;
  }

  body.pattern-page--colorway-immersive.pattern-page--stash-colorway[data-cw-sheet="order"]
    .cw-section--stripe-yarns {
    margin-top: 0.35rem;
  }

  .cw-colorway-sheet-chrome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 0.75rem 1rem 0.55rem;
    background: #fff;
    border-bottom: 1px solid rgba(12, 41, 90, 0.08);
  }

  .cw-colorway-sheet-chrome__heading {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    min-width: 0;
    flex: 1 1 auto;
  }

  .cw-colorway-sheet-chrome__title {
    margin: 0;
    font-family: Lexend, system-ui, sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--dc-navy, #0c295a);
  }

  .cw-colorway-sheet-chrome__status {
    font-family: Lexend, system-ui, sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: rgba(12, 41, 90, 0.55);
    line-height: 1.2;
  }

  .cw-colorway-sheet-chrome__close {
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--dc-navy, #0c295a);
    cursor: pointer;
  }

  .cw-colorway-sheet-footer {
    display: none;
    position: sticky;
    bottom: 0;
    z-index: 1;
    padding: 0.75rem 1rem
      calc(0.75rem + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-top: 1px solid rgba(12, 41, 90, 0.1);
  }

  body.pattern-page--colorway-sheet-open .cw-colorway-sheet-footer {
    display: flex;
    align-items: stretch;
    gap: 0.65rem;
  }

  .cw-colorway-sheet-footer__back {
    flex: 0 0 auto;
    min-width: 5.25rem;
    min-height: 48px;
    margin: 0;
    padding: 0.65rem 0.9rem;
    border: 1px solid rgba(12, 41, 90, 0.22);
    border-radius: 8px;
    background: #fff;
    color: var(--dc-navy, #0c295a);
    font-family: Lexend, system-ui, sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
  }

  .cw-colorway-sheet-footer__apply {
    flex: 1 1 auto;
    width: auto;
    min-height: 48px;
    font-size: 0.95rem;
  }

  .cw-colorway-sheet-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 17;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgba(12, 41, 90, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  body.pattern-page--colorway-sheet-open .cw-colorway-sheet-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
}

/* Match colorway page: clickable zones + direct reset affordance */
body.pattern-page--colorway-embed .pattern-stage.svg-stage svg [data-color-zone] {
  cursor: pointer;
}

body.pattern-page--colorway-embed .pattern-stage.svg-stage.svg-stage--hue-shift {
  background: transparent;
}

body.pattern-page--colorway-embed .pattern-stage.svg-stage--moon-tide {
  display: block;
  max-height: none;
  min-height: 0;
  padding: 10px 10px 0;
  overflow: visible;
}

/* Casco / FO / stripe·stash schematics are drawings — don’t hide them under the nameplate. */
body.pattern-page--colorway-embed .pattern-stage-wrap--nameplate:has(.svg-stage--moon-tide),
body.pattern-page--colorway-embed .pattern-stage-wrap--nameplate:has(.svg-stage--fo-schematic),
body.pattern-page--colorway-embed .pattern-stage-wrap--nameplate:has(.svg-stage--stash-map),
body.pattern-page--colorway-embed .pattern-stage-wrap--nameplate:has(.svg-stage--stripe-map) {
  overflow: visible;
}

body.pattern-page--colorway-embed
  .pattern-stage-wrap--nameplate:has(.svg-stage--moon-tide)
  .pattern-hue-setup-hero__nameplate-band--overlay,
body.pattern-page--colorway-embed
  .pattern-stage-wrap--nameplate:has(.svg-stage--fo-schematic)
  .pattern-hue-setup-hero__nameplate-band--overlay,
body.pattern-page--colorway-embed
  .pattern-stage-wrap--nameplate:has(.svg-stage--stash-map)
  .pattern-hue-setup-hero__nameplate-band--overlay,
body.pattern-page--colorway-embed
  .pattern-stage-wrap--nameplate:has(.svg-stage--stripe-map)
  .pattern-hue-setup-hero__nameplate-band--overlay {
  position: relative;
  height: auto;
  min-height: 56px;
}

/* Color scheme namecard: same overlay as Terminology / Your progress. */
body.pattern-page--colorway-embed .pattern-stage-wrap--nameplate {
  position: relative;
  overflow: hidden;
  margin-bottom: 14px;
  border-radius: var(--pattern-tile-radius, 4px);
  border: 1px solid rgba(12, 41, 90, 0.1);
  background: #fff;
  box-shadow: 0 2px 10px rgba(12, 41, 90, 0.06);
}

body.pattern-page--colorway-embed .pattern-stage-wrap--nameplate .pattern-stage {
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 8px 8px 0;
}

body.pattern-page--colorway-embed
  .pattern-stage-wrap--nameplate
  .pattern-stage.svg-stage--stash-map,
body.pattern-page--colorway-embed
  .pattern-stage-wrap--nameplate
  .pattern-stage.svg-stage--stripe-map {
  /* Keep tassels clear of the in-flow nameplate band. */
  padding: 8px 8px 10px;
  overflow: visible;
}

body.pattern-page--colorway-embed .pattern-stage-wrap--nameplate #pattern-colorway-nameplate {
  margin: 0;
}

/* After the shared nameplate rules so Casco / FO / stripe·stash schematics are not cropped. */
body.pattern-page--colorway-embed
  .pattern-stage-wrap--nameplate.pattern-hue-setup-hero:has(.svg-stage--moon-tide),
body.pattern-page--colorway-embed
  .pattern-stage-wrap--nameplate.pattern-hue-setup-hero:has(.svg-stage--fo-schematic),
body.pattern-page--colorway-embed
  .pattern-stage-wrap--nameplate.pattern-hue-setup-hero:has(.svg-stage--stash-map),
body.pattern-page--colorway-embed
  .pattern-stage-wrap--nameplate.pattern-hue-setup-hero:has(.svg-stage--stripe-map) {
  overflow: visible;
}

body.pattern-page--colorway-embed
  .pattern-stage-wrap--nameplate:has(.svg-stage--moon-tide)
  .pattern-hue-setup-hero__nameplate-band--overlay,
body.pattern-page--colorway-embed
  .pattern-stage-wrap--nameplate:has(.svg-stage--fo-schematic)
  .pattern-hue-setup-hero__nameplate-band--overlay,
body.pattern-page--colorway-embed
  .pattern-stage-wrap--nameplate:has(.svg-stage--stash-map)
  .pattern-hue-setup-hero__nameplate-band--overlay,
body.pattern-page--colorway-embed
  .pattern-stage-wrap--nameplate:has(.svg-stage--stripe-map)
  .pattern-hue-setup-hero__nameplate-band--overlay {
  position: relative;
  inset: auto;
  height: auto;
  min-height: 56px;
  width: 100%;
}

.pattern-moon-tide-colorway {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.pattern-moon-tide-colorway__tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.pattern-moon-tide-colorway__tab {
  appearance: none;
  border: 1px solid rgba(12, 41, 90, 0.14);
  background: #fff;
  color: var(--dc-navy, #0c295a);
  border-radius: 4px;
  min-height: 42px;
  padding: 0.5rem 0.85rem;
  font-family: Lexend, system-ui, sans-serif;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.pattern-moon-tide-colorway__tab--active {
  background: var(--dc-navy, #0c295a);
  border-color: var(--dc-navy, #0c295a);
  color: #fff;
}

.pattern-moon-tide-colorway__stage {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
  padding: 8px 8px 12px;
  overflow: visible;
}

.pattern-moon-tide-colorway__frame {
  flex: 0 0 auto;
  margin: 0 auto;
  max-width: 100%;
}

.pattern-moon-tide-colorway__frame--project {
  width: min(100%, 340px);
  box-sizing: border-box;
}

.pattern-moon-tide-colorway__frame--chart {
  width: min(100%, 300px);
}

.pattern-moon-tide-colorway__frame > svg.pattern-moon-tide-colorway__svg {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(48vh, 380px);
  margin: 0 auto;
}

.pattern-moon-tide-colorway__frame--chart > svg.pattern-moon-tide-colorway__svg {
  max-height: min(42vh, 300px);
}

.pattern-hue-home--color-scheme,
.pattern-chroma-setup--colorway {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pattern-card--colorway-controls .pattern-card__title {
  margin-bottom: 0.35rem;
}

.pattern-colorway-panel__heading {
  margin: 0 0 0.65rem;
  padding: 0;
  font-family: "Lexend", sans-serif;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--dc-navy);
}

.cw-stash-plan-host {
  margin: 0 0 0.85rem;
}

.cw-yarn-slots {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
}

.cw-yarn-slot {
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.45rem 0.55rem;
  margin: 0;
  padding: 0.35rem 0.4rem 0.35rem 0.35rem;
  border-radius: 12px;
  border: 1px solid rgba(12, 41, 90, 0.12);
  background: rgba(255, 255, 255, 0.92);
  touch-action: manipulation;
}

.cw-yarn-slot--draggable:not(:has(.cw-yarn-slot__handle)) {
  grid-template-columns: 1.75rem minmax(0, 1fr);
}

.cw-yarn-slots--drag-enabled .cw-yarn-slot--draggable {
  cursor: grab;
}

.cw-yarn-slots--drag-enabled .cw-yarn-slot__handle {
  cursor: grab;
}

.cw-yarn-slots--reordering .cw-yarn-slot__handle {
  cursor: grabbing;
}

.cw-yarn-slots--reordering {
  touch-action: none;
  user-select: none;
}

.cw-yarn-slot--dragging {
  cursor: grabbing;
  opacity: 0.92;
  box-shadow: 0 8px 22px rgba(12, 41, 90, 0.18);
  transform: scale(1.02);
  z-index: 2;
  position: relative;
  border-color: var(--dc-teal, #1b9aaa);
}

.cw-yarn-slot--chip {
  grid-template-columns: minmax(0, 1fr);
}

.cw-yarn-slot__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 999px;
  font: 700 0.75rem/1 Lexend, system-ui, sans-serif;
  color: #fff;
  background: #0c295a;
}

.cw-yarn-slot__pick {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: 1 1 auto;
  margin: 0;
  padding: 0.2rem 0.35rem;
  min-width: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}

.cw-yarn-slot__pick:hover,
.cw-yarn-slot__pick:focus-visible {
  background: rgba(12, 41, 90, 0.06);
  outline: none;
}

.cw-yarn-slot__pick--view {
  cursor: default;
}

.cw-yarn-slot__pick--view:hover,
.cw-yarn-slot__pick--view:focus-visible {
  background: transparent;
}

.cw-yarn-slot__swatch {
  flex: 0 0 auto;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 1px rgba(12, 41, 90, 0.18);
}

.cw-yarn-slot__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 600 0.8125rem/1.25 Lexend, system-ui, sans-serif;
  color: var(--dc-navy, #0c295a);
}

.cw-yarn-slot__fiber {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 0;
  border: none;
  background: transparent;
  font: 600 0.72rem/1.2 Lexend, system-ui, sans-serif;
  letter-spacing: 0.01em;
  text-transform: lowercase;
  color: rgba(12, 41, 90, 0.55);
}

.cw-yarn-slot__fiber--stellina,
.cw-yarn-slot__fiber--yak {
  color: rgba(12, 41, 90, 0.55);
}

.cw-yarn-slot__handle {
  display: grid;
  grid-template-columns: repeat(2, 0.28rem);
  grid-template-rows: repeat(3, 0.28rem);
  gap: 0.22rem 0.28rem;
  align-content: center;
  justify-content: center;
  margin: 0;
  padding: 0.45rem 0.4rem;
  width: auto;
  min-width: 1.75rem;
  min-height: 2.1rem;
  border-radius: 8px;
  border: 1px solid rgba(12, 41, 90, 0.12);
  background: rgba(12, 41, 90, 0.04);
  color: #0c295a;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.cw-yarn-slot__handle:hover,
.cw-yarn-slot__handle:focus-visible {
  border-color: rgba(12, 41, 90, 0.28);
  background: rgba(12, 41, 90, 0.08);
  outline: none;
}

.cw-yarn-slot__handle-dot {
  display: block;
  width: 0.28rem;
  height: 0.28rem;
  border-radius: 999px;
  background: currentColor;
}

.cw-stash-plan {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.cw-stash-plan .cw-section-title {
  margin: 0;
}

.cw-stash-plan__pills {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.2rem;
  border-radius: 999px;
  background: rgba(12, 41, 90, 0.06);
  border: 1px solid rgba(12, 41, 90, 0.1);
  align-self: flex-start;
  max-width: 100%;
}

.cw-stash-plan__pill {
  margin: 0;
  padding: 0.4rem 0.85rem;
  border: none;
  border-radius: 999px;
  font: 600 0.8125rem/1.2 Lexend, system-ui, sans-serif;
  color: rgba(12, 41, 90, 0.72);
  background: transparent;
  cursor: pointer;
}

.cw-stash-plan__pill:hover {
  color: #0c295a;
  background: rgba(255, 255, 255, 0.65);
}

.cw-stash-plan__pill.is-active {
  color: #fff;
  background: #0c295a;
}

.cw-stash-plan__your {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.cw-stash-plan__slider-label {
  font: 600 0.8125rem/1.3 Lexend, system-ui, sans-serif;
  color: var(--dc-navy, #0c295a);
}

.cw-stash-plan__slider {
  width: min(100%, 280px);
  accent-color: #0c295a;
}

.cw-stash-count,
.cw-stash-sequence {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.cw-stash-choice-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0;
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid rgba(12, 41, 90, 0.14);
  border-radius: 10px;
  background: #fff;
  color: var(--dc-navy, #0c295a);
  cursor: pointer;
  text-align: left;
}

.cw-stash-choice-btn.is-active {
  border-color: #0c295a;
  background: rgba(12, 41, 90, 0.06);
  box-shadow: inset 0 0 0 1px #0c295a;
}

.cw-stash-choice-btn__label {
  font: 700 0.9rem/1.25 Lexend, system-ui, sans-serif;
}

.cw-stash-choice-btn__meta {
  font: 500 0.78rem/1.25 Lexend, system-ui, sans-serif;
  color: rgba(12, 41, 90, 0.65);
}

.cw-stash-count__custom {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(12, 41, 90, 0.1);
  background: rgba(12, 41, 90, 0.03);
}

.cw-stash-count__custom.is-active {
  border-color: rgba(12, 41, 90, 0.22);
  background: #fff;
}

.cw-stash-sequence__list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.cw-stash-seq-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
  margin: 0;
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(12, 41, 90, 0.12);
  border-radius: 10px;
  background: #fff;
  color: var(--dc-navy, #0c295a);
  cursor: pointer;
  text-align: left;
}

.cw-stash-seq-card.is-active {
  border-color: #0c295a;
  background: rgba(12, 41, 90, 0.05);
  box-shadow: inset 0 0 0 1px #0c295a;
}

.cw-stash-seq-card.is-disabled,
.cw-stash-seq-card:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  background: rgba(12, 41, 90, 0.03);
  border-color: rgba(12, 41, 90, 0.08);
  box-shadow: none;
  filter: grayscale(0.35);
}

.cw-stash-seq-card.is-disabled .cw-stash-seq-card__blurb,
.cw-stash-seq-card:disabled .cw-stash-seq-card__blurb {
  color: rgba(12, 41, 90, 0.55);
  font-weight: 600;
}

.cw-stash-seq-card__copy {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.cw-stash-seq-card__label {
  font: 700 0.88rem/1.25 Lexend, system-ui, sans-serif;
}

.cw-stash-seq-card__blurb {
  font: 500 0.75rem/1.35 Lexend, system-ui, sans-serif;
  color: rgba(12, 41, 90, 0.62);
}

.cw-stash-seq-preview {
  display: flex;
  flex-direction: column;
  width: 40px;
  height: 56px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(12, 41, 90, 0.12);
  flex-shrink: 0;
}

.cw-stash-seq-preview__row {
  flex: 1 1 0;
  min-height: 0;
  display: block;
}

.pattern-colorway-chart-unlock {
  margin: 0 0 0.85rem;
}

.pattern-colorway-stitch-chart {
  margin: 1.15rem 0 0;
}

.pattern-colorway-stitch-chart img {
  display: block;
  width: 100%;
  max-width: 28rem;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--dc-navy) 14%, transparent);
  background: #fff;
}

.pattern-colorway-stitch-chart figcaption {
  margin-top: 0.4rem;
  font: 600 0.78rem/1.3 Montserrat, system-ui, sans-serif;
  color: color-mix(in srgb, var(--dc-navy) 72%, transparent);
}

.pattern-colorway-panel-details {
  margin: 0;
  border-radius: var(--radius);
  border: 1px solid rgba(12, 41, 90, 0.12);
  background: var(--dc-white);
  overflow: hidden;
}

.pattern-colorway-panel-details__summary {
  margin: 0;
  padding: 0.75rem 0.9rem;
  font-family: "Lexend", sans-serif;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--dc-navy);
  cursor: pointer;
  list-style: none;
  background: var(--dc-gray-light);
}

.pattern-colorway-panel-details__summary::-webkit-details-marker {
  display: none;
}

.pattern-colorway-panel-details__summary::before {
  content: "";
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  margin-right: 0.55rem;
  border-right: 2px solid var(--dc-navy);
  border-bottom: 2px solid var(--dc-navy);
  transform: rotate(-45deg);
  vertical-align: 0.1rem;
  transition: transform 0.15s ease;
}

.pattern-colorway-panel-details[open] > .pattern-colorway-panel-details__summary::before {
  transform: rotate(45deg);
  vertical-align: -0.05rem;
}

.pattern-colorway-panel-details > .pattern-colorway-panel-host {
  padding: 0.75rem 0.9rem 0.85rem;
}

.pattern-colorway-panel-host.panel-inner {
  gap: 0.65rem;
  padding: 0;
}

.pattern-colorway-panel-host .cw-embedded-colorway-hint {
  margin: 0.15rem 0 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: rgba(12, 41, 90, 0.72);
}

body[data-view="home"].pattern-page--hue-no-stage .pattern-main,
body[data-hue-section="setup"] .pattern-main {
  padding-top: 0.5rem;
}

/* Pattern home (no stage): allow natural height, but never shorter than the viewport
   so the mint global canvas doesn't peek out under the panel. */
html:has(body.pattern-page--hue-no-stage) {
  min-height: 100%;
  height: auto;
  background: #f7f8fa;
}

body.pattern-page.pattern-page--hue-no-stage {
  min-height: 100vh;
  min-height: 100dvh;
  height: auto;
  background: #f7f8fa;
}

body.pattern-page--hue-no-stage .pattern-panel .panel-inner {
  flex: none;
  overflow: visible;
  padding: 1rem 1.1rem max(1rem, env(safe-area-inset-bottom, 0px));
}

body.pattern-page--hue-no-stage .pattern-hue-continue-banner {
  margin-bottom: 0.75rem;
  padding: 0.7rem 0.85rem;
}

body.pattern-page--hue-no-stage .pattern-hue-setup-body {
  padding-bottom: 0.25rem;
}

body.pattern-page--hue-no-stage .pattern-section-steps-lead {
  margin-bottom: 0.55rem;
  font-size: 0.875rem;
  line-height: 1.4;
}

.pattern-stage {
  background: #ffffff;
  border: 1px solid rgba(12, 41, 90, 0.14);
  border-radius: var(--radius);
  overflow: hidden;
  padding: 12px;
  min-height: 0;
  box-shadow: 0 10px 28px rgba(12, 41, 90, 0.1);
}

.pattern-stage:not(.svg-stage--moon-tide) svg {
  width: 100%;
  height: auto;
  display: block;
}

/* Stage carousel (home view): photo + full diagram */
.pattern-stage-carousel {
  width: 100%;
  /* Shared “viewport” height for both slides (keeps sizes consistent without wasting space). */
  --pattern-carousel-h: clamp(320px, 46vh, 420px);
  /* Allow vertical page scroll; let JS handle horizontal swipe. */
  touch-action: pan-y;
}

.pattern-stage-carousel__track {
  display: flex;
  width: 200%;
  transform: translateX(0%);
  transition: transform 220ms ease;
}

.pattern-stage-carousel__slide {
  width: 100%;
  flex: 0 0 50%;
}

.pattern-stage-carousel__img {
  width: 100%;
  height: var(--pattern-carousel-h);
  object-fit: contain;
  object-position: center;
  display: block;
  border-radius: 14px;
  border: 1px solid rgba(12, 41, 90, 0.12);
  background: #ffffff;
}

.pattern-stage-carousel__diagram {
  width: 100%;
  height: var(--pattern-carousel-h);
  border-radius: 14px;
  border: 1px solid rgba(12, 41, 90, 0.12);
  background: #ffffff;
  padding: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pattern-stage-carousel__diagram svg {
  width: auto;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  display: block;
}

.pattern-stage-carousel__controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

@media (max-width: 420px) {
  .pattern-stage {
    padding: 10px;
  }

  .pattern-stage-carousel {
    --pattern-carousel-h: clamp(260px, 38vh, 340px);
  }

  .pattern-stage-carousel__controls {
    margin-top: 6px;
  }
}

.pattern-stage-carousel__arrow {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  border: 1px solid rgba(12, 41, 90, 0.22);
  background: #fff;
  color: var(--dc-navy, #0c295a);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.pattern-stage-carousel__arrow:hover:not(:disabled) {
  border-color: var(--dc-teal, #1b9aaa);
  color: var(--dc-teal, #1b9aaa);
}

.pattern-stage-carousel__arrow:disabled {
  opacity: 0.35;
  cursor: default;
}

.pattern-stage-carousel__status {
  min-width: 2.75rem;
  text-align: center;
  font-family: "Lexend", system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(12, 41, 90, 0.72);
}

.pattern-hue-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(260px, 42vh, 420px);
  border-radius: 14px;
  border: 1px solid rgba(12, 41, 90, 0.12);
  background:
    radial-gradient(circle at top left, rgba(27, 154, 170, 0.12), transparent 38%),
    #ffffff;
  overflow: hidden;
}

.pattern-hue-stage__img {
  width: 100%;
  height: clamp(260px, 42vh, 420px);
  object-fit: cover;
  object-position: center;
  display: block;
}

.pattern-section-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  max-height: min(32vh, 200px);
  border-radius: 14px;
  border: 1px solid rgba(12, 41, 90, 0.12);
  background: #fff;
  overflow: hidden;
}

.pattern-section-stage__img {
  width: 100%;
  height: min(32vh, 200px);
  object-fit: cover;
  object-position: center;
  display: block;
}

.pattern-hue-full-chart-stage {
  min-height: clamp(260px, 50vh, 640px);
  max-height: min(78vh, 900px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 14px;
  border: 1px solid rgba(12, 41, 90, 0.12);
  background: #fff;
}

.pattern-hue-full-chart-stage__img {
  display: block;
  width: 100%;
  height: auto;
}

.pattern-hue-full-chart-hint {
  margin-top: 0.5rem;
  font-size: 0.875rem;
}

.pattern-hue-home {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pattern-hue-hero {
  background:
    radial-gradient(circle at top right, rgba(241, 148, 85, 0.18), transparent 34%),
    #ffffff;
}

.pattern-hue-kicker {
  margin: 0 0 6px;
  font-family: "Lexend", system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dc-teal);
}

.pattern-hue-title {
  margin-bottom: 8px;
}

.pattern-hue-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.pattern-hue-callout {
  border-color: rgba(27, 154, 170, 0.28);
}

.pattern-hue-tip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  background: rgba(245, 245, 245, 0.82);
}

.pattern-hue-tip__icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  background: rgba(241, 148, 85, 0.18);
}

.pattern-hue-list {
  margin: 10px 0 0;
  padding-left: 1.2rem;
  color: var(--dc-text-muted);
  font-size: calc(0.95rem * var(--pattern-text-scale, 1));
  line-height: var(--pattern-text-lh, 1.55);
}

.pattern-section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 8px;
  margin-top: 12px;
}

@media (min-width: 560px) {
  .pattern-section-grid {
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 10px;
  }
}

.pattern-section-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(12, 41, 90, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  color: inherit;
  text-decoration: none;
  box-shadow: 0 1px 4px rgba(12, 41, 90, 0.06);
}

.pattern-section-card__media {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  background: #fff;
}

.pattern-section-card__img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.pattern-section-card > :not(.pattern-section-card__media) {
  margin-left: 8px;
  margin-right: 8px;
}

.pattern-section-card > .pattern-section-card__title {
  margin: 6px 8px 8px;
}

.pattern-section-card:not(:has(.pattern-section-card__media)) {
  padding: 12px;
}

.pattern-section-card:not(:has(.pattern-section-card__media)) > * {
  margin-left: 0;
  margin-right: 0;
}

.pattern-section-card:not(:has(.pattern-section-card__media)) > .pattern-section-card__title {
  margin-top: 0;
}

.pattern-section-card:hover {
  border-color: var(--dc-teal);
  box-shadow: var(--dc-shadow);
}

button.pattern-section-card {
  width: 100%;
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.pattern-hue-back {
  margin-bottom: 12px;
}

.pattern-hue-text-back {
  display: inline-block;
  margin: 0 0 10px;
  padding: 0;
  border: 0;
  background: none;
  font-family: Lexend, system-ui, sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--dc-teal, #1b9aa0);
  cursor: pointer;
  text-align: left;
}

.pattern-hue-text-back:hover {
  text-decoration: underline;
}

.pattern-hue-setup-back {
  padding: 0.35rem 1.25rem 0.65rem;
  padding-left: max(1.25rem, env(safe-area-inset-left, 0px));
  padding-right: max(1.25rem, env(safe-area-inset-right, 0px));
}

.pattern-hue-home--row-lesson {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pattern-loading {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.pattern-loading__spinner {
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  border: 2px solid rgba(12, 41, 90, 0.18);
  border-top-color: var(--dc-teal, #1b9aaa);
  animation: pattern-loading-spin 0.7s linear infinite;
  flex: 0 0 auto;
}

@keyframes pattern-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

.pattern-boot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.pattern-hue-home--setup {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pattern-hue-setup-intro-hero {
  margin: -1rem -1.25rem 0.35rem;
  margin-left: max(-1.25rem, calc(-1 * env(safe-area-inset-left, 0px)));
  margin-right: max(-1.25rem, calc(-1 * env(safe-area-inset-right, 0px)));
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(12, 41, 90, 0.08);
}

.pattern-hue-setup-back + .pattern-hue-setup-intro-hero {
  margin-top: 0;
}

.pattern-hue-setup-intro-hero + .pattern-hue-setup-intro-hero {
  margin-top: 0;
  padding-top: 0;
}

.pattern-hue-setup-video--hero {
  margin: 0;
}

.pattern-hue-setup-video--hero .pattern-video-embed {
  aspect-ratio: 16 / 9;
  min-height: min(52vw, 280px);
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  box-shadow: 0 8px 24px rgba(12, 41, 90, 0.12);
}

/* Casco Moon Tide — Part 2 Seaming page: video on top, swipeable step deck below. */
.pattern-moon-tide-seaming {
  display: flex;
  flex-direction: column;
}

/* Read-ahead note card at the foot of the seaming page. */
.pattern-moon-tide-seaming__note {
  margin: 1rem 0 0;
  padding: 0.85rem 1rem;
  border-radius: var(--pattern-tile-radius, 4px);
  border: 1px solid rgba(12, 41, 90, 0.12);
  border-left: 4px solid var(--dc-navy, #0c295a);
  background: var(--pattern-tile-wash-navy, #e9edf3);
}

.pattern-moon-tide-seaming__note-text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: rgba(12, 41, 90, 0.75);
}

.pattern-moon-tide-seaming__color {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.85rem;
}

.pattern-moon-tide-seaming__color-label {
  font-family: "Lexend", system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(12, 41, 90, 0.55);
}

.pattern-moon-tide-seaming__color-swatch-wrap {
  display: flex;
  align-items: center;
}

.pattern-moon-tide-seaming__color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(12, 41, 90, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.pattern-moon-tide-seaming__instructions {
  margin: 0.35rem 0 0;
}

.pattern-moon-tide-seaming__heading {
  margin: 0 0 0.45rem;
  font-family: "Lexend", system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dc-teal, #1b9aaa);
}

.pattern-moon-tide-seaming__lead {
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--dc-text, #0c295a);
}

/* Collapsible video so the written steps sit closer to the top. */
.pattern-moon-tide-seaming__video-toggle {
  margin-bottom: 0.85rem;
  border: 1px solid rgba(12, 41, 90, 0.12);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.pattern-moon-tide-seaming__video-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.85rem;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--dc-text, #0c295a);
  list-style: none;
}

.pattern-moon-tide-seaming__video-icon {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--dc-teal, #1b9aaa);
  line-height: 0;
}

.pattern-moon-tide-seaming__video-icon svg {
  display: block;
}

.pattern-moon-tide-seaming__video-label {
  min-width: 0;
}

.pattern-moon-tide-seaming__video-summary::-webkit-details-marker {
  display: none;
}

.pattern-moon-tide-seaming__video-summary::after {
  content: "";
  margin-left: auto;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid rgba(12, 41, 90, 0.4);
  border-bottom: 2px solid rgba(12, 41, 90, 0.4);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}

.pattern-moon-tide-seaming__video-toggle[open] .pattern-moon-tide-seaming__video-summary::after {
  transform: rotate(45deg);
}

.pattern-moon-tide-seaming__video {
  padding: 0 0.6rem 0.6rem;
}

/* Keep the embed contained + rounded inside the toggle card (no full-bleed hero margins). */
.pattern-moon-tide-seaming__video .pattern-hue-setup-video--hero {
  margin: 0;
}

.pattern-moon-tide-seaming__video .pattern-hue-setup-video--hero .pattern-video-embed {
  border-radius: 10px;
  border: 1px solid rgba(12, 41, 90, 0.12);
  box-shadow: none;
  min-height: 0;
}

/* Read-ahead copy tucked under the video, inside the toggle card. */
.pattern-moon-tide-seaming__video-note {
  margin: 0;
  padding: 0 0.6rem 0.7rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: rgba(12, 41, 90, 0.75);
}

.pattern-moon-tide-seaming__carousel {
  margin: 0 -6px;
}

.pattern-moon-tide-seaming__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0 6px 6px;
}

.pattern-moon-tide-seaming__status {
  margin: 0;
  font-family: "Lexend", system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--dc-teal, #1b9aaa);
}

.pattern-moon-tide-seaming__hint {
  margin: 0;
  font-size: 0.75rem;
  white-space: nowrap;
}

.pattern-moon-tide-seaming__deck {
  list-style: none;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 6px 10px;
  margin: 0;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scroll-padding-left: 6px;
  touch-action: pan-x pan-y;
}

.pattern-moon-tide-seaming__card {
  flex: 0 0 auto;
  width: min(86%, 320px);
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.85rem;
  border-radius: 14px;
  border: 1px solid rgba(12, 41, 90, 0.12);
  background: #fff;
  box-shadow: 0 4px 14px rgba(12, 41, 90, 0.06);
}

/* Redundant on phones (the "Step N of X" status already shows the number). */
.pattern-moon-tide-seaming__step-num {
  display: none;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--dc-teal, #1b9aaa);
}

.pattern-moon-tide-seaming__media {
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: rgba(12, 41, 90, 0.04);
  cursor: zoom-in;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}

.pattern-moon-tide-seaming__media:focus-visible {
  outline: 2px solid var(--dc-orange, #f19455);
  outline-offset: 2px;
}

/* Keep natural aspect (mattress diagrams are 3:4) — no fixed height crop. */
.pattern-moon-tide-seaming__step-img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center;
  border-radius: 10px;
  background: rgba(12, 41, 90, 0.04);
  pointer-events: none;
}

.pattern-moon-tide-seaming__zoom-hint {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(12, 41, 90, 0.72);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  pointer-events: none;
}

.pattern-moon-tide-seaming__step-text {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--dc-text, #0c295a);
}

.pattern-moon-tide-seaming__photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 12rem;
  border: 1px dashed rgba(12, 41, 90, 0.3);
  border-radius: 10px;
  background: rgba(12, 41, 90, 0.03);
  color: rgba(12, 41, 90, 0.55);
  font-size: 0.82rem;
  font-style: italic;
}

.pattern-moon-tide-seaming__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 2px 0 0;
}

.pattern-moon-tide-seaming__arrow {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(12, 41, 90, 0.18);
  border-radius: 999px;
  background: #fff;
  color: var(--dc-text, #0c295a);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.pattern-moon-tide-seaming__arrow:disabled {
  opacity: 0.35;
  cursor: default;
}

.pattern-moon-tide-seaming__arrow:focus-visible {
  outline: 2px solid var(--dc-orange, #f19455);
  outline-offset: 2px;
}

.pattern-moon-tide-seaming__dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 0;
}

.pattern-moon-tide-seaming__dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(12, 41, 90, 0.2);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.pattern-moon-tide-seaming__dot--active {
  background: var(--dc-teal, #1b9aaa);
  transform: scale(1.15);
}

.pattern-moon-tide-seaming__dot:focus-visible {
  outline: 2px solid var(--dc-orange, #f19455);
  outline-offset: 2px;
}

.pattern-moon-tide-seaming__ask {
  margin-top: 1rem;
  align-self: flex-start;
}

/* Wider screens: drop the swipe deck and stack every step (image above text).
   The per-step "Step N" label replaces the swipe "Step N of X" status here. */
@media (min-width: 560px) {
  .pattern-moon-tide-seaming__meta,
  .pattern-moon-tide-seaming__hint,
  .pattern-moon-tide-seaming__controls {
    display: none;
  }

  .pattern-moon-tide-seaming__deck {
    flex-direction: column;
    gap: 12px;
    overflow: visible;
    scroll-snap-type: none;
    padding: 0 6px;
  }

  .pattern-moon-tide-seaming__card {
    width: min(100%, 420px);
    scroll-snap-align: unset;
    scroll-snap-stop: normal;
  }

  .pattern-moon-tide-seaming__step-num {
    display: block;
  }

  .pattern-moon-tide-seaming__media,
  .pattern-moon-tide-seaming__photo-placeholder {
    max-width: 280px;
  }
}

/* Technique photo lightbox */
.pattern-image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 320;
  display: flex;
  flex-direction: column;
  background: rgba(8, 16, 28, 0.94);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom)
    env(safe-area-inset-left);
}

.pattern-image-lightbox[hidden] {
  display: none;
}

.pattern-image-lightbox__backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
}

.pattern-image-lightbox__chrome {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
  padding: 12px 14px;
}

.pattern-image-lightbox__hint {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.72);
}

.pattern-image-lightbox__close {
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  color: #0c295a;
  background: #fff;
  cursor: pointer;
}

.pattern-image-lightbox__scroll {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-x pan-y pinch-zoom;
  padding: 8px 12px 24px;
}

.pattern-image-lightbox__img {
  display: block;
  width: min(100%, 720px);
  max-width: none;
  height: auto;
  margin: 0 auto;
  border-radius: 8px;
  background: #fff;
}

body.pattern-lightbox-open {
  overflow: hidden;
}

/* Casco Moon Tide — Part 2 Edging pages: collapsible chart, stat, step cards
   (shares the Seaming page's visual language). */
.pattern-moon-tide-edging {
  display: flex;
  flex-direction: column;
}

.pattern-moon-tide-edging__chart-toggle {
  margin-bottom: 0.9rem;
  border: 1px solid rgba(12, 41, 90, 0.12);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.pattern-moon-tide-edging__chart-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.85rem;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--dc-text, #0c295a);
  list-style: none;
}

.pattern-moon-tide-edging__chart-summary::-webkit-details-marker {
  display: none;
}

.pattern-moon-tide-edging__chart-summary::after {
  content: "";
  margin-left: auto;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid rgba(12, 41, 90, 0.4);
  border-bottom: 2px solid rgba(12, 41, 90, 0.4);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}

.pattern-moon-tide-edging__chart-toggle[open] .pattern-moon-tide-edging__chart-summary::after {
  transform: rotate(45deg);
}

.pattern-moon-tide-edging__chart {
  padding: 0 0.6rem 0.6rem;
}

.pattern-moon-tide-edging__stat {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.15rem 0.5rem;
  margin: 0 0 0.9rem;
  padding: 0.6rem 0.85rem;
  border-radius: 12px;
  background: rgba(27, 154, 170, 0.1);
  border: 1px solid rgba(27, 154, 170, 0.28);
}

.pattern-moon-tide-edging__stat-value {
  font-family: "Lexend", system-ui, sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--dc-teal, #1b9aaa);
}

.pattern-moon-tide-edging__stat-label {
  font-size: 0.85rem;
  color: var(--dc-text, #0c295a);
}

.pattern-moon-tide-edging__steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.pattern-moon-tide-edging__step {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.75rem 0.85rem;
  border-radius: 14px;
  border: 1px solid rgba(12, 41, 90, 0.12);
  background: #fff;
  box-shadow: 0 4px 14px rgba(12, 41, 90, 0.06);
}

.pattern-moon-tide-edging__step-num {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--dc-teal, #1b9aaa);
}

.pattern-moon-tide-edging__step-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--dc-text, #0c295a);
}

.pattern-moon-tide-edging__step-text {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--dc-text, #0c295a);
}

.pattern-moon-tide-edging__ask {
  margin-top: 1rem;
  align-self: flex-start;
}

/* Casco Moon Tide — Part 2 overview celebratory banner. */
.pattern-moon-tide-celebrate {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 0.75rem 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--pattern-tile-radius, 4px);
  background: var(--pattern-tile-wash-mint, #ecf1ee);
  border: 1px solid rgba(12, 41, 90, 0.12);
  border-left: 4px solid var(--dc-green, #89d18c);
  box-shadow: 0 2px 10px rgba(12, 41, 90, 0.06);
  animation: moonTideCelebrateIn 0.5s ease both;
}

.pattern-moon-tide-celebrate__emoji {
  flex-shrink: 0;
  font-size: 1.9rem;
  line-height: 1;
  transform-origin: center;
  animation: moonTideCelebratePop 0.9s cubic-bezier(0.2, 0.8, 0.3, 1.2) 0.25s both;
}

.pattern-moon-tide-celebrate__title {
  margin: 0;
  font-family: "Comfortaa", system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--dc-navy, #0c295a);
}

.pattern-moon-tide-celebrate__body {
  margin: 0.15rem 0 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--dc-text, #0c295a);
}

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

@keyframes moonTideCelebratePop {
  0% {
    opacity: 0;
    transform: scale(0.5) rotate(-12deg);
  }
  55% {
    opacity: 1;
    transform: scale(1.18) rotate(8deg);
  }
  100% {
    transform: scale(1) rotate(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pattern-moon-tide-celebrate,
  .pattern-moon-tide-celebrate__emoji {
    animation: none;
  }
}

/* Casco Moon Tide — end-of-pattern Done + share card. */
.pattern-moon-tide-done {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0.2rem 0 1.25rem;
  animation: moonTideCelebrateIn 0.55s ease both;
}

.pattern-moon-tide-done__title {
  margin: 0;
  font-family: "Lexend", "Comfortaa", system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(1.25rem, 4vw, 1.55rem);
  line-height: 1.2;
  color: var(--dc-navy, #0c295a);
}

.pattern-moon-tide-done__lead {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--dc-navy, #0c295a);
}

.pattern-moon-tide-done__card {
  width: 100%;
  max-width: 28rem;
  margin: 0.15rem auto 0;
  aspect-ratio: 1 / 1;
  display: grid;
  grid-template-rows: 1.65fr 1fr;
  border: 1px solid var(--dc-navy, #0c295a);
  overflow: hidden;
  background: #f7f4ef;
  box-shadow: 0 2px 14px rgba(12, 41, 90, 0.08);
}

.pattern-moon-tide-done__card-photo {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: #b8b9b6;
}

.pattern-moon-tide-done__card-photo.is-awaiting-photo {
  background: linear-gradient(160deg, #c5c8c4 0%, #9aa3a8 100%);
}

.pattern-moon-tide-done__card-photo-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.pattern-moon-tide-done__card-photo-img.is-ghost {
  opacity: 0.28;
  filter: saturate(0.85);
}

.pattern-moon-tide-done__photo-prompt {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.75rem;
  z-index: 1;
}

.pattern-moon-tide-done__camera-btn {
  appearance: none;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin: 0;
  min-width: 7.5rem;
  padding: 0.85rem 1.1rem 0.75rem;
  border-radius: 4px;
  border: 1.5px solid rgba(255, 255, 255, 0.92);
  background: rgba(12, 41, 90, 0.78);
  color: #fff;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.2;
  box-shadow: 0 6px 18px rgba(12, 41, 90, 0.22);
}

.pattern-moon-tide-done__camera-btn svg {
  display: block;
}

.pattern-moon-tide-done__camera-btn:hover {
  background: rgba(12, 41, 90, 0.9);
}

.pattern-moon-tide-done__camera-btn:focus-visible {
  outline: 2px solid var(--dc-orange, #f19455);
  outline-offset: 3px;
}

.pattern-moon-tide-done__library-btn {
  appearance: none;
  cursor: pointer;
  margin: 0;
  padding: 0.35rem 0.55rem;
  border-radius: 4px;
  border: 0;
  background: rgba(247, 244, 239, 0.88);
  color: var(--dc-navy, #0c295a);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
}

.pattern-moon-tide-done__library-btn:focus-visible {
  outline: 2px solid var(--dc-orange, #f19455);
  outline-offset: 2px;
}

.pattern-moon-tide-done__photo-manage {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  z-index: 1;
  display: flex;
  gap: 0.35rem;
}

.pattern-moon-tide-done__photo-link {
  appearance: none;
  cursor: pointer;
  margin: 0;
  padding: 0.28rem 0.5rem;
  border-radius: 4px;
  border: 1px solid rgba(12, 41, 90, 0.18);
  background: rgba(247, 244, 239, 0.92);
  color: var(--dc-navy, #0c295a);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
}

.pattern-moon-tide-done__photo-link:focus-visible {
  outline: 2px solid var(--dc-orange, #f19455);
  outline-offset: 2px;
}

.pattern-moon-tide-done__card-band {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 0.65rem;
  align-items: center;
  padding: 0.75rem 0.85rem;
  border-top: 1px solid rgba(12, 41, 90, 0.12);
  min-height: 0;
}

.pattern-moon-tide-done__card-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.pattern-moon-tide-done__card-mark svg {
  display: block;
  width: 2.35rem;
  height: 2.35rem;
}

.pattern-moon-tide-done__card-text {
  min-width: 0;
}

.pattern-moon-tide-done__card-line {
  font-family: "Lexend", system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(0.92rem, 3.2vw, 1.05rem);
  line-height: 1.2;
}

.pattern-moon-tide-done__card-name {
  margin-top: 0.2rem;
  font-size: 0.78rem;
  line-height: 1.25;
}

.pattern-moon-tide-done__card-tags {
  margin-top: 0.3rem;
  font-size: 0.68rem;
  line-height: 1.2;
  letter-spacing: 0.01em;
  word-break: break-word;
}

.pattern-moon-tide-done__kit {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.pattern-moon-tide-done__chip-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.pattern-moon-tide-done__chip-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(12, 41, 90, 0.72);
}

.pattern-moon-tide-done__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pattern-moon-tide-done__chip {
  appearance: none;
  cursor: pointer;
  margin: 0;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  border: 1px solid rgba(12, 41, 90, 0.14);
  background: #fff;
  color: var(--dc-navy, #0c295a);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
}

.pattern-moon-tide-done__chip.is-selected {
  border: 1.5px solid var(--dc-orange, #f19455);
  background: #fde6d2;
}

.pattern-moon-tide-done__chip:focus-visible {
  outline: 2px solid var(--dc-orange, #f19455);
  outline-offset: 2px;
}

.pattern-moon-tide-done__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.35rem;
}

.pattern-moon-tide-done__share {
  width: 100%;
  min-width: 0;
  justify-content: center;
}

.pattern-moon-tide-done__status {
  margin: 0;
  text-align: center;
  min-height: 1.25em;
  font-size: 0.9rem;
}

@media (prefers-reduced-motion: reduce) {
  .pattern-moon-tide-done {
    animation: none;
  }
}

.pattern-hue-intro-cover {
  margin: 0;
  line-height: 0;
  background: var(--pattern-tile-wash, #eef1f0);
  box-shadow: 0 2px 10px rgba(12, 41, 90, 0.06);
}

.pattern-hue-intro-cover__img {
  display: block;
  width: 100%;
  height: auto;
  min-height: min(40vw, 200px);
  max-height: min(52vw, 280px);
  object-fit: cover;
  object-position: center;
}

/* Pattern-home brand marks as part heroes — contain, don't crop/zoom. */
.pattern-hue-intro-cover--home-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: min(40vw, 200px);
  padding: 28px 20px;
  box-sizing: border-box;
  background: #f4f6f5;
  box-shadow: none;
}

.pattern-hue-intro-cover__img--home-icon {
  display: block;
  width: 96px !important;
  max-width: 96px;
  height: 96px !important;
  min-height: 0 !important;
  max-height: 96px !important;
  object-fit: contain !important;
  object-position: center;
}

/* Part overview hero — recolored diagram in a framed thumb strip */
.pattern-part-diagram-hero {
  margin: 0;
  line-height: 0;
  background: #29b0bc;
  padding: 12px 14px 14px;
  box-shadow: 0 8px 24px rgba(12, 41, 90, 0.12);
}

.pattern-part-diagram-hero__frame {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: min(36vw, 200px);
  background: #fff;
  border-radius: 12px;
  padding: 8px 12px;
  box-sizing: border-box;
}

.pattern-part-diagram-hero__img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(40vw, 220px);
  object-fit: contain;
  object-position: center;
}

.row-lesson-content {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.row-lesson-instructions .row-lesson-instr__p.pattern-muted,
.row-lesson-instructions .pattern-muted {
  color: var(--dc-text-muted, #4a5f7a);
  font-size: 0.9em;
}

.pattern-hue-setup-video-help {
  margin: 0.25rem 1rem 0;
}

.pattern-hue-setup-video-help__summary {
  cursor: pointer;
  font-family: Lexend, system-ui, sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgba(12, 41, 90, 0.55);
  list-style: none;
}

.pattern-hue-setup-video-help__summary::-webkit-details-marker {
  display: none;
}

.pattern-hue-setup-video-help__link {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--dc-teal, #1b9aa0);
}

.pattern-hue-continue-banner {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--pattern-tile-radius, 4px);
  border: 1px solid rgba(12, 41, 90, 0.12);
  border-left: 4px solid var(--dc-teal, #1b9aaa);
  background: var(--pattern-tile-wash-teal, #e8f0f1);
  box-shadow: 0 2px 10px rgba(12, 41, 90, 0.06);
}

.pattern-hue-continue-banner__status {
  margin: 0 0 0.65rem;
  font-family: Montserrat, system-ui, sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(12, 41, 90, 0.82);
}

.pattern-hue-continue-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pattern-hue-continue-banner__btn {
  flex: 1 1 10rem;
  justify-content: center;
  text-align: center;
  text-decoration: none;
}

.pattern-login-keep-place {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--pattern-tile-radius, 4px);
  border: 1px solid rgba(12, 41, 90, 0.12);
  border-left: 4px solid var(--dc-navy, #0c295a);
  background: var(--pattern-tile-wash-navy, #e9edf3);
}

.pattern-login-keep-place__text {
  margin: 0 0 0.65rem;
  font-family: Montserrat, system-ui, sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(12, 41, 90, 0.82);
  line-height: 1.4;
}

.pattern-login-keep-place__btn {
  display: inline-flex;
  text-decoration: none;
}

.pattern-tester-feedback--done {
  border-left-color: var(--dc-teal, #1b9aaa);
  background: var(--pattern-tile-wash-teal, #e8f0f1);
}

.pattern-learn-full-charts {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
  height: 100%;
  overflow: auto;
  padding: 0.75rem;
  box-sizing: border-box;
}

.pattern-learn-full-charts__block {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-height: 0;
}

.pattern-learn-full-charts__label {
  margin: 0;
  font-family: Montserrat, system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(12, 41, 90, 0.72);
}

.pattern-learn-full-charts__svg-host {
  width: 100%;
  min-height: 160px;
  padding: 0.5rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(12, 41, 90, 0.1);
  box-sizing: border-box;
}

.pattern-learn-full-charts__svg-host svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(48vh, 420px);
}

.pattern-learn-full-charts__toc {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
  font-family: Montserrat, system-ui, sans-serif;
  font-size: 0.85rem;
  color: rgba(12, 41, 90, 0.78);
}

.pattern-learn-bridge-banner {
  position: relative;
  z-index: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin: 0 0 1rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(12, 41, 90, 0.12);
  background: #fff;
  box-shadow: 0 2px 10px rgba(12, 41, 90, 0.06);
}

.pattern-learn-bridge-banner--return {
  border-color: rgba(27, 154, 160, 0.3);
  background: rgba(196, 232, 198, 0.38);
}

.pattern-learn-bridge-banner__title {
  margin: 0 0 0.2rem;
  font-family: Montserrat, system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: rgba(12, 41, 90, 0.92);
}

.pattern-learn-bridge-banner__text {
  margin: 0;
  max-width: 34ch;
  font-family: Montserrat, system-ui, sans-serif;
  font-size: 0.78rem;
  line-height: 1.4;
  color: rgba(12, 41, 90, 0.68);
}

.pattern-learn-bridge-banner__btn {
  flex: 0 0 auto;
  text-decoration: none;
  white-space: nowrap;
}

/* Legacy sticky bar — remove if a cached build left one in the DOM */
#pattern-learn-return-bar {
  display: none !important;
}

.pattern-stage-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 200px;
  padding: 12px;
  box-sizing: border-box;
}

.pattern-stage-photo__img {
  display: block;
  max-width: 100%;
  max-height: min(72vh, 520px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 4px 18px rgba(12, 41, 90, 0.12);
}

/* Seaming / edging step photos inside the instruction panel (mobile-first). */
.pattern-step-view__photo {
  width: 100%;
  margin: 10px 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(12, 41, 90, 0.1);
  background: rgba(255, 255, 255, 0.95);
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(12, 41, 90, 0.08);
}

.pattern-step-view__img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(56vh, 480px);
  object-fit: contain;
  object-position: center;
}

.pattern-hue-setup-body {
  margin: 0;
  padding: 0.35rem 0 0.5rem;
  background: transparent;
}

.pattern-hue-setup-overview--flat {
  margin: -0.15rem 0 1rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid rgba(12, 41, 90, 0.12);
  border-left: 4px solid var(--dc-teal, #1b9aaa);
  border-radius: var(--pattern-tile-radius, 4px);
  background: var(--pattern-tile-wash, #eef1f0);
  box-shadow: 0 2px 10px rgba(12, 41, 90, 0.06);
}

.pattern-hue-setup-overview--flat .pattern-hue-setup-overview__summary {
  padding: 0.15rem 0;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(27, 154, 160, 0.88);
}

.pattern-hue-setup-overview__body {
  margin: 0.5rem 0 0;
  padding: 0 0 0 0.65rem;
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: calc(0.9rem * var(--pattern-text-scale, 1));
  line-height: var(--pattern-text-lh, 1.45);
  color: var(--dc-text-muted, rgba(12, 41, 90, 0.72));
}

.pattern-hue-setup-overview--flat .pattern-hue-setup-overview__list {
  margin-top: 0.5rem;
  padding-left: 1.1rem;
}

.pattern-section-steps-heading {
  margin: 0 0 0.25rem;
  font-family: Comfortaa, system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(27, 154, 160, 0.88);
}

.pattern-section-steps-lead {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--dc-text-muted, rgba(12, 41, 90, 0.72));
}

.pattern-finish-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.9rem 1rem;
  background: var(--pattern-tile-wash, #eef1f0);
  border-radius: var(--pattern-tile-radius, 4px);
  border: 1px solid rgba(12, 41, 90, 0.12);
  border-left: 4px solid var(--dc-teal, #1b9aaa);
  box-shadow: 0 1px 2px rgba(12, 41, 90, 0.04);
  cursor: pointer;
}

.pattern-finish-check {
  flex: 0 0 auto;
  margin-top: 0.15rem;
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--dc-navy, #0c295a);
}

.pattern-finish-item__text {
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--dc-navy, #0c295a);
}

.pattern-hue-part-continue {
  margin: 0 0 1.25rem;
}

.pattern-hue-part-continue__btn {
  display: inline-flex;
  width: 100%;
  max-width: 100%;
  justify-content: center;
  box-sizing: border-box;
  text-decoration: none;
}

/* Casco Part 1 — logical body progress (not chart rows 1–9) */
.pattern-body-progress {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 0;
}

.pattern-body-progress__summary {
  margin: 0;
  font-family: Lexend, system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--dc-navy, #0c295a);
  line-height: 1.35;
}

.pattern-body-progress__continue {
  align-self: flex-start;
}

.pattern-body-progress__blocks {
  list-style: none;
  margin: 0.25rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pattern-body-progress__block {
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(12, 41, 90, 0.03);
  border: 1px solid rgba(12, 41, 90, 0.08);
}

.pattern-body-progress__block--current {
  background: rgba(98, 210, 255, 0.12);
  border-color: rgba(27, 154, 170, 0.28);
}

.pattern-body-progress__block--upcoming {
  opacity: 0.72;
}

.pattern-body-progress__block--done {
  opacity: 0.85;
}

.pattern-body-progress__block-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: Lexend, system-ui, sans-serif;
  font-size: 0.85rem;
  font-weight: 650;
  color: var(--dc-navy, #0c295a);
}

.pattern-body-progress__status {
  flex: 0 0 1.1em;
  width: 1.1em;
  text-align: center;
  font-size: 0.85rem;
  line-height: 1.3;
}

.pattern-body-progress__status--done {
  color: var(--dc-teal, #1b9aaa);
  font-weight: 700;
}

.pattern-body-progress__status--current {
  width: 0.55em;
  height: 0.55em;
  border-radius: 999px;
  background: var(--dc-teal, #1b9aaa);
  flex: 0 0 auto;
  margin: 0 0.28em;
}

.pattern-body-progress__status--upcoming {
  width: 0.55em;
  height: 0.55em;
  border-radius: 999px;
  border: 1.5px solid rgba(12, 41, 90, 0.22);
  flex: 0 0 auto;
  margin: 0 0.28em;
}

.pattern-body-progress__block-label {
  flex: 1 1 auto;
  min-width: 0;
}

.pattern-body-progress__block-frac {
  flex: 0 0 auto;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--dc-teal, #1b9aaa);
}

.pattern-body-progress__mark-row {
  display: flex;
  margin: 0.4rem 0 0.15rem 1.35em;
}

.pattern-body-progress__mark-btn {
  margin: 0;
  padding: 0.4rem 0.7rem;
  border: 1px solid rgba(27, 154, 170, 0.45);
  border-radius: 6px;
  background: rgba(27, 154, 170, 0.08);
  color: var(--dc-navy, #0c295a);
  font-family: Lexend, system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 650;
  cursor: pointer;
}

.pattern-body-progress__mark-btn:hover,
.pattern-body-progress__mark-btn:focus-visible {
  background: rgba(27, 154, 170, 0.14);
  outline: none;
}

.pattern-body-progress__peek-hint {
  margin: 0.35rem 0 0.15rem 1.35em;
}

.pattern-body-progress__rows {
  list-style: none;
  margin: 0.25rem 0 0 1.35em;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pattern-body-progress__row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
}

.pattern-body-progress__row-link {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.3rem 0;
  font-family: Lexend, system-ui, sans-serif;
  font-size: 0.84rem;
  font-weight: 550;
  color: var(--dc-navy, #0c295a);
  text-decoration: none;
}

.pattern-body-progress__row-link:hover,
.pattern-body-progress__row-link:focus-visible {
  text-decoration: underline;
  outline: none;
}

.pattern-body-progress__row--done .pattern-body-progress__row-link {
  color: rgba(12, 41, 90, 0.55);
}

.pattern-body-progress__row--here {
  /* Bleed to block edge; keep content aligned with sibling rows. */
  margin-left: calc(-1.35em - 10px);
  margin-right: -10px;
  padding-left: calc(1.35em + 10px);
  padding-right: 10px;
  border-radius: 0;
  background: rgba(56, 142, 60, 0.22);
  box-shadow: none;
}

.pattern-body-progress__row--here .pattern-body-progress__row-link {
  font-weight: 700;
}

.pattern-body-progress__row-check {
  flex: 0 0 auto;
  color: var(--dc-teal, #1b9aaa);
  font-weight: 700;
  font-size: 0.8rem;
}

.pattern-body-progress__charts {
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(12, 41, 90, 0.1);
}

.pattern-body-progress__charts > summary {
  cursor: pointer;
  font-family: Lexend, system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(12, 41, 90, 0.65);
  padding: 0.35rem 0;
}

.pattern-body-progress__charts[open] > summary {
  margin-bottom: 0.5rem;
}

.pattern-section-card--step-done {
  opacity: 0.78;
}

.pattern-section-card--step-done .pattern-section-card__title {
  color: rgba(12, 41, 90, 0.72);
}

.pattern-section-card__done-mark {
  display: inline-block;
  margin-left: 0.4em;
  color: var(--dc-teal, #1b9aaa);
  font-weight: 700;
}

/* Section step lists — shared pattern home template (all section-home patterns). */
.pattern-section-list {
  --pattern-setup-strip: #89d18c;
  --pattern-setup-badge: var(--dc-navy, #0c295a);
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
}

@media (min-width: 560px) {
  .pattern-section-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 1fr;
    gap: 10px;
    align-items: stretch;
  }
}

.pattern-section-card--setup-step,
.pattern-section-list .pattern-section-card--setup-step {
  position: relative;
  display: grid;
  grid-template-columns: minmax(56px, 72px) minmax(0, 1fr);
  grid-template-areas: "media title";
  align-items: center;
  gap: 10px 12px;
  padding: 10px 12px;
  text-align: left;
  background: var(--pattern-tile-wash, #eef1f0);
  border: 1px solid rgba(12, 41, 90, 0.12);
  border-left: 4px solid var(--pattern-setup-strip, var(--dc-teal, #1b9aaa));
  border-radius: var(--pattern-tile-radius, 4px);
  box-shadow: 0 2px 10px rgba(12, 41, 90, 0.06);
}

.pattern-section-card__order,
.pattern-section-list .pattern-section-card__order {
  grid-area: order;
  position: static;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--pattern-setup-badge, #0c295a);
  border: 1px solid var(--pattern-setup-badge, #0c295a);
  font-family: "Lexend", system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(12, 41, 90, 0.2);
}

.pattern-section-card__media,
.pattern-section-list .pattern-section-card__media {
  grid-area: media;
  position: relative;
  width: 100%;
  max-width: 88px;
  height: 56px;
  aspect-ratio: auto;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f4f8f6;
  border-bottom: none;
  box-sizing: border-box;
  padding: 0;
}

.pattern-section-part-steps .pattern-section-card--setup-step {
  --pattern-part-step-thumb-w: 112px;
  --pattern-part-step-thumb-h: 52px;
  grid-template-columns: var(--pattern-part-step-thumb-w) auto;
  justify-content: start;
}

.pattern-section-part-steps .pattern-section-card__media {
  width: var(--pattern-part-step-thumb-w);
  max-width: var(--pattern-part-step-thumb-w);
  min-width: var(--pattern-part-step-thumb-w);
  height: var(--pattern-part-step-thumb-h);
  overflow: hidden;
}

.pattern-section-card__media--hue-cover,
.pattern-section-list .pattern-section-card__media--hue-cover {
  background: #29b0bc;
  padding: 3px 4px 4px;
  overflow: visible;
}

.pattern-section-card__media-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 48px;
  background: #fff;
  border-radius: 8px;
  padding: 2px 3px;
  box-sizing: border-box;
}

.pattern-section-card__media--home-icon,
.pattern-section-list .pattern-section-card__media--home-icon {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  overflow: visible;
  position: relative;
  z-index: 1;
  line-height: 0;
  box-shadow: none;
}

.pattern-section-card__home-icon-glyph {
  display: block;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  flex: 0 0 48px;
  aspect-ratio: 1;
  object-fit: contain;
  object-position: center;
}

.pattern-section-card__media--hue-cover .pattern-section-card__img,
.pattern-section-list .pattern-section-card__media--hue-cover .pattern-section-card__img {
  width: 100%;
  height: 48px;
  object-fit: contain;
  object-position: center;
}

.pattern-section-card__img,
.pattern-section-list .pattern-section-card__img {
  width: 100%;
  height: 56px;
  min-height: 0;
  max-height: none;
  object-fit: cover;
  object-position: center;
}

.pattern-section-part-steps .pattern-section-card__img {
  height: 100%;
}

.pattern-section-card__media--diagram,
.pattern-section-card__media:has(.pattern-section-card__img--diagram) {
  background: #fff;
  padding: 4px;
}

.pattern-section-card__img--diagram,
.pattern-section-list .pattern-section-card__img--diagram {
  height: 56px;
  padding: 2px;
  object-fit: contain;
}

.pattern-section-list .pattern-section-card > .pattern-section-card__title,
.pattern-section-list .pattern-section-card__text {
  grid-area: title;
  margin: 0;
  text-align: left;
}

.pattern-section-list .pattern-section-card > :not(.pattern-section-card__media) {
  margin-left: 0;
  margin-right: 0;
}

@media (min-width: 560px) {
  .pattern-section-list .pattern-section-card--setup-step {
    height: 100%;
  }

  .pattern-section-card--setup-step,
  .pattern-section-list .pattern-section-card--setup-step {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    position: relative;
    padding: 0;
    border-left-width: 4px;
  }

  .pattern-section-card__order,
  .pattern-section-list .pattern-section-card__order {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    grid-area: unset;
    box-shadow: 0 2px 6px rgba(12, 41, 90, 0.2);
  }

  .pattern-section-card__media,
  .pattern-section-list .pattern-section-card__media {
    grid-area: unset;
    width: 100%;
    max-width: none;
    height: auto;
    aspect-ratio: 5 / 2;
    flex: 0 0 auto;
    border-radius: 0;
    border-bottom: none;
    padding: 0;
    overflow: hidden;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .pattern-section-card__media--hue-cover,
  .pattern-section-list .pattern-section-card__media--hue-cover {
    padding: 10px 12px 12px;
    background: #29b0bc;
  }

  .pattern-section-card__media-frame {
    flex: 1;
    width: 100%;
    min-height: 0;
    height: 100%;
    border-radius: 12px;
    padding: 6px 10px;
  }

  .pattern-section-card__media--home-icon,
  .pattern-section-list .pattern-section-card__media--home-icon {
    overflow: visible;
    width: auto;
    max-width: min(38%, 84px);
    margin: 10px auto 12px;
    aspect-ratio: 1;
    padding: 0;
    background: transparent;
    box-shadow: none;
  }

  .pattern-section-card--home-tile .pattern-section-card__media--home-icon,
  .pattern-section-list .pattern-section-card--home-tile .pattern-section-card__media--home-icon {
    background: var(--pattern-home-icon-square, transparent);
    border-radius: 2px;
  }

  .pattern-section-card--setup-step .pattern-section-card__home-icon-glyph {
    width: 72px;
    height: 72px;
    min-width: 72px;
    min-height: 72px;
    flex-basis: 72px;
  }

  .pattern-section-card__media--hue-cover .pattern-section-card__img,
  .pattern-section-list .pattern-section-card__media--hue-cover .pattern-section-card__img {
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: none;
    object-fit: contain;
  }

  .pattern-section-card__media--diagram,
  .pattern-section-card__media:has(.pattern-section-card__img--diagram) {
    background: #fff;
    padding: 8px;
  }

  .pattern-section-card__media--diagram::after,
  .pattern-section-card__media:has(.pattern-section-card__img--diagram)::after {
    content: none;
  }

  .pattern-section-card__img,
  .pattern-section-list .pattern-section-card__img {
    width: 100%;
    height: auto;
    min-height: 100px;
    max-height: 120px;
    object-fit: contain;
    object-position: center;
  }

  .pattern-section-card__img--diagram,
  .pattern-section-list .pattern-section-card__img--diagram {
    height: auto;
    min-height: 80px;
    max-height: 110px;
    padding: 4px;
    object-fit: contain;
  }

  .pattern-section-list .pattern-section-card > .pattern-section-card__title,
  .pattern-section-list .pattern-section-card__text {
    grid-area: unset;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
  }

  .pattern-section-list .pattern-section-card__text {
    margin: 0;
    padding: 8px 10px 10px;
    background: transparent;
    border-top: 1px solid rgba(12, 41, 90, 0.08);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex: 1 1 auto;
    min-height: 0;
  }

  .pattern-section-list .pattern-section-card > .pattern-section-card__title {
    margin: 8px;
    font-size: 1rem;
  }
}

.pattern-section-list .pattern-section-card > :not(.pattern-section-card__media) {
  margin-left: 0;
  margin-right: 0;
}

.pattern-hue-setup--past-video .pattern-section-card--setup-step-start {
  border-color: rgba(12, 41, 90, 0.2);
  border-left-color: var(--pattern-setup-strip, var(--dc-teal, #1b9aaa));
  border-left-width: 4px;
  box-shadow: 0 2px 10px rgba(12, 41, 90, 0.08);
}

.pattern-hue-setup--past-video .pattern-section-card--setup-step-start .pattern-section-card__order {
  background: var(--pattern-setup-badge, #0c295a);
  border-color: var(--pattern-setup-badge, #0c295a);
  color: #fff;
  box-shadow: 0 2px 6px rgba(12, 41, 90, 0.2);
}

.pattern-hue-setup-video {
  margin-bottom: 1rem;
}

.pattern-hue-setup-video__title {
  margin: 0 0 0.5rem;
  font-family: Comfortaa, system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--dc-navy, #0c295a);
}

.pattern-hue-setup-overview:not(.pattern-hue-setup-overview--flat) {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid rgba(12, 41, 90, 0.12);
  border-left: 4px solid var(--dc-teal, #1b9aaa);
  border-radius: var(--pattern-tile-radius, 4px);
  background: var(--pattern-tile-wash-teal, #e8f0f1);
}

.pattern-hue-setup-overview__summary {
  cursor: pointer;
  font-family: Comfortaa, system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--dc-navy, #0c295a);
  list-style: none;
}

.pattern-hue-setup-overview__summary::-webkit-details-marker {
  display: none;
}

.pattern-hue-setup-overview__summary::before {
  content: "▸ ";
  display: inline-block;
  transition: transform 0.15s ease;
}

.pattern-hue-setup-overview[open] .pattern-hue-setup-overview__summary::before {
  transform: rotate(90deg);
}

.pattern-hue-setup-overview__list {
  margin: 0.65rem 0 0;
  padding-left: 1.15rem;
}

.pattern-section-subsection-grid {
  margin-top: 10px;
}

.pattern-hue-content-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(12, 41, 90, 0.1);
}

.pattern-hue-techniques {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  margin-top: 0.85rem;
}

.pattern-hue-techniques__block {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.85rem 0 0;
  border-top: 1px solid rgba(12, 41, 90, 0.1);
}

.pattern-hue-techniques__block:first-child {
  border-top: none;
  padding-top: 0;
}

.pattern-hue-techniques__title {
  margin: 0;
  font: 700 1.02rem/1.3 Lexend, system-ui, sans-serif;
  color: var(--dc-navy, #0c295a);
}

.pattern-hue-techniques__body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  font-size: calc(0.95rem * var(--pattern-text-scale, 1));
  line-height: var(--pattern-text-lh, 1.55);
}

.pattern-hue-techniques__body p {
  margin: 0;
}

.pattern-hue-techniques__image {
  display: block;
  width: 100%;
  max-width: min(100%, 520px);
  height: auto;
  margin: 0.15rem 0 0.25rem;
  border-radius: 12px;
  border: 1px solid rgba(12, 41, 90, 0.12);
}

.pattern-hue-content-section--anchored {
  scroll-margin-top: 5.5rem;
}

.pattern-term-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.85rem 0 0.15rem;
}

.pattern-term-jump__link {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(12, 41, 90, 0.18);
  background: rgba(12, 41, 90, 0.04);
  color: var(--dc-navy, #0c295a);
  font: 600 0.82rem/1.2 Montserrat, system-ui, sans-serif;
  text-decoration: none;
  cursor: pointer;
}

.pattern-term-jump__link:hover {
  border-color: var(--dc-teal, #1b9aaa);
  color: var(--dc-teal, #1b9aaa);
}

.pattern-term-jump__link[aria-selected="true"] {
  border-color: var(--dc-teal, #1b9aaa);
  background: rgba(27, 154, 170, 0.12);
  color: var(--dc-teal, #1b9aaa);
}

.pattern-term-jump__link:focus-visible {
  outline: 2px solid var(--dc-teal, #1b9aaa);
  outline-offset: 2px;
}

.pattern-term-panels {
  margin-top: 0.35rem;
}

.pattern-term-panel[hidden] {
  display: none !important;
}

.pattern-hue-content-section--tab-panel .pattern-hue-content-title {
  display: none;
}

/* Shawl construction — overview hero + part blocks */
.pattern-hue-construction-hero {
  margin: 0 0 12px;
}

.pattern-hue-construction-hero__img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  object-position: center;
  border-radius: var(--pattern-tile-radius, 4px);
  border: 1px solid rgba(12, 41, 90, 0.12);
  background: #fff;
}

.pattern-hue-construction-hero__caption {
  margin: 6px 0 0;
  font-size: 0.82rem;
  line-height: 1.4;
  text-align: center;
}

.pattern-hue-construction-intro {
  margin: 0 0 4px;
}

.pattern-hue-construction-parts-title {
  margin: 14px 0 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(12, 41, 90, 0.1);
  font-family: "Lexend", system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--dc-navy);
}

.pattern-hue-home--construction {
  --pattern-construction-strip: #89d18c;
  --pattern-construction-badge: var(--dc-navy, #0c295a);
}

.pattern-hue-setup-hero + .pattern-hue-construction-carousel {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid rgba(12, 41, 90, 0.1);
}

.pattern-hue-construction-carousel__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0 6px 6px;
}

.pattern-hue-construction-carousel__status {
  margin: 0;
  font-family: "Lexend", system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--dc-teal, #1b9aaa);
}

.pattern-hue-construction-carousel__hint {
  margin: 0;
  font-size: 0.75rem;
  white-space: nowrap;
}

.pattern-hue-construction-parts {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 6px 10px;
  margin: 0;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scroll-padding-left: 6px;
  touch-action: pan-x pan-y;
}

.pattern-hue-construction-carousel__dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 2px 0 0;
  padding: 0;
}

.pattern-hue-construction-carousel__dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(12, 41, 90, 0.2);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.pattern-hue-construction-carousel__dot--active {
  background: var(--dc-teal, #1b9aaa);
  transform: scale(1.15);
}

.pattern-hue-construction-carousel__dot:focus-visible {
  outline: 2px solid var(--dc-orange, #f19455);
  outline-offset: 2px;
}

.pattern-hue-part-block {
  position: relative;
  flex: 0 0 auto;
  width: min(86%, 300px);
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  flex-direction: column;
  border-radius: var(--pattern-tile-radius, 4px);
  border: 1px solid rgba(12, 41, 90, 0.12);
  border-left-width: 4px;
  border-left-color: var(--pattern-construction-strip, #89d18c);
  background: var(--pattern-tile-wash-mint, #ecf1ee);
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(12, 41, 90, 0.06);
}

.pattern-hue-construction-parts .pattern-hue-part-block:nth-child(2) {
  --pattern-construction-strip: #f19455;
  background: var(--pattern-tile-wash-coral, #f0eeec);
}

@media (min-width: 560px) {
  .pattern-hue-construction-carousel__hint,
  .pattern-hue-construction-carousel__dots {
    display: none;
  }

  .pattern-hue-construction-carousel__meta {
    margin-bottom: 10px;
  }

  .pattern-hue-construction-carousel__status {
    font-size: 0.88rem;
  }

  .pattern-hue-construction-parts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    overflow: visible;
    scroll-snap-type: none;
    padding: 0 6px;
  }

  .pattern-hue-part-block {
    width: auto;
    scroll-snap-align: unset;
    scroll-snap-stop: normal;
  }
}

.pattern-hue-part-block__badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.65rem;
  height: 1.65rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  font-family: "Lexend", system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  background: var(--pattern-construction-badge, #0c295a);
  box-shadow: 0 2px 6px rgba(12, 41, 90, 0.2);
}

.pattern-hue-part-block__media {
  background: rgba(247, 248, 250, 0.9);
  border-bottom: 1px solid rgba(12, 41, 90, 0.08);
}

.pattern-hue-part-block--diagram .pattern-hue-part-block__media {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 5 / 2;
  min-height: 76px;
  background: #fff;
  padding: 8px;
  box-sizing: border-box;
}

.pattern-hue-part-block__img {
  display: block;
  width: 100%;
  max-height: 72px;
  object-fit: contain;
  object-position: center;
  padding: 4px 8px;
}

.pattern-hue-part-block--diagram .pattern-hue-part-block__img {
  height: 100%;
  max-height: 110px;
  min-height: 56px;
  padding: 4px;
}

.pattern-hue-part-block__body {
  padding: 8px 10px 10px;
}

.pattern-hue-part-block--diagram .pattern-hue-part-block__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: flex-start;
  background: transparent;
  border-top: 1px solid rgba(12, 41, 90, 0.08);
}

.pattern-hue-part-block__title {
  margin: 0 0 6px;
  font-family: "Lexend", system-ui, sans-serif;
  font-size: 0.95rem;
  line-height: 1.35;
}

.pattern-hue-part-block__name {
  font-weight: 700;
  color: var(--dc-navy, #0c295a);
}

.pattern-hue-part-block__text {
  margin: 0 0 6px;
  font-size: 0.88rem;
  line-height: 1.45;
}

.pattern-hue-part-block__text:last-of-type {
  margin-bottom: 8px;
}

.pattern-hue-part-block__link {
  display: inline-block;
  margin: auto 0 0;
  padding: 0;
  border: 0;
  background: none;
  font-family: "Lexend", system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--dc-teal, #1b9aaa);
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}

.pattern-hue-part-block__link:hover {
  text-decoration: underline;
}

.pattern-hue-part-block__link:focus-visible {
  outline: 2px solid var(--dc-orange, #f19455);
  outline-offset: 2px;
  border-radius: 4px;
}

.pattern-hue-content-title {
  margin: 0;
  font-family: "Lexend", system-ui, sans-serif;
  font-size: 1rem;
  color: var(--dc-navy);
}

.pattern-hue-native-callout {
  margin-top: 10px;
  padding: 12px;
  border-radius: var(--pattern-tile-radius, 4px);
  border: 1px solid rgba(12, 41, 90, 0.12);
  border-left: 4px solid var(--dc-orange, #f19455);
  background: var(--pattern-tile-wash-coral, #f0eeec);
  color: var(--dc-navy);
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: calc(0.9rem * var(--pattern-text-scale, 1));
  line-height: var(--pattern-text-lh, 1.45);
}

.pattern-hue-native-callout--gauge-1 {
  background: var(--pattern-tile-wash-navy, #e9edf3);
  border-left-color: var(--dc-navy, #0c295a);
}

.pattern-hue-native-callout--gauge-2 {
  background: var(--pattern-tile-wash-mint, #ecf1ee);
  border-left-color: var(--dc-green, #89d18c);
}

.pattern-hue-native-callout--gauge-3 {
  background: var(--pattern-tile-wash-coral, #f0eeec);
  border-left-color: var(--dc-orange, #f19455);
}

.pattern-hue-native-callout--with-icon {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.pattern-hue-callout__icon {
  flex-shrink: 0;
  width: 1.5rem;
  font-size: 1.2rem;
  line-height: 1.35;
  text-align: center;
}

.pattern-hue-callout__text {
  flex: 1;
  min-width: 0;
}

.pattern-hue-callout__signin {
  color: var(--dc-teal, #1b9aaa);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.pattern-hue-callout__signin:hover {
  color: var(--dc-navy, #0c295a);
}

.pattern-hue-setup-hero {
  margin: 0 0 14px;
  border-radius: var(--pattern-tile-radius, 4px);
  overflow: hidden;
  border: 1px solid rgba(12, 41, 90, 0.1);
  background: #f7f8fa;
  box-shadow: 0 2px 10px rgba(12, 41, 90, 0.06);
}

.pattern-hue-setup-hero--band-only {
  margin-bottom: 12px;
}

.pattern-hue-setup-hero--band-only .pattern-hue-setup-hero__band {
  border-top: none;
}

.pattern-hue-setup-hero__visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: min(40vw, 168px);
  line-height: 0;
  overflow: hidden;
  background: var(--pattern-tile-wash, #eef1f0);
}

.pattern-hue-setup-hero__img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 100%;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
}

/* Wide hero frame — photos bleed edge to edge (shared size for all setup heroes). */
.pattern-hue-setup-hero--landscape .pattern-hue-setup-hero__visual {
  height: auto;
  aspect-ratio: 16 / 9;
  max-height: min(72vw, 380px);
}

.pattern-hue-setup-hero--landscape .pattern-hue-setup-hero__img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  /* Fallback when no data-driven placement is set (nameplate safe zone). */
  object-position: center 52%;
}

.pattern-hue-setup-hero--nameplate .pattern-hue-setup-hero__img--cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 52%;
}

/* Diagram / SVG heroes: contain on paper — never crop charts into a photo frame. */
.pattern-hue-setup-hero--diagram.pattern-hue-setup-hero--landscape .pattern-hue-setup-hero__visual {
  background: #f7f4ef;
}

.pattern-hue-setup-hero--diagram.pattern-hue-setup-hero--landscape .pattern-hue-setup-hero__img,
.pattern-hue-setup-hero--diagram .pattern-hue-setup-hero__img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  object-position: center;
  padding: 10px 12px 18px;
  box-sizing: border-box;
}

.pattern-hue-setup-hero__nameplate-band {
  --nameplate-mark-size: 42px;
  --nameplate-mark-inset: 12px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 10px calc(var(--nameplate-mark-inset) + var(--nameplate-mark-size) + 10px);
  background: #f7f8fa;
  border-top: 1px solid rgba(12, 41, 90, 0.08);
}

.pattern-hue-setup-hero__nameplate-mark {
  position: absolute;
  left: var(--nameplate-mark-inset);
  top: 50%;
  display: block;
  width: var(--nameplate-mark-size);
  height: var(--nameplate-mark-size);
  transform: translateY(-50%);
}

.pattern-hue-setup-hero__nameplate-copy {
  flex: 1;
  min-width: 0;
  max-width: 22rem;
  text-align: center;
}

.pattern-hue-setup-hero__nameplate-title {
  margin: 0;
  font-family: "Lexend", system-ui, sans-serif;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--dc-navy, #0c295a);
}

.pattern-hue-setup-hero--illustration.pattern-hue-setup-hero--landscape .pattern-hue-setup-hero__visual {
  height: auto;
  aspect-ratio: auto;
  max-height: none;
  background: #ffe8e6;
}

.pattern-hue-setup-hero--illustration.pattern-hue-setup-hero--landscape .pattern-hue-setup-hero__img {
  width: 100%;
  height: auto;
  max-height: min(62vw, 320px);
  object-fit: contain;
  object-position: center;
}

/* Design-kit nameplate PNGs — DOM mark + title sit in the painted cream band. */
.pattern-hue-setup-hero__nameplate-band--overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  box-sizing: border-box;
  height: 20%;
  min-height: 56px;
  background: #f7f8fa;
  border-top: 1px solid rgba(12, 41, 90, 0.08);
}

.pattern-hue-setup-hero__nameplate-band--overlay .pattern-hue-setup-hero__nameplate-title {
  font-size: clamp(0.98rem, 3.8vw, 1.18rem);
}

/* Legacy title-only overlay (unused; kept for older markup). */
.pattern-hue-setup-hero__nameplate-copy--overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 20%;
  min-height: 56px;
  padding: 0 3.75rem;
  text-align: center;
  pointer-events: none;
}

.pattern-hue-setup-hero__nameplate-copy--overlay .pattern-hue-setup-hero__nameplate-title {
  font-size: clamp(0.98rem, 3.8vw, 1.18rem);
}

/* Gauge (design-kit recipe):
   1) fabric fills the image plane edge-to-edge
   2) L-ruler sits on that plane's left + bottom edges
   3) cream nameplate under the image plane */
.pattern-hue-setup-hero--gauge-hero {
  --gauge-bar-v: clamp(28px, 9vw, 36px);
  --gauge-bar-h: clamp(40px, 12vw, 52px);
  --gauge-tick: #ffffff;
  --gauge-tick-step: 11px;
  --gauge-tick-w: 1.35px;
  --gauge-tick-inset: 8px;
}

.pattern-hue-setup-hero--gauge-hero.pattern-hue-setup-hero--landscape .pattern-hue-setup-hero__visual {
  aspect-ratio: 16 / 9;
  max-height: min(72vw, 380px);
  background: #f7f8fa;
}

.pattern-hue-setup-hero--gauge-hero .pattern-hue-setup-hero__img {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 80%;
  width: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  object-position: center;
}

/* FO photo: fill the inner L (right of the vertical arm, above the bottom arm). */
.pattern-hue-setup-hero--gauge-photo .pattern-hue-setup-hero__img {
  left: var(--gauge-bar-v);
  width: calc(100% - var(--gauge-bar-v));
  height: calc(80% - var(--gauge-bar-h));
  object-fit: cover;
  object-position: center;
}

.pattern-hue-setup-hero__gauge-edge-ruler {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 80%;
  z-index: 1;
  pointer-events: none;
  /* Solid L on the photo-plane edges (taller bottom arm only) */
  background:
    linear-gradient(#0c295a, #0c295a) left top / var(--gauge-bar-v) 100% no-repeat,
    linear-gradient(#0c295a, #0c295a) left bottom / 100% var(--gauge-bar-h) no-repeat;
}

/* Vertical arm (left): minor + major ticks, alternating length */
.pattern-hue-setup-hero__gauge-ticks--v {
  position: absolute;
  left: 0;
  top: var(--gauge-tick-inset);
  bottom: var(--gauge-bar-h);
  width: var(--gauge-bar-v);
  pointer-events: none;
}

.pattern-hue-setup-hero__gauge-ticks--v::before,
.pattern-hue-setup-hero__gauge-ticks--v::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  right: 5px;
}

.pattern-hue-setup-hero__gauge-ticks--v::before {
  width: calc(var(--gauge-bar-v) * 0.4);
  background: repeating-linear-gradient(
    to bottom,
    var(--gauge-tick) 0 var(--gauge-tick-w),
    transparent var(--gauge-tick-w) calc(var(--gauge-tick-step) * 2)
  );
}

.pattern-hue-setup-hero__gauge-ticks--v::after {
  width: calc(var(--gauge-bar-v) * 0.68);
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 var(--gauge-tick-step),
    var(--gauge-tick) var(--gauge-tick-step) calc(var(--gauge-tick-step) + var(--gauge-tick-w)),
    transparent calc(var(--gauge-tick-step) + var(--gauge-tick-w)) calc(var(--gauge-tick-step) * 2)
  );
}

/* Horizontal arm (bottom): minor + major ticks, alternating length */
.pattern-hue-setup-hero__gauge-ticks--h {
  position: absolute;
  left: var(--gauge-bar-v);
  right: var(--gauge-tick-inset);
  bottom: 0;
  height: var(--gauge-bar-h);
  pointer-events: none;
}

.pattern-hue-setup-hero__gauge-ticks--h::before,
.pattern-hue-setup-hero__gauge-ticks--h::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 5px;
  bottom: 5px;
  background-repeat: repeat-x;
  background-position: left top;
}

/* Short ticks (every other) */
.pattern-hue-setup-hero__gauge-ticks--h::before {
  background-image: repeating-linear-gradient(
    to right,
    var(--gauge-tick) 0 var(--gauge-tick-w),
    transparent var(--gauge-tick-w) calc(var(--gauge-tick-step) * 2)
  );
  background-size: 100% 22%;
}

/* Tall ticks (alternating with short) */
.pattern-hue-setup-hero__gauge-ticks--h::after {
  background-image: repeating-linear-gradient(
    to right,
    transparent 0 var(--gauge-tick-step),
    var(--gauge-tick) var(--gauge-tick-step) calc(var(--gauge-tick-step) + var(--gauge-tick-w)),
    transparent calc(var(--gauge-tick-step) + var(--gauge-tick-w)) calc(var(--gauge-tick-step) * 2)
  );
  background-size: 100% 78%;
}

.pattern-hue-setup-hero--gauge-hero .pattern-hue-setup-hero__nameplate-band--inset {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  box-sizing: border-box;
  height: 20%;
  min-height: 56px;
  background: #f7f8fa;
  border-top: 1px solid rgba(12, 41, 90, 0.08);
}

/* Keep the painted nameplate strip in frame for design-kit heroes.
   Per-photo objectPosition (inline) overrides this when set. */
.pattern-hue-setup-hero--nameplate-frame .pattern-hue-setup-hero__img {
  object-position: center 52%;
}

/* Cover-relative Place layout (absolute img sized from coverScale × zoom). */
.pattern-hue-setup-hero__visual--placed {
  position: relative;
}

.pattern-hue-setup-hero--landscape .pattern-hue-setup-hero__img--placed,
.pattern-hue-setup-hero__img--placed {
  max-width: none;
  max-height: none;
  margin: 0;
}

/* Staff preview: live hero photo placement (drag + Y/Zoom). */
.pattern-hue-setup-hero__visual--staff-place {
  touch-action: none;
}

.pattern-hero-place-staff {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.pattern-hero-place-staff__drag {
  position: absolute;
  inset: 0 0 22% 0;
  pointer-events: auto;
  cursor: ns-resize;
  touch-action: none;
}

.pattern-hero-place-staff__drag.is-dragging {
  cursor: grabbing;
}

.pattern-hero-place-staff__panel {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
  width: min(176px, calc(100% - 16px));
  padding: 8px 10px 9px;
  border-radius: 8px;
  background: rgba(12, 41, 90, 0.88);
  color: #fff;
  box-shadow: 0 6px 18px rgba(12, 41, 90, 0.28);
  pointer-events: auto;
  font-family: "Lexend", system-ui, sans-serif;
}

.pattern-hero-place-staff__title {
  margin: 0 0 6px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.92;
}

.pattern-hero-place-staff__row {
  display: grid;
  grid-template-columns: 36px 1fr 40px;
  gap: 6px;
  align-items: center;
  margin: 0 0 5px;
  font-size: 0.72rem;
}

.pattern-hero-place-staff__label {
  font-weight: 600;
  opacity: 0.9;
}

.pattern-hero-place-staff__value {
  text-align: right;
  font-variant-numeric: tabular-nums;
  opacity: 0.9;
}

.pattern-hero-place-staff__range {
  width: 100%;
  accent-color: #7ec8cb;
}

.pattern-hero-place-staff__actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.pattern-hero-place-staff__btn {
  flex: 1;
  margin: 0;
  padding: 5px 8px;
  border: 0;
  border-radius: 6px;
  background: #7ec8cb;
  color: #0c295a;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.pattern-hero-place-staff__btn--ghost {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.pattern-hero-place-staff.is-settled {
  inset: auto;
  top: 8px;
  right: 8px;
  left: auto;
  bottom: auto;
  width: auto;
  height: auto;
}

.pattern-hero-place-staff.is-settled .pattern-hero-place-staff__drag,
.pattern-hero-place-staff.is-settled .pattern-hero-place-staff__panel {
  display: none;
}

.pattern-hero-place-staff__chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px 5px 10px;
  border-radius: 999px;
  background: rgba(12, 41, 90, 0.82);
  color: #fff;
  box-shadow: 0 4px 14px rgba(12, 41, 90, 0.22);
  pointer-events: auto;
  font-family: "Lexend", system-ui, sans-serif;
  border: 1px solid rgba(126, 200, 203, 0.55);
}

.pattern-hero-place-staff__chip-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.pattern-hero-place-staff__chip-edit {
  margin: 0;
  padding: 3px 8px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font: inherit;
  font-size: 0.65rem;
  font-weight: 700;
  cursor: pointer;
}

.pattern-hero-place-staff__chip-edit:hover {
  background: rgba(255, 255, 255, 0.22);
}

.pattern-hero-place-staff__panel.is-locked {
  box-shadow: 0 0 0 1px rgba(126, 200, 203, 0.65);
}

.pattern-hero-place-staff__btn.is-locked,
.pattern-hero-place-staff__btn:disabled {
  background: rgba(126, 200, 203, 0.35);
  color: #fff;
  cursor: default;
  opacity: 0.95;
}

.pattern-hero-place-staff__status {
  margin: 6px 0 0;
  font-size: 0.65rem;
  line-height: 1.3;
  opacity: 0.9;
  word-break: break-word;
}

.pattern-hero-place-staff__hint {
  margin: 6px 0 0;
  padding: 5px 6px;
  border-radius: 5px;
  background: rgba(255, 196, 86, 0.16);
  color: #ffe8a8;
  font-size: 0.62rem;
  line-height: 1.35;
}

.pattern-hero-place-staff.is-settled .pattern-hero-place-staff__hint {
  display: none;
}

/* Learn-course repeat blocks — interactive row counter (stripe chips later). */
.pattern-row-counter-host {
  margin: 0 0 14px;
}

.pattern-row-recolor-note {
  margin: 0.65rem 12px 0;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 0.82rem;
  line-height: 1.4;
  color: #0c295a;
  background: #eef6f7;
  border: 1px solid rgba(27, 154, 170, 0.28);
}

.pattern-row-recolor-note--warn {
  color: #7a2e0e;
  background: #fff4ec;
  border-color: rgba(196, 90, 40, 0.35);
}

.pattern-row-counter {
  padding: 14px 16px 13px;
  border-radius: 12px;
  background: #f3f6f8;
  border: 1px solid rgba(12, 41, 90, 0.08);
}

.pattern-row-counter.is-complete {
  background: rgba(126, 200, 203, 0.18);
  border-color: rgba(27, 154, 170, 0.28);
}

.pattern-row-counter__title {
  margin: 0 0 10px;
  font-family: "Lexend", system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  color: #0c295a;
  opacity: 0.85;
}

.pattern-row-counter__stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.pattern-row-counter__btn {
  flex: 0 0 auto;
  width: 2.85rem;
  height: 2.85rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #0c295a;
  font: 700 1.35rem/1 "Lexend", system-ui, sans-serif;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(12, 41, 90, 0.14);
}

.pattern-row-counter__btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.pattern-row-counter__btn--primary {
  background: #0c295a;
  color: #fff;
  box-shadow: none;
}

.pattern-row-counter__btn--primary:disabled {
  background: #8594ac;
  opacity: 1;
}

.pattern-row-counter__readout {
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 7.5rem;
  max-width: 12rem;
  text-align: center;
}

.pattern-row-counter__value {
  font-family: "Lexend", system-ui, sans-serif;
  font-size: 1.12rem;
  font-weight: 700;
  color: #0c295a;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pattern-row-counter__yarn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(12, 41, 90, 0.08);
  font-family: "Lexend", system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  color: #0c295a;
}

.pattern-row-counter__yarn.has-swatch::before {
  content: "";
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
  background: var(--row-counter-yarn, #8594ac);
  box-shadow: 0 0 0 1px rgba(12, 41, 90, 0.15);
}

.pattern-row-counter__hint,
.pattern-row-counter__status {
  margin: 10px 0 0;
  font-family: "Lexend", system-ui, sans-serif;
  font-size: 0.8rem;
  line-height: 1.35;
  text-align: center;
  color: #3a4a63;
}

.pattern-row-counter__status {
  font-weight: 600;
  color: #0c295a;
}

.pattern-hue-setup-hero--gauge-window {
  background: #f7f8fa;
  padding: 0;
}

.pattern-hue-setup-hero__gauge-window {
  position: relative;
  width: min(100%, 280px);
  margin: 0 auto;
  aspect-ratio: 1;
  overflow: hidden;
  background: #0c295a;
  box-shadow:
    inset 54px 0 0 #0c295a,
    inset 0 -54px 0 #0c295a;
}

.pattern-hue-setup-hero__gauge-window .pattern-hue-setup-hero__img {
  position: absolute;
  inset: 0 0 54px 54px;
  width: auto;
  max-width: none;
  height: auto;
  min-width: calc(100% - 54px);
  min-height: calc(100% - 54px);
  object-fit: cover;
}

.pattern-hue-setup-intro-hero .pattern-hue-setup-hero {
  margin-bottom: 0;
}

.pattern-stage-carousel__img--landscape {
  object-fit: cover;
  object-position: center;
}

.pattern-card__subtitle {
  margin: 1rem 0 0.35rem;
  font-family: "Lexend", system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: rgba(12, 41, 90, 0.88);
}

.pattern-muted-divider {
  margin: 1rem 0 0.5rem;
  border: none;
  border-top: 1px solid rgba(12, 41, 90, 0.12);
}

/* Magazine dek under the hero — not a second nameplate. */
.pattern-hue-setup-dek {
  margin: 2px 0 22px;
  padding: 0 2px;
  max-width: 36rem;
}

.pattern-hue-setup-dek__kicker {
  margin: 0 0 8px;
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dc-teal, #1b9aaa);
}

.pattern-hue-setup-dek__lede {
  margin: 0;
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.55;
  color: var(--dc-navy, #0c295a);
  white-space: pre-line;
}

.pattern-hue-setup-hero + .pattern-hue-setup-dek + .pattern-hue-construction-carousel {
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid rgba(12, 41, 90, 0.1);
}

.pattern-hue-setup-hero__band {
  margin: 0;
  padding: 12px 14px 14px;
  text-align: center;
  background: #f7f8fa;
  border-top: 1px solid rgba(12, 41, 90, 0.1);
}

.pattern-hue-setup-hero__band-kicker {
  margin: 0 0 4px;
  font-family: "Lexend", system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dc-teal, #1b9aaa);
}

.pattern-hue-setup-hero__band-value {
  margin: 0;
  font-family: "Lexend", system-ui, sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--dc-navy, #0c295a);
  white-space: pre-line;
}

.pattern-hue-setup-hero-specs .pattern-hue-content-section:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.pattern-hue-setup-hero-specs .pattern-hue-content-section + .pattern-hue-content-section {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(12, 41, 90, 0.1);
}

.pattern-hue-setup-hero-specs .pattern-hue-content-title {
  margin-bottom: 4px;
  font-size: 0.95rem;
}

.pattern-hue-setup-hero-specs .pattern-hue-list {
  margin-top: 0;
}

.pattern-hue-materials-body .pattern-hue-content-section + .pattern-hue-content-section {
  margin-top: 20px;
}

.pattern-hue-materials-body .pattern-hue-list > li + li {
  margin-top: 0.85rem;
}

.pattern-hue-materials-note {
  margin: 0.55rem 0 0;
}

.pattern-hue-list > li .pattern-hue-materials-note {
  margin-left: 0;
}

.pattern-hue-materials-note .pattern-hue-setup-overview__body + .pattern-hue-setup-overview__body {
  margin-top: 0.65rem;
}

.pattern-variant-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.35rem 0 0.75rem;
}

.pattern-variant-toggle__btn {
  appearance: none;
  margin: 0;
  padding: 0.4rem 0.85rem;
  border: 1px solid rgba(12, 41, 90, 0.22);
  border-radius: 999px;
  background: #fff;
  color: var(--dc-navy, #0c295a);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.pattern-variant-toggle__btn.is-active {
  background: var(--dc-navy, #0c295a);
  border-color: var(--dc-navy, #0c295a);
  color: #fff;
}

.pattern-finished-dims__list {
  display: grid;
  gap: 0.35rem;
  margin: 0.35rem 0 0;
}

.pattern-finished-dims__size {
  display: grid;
  gap: 0.2rem;
  margin: 0;
  padding: 0.65rem 0.75rem;
  border: none;
  border-radius: 10px;
  border-left: 3px solid transparent;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: default;
}

button.pattern-finished-dims__size {
  cursor: pointer;
  width: 100%;
}

button.pattern-finished-dims__size:hover {
  background: rgba(12, 41, 90, 0.04);
}

button.pattern-finished-dims__size:hover .pattern-finished-dims__label {
  color: var(--dc-teal, #1b9aaa);
}

.pattern-finished-dims__size.is-selected {
  background: rgba(27, 154, 170, 0.1);
  border-left-color: var(--dc-teal, #1b9aaa);
}

.pattern-finished-dims__size.is-selected .pattern-finished-dims__label {
  color: var(--dc-teal, #1b9aaa);
}

.pattern-finished-dims__label {
  margin: 0;
  font-family: "Lexend", system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--dc-navy, #0c295a);
  line-height: 1.3;
}

.pattern-finished-dims__measure {
  margin: 0;
  font-size: calc(0.92rem * var(--pattern-text-scale, 1));
  line-height: var(--pattern-text-lh, 1.4);
  color: var(--dc-navy, #0c295a);
}

.pattern-finished-dims__hint {
  margin: 0.75rem 0 0;
  font-size: 0.88rem;
}

.pattern-yarn-passes {
  display: grid;
  gap: 1.1rem;
  margin: 0.15rem 0 0;
}

.pattern-yarn-pass {
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: inherit;
}

.pattern-yarn-pass + .pattern-yarn-pass {
  padding-top: 1.1rem;
  border-top: 1px solid rgba(12, 41, 90, 0.1);
}

.pattern-yarn-pass__option {
  margin: 0 0 0.2rem;
  font-family: "Lexend", system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dc-teal, #0d9488);
}

.pattern-yarn-pass__label {
  margin: 0 0 0.3rem;
  font-weight: 700;
  color: var(--dc-navy, #0c295a);
  line-height: 1.35;
}

.pattern-yarn-pass__meta {
  margin: 0;
  font-size: 0.92rem;
}

.pattern-yarn-pass__totals {
  margin: 0.2rem 0 0;
  font-size: 0.92rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.pattern-yarn-pass .pattern-hue-materials-note {
  margin-top: 0.55rem;
}

.pattern-yarn-pass__colors {
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

.pattern-yarn-pass__colors summary {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: "Lexend", system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dc-teal, #1b9aaa);
  list-style: none;
}

.pattern-yarn-pass__colors summary:hover {
  color: var(--dc-navy, #0c295a);
}

.pattern-yarn-pass__colors summary::-webkit-details-marker {
  display: none;
}

.pattern-yarn-pass__colors summary::after {
  content: "";
  width: 0.35rem;
  height: 0.35rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  margin-top: -0.15rem;
  opacity: 0.85;
}

.pattern-yarn-pass__colors[open] summary::after {
  transform: rotate(-135deg);
  margin-top: 0.1rem;
}

.pattern-yarn-pass__color-list {
  margin: 0.45rem 0 0;
  padding-left: 1.15rem;
  font-family: Montserrat, system-ui, sans-serif;
  font-size: 0.92rem;
  color: var(--dc-navy, #0c295a);
}

.pattern-starting-chain {
  margin: 0 0 0.95rem;
  padding: 0.8rem 0.95rem;
  border-radius: 12px;
  background: rgba(12, 41, 90, 0.06);
  color: var(--dc-navy, #0c295a);
}

.row-work-direction {
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.9rem;
  border-radius: 12px;
  background: rgba(12, 41, 90, 0.05);
  color: var(--dc-navy, #0c295a);
}

.row-work-direction__kicker {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.row-work-direction__row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.row-work-direction__icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  color: var(--dc-navy, #0c295a);
}

.row-work-direction__glyph {
  display: block;
  width: 100%;
  height: 100%;
}

.row-work-direction__value {
  margin: 0;
  font-weight: 700;
  font-size: 1.02rem;
}

.row-work-direction--inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.35rem;
  margin: -0.35rem 0 0.85rem;
  padding: 0;
  background: transparent;
}

.row-work-direction--inline .row-work-direction__kicker {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  opacity: 0.75;
}

.row-work-direction--inline .row-work-direction__row {
  gap: 0.35rem;
}

.row-work-direction--inline .row-work-direction__icon {
  width: 1.25rem;
  height: 1.25rem;
}

.row-work-direction--inline .row-work-direction__value {
  font-size: 0.95rem;
}

.pattern-starting-chain__kicker {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pattern-starting-chain .pattern-variant-toggle {
  margin: 0 0 0.55rem;
}

.pattern-starting-chain__value {
  margin: 0;
  font-weight: 700;
  font-size: 1.05rem;
}

.pattern-starting-chain__alts {
  margin: 0.4rem 0 0;
  font-size: 0.88rem;
  opacity: 0.85;
}

.pattern-hue-setup-callouts {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(12, 41, 90, 0.1);
}

.pattern-hue-setup-callouts--after-hero {
  margin-bottom: 4px;
}

.pattern-hue-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(12, 41, 90, 0.12);
  border-radius: var(--pattern-tile-radius, 4px);
}

.pattern-hue-table {
  width: 100%;
  border-collapse: collapse;
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 0.84rem;
}

.pattern-hue-table th,
.pattern-hue-table td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid rgba(12, 41, 90, 0.08);
  text-align: left;
}

.pattern-hue-table th {
  font-family: "Lexend", system-ui, sans-serif;
  color: var(--dc-navy);
  background: rgba(27, 154, 170, 0.08);
}

.pattern-hue-table tr:last-child td {
  border-bottom: 0;
}

.pattern-hue-stitch-ref {
  margin-top: 4px;
  padding: 0;
  background: transparent;
}

.pattern-hue-stitch-ref .pattern-details--nested {
  border: 1px solid rgba(12, 41, 90, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  overflow: hidden;
}

.pattern-hue-stitch-ref .pattern-details--nested + .pattern-details--nested {
  margin-top: 8px;
}

.pattern-hue-stitch-ref .pattern-legend-symbol--lg {
  max-width: min(100%, 220px);
  height: auto;
}

.pattern-section-card__title {
  font-family: "Lexend", system-ui, sans-serif;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--dc-navy);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

@media (min-width: 560px) {
  .pattern-section-card__title {
    font-size: 0.82rem;
  }
}

/* Pattern home + setup step rows — shared title hierarchy (Hue Shift template). */
.pattern-section-list .pattern-section-card__text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  align-items: flex-start;
}

.pattern-section-list .pattern-section-card__text .pattern-section-card__title {
  margin: 0;
}

/* Body-row cards: Row N on top, quieter "Repeat row X" underneath (not an eyebrow). */
.pattern-section-list .pattern-section-card__text--title-first .pattern-section-card__meta {
  text-transform: none;
  letter-spacing: normal;
  font-weight: 600;
  font-size: 0.68rem;
  color: var(--dc-text-muted, #5a6b7d);
}

.pattern-section-list--home .pattern-section-card__text {
  align-self: stretch;
  padding: 8px 10px;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.pattern-section-list .pattern-section-card > .pattern-section-card__title {
  font-family: "Lexend", system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--dc-navy, #0c295a);
  letter-spacing: normal;
  text-transform: none;
  -webkit-line-clamp: 3;
}

.pattern-section-list .pattern-section-card__meta {
  font-family: "Lexend", system-ui, sans-serif;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--dc-teal, #1b9aa0);
  line-height: 1.35;
}

@media (min-width: 560px) {
  .pattern-section-list .pattern-section-card__text {
    align-items: center;
  }

  .pattern-section-list--home .pattern-section-card__text {
    margin: 0;
    padding: 8px 10px 10px;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 0;
  }

  .pattern-section-list .pattern-section-card > .pattern-section-card__title {
    margin: 8px;
    text-align: center;
    font-size: 0.95rem;
  }

  .pattern-section-list .pattern-section-card__meta {
    font-size: 0.68rem;
  }
}

.pattern-section-card--setup-step.pattern-section-card--home-tile {
  background: var(--pattern-home-icon-tile, var(--dc-page-bg, #e8f5ea));
  border-color: rgba(12, 41, 90, 0.12);
  border-left: 4px solid var(--pattern-home-icon-accent, var(--pattern-setup-strip, #89d18c));
  border-radius: 4px;
  overflow: visible;
  box-shadow: 0 2px 10px rgba(12, 41, 90, 0.06);
}

.pattern-section-card--home-tile .pattern-section-card__media--home-icon,
.pattern-section-list .pattern-section-card--home-tile .pattern-section-card__media--home-icon {
  background: var(--pattern-home-icon-square, transparent);
  border-radius: 2px;
}

.pattern-section-part-steps .pattern-section-card--home-tile {
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 9px 10px;
  padding: 12px;
}

.pattern-section-part-steps .pattern-section-card__media--home-icon {
  width: 48px;
  max-width: 48px;
  min-width: 48px;
  height: 48px;
  min-height: 48px;
  max-height: 48px;
  overflow: visible;
}

/* Pattern home — navy badges, muted tiles, accent stripe. */
.pattern-section-list--home {
  --pattern-setup-strip: var(--dc-teal, #1b9aaa);
  gap: 12px;
}

.pattern-section-list--home .pattern-section-card__order {
  background: var(--dc-navy, #0c295a);
  color: #ffffff;
  border: 1px solid var(--dc-navy, #0c295a);
  box-shadow: 0 2px 6px rgba(12, 41, 90, 0.18);
}

.pattern-section-list--home .pattern-section-card > .pattern-section-card__title {
  color: var(--dc-navy, #0c295a);
  font-weight: 600;
}

/* Hue Shift home — one square thumb size for every row; part motifs cropped tight. */
.pattern-section-list--home-photos {
  --pattern-home-thumb-size: 52px;
}

.pattern-section-card__media--section-thumb {
  width: var(--pattern-home-thumb-size, 52px);
  height: var(--pattern-home-thumb-size, 52px);
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
}

.pattern-section-card__media--section-thumb .pattern-section-card__thumb-host,
.pattern-section-card__media--section-thumb .ppm-panel-row__thumb-host {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #fff;
}

.pattern-section-card__media--section-thumb .ppm-panel-row__thumb-svg,
.pattern-section-card__media--section-thumb .ppm-panel-row__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* PNG placeholder — zoom strip to one repeat until live SVG motif crop loads. */
.pattern-section-card__media--section-thumb
  [data-hs-thumb-crop="motif"]
  .ppm-panel-row__img {
  transform: scale(var(--hs-motif-units, 4));
  transform-origin: center center;
}

.pattern-section-card__media--section-thumb
  [data-hs-thumb-crop="motif"]
  .ppm-panel-row__thumb-svg {
  transform: none;
}

@media (min-width: 560px) {
  .pattern-section-list--home-photos .pattern-section-card--setup-step {
    display: grid;
    grid-template-columns: var(--pattern-home-thumb-size) minmax(0, 1fr);
    grid-template-areas: "media title";
    align-items: center;
    gap: 12px 14px;
    padding: 14px 16px;
    height: auto;
    flex-direction: unset;
  }

  .pattern-section-list--home-photos .pattern-section-card--setup-step .pattern-section-card__order {
    position: static;
    grid-area: order;
  }

  .pattern-section-list--home-photos
    .pattern-section-card--setup-step
    .pattern-section-card__media:not(.pattern-section-card__media--home-icon) {
    grid-area: media;
    width: var(--pattern-home-thumb-size);
    max-width: var(--pattern-home-thumb-size);
    min-width: var(--pattern-home-thumb-size);
    height: var(--pattern-home-thumb-size);
    aspect-ratio: auto;
    flex: none;
    border-radius: 8px;
    overflow: hidden;
    justify-self: start;
  }

  .pattern-section-list--home-photos .pattern-section-card--setup-step > .pattern-section-card__title,
  .pattern-section-list--home-photos .pattern-section-card--setup-step .pattern-section-card__text {
    grid-area: title;
    margin: 0;
    text-align: left;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
  }

  .pattern-section-list--home-photos
    .pattern-section-card__media:not(.pattern-section-card__media--home-icon):not(
      .pattern-section-card__media--section-thumb
    ) {
    background: #faf8f5;
  }

  .pattern-section-list--home-photos .pattern-section-card__img:not(.pattern-section-card__img--home-icon) {
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: none;
    object-fit: cover;
    object-position: center;
  }
}

/* Pattern home on phones — row cards (badge | thumb | title), same as early Hue Shift home. */
@media (max-width: 559px) {
  .pattern-section-list--home {
    display: flex;
    flex-direction: column;
    gap: 11px;
  }

  .pattern-section-list--home .pattern-section-card--setup-step {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    grid-template-areas: "media title";
    align-items: center;
    gap: 9px 12px;
    padding: 12px;
    height: auto;
    overflow: visible;
    box-shadow: 0 2px 10px rgba(12, 41, 90, 0.06);
  }

  .pattern-section-list--home .pattern-section-card__order {
    position: static;
    grid-area: order;
    width: 24px;
    height: 24px;
    font-size: 0.72rem;
    background: var(--dc-navy, #0c295a);
    color: #ffffff;
    border: 1px solid var(--dc-navy, #0c295a);
    box-shadow: 0 2px 6px rgba(12, 41, 90, 0.18);
  }

  .pattern-section-list--home .pattern-section-card__media:not(.pattern-section-card__media--home-icon) {
    grid-area: media;
    width: 100%;
    max-width: 48px;
    height: auto;
    aspect-ratio: auto;
    display: block;
    background: transparent;
    border-radius: 7px;
    overflow: hidden;
    padding: 0;
  }

  .pattern-section-list--home .pattern-section-card__media--hue-cover:not(.pattern-section-card__media--home-icon) {
    padding: 0;
    background: transparent;
    overflow: hidden;
  }

  .pattern-section-list--home .pattern-section-card__media--home-icon {
    grid-area: media;
    align-self: center;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    max-width: 48px;
    max-height: 48px;
    flex-shrink: 0;
    margin: 0;
  }

  .pattern-section-list--home
    .pattern-section-card__media:not(.pattern-section-card__media--home-icon)
    .pattern-section-card__media-frame {
    min-height: 0;
    padding: 0;
    border-radius: 0;
    background: transparent;
  }

  .pattern-section-list--home .pattern-section-card__img:not(.pattern-section-card__img--home-icon),
  .pattern-section-list--home .pattern-section-card__media--hue-cover:not(.pattern-section-card__media--home-icon) .pattern-section-card__img {
    width: 100%;
    height: 48px;
    min-height: 0;
    max-height: none;
    object-fit: cover;
    object-position: center;
  }

  .pattern-section-list--home .pattern-section-card__img--diagram {
    height: 48px;
    padding: 0;
    object-fit: cover;
  }

  .pattern-section-list--home-photos .pattern-section-card--setup-step {
    grid-template-columns: var(--pattern-home-thumb-size) minmax(0, 1fr);
  }

  .pattern-section-list--home-photos
    .pattern-section-card__media:not(.pattern-section-card__media--home-icon) {
    width: var(--pattern-home-thumb-size);
    max-width: var(--pattern-home-thumb-size);
    min-width: var(--pattern-home-thumb-size);
    height: var(--pattern-home-thumb-size);
    aspect-ratio: auto;
    border-radius: 8px;
    overflow: hidden;
    justify-self: start;
  }

  .pattern-section-list--home-photos
    .pattern-section-card__media:not(.pattern-section-card__media--home-icon):not(
      .pattern-section-card__media--section-thumb
    ) {
    background: #faf8f5;
  }

  .pattern-section-list--home-photos .pattern-section-card__media--section-thumb {
    background: #fff;
  }

  .pattern-section-list--home-photos .pattern-section-card__img:not(.pattern-section-card__img--home-icon),
  .pattern-section-list--home-photos
    .pattern-section-card__media--hue-cover:not(.pattern-section-card__media--home-icon)
    .pattern-section-card__img,
  .pattern-section-list--home-photos
    .pattern-section-card__media--tinted
    .pattern-section-card__img {
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: none;
    object-fit: cover;
    object-position: center;
  }

  .pattern-section-list--home .pattern-section-card > .pattern-section-card__title,
  .pattern-section-list--home .pattern-section-card__text {
    grid-area: title;
    margin: 0;
    text-align: left;
    width: auto;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    font-size: 0.9rem;
    line-height: 1.28;
    color: var(--dc-navy, #0c295a);
    font-weight: 600;
  }

  .pattern-section-list--home .pattern-section-card--setup-step:is(button, a):active {
    transform: scale(0.99);
    box-shadow: 0 1px 5px rgba(12, 41, 90, 0.08);
  }
}

@media (min-width: 560px) {
  .pattern-section-list--home:not(.pattern-section-list--home-photos) {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .pattern-section-list--home:not(.pattern-section-list--home-photos)
    .pattern-section-card--setup-step {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    grid-template-areas: "media title";
    align-items: center;
    gap: 9px 12px;
    padding: 12px;
    height: auto;
    flex-direction: unset;
  }

  .pattern-section-list--home:not(.pattern-section-list--home-photos)
    .pattern-section-card__media--home-icon {
    grid-area: media;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    max-width: 48px;
    max-height: 48px;
    margin: 0;
    aspect-ratio: auto;
  }

  .pattern-section-list--home:not(.pattern-section-list--home-photos)
    .pattern-section-card--setup-step
    .pattern-section-card__home-icon-glyph {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    flex-basis: 48px;
  }

  .pattern-section-list--home:not(.pattern-section-list--home-photos)
    .pattern-section-card
    > .pattern-section-card__title,
  .pattern-section-list--home:not(.pattern-section-list--home-photos)
    .pattern-section-card__text {
    grid-area: title;
    margin: 0;
    text-align: left;
    width: auto;
    padding: 0;
    background: transparent;
    border: 0;
    font-size: 0.9rem;
  }
}

/* Part overview — fixed thumb window; wide row strips are cropped with object-fit: cover. */
.pattern-section-part-steps .pattern-section-card > .pattern-section-card__title {
  white-space: nowrap;
}

.pattern-section-card__media--tinted {
  background: #faf8f5;
}

.pattern-section-card__media--tinted .pattern-section-card__img {
  position: relative;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 56px;
  object-fit: cover;
  object-position: center;
}

.pattern-section-list .pattern-section-card__media--tinted .pattern-section-card__img {
  min-height: 0;
}

@media (min-width: 560px) {
  .pattern-section-list .pattern-section-card__media--tinted .pattern-section-card__img {
    min-height: 100px;
    max-height: 120px;
    object-fit: cover;
  }

}

.pattern-section-card__media--tinted::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  border-radius: inherit;
  background: color-mix(in srgb, var(--step-tint, #de8015) 14%, transparent);
}

.pattern-section-part-steps .pattern-section-card__media--diagram,
.pattern-section-part-steps .pattern-section-card__media:has(.pattern-section-card__img--diagram) {
  padding: 2px 4px;
}

.pattern-section-part-steps .pattern-section-card__img--diagram {
  position: relative;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  padding: 0;
  object-fit: cover;
  object-position: left center;
}

/* Drop the teal hue-cover trim on part step thumbnails — render photo covers as
   a clean tile so they read consistently with the diagram/chart thumbnails. */
.pattern-section-part-steps .pattern-section-card__media--hue-cover {
  background: #f4f8f6;
  padding: 0;
}

.pattern-section-part-steps
  .pattern-section-card__media--hue-cover
  .pattern-section-card__media-frame {
  background: transparent;
  padding: 0;
  min-height: 0;
  border-radius: inherit;
}

.pattern-section-part-steps
  .pattern-section-card__media--hue-cover
  .pattern-section-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

@media (min-width: 560px) {
  .pattern-section-part-steps .pattern-section-card--setup-step {
    --pattern-part-step-thumb-h: 56px;
  }

  .pattern-section-part-steps .pattern-section-card__media--diagram,
  .pattern-section-part-steps .pattern-section-card__media:has(.pattern-section-card__img--diagram) {
    width: 100%;
    max-width: none;
    min-width: 0;
    aspect-ratio: auto;
    height: var(--pattern-part-step-thumb-h);
    min-height: var(--pattern-part-step-thumb-h);
    max-height: var(--pattern-part-step-thumb-h);
  }

  .pattern-section-part-steps .pattern-section-card__media--hue-cover {
    background: #f4f8f6;
    padding: 0;
  }

  .pattern-section-part-steps .pattern-section-card__media--step-kind {
    width: 48px;
    max-width: 48px;
    min-width: 48px;
    height: 48px;
    min-height: 48px;
    max-height: 48px;
    aspect-ratio: 1;
  }
}

.pattern-section-part-steps .pattern-section-card:has(.pattern-section-card__media--step-kind),
.pattern-section-part-steps .pattern-section-card--setup-step.pattern-section-card--step-kind,
.pattern-section-card--step-kind {
  --casco-yarn: #9aa4ae;
  --casco-yarn-wash: 20%;
  --pattern-part-step-thumb-w: 48px;
  --pattern-part-step-thumb-h: 48px;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  background: color-mix(in srgb, var(--casco-yarn) var(--casco-yarn-wash), #f7f8fa);
  border: 1px solid color-mix(in srgb, var(--casco-yarn) 28%, rgba(12, 41, 90, 0.08));
  border-left-width: 1px;
  border-left-color: color-mix(in srgb, var(--casco-yarn) 28%, rgba(12, 41, 90, 0.08));
  box-shadow: none;
}

.pattern-section-part-steps .pattern-section-card--step-kind[data-step-facing="rs"],
.pattern-section-part-steps .pattern-section-card--setup-step.pattern-section-card--step-kind[data-step-facing="rs"],
.pattern-section-card--step-kind[data-step-facing="rs"],
.pattern-section-part-steps .pattern-section-card--step-kind[data-step-facing="cw"],
.pattern-section-part-steps .pattern-section-card--setup-step.pattern-section-card--step-kind[data-step-facing="cw"],
.pattern-section-card--step-kind[data-step-facing="cw"] {
  --casco-yarn-wash: 16%;
}

.pattern-section-part-steps .pattern-section-card--step-kind[data-step-facing="ws"],
.pattern-section-part-steps .pattern-section-card--setup-step.pattern-section-card--step-kind[data-step-facing="ws"],
.pattern-section-card--step-kind[data-step-facing="ws"],
.pattern-section-part-steps .pattern-section-card--step-kind[data-step-facing="ccw"],
.pattern-section-part-steps .pattern-section-card--setup-step.pattern-section-card--step-kind[data-step-facing="ccw"],
.pattern-section-card--step-kind[data-step-facing="ccw"] {
  --casco-yarn-wash: 26%;
}

.pattern-section-part-steps .pattern-section-card__media.pattern-section-card__media--step-kind,
.pattern-section-list .pattern-section-card__media.pattern-section-card__media--step-kind,
.pattern-section-card__media--step-kind {
  width: 48px;
  max-width: 48px;
  min-width: 48px;
  height: 48px;
  min-height: 48px;
  max-height: 48px;
  aspect-ratio: 1;
  border-radius: 2px;
  box-shadow: none;
  padding: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--casco-yarn, #9aa4ae);
  /* Step SVG inks follow yarn luminance (set in paintCascoYarnSurface). */
  --casco-yarn-ink: #0c295a;
  --casco-yarn-accent: #1b9aaa;
  color: var(--casco-yarn-ink);
}

.pattern-section-card__step-kind {
  width: 32px;
  height: 32px;
  display: block;
  object-fit: contain;
  pointer-events: none;
}

/* Raster fallback before inline SVG loads — lighten marks on dark yarn chips. */
.pattern-section-card__media--step-kind[data-yarn-ink="light"]
  > img.pattern-section-card__step-kind {
  filter: brightness(0) invert(1) opacity(0.95);
}

.pattern-section-card__media--step-kind > svg.pattern-section-card__step-kind {
  flex: 0 0 32px;
  overflow: visible;
}

.pattern-section-part-steps .pattern-section-card__meta {
  font-family: "Lexend", system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--dc-teal, #1b9aa0);
  line-height: 1.35;
}

.pattern-section-part-steps
  .pattern-section-card__text--title-first
  .pattern-section-card__meta {
  text-transform: none;
  letter-spacing: normal;
  font-weight: 600;
  color: var(--dc-text-muted, #5a6b7d);
}

.pattern-section-card__meta {
  font-family: "Lexend", system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--dc-teal);
}

.pattern-section-card__desc {
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--dc-text-muted);
}

.pattern-section-card__list {
  margin: 2px 0 0;
  padding-left: 1.05rem;
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 0.84rem;
  line-height: 1.4;
  color: var(--dc-text-muted);
}

.pattern-section-card__cta {
  margin-top: 3px;
  font-family: "Lexend", system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--dc-teal);
}

.pattern-panel .panel-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pattern-beta-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  font-family: "Lexend", system-ui, sans-serif;
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 560px) {
  .pattern-beta-link {
    min-height: 20px;
    padding: 0.1rem 0.45rem;
    font-size: 0.66rem;
    letter-spacing: 0.07em;
  }
}

.pattern-beta-link:hover {
  background: rgba(255, 255, 255, 0.14);
}

.pattern-beta-link:focus-visible {
  outline: 2px solid var(--dc-orange);
  outline-offset: 2px;
}

.pattern-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pattern-nav--cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.pattern-auth-row {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 2px;
}

.pattern-auth-row__who {
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 12px;
  color: var(--dc-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pattern-auth-row__btn {
  border: 1px solid var(--dc-navy, #0c295a);
  background: transparent;
  color: var(--dc-navy, #0c295a);
  border-radius: 4px;
  min-height: 42px;
  padding: 0.5rem 0.85rem;
  font-family: "Lexend", system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
}

.pattern-auth-row__btn:hover {
  background: rgba(255, 255, 255, 0.92);
  color: var(--dc-navy);
}

.pattern-nav-card {
  border: 1px solid var(--dc-gray-border);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 14px;
  padding: 10px;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 1px 8px rgba(12, 41, 90, 0.06);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pattern-nav-card__icon {
  width: 42px;
  height: 42px;
  object-fit: contain;
  margin-bottom: 2px;
  opacity: 1;
}

.pattern-nav-card--start-here {
  border-color: rgba(27, 154, 170, 0.55);
  box-shadow: 0 0 0 2px rgba(27, 154, 170, 0.12);
}

.pattern-nav-card--active.pattern-nav-card--tone-warm {
  background: #fff6f0;
}

.pattern-nav-card--active.pattern-nav-card--tone-cool {
  background: #f2f7ff;
}

.pattern-nav-card--active.pattern-nav-card--tone-mint {
  background: #edffef;
}

.pattern-nav-card:hover {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(27, 154, 170, 0.65);
  box-shadow: var(--dc-shadow);
}

.pattern-nav-card:focus-visible {
  outline: 2px solid var(--dc-orange);
  outline-offset: 2px;
}

.pattern-nav-card--active {
  border-color: var(--dc-teal);
  border-width: 2px;
  box-shadow:
    0 1px 10px rgba(27, 154, 170, 0.22),
    0 0 0 3px rgba(27, 154, 170, 0.12);
}

.pattern-nav-card:not(.pattern-nav-card--active) .pattern-nav-card__icon {
  opacity: 0.88;
}

.pattern-section {
  background: rgba(255, 255, 255, 0.72);
}

.pattern-section__icon {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

.pattern-nav-card__title {
  margin: 0;
  font-family: "Lexend", system-ui, sans-serif;
  font-weight: 900;
  font-size: 13px;
  color: var(--dc-navy);
}

.pattern-nav-card__desc {
  margin: 0;
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 12px;
  color: var(--dc-text-muted);
  line-height: 1.25;
}

/* Fixed prev/next while in Setup (matches /row/ lesson nav) */
body.pattern-page--with-setup-nav {
  padding-bottom: calc(5.75rem + env(safe-area-inset-bottom, 0px));
}

.pattern-setup-nav-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 15;
  pointer-events: none;
}

.pattern-setup-nav-bar[hidden] {
  display: none !important;
}

.pattern-setup-nav-bar__inner {
  pointer-events: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.65rem;
  align-items: stretch;
  width: min(560px, 100%);
  margin: 0 auto;
  padding: 0.65rem max(12px, env(safe-area-inset-left, 0px))
    max(0.65rem, env(safe-area-inset-bottom, 0px))
    max(12px, env(safe-area-inset-right, 0px));
  background: #ffffff;
  border-top: 1px solid rgba(12, 41, 90, 0.12);
  box-shadow: 0 -6px 24px rgba(12, 41, 90, 0.1);
  box-sizing: border-box;
}

.pattern-setup-nav__btn {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  padding: 0.5rem 0.65rem;
  font-size: 0.8125rem;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  overflow: hidden;
}

.pattern-setup-nav__btn--prev {
  justify-self: start;
}

.pattern-setup-nav__btn--next {
  justify-self: end;
}

.pattern-setup-nav__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.pattern-setup-nav__arrow {
  flex-shrink: 0;
}

.pattern-setup-nav__spacer {
  display: block;
}

.pattern-home-fab {
  position: fixed;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  width: 52px;
  height: 52px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(12, 41, 90, 0.96);
  color: #fff;
  box-shadow: 0 10px 22px rgba(12, 41, 90, 0.22);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 80;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 160ms ease, box-shadow 160ms ease, transform 120ms ease;
}

.pattern-home-fab svg {
  fill: currentColor;
}

.pattern-home-fab:hover {
  background: var(--dc-teal);
  box-shadow: 0 12px 26px rgba(27, 154, 170, 0.28);
}

.pattern-home-fab:active {
  transform: translateY(1px);
}

.pattern-home-fab:focus-visible {
  outline: 2px solid var(--dc-teal);
  outline-offset: 3px;
}

.pattern-nav__btn {
  border: 1px solid var(--dc-navy, #0c295a);
  background: transparent;
  color: var(--dc-navy, #0c295a);
  border-radius: 4px;
  min-height: 42px;
  padding: 0.5rem 0.85rem;
  font-family: "Lexend", system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
}

.pattern-nav__btn--active {
  background: var(--dc-teal);
  border-color: var(--dc-teal);
  color: #fff;
}

.pattern-card {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--dc-gray-border);
  border-radius: var(--radius);
  padding: 12px;
}

/* Setup steps: one outer panel frame only (must follow .pattern-card) */
.pattern-card.pattern-card--setup-step {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  border-radius: 0;
  overflow: visible;
}

.pattern-card.pattern-card--setup-step .pattern-hue-construction-hero__img {
  border: none;
}

.pattern-card.pattern-card--setup-step .pattern-card--colorway-controls {
  margin-top: 4px;
  padding-top: 0;
  border-top: none;
}

/* Community (embedded) */
.pattern-community-preview {
  margin-top: 10px;
}

.pattern-community-preview__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.pattern-community-preview__grid img {
  width: 100%;
  height: 96px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(12, 41, 90, 0.1);
  background: rgba(255, 255, 255, 0.8);
}

.pattern-community-preview__note {
  margin: 10px 0 0;
}

.pattern-community-gate {
  margin-top: 12px;
}

.pattern-community-signin {
  display: grid;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(12, 41, 90, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
}

.pattern-community-signin__label-text {
  display: block;
  font-family: "Lexend", system-ui, sans-serif;
  font-weight: 800;
  font-size: 12px;
  color: rgba(12, 41, 90, 0.7);
  margin-bottom: 6px;
}

.pattern-community-signin__input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(12, 41, 90, 0.14);
  background: rgba(255, 255, 255, 0.9);
  padding: 10px 12px;
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 14px;
}

.pattern-community-signin__check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 13px;
  color: var(--dc-text-muted);
}

.pattern-community-signin__status {
  margin: 0;
}

.pattern-community-connect {
  border-radius: 12px;
  border: 1px solid rgba(12, 41, 90, 0.08);
  background: rgba(255, 255, 255, 0.7);
  padding: 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pattern-community-connect__title {
  font-family: "Lexend", system-ui, sans-serif;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(12, 41, 90, 0.62);
}

.pattern-community-connect__body {
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 13px;
  color: var(--dc-text-muted);
}

.pattern-community-connect__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}

a.pattern-community-connect__link {
  width: 34px;
  height: 34px;
  border-radius: 4px;
  border: 1px solid rgba(12, 41, 90, 0.12);
  background: rgba(255, 255, 255, 0.9);
  color: var(--dc-navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 120ms ease;
}

a.pattern-community-connect__link--text {
  width: auto;
  min-width: 34px;
  padding: 0 0.65rem;
  font-family: "Lexend", sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
}

a.pattern-community-connect__link:hover {
  border-color: rgba(27, 154, 170, 0.55);
  background: rgba(255, 255, 255, 1);
  color: var(--dc-teal);
}

a.pattern-community-connect__link:active {
  transform: translateY(1px);
}

a.pattern-community-connect__link:focus-visible {
  outline: 2px solid var(--dc-orange);
  outline-offset: 2px;
}

.pattern-community-unlocked {
  padding: 10px 12px;
  border: 1px solid rgba(12, 41, 90, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
}

.pattern-community-unlocked__row {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.pattern-section {
  position: relative;
}

.pattern-section__title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.pattern-section__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  list-style: none;
  padding: 2px 0;
}

.pattern-section__summary::-webkit-details-marker {
  display: none;
}

.pattern-section__summary-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.pattern-section__chev {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  color: rgba(12, 41, 90, 0.6);
  font-size: 14px;
  line-height: 1;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

details.pattern-section[open] .pattern-section__chev {
  transform: rotate(180deg);
}

details.pattern-section > summary.pattern-section__summary {
  border-radius: 12px;
  padding: 6px 6px;
}

details.pattern-section > summary.pattern-section__summary:hover {
  background: rgba(255, 255, 255, 0.55);
}

details.pattern-section[open] > summary.pattern-section__summary {
  margin-bottom: 8px;
}

.pattern-materials-default {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pattern-materials-field strong,
.pattern-materials-row strong {
  display: block;
  margin-bottom: 4px;
  font-family: "Lexend", system-ui, sans-serif;
  font-size: 0.84rem;
  color: var(--dc-navy);
}

.pattern-materials-field__text {
  margin: 0;
  line-height: 1.5;
}

.pattern-materials-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}

.pattern-materials-row--colorway {
  align-items: center;
}

.pattern-materials-colorway-btn {
  flex-shrink: 0;
  text-decoration: none;
}

.pattern-card__title {
  margin: 0 0 8px 0;
  font-family: "Lexend", system-ui, sans-serif;
  font-weight: 800;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pattern-title-icon {
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(27, 154, 170, 0.08);
  border: 1px solid rgba(12, 41, 90, 0.1);
  color: var(--dc-navy);
  font-size: 14px;
  line-height: 1;
}

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

.pattern-card__header .pattern-card__title {
  margin-bottom: 0;
}

.pattern-reset-btn {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  border: 1px solid rgba(12, 41, 90, 0.12);
  background: rgba(255, 255, 255, 0.65);
  color: rgba(12, 41, 90, 0.7);
  display: grid;
  place-items: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.pattern-reset-btn svg {
  display: block;
}

.pattern-reset-btn:hover {
  background: rgba(255, 255, 255, 0.92);
  color: var(--dc-teal);
}

.pattern-reset-btn:focus-visible {
  outline: 2px solid var(--dc-teal);
  outline-offset: 3px;
}

.pattern-muted {
  font-family: "Montserrat", system-ui, sans-serif;
  color: var(--dc-text-muted);
  font-size: 14px;
  line-height: 1.45;
}

/* Row lesson body also carries .pattern-muted — beat its fixed 14px so ☰ text size applies. */
.row-lesson-instructions,
.row-lesson-instructions.pattern-muted {
  font-size: calc(0.95rem * var(--pattern-text-scale, 1));
  line-height: var(--pattern-text-lh, 1.55);
}

/* Round viewer: main text + collapsible Stitch counts / Reference (Notion-style toggles) */
.pattern-round-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  /* Body copy: a touch darker than global .pattern-muted for clearer instructions */
  --pattern-instruction-ink: #344860;
  /* Accordions + reference: softer, lighter grey than the body copy above */
  --pattern-support-ink: #8e9aad;
  --pattern-support-ink-strong: #7a8798;
  --pattern-support-ink-faint: #a8b2bf;
}

.pattern-round-body.pattern-muted {
  color: var(--pattern-instruction-ink);
}

.pattern-round-body {
  margin: 0;
  font-size: calc(0.95rem * var(--pattern-text-scale, 1));
  line-height: var(--pattern-text-lh, 1.55);
}

.pattern-round-body > p:first-child {
  margin-top: 0;
}

.pattern-round-subsections {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--pattern-support-ink);
}

.pattern-round-subsections .pattern-muted {
  color: var(--pattern-support-ink);
}

.pattern-round-subsections strong {
  color: var(--pattern-support-ink-strong);
  font-weight: 500;
}

.pattern-round-subsections .pattern-stitch-counts__lead {
  margin: 0 0 4px;
}

.pattern-round-subsections .pattern-stitch-counts__list {
  margin: 0;
  padding-left: 1.2rem;
  list-style-type: disc;
  line-height: 1.5;
}

.pattern-round-subsections .pattern-stitch-counts__list li {
  margin: 0.15em 0;
  padding-left: 0.1em;
}

.pattern-round-subsections .pattern-stitch-counts__list li::marker {
  color: var(--pattern-support-ink-faint);
}

.pattern-round-subsections .pattern-details__summary {
  color: var(--pattern-support-ink);
  font-weight: 400;
}

.pattern-round-subsections .pattern-details__title {
  color: var(--pattern-support-ink);
  font-weight: 500;
}

.pattern-round-subsections .pattern-details__panel.pattern-muted,
.pattern-round-subsections .pattern-details__panel {
  color: var(--pattern-support-ink);
}

.pattern-round-subsections .pattern-details__empty {
  color: var(--pattern-support-ink-faint);
}

.pattern-round-subsections .pattern-details__chev {
  border-left-color: rgba(12, 41, 90, 0.26);
}

.pattern-round-subsections .pattern-details__icon {
  opacity: 0.78;
}

.pattern-round-subsections .pattern-details__stitch-title {
  color: var(--pattern-support-ink);
  font-weight: 400;
}

.pattern-round-subsections .pattern-details__summary--nested {
  font-weight: 400;
}

.pattern-round-subsections .pattern-ref-block__label {
  color: rgba(12, 41, 90, 0.38);
  font-weight: 600;
}

.pattern-round-subsections .pattern-ref-links a {
  color: color-mix(in srgb, var(--dc-teal) 72%, var(--pattern-support-ink) 28%);
  font-weight: 500;
}

.pattern-round-subsections .pattern-ref-links a:hover {
  color: var(--pattern-support-ink-strong);
}

.pattern-round-subsections .pattern-legend-symbol {
  opacity: 0.88;
}

.pattern-details {
  border: 1px solid rgba(12, 41, 90, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
  overflow: hidden;
}

.pattern-details--nested {
  margin: 0 0 8px 0;
  background: rgba(255, 255, 255, 0.72);
}

.pattern-details--nested:last-child {
  margin-bottom: 0;
}

.pattern-details__summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--dc-text-muted);
  list-style: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.pattern-details__summary::-webkit-details-marker {
  display: none;
}

.pattern-details__summary:hover {
  background: rgba(255, 255, 255, 0.65);
}

.pattern-details__chev {
  display: inline-block;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid rgba(12, 41, 90, 0.38);
  flex-shrink: 0;
  transition: transform 140ms ease;
  margin-right: 2px;
}

.pattern-details[open] > .pattern-details__summary .pattern-details__chev {
  transform: rotate(90deg);
}

.pattern-details__icon {
  font-size: 15px;
  line-height: 1;
  flex-shrink: 0;
  opacity: 0.92;
}

.pattern-details__title {
  color: var(--dc-navy);
  font-weight: 700;
}

.pattern-details__panel {
  padding: 0 12px 12px 14px;
  border-top: 1px solid rgba(12, 41, 90, 0.06);
  font-size: calc(14px * var(--pattern-text-scale, 1));
  line-height: var(--pattern-text-lh, 1.55);
}

.pattern-details__panel--reference {
  padding-top: 8px;
}

.pattern-ref-block--row-specific {
  margin-top: 0.65rem;
}

.pattern-ref-block--row-specific + .pattern-details--nested {
  margin-top: 0.15rem;
}

.pattern-details__empty {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--dc-text-muted);
}

.pattern-details__empty--inline {
  margin: 0;
}

.pattern-details__summary--nested {
  padding: 8px 10px;
  font-weight: 600;
  font-size: 13px;
}

.pattern-details__summary-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.pattern-details__stitch-title {
  color: var(--dc-text-muted);
  font-weight: 600;
}

.pattern-legend-symbol {
  display: block;
  flex-shrink: 0;
  color: var(--dc-navy);
  object-fit: contain;
}

.pattern-legend-symbol--sm {
  width: 32px;
  max-height: 24px;
  height: auto;
}

.pattern-legend-symbol--lg {
  width: min(120px, 100%);
  max-height: 92px;
  height: auto;
  margin-left: auto;
  margin-right: auto;
}

.pattern-details--nested .pattern-legend-symbol--lg {
  max-width: 140px;
}

.pattern-ref {
  padding: 4px 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pattern-ref__hero {
  display: flex;
  justify-content: center;
  padding: 4px 0 2px;
}

.pattern-ref-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pattern-ref-block__label {
  font-family: "Lexend", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(12, 41, 90, 0.55);
}

.pattern-ref-block__body > p:first-child {
  margin-top: 0;
}

.pattern-ref-links {
  font-size: calc(14px * var(--pattern-text-scale, 1));
  line-height: var(--pattern-text-lh, 1.5);
}

.pattern-ref-links a,
.pattern-video-link {
  color: var(--dc-teal);
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.pattern-ref-links a:hover,
.pattern-video-link:hover {
  color: var(--dc-navy);
}

.pattern-ref-links__sep {
  opacity: 0.45;
}

.pattern-video-link {
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

.pattern-video-embed-host {
  margin-top: 10px;
}

.pattern-video-embed {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--pattern-tile-radius, 4px);
  overflow: hidden;
  border: 1px solid rgba(12, 41, 90, 0.12);
  background: rgba(255, 255, 255, 0.85);
}

.pattern-video-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.pattern-video-embed__facade {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: #0c295a;
  cursor: pointer;
}

.pattern-video-embed__poster {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pattern-video-embed__play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4rem;
  height: 4rem;
  margin: -2rem 0 0 -2rem;
  border-radius: 50%;
  background: rgba(12, 41, 90, 0.82);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.28);
}

.pattern-video-embed__play::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  margin: -0.55rem 0 0 -0.35rem;
  border-style: solid;
  border-width: 0.55rem 0 0.55rem 0.95rem;
  border-color: transparent transparent transparent #fff;
}

.pattern-video-embed__facade:focus-visible {
  outline: 2px solid var(--dc-orange, #f19455);
  outline-offset: 2px;
}

.pattern-section-thumb-hero__png {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

.pattern-video-embed__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 8px;
}

.pattern-round-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (min-width: 520px) {
  .pattern-round-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.pattern-round-tile {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(12, 41, 90, 0.14);
  background: transparent;
  border-radius: 11px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  cursor: pointer;
  text-align: left;
  box-shadow:
    0 2px 6px rgba(12, 41, 90, 0.08),
    0 10px 22px rgba(12, 41, 90, 0.06);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 120ms ease;
}

.pattern-round-tile:hover {
  border-color: rgba(27, 154, 170, 0.55);
  box-shadow:
    0 3px 10px rgba(12, 41, 90, 0.1),
    0 14px 28px rgba(12, 41, 90, 0.08);
}

.pattern-round-tile:active {
  transform: translateY(1px);
  box-shadow:
    0 1px 4px rgba(12, 41, 90, 0.1),
    inset 0 1px 2px rgba(12, 41, 90, 0.05);
}

.pattern-round-tile:focus-visible {
  outline: 2px solid var(--dc-orange);
  outline-offset: 2px;
}

/* Art band: illustration + status only; label lives in .pattern-round-tile__footer */
.pattern-round-tile__banner {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 1;
  min-height: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 0;
}

.pattern-round-tile__footer {
  flex-shrink: 0;
  width: 100%;
  padding: 10px 12px 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border-top: 1px solid rgba(12, 41, 90, 0.09);
}

.pattern-round-tile__footer .pattern-round-tile__label {
  margin: 0;
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--dc-navy);
  line-height: 1.2;
  text-align: center;
}

.pattern-round-tile__banner::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background-color: #faf8f5;
  background-image: url("../images/pattern/round-card-art.png?v=6");
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  /* Greyscale asset: light touch only */
  filter: saturate(0.96) contrast(0.96) brightness(1.04);
  pointer-events: none;
}

.pattern-round-tile__banner::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  border-radius: inherit;
  background: color-mix(in srgb, var(--round-tint, #c9a07a) 12%, transparent);
}

/* Status centered on art */
.pattern-round-tile__banner .pattern-round-tile__status {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  margin: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(255, 255, 255, 0.85));
}

.pattern-round-tile__status-ring {
  width: 20px;
  height: 20px;
  border-radius: 7px;
  border: 2px solid rgba(12, 41, 90, 0.32);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5);
}

/* Started: dashed outline only (no teal fill — distinct from not-started solid ring) */
.pattern-round-tile__status-dot {
  width: 20px;
  height: 20px;
  border-radius: 7px;
  background: transparent;
  border: 2px dashed rgba(12, 41, 90, 0.38);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.pattern-round-tile__status-check {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--dc-green);
  color: rgba(255, 255, 255, 0.98);
  display: grid;
  place-items: center;
  font-family: "Lexend", system-ui, sans-serif;
  font-weight: 900;
  font-size: 14px;
  line-height: 1;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 1px 4px rgba(12, 41, 90, 0.18);
}

/* Dev “Test color changes” row: a bit more presence without fighting the chart UI */
.pattern-test-colors__row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.pattern-test-colors__row .cw-btn--secondary {
  background: linear-gradient(180deg, #ffffff 0%, #f0f4f9 100%);
  border-radius: 10px;
  box-shadow:
    0 1px 2px rgba(12, 41, 90, 0.09),
    0 3px 10px rgba(12, 41, 90, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.pattern-test-colors__row .cw-btn--secondary:hover:not(:disabled) {
  box-shadow:
    0 2px 4px rgba(12, 41, 90, 0.1),
    0 8px 18px rgba(12, 41, 90, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 1);
}

.pattern-test-colors__row .cw-btn--primary {
  background: linear-gradient(180deg, var(--dc-navy) 0%, #0a2540 100%);
  border-radius: 10px;
  box-shadow:
    0 2px 6px rgba(12, 41, 90, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.pattern-test-colors__row .cw-btn--primary:hover:not(:disabled) {
  background: linear-gradient(180deg, var(--dc-teal) 0%, #178a9a 100%);
  box-shadow:
    0 3px 10px rgba(27, 154, 170, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}


.pattern-round-view__diagram {
  width: 100%;
  margin: 10px 0;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.9);
  overflow: hidden;
}

/* Default (round ≥3): full card width, natural height — same as original img sizing. */
.pattern-round-view__img {
  width: 100%;
  height: auto;
  display: block;
}

/* Rounds 1–2 only: short-wide SVGs need a tall viewport. The img must fill that box with
   width AND height set so object-fit: contain scales uniformly; height-only + width:auto
   hits max-width first and leaves the diagram tiny in the middle of the frame. */
.pattern-round-view__diagram--boost {
  --pattern-round-diagram-h: clamp(380px, 62vh, 720px);
  height: var(--pattern-round-diagram-h);
  padding: 6px;
  box-sizing: border-box;
  display: grid;
  grid-template: 1fr / 1fr;
  min-height: 0;
}

/* Row-based charts (long + skinny) — Moon Tide, Chroma Remix */
.pattern-round-view__diagram--row-chart.pattern-round-view__diagram--boost {
  --pattern-round-diagram-h: clamp(160px, 34vw, 260px);
  height: var(--pattern-round-diagram-h);
  aspect-ratio: 5 / 2;
}

/* Round-based charts (squarer) — Hue Shift-style rounds */
.pattern-round-view__diagram--round-chart.pattern-round-view__diagram--boost {
  --pattern-round-diagram-h: clamp(380px, 62vh, 720px);
}

.pattern-round-view__diagram--boost .pattern-round-view__img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  object-position: center;
}

@media (max-width: 420px) {
  .pattern-round-view__diagram--boost {
    --pattern-round-diagram-h: clamp(320px, 56vh, 560px);
  }

  .pattern-round-view__diagram--row-chart.pattern-round-view__diagram--boost {
    --pattern-round-diagram-h: clamp(130px, 40vw, 200px);
  }
}

/* Chart toolbar — same row as /row/ lock, fit, ask designer */
.pattern-chart-toolbar,
.maker-question-toolbar,
.row-chart-toolbar {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  flex-shrink: 0;
  margin: 0 0 0.15rem;
}

.pattern-chart-toolbar .row-ask-question-btn,
.maker-question-toolbar .row-ask-question-btn,
.row-chart-toolbar .row-ask-question-btn {
  margin-left: auto;
}

/* In-pattern row chart viewer — Hue Shift /row/ chrome in the panel */
div.row-repeat-pill,
.row-repeat-pill--readonly,
.pattern-row-chart-meta__repeat-readonly {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  margin: 0;
  padding: 0.25rem 0.55rem;
  min-height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(12, 41, 90, 0.18);
  background: rgba(255, 255, 255, 0.65);
  color: var(--dc-navy);
  box-shadow: 0 1px 3px rgba(12, 41, 90, 0.08);
  cursor: default;
  pointer-events: none;
}

/* Soft chart-ref pill when an interactive row counter owns the count. */
div.row-repeat-pill.row-repeat-pill--soft {
  border-color: rgba(12, 41, 90, 0.1);
  background: rgba(255, 255, 255, 0.45);
  box-shadow: none;
  opacity: 0.88;
}

div.row-repeat-pill.row-repeat-pill--soft .row-repeat-pill-label {
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
  opacity: 0.75;
}

/* Row-chart views — match Hue Shift `/row/` full-width layout */
body.pattern-page.pattern-page--row-chart-view {
  --row-chart-max-viewport-height: calc(100dvh - 12.5rem);
  padding-top: max(0.65rem, env(safe-area-inset-top, 0px));
  padding-right: max(12px, env(safe-area-inset-right, 0px));
  padding-left: max(12px, env(safe-area-inset-left, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Row-chart step views keep the fixed prev/next bar — don't let row-chart padding wipe it */
body.pattern-page.pattern-page--row-chart-view.pattern-page--with-setup-nav,
body.pattern-page.pattern-page--row-chart-view.row-page--with-lesson-nav {
  padding-bottom: calc(5.75rem + env(safe-area-inset-bottom, 0px));
}

body.pattern-page.pattern-page--row-chart-view .row-lesson {
  padding-bottom: 0.5rem;
}

body.pattern-page.pattern-page--row-chart-view .app-header[hidden],
body.pattern-page.pattern-page--row-chart-view .pattern-stage-wrap {
  display: none !important;
}

body.pattern-page.pattern-page--row-chart-view .pattern-row-chart-header {
  display: flex;
  width: 100%;
  margin: 0 0 0.4rem;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

body.pattern-page.pattern-page--row-chart-view .pattern-main {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

body.pattern-page.pattern-page--row-chart-view .pattern-panel,
body.pattern-page.pattern-page--row-chart-view .pattern-panel .panel-inner {
  padding: 0;
  margin: 0;
  gap: 0;
  max-width: none;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}

body.pattern-page.pattern-page--row-chart-view .pattern-row-page-inner {
  width: 100%;
  max-width: none;
}

body.pattern-page.pattern-page--row-chart-view .pattern-setup-nav-bar__inner {
  width: 100%;
  max-width: 980px;
}

body.pattern-page.pattern-page--row-chart-view .row-scroll {
  /* Readable stitch-strip height; frame hugs the chart (no tall empty band). */
  --pattern-row-chart-frame-min-h: clamp(120px, 28vw, 200px);
  display: flex;
  align-items: center;
  justify-content: safe center;
  max-height: var(--row-chart-max-viewport-height);
  min-height: 0;
}

body.pattern-page.pattern-page--row-chart-view .row-media {
  display: block;
  flex: 0 0 auto;
}

body.pattern-page.pattern-page--row-chart-view .row-scroll img {
  object-position: center center;
}

/* Keep the diagram frame while Colorway recolor runs (no alt-text flash). */
body.pattern-page.pattern-page--row-chart-view .row-scroll img.row-chart-img--loading,
.pattern-round-view__img.row-chart-img--loading {
  visibility: hidden;
}

body.pattern-page.pattern-page--row-chart-view .row-scroll.row-scroll--fit {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
}

body.pattern-page.pattern-page--row-chart-view .row-scroll.row-scroll--fit .row-media {
  display: flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  max-width: none;
  min-height: 0;
  margin-inline: auto;
}

/* Wide Blossom-style strips: size by height so stitches stay large; scroll sideways. */
body.pattern-page.pattern-page--row-chart-view .row-scroll.row-scroll--fit .row-media > img {
  width: auto;
  max-width: none;
  height: var(--pattern-row-chart-frame-min-h);
  max-height: min(
    var(--pattern-row-chart-frame-min-h),
    var(--row-chart-max-viewport-height)
  );
  object-fit: contain;
}

.pattern-card--row-chart .pattern-row-chart-view__scroll-wrap {
  margin-bottom: 0;
}

/* Multi-photo carousel on shell row chart Photo tab */
.pattern-row-photo-carousel {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  width: 100%;
  min-height: var(--pattern-row-chart-frame-min-h, clamp(160px, 34vw, 260px));
}

.pattern-row-photo-carousel__hint {
  margin: 0;
  font-family: Montserrat, system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(12, 41, 90, 0.55);
  text-align: center;
}

.pattern-row-photo-carousel__track {
  display: flex;
  gap: 0;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
  background: #fff;
}

.pattern-row-photo-carousel__track::-webkit-scrollbar {
  height: 0;
}

.pattern-row-photo-carousel__slide {
  flex: 0 0 100%;
  width: 100%;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--pattern-row-chart-frame-min-h, clamp(160px, 34vw, 260px));
  box-sizing: border-box;
  padding: 0.35rem;
}

.pattern-row-photo-carousel__slide img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: var(--row-chart-max-viewport-height, calc(100dvh - 12.5rem));
  object-fit: contain;
}

.pattern-row-photo-carousel__dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  padding: 0.15rem 0 0.25rem;
}

.pattern-row-photo-carousel__dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(12, 41, 90, 0.22);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.pattern-row-photo-carousel__dot.is-active {
  background: var(--dc-navy, #0c295a);
  transform: scale(1.15);
}

.pattern-row-photo-carousel__dot:focus-visible {
  outline: 2px solid var(--dc-orange, #f19455);
  outline-offset: 2px;
}

/* Legacy in-card row chart — superseded by row-page-inner layout */
.pattern-card--row-chart .row-scroll {
  max-height: var(--row-chart-max-viewport-height, calc(100dvh - 12.5rem));
}

button.row-lock-icon-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--dc-text-muted);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

button.row-lock-icon-btn:hover:not(:disabled) {
  color: var(--dc-navy);
  background: rgba(12, 41, 90, 0.06);
}

button.row-lock-icon-btn:focus-visible {
  outline: 2px solid var(--dc-teal);
  outline-offset: 2px;
}

button.row-lock-icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

button.row-lock-icon-btn[aria-pressed="true"] {
  color: var(--dc-teal);
}

.row-lock-icon[hidden] {
  display: none !important;
}

.pattern-round-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.pattern-round-actions--single {
  justify-content: flex-end;
}

.pattern-round-actions--two {
  flex-wrap: nowrap;
}

.pattern-round-actions--two > .pattern-round-actions__btn {
  flex: 1 1 0;
  justify-content: center;
}

.pattern-round-actions__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pattern-round-actions__glyph {
  flex-shrink: 0;
  font-weight: 600;
  font-size: 1.05em;
  line-height: 1;
}

/* Celebration overlay (mirrors /row/ “Nice work!” vibe) */
.pattern-celebrate {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
}

.pattern-celebrate[hidden] {
  display: none !important;
}

.pattern-celebrate-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 41, 90, 0.28);
  opacity: 0;
  transition: opacity 240ms ease;
}

.pattern-celebrate-content {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%) scale(0.98);
  width: min(420px, calc(100vw - 42px));
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(12, 41, 90, 0.14);
  border-radius: 16px;
  box-shadow: var(--dc-shadow-active);
  padding: 18px 18px 16px;
  text-align: center;
  opacity: 0;
  transition: opacity 240ms ease, transform 240ms ease;
}

.pattern-celebrate-check {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  margin: 0 auto 10px;
  display: grid;
  place-items: center;
  background: rgba(137, 209, 140, 0.28);
  color: var(--dc-navy);
  font-family: "Lexend", system-ui, sans-serif;
  font-weight: 900;
  font-size: 22px;
}

.pattern-celebrate-title {
  margin: 0;
  font-family: "Lexend", system-ui, sans-serif;
  font-weight: 900;
  font-size: 18px;
  color: var(--dc-navy);
}

.pattern-celebrate-confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.pattern-confetti-piece {
  position: absolute;
  top: -12px;
  left: var(--cx, 50%);
  width: 10px;
  height: 16px;
  border-radius: 4px;
  background: var(--cc, var(--dc-teal));
  transform: rotate(15deg);
  opacity: 0;
}

.pattern-celebrate--active .pattern-celebrate-backdrop {
  opacity: 1;
}

.pattern-celebrate--active .pattern-celebrate-content {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.pattern-celebrate--active .pattern-confetti-piece {
  opacity: 1;
  animation: pattern-confetti-fall 980ms ease-in forwards;
  animation-delay: var(--cd, 0s);
}

@keyframes pattern-confetti-fall {
  0% {
    transform: translate3d(0, 0, 0) rotate(15deg);
  }
  100% {
    transform: translate3d(0, 110vh, 0) rotate(220deg);
  }
}

