/* Design Crochet — design_specs.txt */

:root {
  --dc-navy: #0c295a;
  --dc-teal: #1b9aaa;
  --dc-teal-hover: #168896;
  --dc-orange: #f19455;
  --dc-green: #89d18c;
  --dc-gray-light: #f5f5f5;
  --dc-gray-border: #d3d3d3;
  --dc-disabled-bg: #d3d3d3;
  --dc-disabled-text: #555555;
  --dc-white: #ffffff;
  --dc-text: #0c295a;
  --dc-text-muted: #4a5f7a;
  --dc-navy-darker: #081d3d;
  --dc-page-bg: #e8f5ea;
  --dc-shadow: 0 2px 8px rgba(12, 41, 90, 0.12);
  --dc-shadow-active: 0 2px 6px rgba(12, 41, 90, 0.22);
  --radius: 10px;
  font-family: "Comfortaa", system-ui, sans-serif;
  font-size: 16px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--dc-page-bg);
  color: var(--dc-text);
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: max(700px, 100dvh);
  overflow-x: hidden;
}

/* —— Header (spec: #0C295A) —— */
.app-header {
  padding: 0.75rem 1.25rem;
  padding-top: max(0.75rem, env(safe-area-inset-top, 0px));
  padding-left: max(1.25rem, env(safe-area-inset-left, 0px));
  padding-right: max(1.25rem, env(safe-area-inset-right, 0px));
  background: var(--dc-navy);
  border-bottom: 3px solid var(--dc-teal);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
}

.app-header-brand {
  min-width: 0;
}

.app-title {
  margin: 0;
  font-family: "Comfortaa", sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--dc-white);
  letter-spacing: -0.02em;
}

.app-tagline {
  margin: 0.25rem 0 0;
  font-family: "Montserrat", sans-serif;
  font-size: 1rem;
  font-style: italic;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.35;
  max-width: 36rem;
}

@media (min-width: 600px) {
  .app-tagline {
    font-size: 1.125rem;
  }
}

.partner-line {
  margin: 0.35rem 0 0;
  font-family: "Montserrat", sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--dc-orange);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Chart click: colorway dropdown + swatches below header */
.chart-pick-bar-root {
  --chart-pick-bar-top: 0px;
  position: fixed;
  inset: 0;
  z-index: 5000;
  pointer-events: none;
}

.chart-pick-bar-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 41, 90, 0.28);
  pointer-events: auto;
}

.chart-pick-bar {
  position: absolute;
  left: 0;
  right: 0;
  /* JS sets --chart-pick-bar-top from header bottom (clamped ≥0). max() keeps the
     sheet below the notch when the header has scrolled away. */
  top: max(var(--chart-pick-bar-top, 0px), env(safe-area-inset-top, 0px));
  max-height: min(55vh, 420px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1rem 1.25rem max(1rem, env(safe-area-inset-bottom, 0px));
  padding-left: max(1.25rem, env(safe-area-inset-left, 0px));
  padding-right: max(1.25rem, env(safe-area-inset-right, 0px));
  background: var(--dc-white);
  border-bottom: 3px solid var(--dc-teal);
  box-shadow: var(--dc-shadow-active);
  pointer-events: auto;
  box-sizing: border-box;
}

.chart-pick-bar__head {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.chart-pick-bar__title {
  margin: 0;
  font-family: "Lexend", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--dc-navy);
}

.chart-pick-bar__label {
  font-family: "Lexend", sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--dc-text-muted);
}

.chart-pick-bar__select {
  width: 100%;
  min-height: 48px;
  padding: 0.5rem 0.75rem;
  font: inherit;
  font-family: "Lexend", sans-serif;
  font-size: 1rem;
  border-radius: var(--radius);
  border: 2px solid var(--dc-gray-border);
  background: var(--dc-white);
  color: var(--dc-navy);
  cursor: pointer;
  accent-color: var(--dc-teal);
}

.chart-pick-bar__select:focus,
.chart-pick-bar__select:focus-visible {
  outline: none;
  box-shadow: none;
}

.chart-pick-bar__swatch-region {
  margin-bottom: 0.85rem;
}

.chart-pick-bar__empty {
  margin: 0;
  font-family: "Montserrat", sans-serif;
  font-size: 0.875rem;
  color: var(--dc-text-muted);
}

.chart-pick-bar__swatches {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(0.35rem, 2vw, 0.65rem);
  align-items: center;
}

.chart-pick-bar__swatch {
  width: clamp(32px, 11vw, 48px);
  height: clamp(32px, 11vw, 48px);
  min-width: clamp(32px, 11vw, 48px);
  min-height: clamp(32px, 11vw, 48px);
  padding: 0;
  margin: 0;
  border-radius: clamp(6px, 2.2vw, 10px);
  border: 2px solid var(--dc-gray-border);
  box-shadow: var(--dc-shadow);
  cursor: pointer;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease;
}

.chart-pick-bar__swatch:hover {
  transform: scale(1.05);
  box-shadow: var(--dc-shadow-active);
}

.chart-pick-bar__swatch:focus-visible {
  outline: 2px solid var(--dc-teal);
  outline-offset: 2px;
}

.chart-pick-bar__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.chart-pick-bar__cancel {
  min-height: 48px;
}

.app-header .placeholder code,
.svg-stage .placeholder code {
  font-size: 0.85em;
  padding: 0.15em 0.4em;
  border-radius: 4px;
  background: var(--dc-gray-light);
  color: var(--dc-navy);
  border: 1px solid var(--dc-gray-border);
}

/* —— Main: single column for embeds (Notion / iframe) —— */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.75rem;
  min-height: 0;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 1.25rem 20px 2rem;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
  padding-bottom: max(2rem, env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
}

.cw-instruction {
  margin: 0;
  text-align: center;
  font-family: "Comfortaa", sans-serif;
  font-size: clamp(1rem, 2.8vw, 1.125rem);
  font-weight: 700;
  line-height: 1.45;
  color: var(--dc-navy);
  max-width: 100%;
}

.cw-tip {
  margin: 0;
  text-align: center;
  font-family: "Montserrat", sans-serif;
  font-size: 0.875rem;
  font-style: italic;
  color: var(--dc-text-muted);
  line-height: 1.45;
  max-width: 100%;
}

.cw-tip--in-section {
  text-align: left;
  margin: -0.35rem 0 1rem;
}

/* Support green as section atmosphere (spec) */
.svg-stage-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.25rem;
  min-height: 0;
  order: 0;
  background: linear-gradient(
    165deg,
    rgba(137, 209, 140, 0.22) 0%,
    var(--dc-page-bg) 45%,
    var(--dc-white) 100%
  );
  border-radius: var(--radius);
}

.demo-view-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  max-width: 36rem;
  font-family: "Montserrat", sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--dc-text-muted);
}

.demo-view-toggle__hint {
  margin: 0;
  max-width: 22rem;
  text-align: center;
  font-family: "Montserrat", sans-serif;
  font-size: 0.8125rem;
  font-weight: 400;
  font-style: italic;
  color: var(--dc-text-muted);
  line-height: 1.4;
}

.demo-view-toggle__segments {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.35rem;
  padding: 0.2rem 0.35rem;
  border-radius: 999px;
  background: var(--dc-white);
  border: 1px solid var(--dc-gray-border);
  box-shadow: 0 1px 3px rgba(12, 41, 90, 0.08);
}

.demo-view-toggle__sep {
  color: var(--dc-gray-border);
  font-weight: 400;
  user-select: none;
}

.demo-view-toggle__btn {
  margin: 0;
  padding: 0.35rem 0.65rem;
  border: none;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  color: var(--dc-text-muted);
  background: transparent;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}

.demo-view-toggle__btn:hover {
  color: var(--dc-navy);
  background: rgba(27, 154, 170, 0.12);
}

.demo-view-toggle__btn:focus-visible {
  outline: 2px solid var(--dc-teal);
  outline-offset: 2px;
}

.demo-view-toggle__btn--active {
  color: var(--dc-white);
  background: var(--dc-navy);
  box-shadow: var(--dc-shadow);
}

.demo-view-toggle__btn--active:hover {
  color: var(--dc-white);
  background: var(--dc-navy-darker);
}

/* Card: white, gray border (spec) */
.svg-stage {
  width: 100%;
  max-width: 100%;
  max-height: min(52vh, 420px);
  min-height: 220px;
  border-radius: var(--radius);
  background: var(--dc-white);
  border: 1px solid var(--dc-gray-border);
  box-shadow: var(--dc-shadow);
  overflow: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
}

/* Direct (?view=direct): anchor for tiny chart-corner reset control */
.svg-stage.svg-stage--direct {
  position: relative;
}

@media (max-width: 599px) {
  .svg-stage {
    justify-content: flex-start;
  }
}

@media (min-width: 600px) {
  .svg-stage {
    max-height: min(58vh, 480px);
    min-height: 280px;
  }
}

/* Subtle color morph when zones update (best-effort; attribute fills vary by browser) */
.svg-stage svg path,
.svg-stage svg rect,
.svg-stage svg circle,
.svg-stage svg ellipse,
.svg-stage svg polygon,
.svg-stage svg polyline {
  transition: fill 0.22s ease, stroke 0.22s ease;
}

.svg-stage svg [data-color-zone] {
  cursor: pointer;
}

.svg-stage svg [data-color-zone].svg-zone--chart-selected {
  filter: drop-shadow(0 0 1px rgba(12, 41, 90, 0.95))
    drop-shadow(0 0 5px rgba(27, 154, 170, 0.55));
}

.svg-stage svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(50vh, 440px);
  flex-shrink: 0;
}

/* Mobile: large tap targets to pick a zone (same flow as chart tap) */
.svg-stage__zone-strip {
  width: 100%;
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 0.5rem 0.35rem;
  box-sizing: border-box;
  border-top: 1px solid var(--dc-gray-border);
  margin-top: 0.35rem;
}

.svg-stage__zone-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 48px;
  padding: 0.35rem 0.65rem;
  margin: 0;
  border-radius: 10px;
  border: 2px solid var(--dc-gray-border);
  background: var(--dc-white);
  box-shadow: var(--dc-shadow);
  cursor: pointer;
  font-family: "Lexend", sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--dc-navy);
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    border-color 0.12s ease;
}

.svg-stage__zone-btn:hover {
  border-color: var(--dc-teal);
  box-shadow: var(--dc-shadow-active);
}

.svg-stage__zone-btn:focus-visible {
  outline: 2px solid var(--dc-teal);
  outline-offset: 2px;
}

.svg-stage__zone-btn:active {
  transform: scale(0.98);
}

.svg-stage__zone-btn__swatch {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 8px;
  border: 1px solid rgba(12, 41, 90, 0.2);
  flex-shrink: 0;
}

.svg-stage__zone-btn__label {
  line-height: 1.2;
  min-width: 0;
  max-width: 9rem;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  word-break: break-word;
}

@media (min-width: 600px) {
  .svg-stage__zone-strip {
    display: none;
  }
}

.svg-stage .placeholder {
  padding: 2rem;
  text-align: center;
  font-family: "Comfortaa", sans-serif;
  font-size: 0.875rem;
  color: var(--dc-text-muted);
  max-width: 280px;
}

/* Panel card */
.panel {
  background: var(--dc-white);
  border: 1px solid var(--dc-gray-border);
  border-radius: var(--radius);
  box-shadow: var(--dc-shadow);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  width: 100%;
}

.panel-inner {
  padding: 1.35rem 1.25rem max(1.5rem, env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  flex: 1;
}

/* —— Soft-gate demo flow (steps are optional jumps, never blocking) —— */
.cw-demo-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.2rem 0.35rem;
  margin-bottom: 0.65rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--dc-gray-border);
}

.cw-demo-flow__step {
  margin: 0;
  padding: 0.3rem 0.5rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-family: "Lexend", sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--dc-text-muted);
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.cw-demo-flow__step:hover {
  color: var(--dc-navy);
  background: rgba(27, 154, 170, 0.12);
}

.cw-demo-flow__step:focus-visible {
  outline: 2px solid var(--dc-teal);
  outline-offset: 2px;
}

.cw-demo-flow__step--current {
  color: var(--dc-navy);
  background: rgba(27, 154, 170, 0.2);
}

.cw-demo-flow__sep {
  color: var(--dc-gray-border);
  font-weight: 400;
  user-select: none;
}

.cw-demo-flow__hint {
  margin: 0 0 1.1rem;
  text-align: center;
  font-family: "Montserrat", sans-serif;
  font-size: 0.8125rem;
  font-style: italic;
  color: var(--dc-text-muted);
  line-height: 1.45;
}

/* Panel zone pickers (Customize step — replaces strip under chart) */
.panel-zone-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  margin-top: 0.15rem;
}

.panel-zone-strip--two-row-scroll {
  flex-direction: column;
  flex-wrap: wrap;
  align-content: flex-start;
  align-items: flex-start;
  max-height: 7.35rem;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  padding-bottom: 4px;
}

/* Customize — Current colors: uniform chip size (swatch + label row). */
.panel-zone-strip--two-row-scroll > .svg-stage__zone-btn {
  flex: 0 0 auto;
  width: 9.25rem;
  min-width: 9.25rem;
  max-width: 9.25rem;
  min-height: 3.3rem;
  box-sizing: border-box;
  align-items: center;
  justify-content: flex-start;
}

.panel-zone-strip--two-row-scroll > .svg-stage__zone-btn .svg-stage__zone-btn__swatch {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
}

.panel-zone-strip--two-row-scroll > .svg-stage__zone-btn .svg-stage__zone-btn__label {
  flex: 1;
  min-width: 0;
  max-width: none;
  text-align: start;
  word-break: normal;
  overflow-wrap: break-word;
}

/* —— Embed tool: sections, palette cards, zone grid, actions —— */
.cw-section {
  margin-bottom: 1.75rem;
}

.cw-section:last-of-type {
  margin-bottom: 0;
}

.cw-section-title {
  margin: 0 0 0.85rem;
  font-family: "Lexend", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--dc-navy);
  letter-spacing: 0.02em;
}

.cw-details {
  margin-top: 1.25rem;
  margin-bottom: 1.75rem;
}

.cw-details__summary {
  margin: 0 0 0.85rem;
  font-family: "Lexend", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--dc-navy);
  letter-spacing: 0.02em;
  cursor: pointer;
  list-style: none;
}

.cw-details__summary::-webkit-details-marker {
  display: none;
}

.cw-details__summary::before {
  content: "▸ ";
  display: inline-block;
  margin-right: 0.2em;
  transition: transform 0.15s ease;
}

.cw-details[open] > .cw-details__summary::before {
  transform: rotate(90deg);
}

.cw-section--yarn-photo .cw-details--yarn {
  margin-top: 0;
  margin-bottom: 0;
}

.yarn-photo__body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.cw-section--in-details {
  margin-bottom: 0;
}

.cw-remap {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--dc-gray-border);
}

.cw-remap__label {
  margin: 0 0 0.65rem;
  font-family: "Lexend", sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--dc-text-muted);
}

.cw-remap__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.cw-remap__step {
  min-width: 48px;
  min-height: 48px;
  padding: 0 0.75rem;
  font-size: 1.25rem;
  line-height: 1;
  font-weight: 700;
}

.cw-remap__offset {
  font-family: "Lexend", ui-monospace, monospace;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--dc-navy);
  min-width: 2.5ch;
  text-align: center;
}

.cw-remap__shuffle {
  min-height: 48px;
}

.palette-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

/* Horizontal strips: edge fade + slightly narrower scrollport (next column peeks). */
.cw-scroll-fade {
  position: relative;
  width: calc(100% - 1.125rem);
  max-width: calc(100% - 1.125rem);
}

.cw-scroll-fade::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 6px;
  width: min(3rem, 28%);
  pointer-events: none;
  z-index: 1;
  background: linear-gradient(
    to left,
    var(--dc-white) 0%,
    rgba(255, 255, 255, 0) 100%
  );
}

/* Max two rows; extra cards scroll horizontally (column-major stacks of 2). */
.palette-grid--two-row-scroll {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 0.75rem;
  max-height: 12.5rem;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  padding-bottom: 4px;
}

.palette-grid--two-row-scroll > .palette-card {
  flex: 0 0 auto;
  width: 148px;
  max-width: 46vw;
  box-sizing: border-box;
}

button.palette-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.55rem;
  padding: 0.65rem 0.7rem;
  margin: 0;
  border-radius: 12px;
  border: 2px solid var(--dc-gray-border);
  background: var(--dc-gray-light);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--dc-navy);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease,
    transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
}

/* First card on Colorways: jump to Photo tab (not a preset). */
button.palette-card.palette-card--upload-cta {
  align-items: stretch;
  text-align: left;
  border-color: var(--dc-teal);
  background: linear-gradient(
    160deg,
    rgba(27, 154, 170, 0.2) 0%,
    rgba(137, 209, 140, 0.16) 100%
  );
  box-shadow: 0 2px 12px rgba(27, 154, 170, 0.2);
}

button.palette-card.palette-card--upload-cta .palette-card__label {
  white-space: nowrap;
}

/* Second row: same band as .palette-card__swatches (label + row + gap). */
.palette-card__upload-icon-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  min-height: 22px;
}

button.palette-card.palette-card--upload-cta:hover {
  border-color: var(--dc-teal-hover);
  background: linear-gradient(
    160deg,
    rgba(27, 154, 170, 0.28) 0%,
    rgba(137, 209, 140, 0.22) 100%
  );
  box-shadow: var(--dc-shadow-active);
}

.palette-card__upload-emoji {
  font-size: 1.15rem;
  line-height: 1;
  flex-shrink: 0;
}

/* Download chooser */
.cw-download-chooser {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(12, 41, 90, 0.35);
}

.cw-download-chooser__card {
  width: min(420px, 100%);
  background: var(--dc-white);
  border: 1px solid var(--dc-gray-border);
  border-radius: 16px;
  box-shadow: var(--dc-shadow-active);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cw-download-chooser__title {
  font-family: "Lexend", sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--dc-navy);
  margin-bottom: 4px;
}

.cw-download-chooser__btn {
  width: 100%;
}

button.cw-btn.cw-btn--ghost {
  background: transparent;
  border: 1px solid transparent;
  color: var(--dc-text-muted);
}

button.cw-btn.cw-btn--ghost:hover {
  background: rgba(12, 41, 90, 0.06);
  color: var(--dc-navy);
}

button.palette-card:hover {
  border-color: var(--dc-teal);
  background: var(--dc-white);
  box-shadow: var(--dc-shadow);
}

button.palette-card:active {
  transform: scale(0.98);
}

button.palette-card.palette-card--active {
  border-color: var(--dc-navy);
  background: var(--dc-white);
  box-shadow: var(--dc-shadow-active);
}

.palette-card__swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  min-height: 22px;
}

.palette-card__dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(12, 41, 90, 0.18);
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.palette-card__dot--placeholder {
  background: linear-gradient(135deg, var(--dc-gray-border), var(--dc-white));
}

.palette-card__label {
  font-family: "Comfortaa", sans-serif;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.25;
}

.zone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.85rem 1rem;
}

.zone-grid--two-row-scroll {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 0.85rem 1rem;
  max-height: 15.5rem;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  padding-bottom: 4px;
}

.zone-grid--two-row-scroll > .zone-color-cell {
  flex: 0 0 auto;
  width: 132px;
  max-width: 42vw;
  box-sizing: border-box;
}

.zone-color-cell {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
  padding: 0.55rem 0.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--dc-gray-border);
  background: var(--dc-white);
}

button.zone-color-cell__trigger {
  width: 100%;
  height: 52px;
  min-height: 48px;
  padding: 0;
  border: 2px solid var(--dc-gray-border);
  border-radius: 10px;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

button.zone-color-cell__trigger:hover {
  border-color: var(--dc-teal);
  box-shadow: var(--dc-shadow);
}

button.zone-color-cell__trigger:active {
  transform: scale(0.98);
}

button.zone-color-cell__trigger:focus-visible {
  outline: 2px solid var(--dc-orange);
  outline-offset: 2px;
}

/* Photo tab: fixed card height; human color name only (matches Customize wording). */
.zone-color-cell--photo-fine-tune {
  min-height: 7.35rem;
  justify-content: flex-start;
}

.zone-color-cell--photo-fine-tune .zone-color-cell__trigger {
  flex-shrink: 0;
}

.zone-color-cell__human-name {
  font-family: "Lexend", sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--dc-navy);
  text-align: center;
  min-height: 2.4em;
  max-height: 2.4em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  word-break: break-word;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}

.zone-color-cell__meta {
  text-align: center;
}

.zone-color-cell__order {
  font-family: "Lexend", sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--dc-navy);
  margin-bottom: 0.15rem;
  text-transform: lowercase;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}

.zone-color-cell__id {
  font-family: "Lexend", sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--dc-text-muted);
  word-break: break-word;
}

button.zone-color-cell__id-btn {
  font: inherit;
  font-family: "Lexend", sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--dc-teal);
  background: transparent;
  border: none;
  padding: 0.2rem 0.35rem;
  margin: 0;
  cursor: pointer;
  border-radius: 6px;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-word;
  max-width: 100%;
  line-height: 1.3;
}

button.zone-color-cell__id-btn:hover {
  color: var(--dc-navy);
  background: rgba(27, 154, 170, 0.12);
}

button.zone-color-cell__id-btn:focus-visible {
  outline: 2px solid var(--dc-orange);
  outline-offset: 2px;
}

button.zone-color-cell__id-btn[aria-pressed="true"] {
  color: var(--dc-navy);
  background: rgba(27, 154, 170, 0.22);
  text-decoration: none;
  font-weight: 700;
}

.zone-color-cell--yarn-target {
  border-color: var(--dc-teal);
  box-shadow: var(--dc-shadow);
}

/* —— Yarn photo palette —— */
/* Spec: Secondary button — #1B9AAA teal background, white text; gutters 20px */
.cw-section--yarn-photo {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.5rem;
}

.cw-section--yarn-photo > .cw-section-title {
  margin: 0;
}

.cw-section--yarn-photo .cw-tip--in-section {
  margin: 0;
}

.yarn-photo__fine-tune-details {
  margin: 0;
  border-radius: var(--radius);
  border: 1px solid var(--dc-gray-border);
  background: var(--dc-white);
  overflow: hidden;
}

.yarn-photo__fine-tune-details__summary {
  margin: 0;
  padding: 0.65rem 0.85rem;
  font-family: "Lexend", sans-serif;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--dc-navy);
  cursor: pointer;
  list-style: none;
  background: var(--dc-gray-light);
}

.yarn-photo__fine-tune-details__summary::-webkit-details-marker {
  display: none;
}

.yarn-photo__fine-tune-details__summary::before {
  content: "▸ ";
  display: inline-block;
  margin-right: 0.25em;
  transition: transform 0.15s ease;
}

.yarn-photo__fine-tune-details[open]
  > .yarn-photo__fine-tune-details__summary::before {
  transform: rotate(90deg);
}

.yarn-photo__fine-tune-details__panel {
  padding: 0.75rem 0.65rem 0.85rem;
  border-top: 1px solid var(--dc-gray-border);
}

.yarn-photo__clear--solo {
  min-height: 48px;
}

.yarn-photo__file-row {
  margin: 0;
  padding: 0;
}

.yarn-photo__file-row--inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
}

.yarn-photo__file-label {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  vertical-align: top;
}

/* Cover only the custom button so the native file UI never sits beside it */
.yarn-photo__file-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
  font-size: 0.001px;
  z-index: 1;
}

.yarn-photo__file-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Comfortaa", sans-serif;
  font-size: 1rem;
  font-weight: 400;
  padding: 0.5rem 1.75rem;
  min-height: 48px;
  border-radius: var(--radius);
  border: 2px solid transparent;
  background: var(--dc-teal);
  color: var(--dc-white);
  box-shadow: var(--dc-shadow);
  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
}

.yarn-photo__file-label:hover .yarn-photo__file-btn {
  background: var(--dc-teal-hover);
  box-shadow: var(--dc-shadow-active);
}

.yarn-photo__file-label:active .yarn-photo__file-btn {
  transform: scale(0.98);
  box-shadow: var(--dc-shadow);
}

.yarn-photo__file-label:focus-within .yarn-photo__file-btn {
  outline: 2px solid var(--dc-orange);
  outline-offset: 2px;
}

.yarn-photo__status {
  margin: 0;
  padding-left: 24px;
  font-family: "Montserrat", sans-serif;
  font-size: 0.875rem;
  color: var(--dc-text-muted);
}

.yarn-photo__status--success {
  color: #1b5e20;
  font-style: normal;
}

.yarn-photo__swatch.yarn-photo__swatch--readonly {
  cursor: default;
  pointer-events: none;
}

.yarn-photo__error,
.yarn-photo__hint {
  margin: 0;
  padding-left: 24px;
  font-family: "Montserrat", sans-serif;
  font-size: 0.875rem;
  color: #9a2a2a;
}

.yarn-photo__hint {
  color: var(--dc-text-muted);
}

.yarn-photo__apply-row {
  margin: 0;
  padding-left: 24px;
  padding-right: 24px;
}

.yarn-photo__zone-label {
  font-family: "Lexend", sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--dc-navy);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.yarn-photo__zone-select {
  font: inherit;
  font-family: "Lexend", sans-serif;
  font-size: 0.875rem;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  border: 2px solid var(--dc-gray-border);
  background: var(--dc-white);
  color: var(--dc-navy);
  min-height: 44px;
  cursor: pointer;
}

.yarn-photo__zone-select:focus-visible {
  outline: 2px solid var(--dc-orange);
  outline-offset: 2px;
}

/* Capped track max so yarn chips stay compact (avoid 1fr stretching like full-width bars) */
.yarn-photo__swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 128px));
  gap: 0.85rem 1rem;
  margin: 0;
  padding-left: 24px;
  padding-right: 24px;
  width: 100%;
  box-sizing: border-box;
  justify-content: start;
}

/* Yarn swatches use .zone-color-cell__trigger for the same look as Customize your colors */

.yarn-photo__hex-label {
  font-family: "Lexend", sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--dc-text-muted);
  word-break: break-word;
}

.yarn-photo__swatch-cell .zone-color-cell__trigger {
  height: 48px;
  min-height: 44px;
}

.yarn-photo__clear {
  margin: 0;
  min-height: 48px;
  flex-shrink: 0;
}

/* Direct (consumer) view: ?view=direct — no Project/Chart demo toggle */
.app--direct .demo-view-toggle {
  display: none;
}

.cw-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 0.25rem;
}

.cw-actions--direct {
  flex-direction: column;
}

.cw-actions-direct__cta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

.cw-direct-print-tip {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  background: var(--dc-white);
  border: 1px solid var(--dc-gray-border);
  box-shadow: var(--dc-shadow);
}

.cw-direct-print-tip p {
  margin: 0 0 0.65rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--dc-text-muted);
}

.cw-direct-print-tip p:last-child {
  margin-bottom: 0;
}

.cw-direct-print-tip__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.75rem;
}

.cw-direct-print-tip__dismiss {
  font-size: 0.85rem;
}

/* Save celebration (?view=direct) */
.cw-direct-celebrate-root {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  pointer-events: auto;
}

.cw-direct-celebrate-confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.cw-direct-confetti-piece {
  position: absolute;
  top: 38%;
  left: var(--cx, 50%);
  width: 7px;
  height: 10px;
  border-radius: 2px;
  background: var(--cc, var(--dc-teal));
  opacity: 0.95;
  transform: translateX(-50%);
  animation: cw-direct-confetti-fall 1.35s ease-out forwards;
  animation-delay: var(--cd, 0s);
}

@keyframes cw-direct-confetti-fall {
  0% {
    transform: translateX(-50%) translateY(0) rotate(0deg) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateX(-50%) translateY(140px) rotate(680deg) scale(0.5);
    opacity: 0;
  }
}

.cw-direct-celebrate-backdrop {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: 0;
  cursor: pointer;
  display: block;
  background: radial-gradient(
    circle at 50% 42%,
    rgba(137, 209, 140, 0.42) 0%,
    rgba(255, 255, 255, 0.92) 55%,
    rgba(255, 255, 255, 0.97) 100%
  );
  animation: cw-direct-celebrate-fade 2s ease forwards;
}

@keyframes cw-direct-celebrate-fade {
  0% {
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

.cw-direct-celebrate-card {
  position: relative;
  z-index: 2;
  max-width: 22rem;
  text-align: center;
  padding: 1.25rem 1.35rem 1.35rem;
  background: var(--dc-white);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(12, 41, 90, 0.18);
  border: 2px solid var(--dc-teal);
  pointer-events: auto;
  animation: cw-direct-celebrate-pop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes cw-direct-celebrate-pop {
  0% {
    transform: scale(0.4);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.cw-direct-celebrate-check {
  font-size: clamp(2.25rem, 10vw, 3rem);
  line-height: 1;
  color: var(--dc-green);
  text-shadow: 0 2px 12px rgba(137, 209, 140, 0.45);
  font-weight: 700;
}

.cw-direct-celebrate-title {
  margin: 0.45rem 0 0;
  font-family: "Comfortaa", sans-serif;
  font-size: clamp(1.15rem, 4vw, 1.35rem);
  font-weight: 700;
  color: var(--dc-navy);
}

.cw-direct-celebrate-subhead {
  margin: 0.55rem 0 0;
  font-family: "Lexend", system-ui, sans-serif;
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--dc-navy);
}

.cw-direct-celebrate-body {
  margin: 0.55rem 0 0;
  font-family: "Lexend", system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 300;
  line-height: 1.5;
  color: var(--dc-text-muted);
}

.cw-direct-celebrate-body--second {
  margin-top: 0.45rem;
}

/* Subtle peek to gallery — row-scarf marker; quieter than primary CTA */
a.cw-direct-celebrate-gallery-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.25rem auto 0;
  padding: 0;
  line-height: 0;
  text-decoration: none;
  border-radius: 50%;
  background: transparent;
  border: none;
  opacity: 0.72;
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
}

a.cw-direct-celebrate-gallery-mark:hover {
  opacity: 1;
  transform: scale(1.04);
}

a.cw-direct-celebrate-gallery-mark:focus-visible {
  opacity: 1;
  outline: 2px solid var(--dc-teal);
  outline-offset: 3px;
}

img.cw-direct-celebrate-gallery-mark__img {
  width: 18px;
  height: 18px;
  display: block;
  pointer-events: none;
  filter: drop-shadow(0 1px 1px rgba(12, 41, 90, 0.08));
}

.cw-direct-celebrate-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

.cw-direct-celebrate-actions .cw-btn,
.cw-direct-celebrate-actions a.cw-btn {
  width: 100%;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  line-height: 1.25;
  min-height: 48px;
  padding: 0.65rem 1rem;
}

@media (min-width: 480px) {
  .cw-actions:not(.cw-actions--direct) {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
  }

  .cw-actions:not(.cw-actions--direct) .cw-btn {
    flex: 1;
    min-width: 0;
  }
}

.cw-btn {
  font-family: "Comfortaa", sans-serif;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.65rem 1rem;
  min-height: 48px;
  border-radius: 12px;
  border: 2px solid transparent;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease,
    transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.cw-btn:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.cw-btn--secondary {
  background: var(--dc-white);
  border-color: var(--dc-navy);
  color: var(--dc-navy);
  box-shadow: var(--dc-shadow);
}

.cw-btn--secondary:hover:not(:disabled) {
  border-color: var(--dc-teal);
  color: var(--dc-teal);
  box-shadow: var(--dc-shadow-active);
}

/* After .cw-btn so min-height / padding do not force the 48px touch target */
button.cw-btn.cw-chart-reset-fab {
  position: absolute;
  right: 6px;
  bottom: 6px;
  z-index: 6;
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  border-radius: 50%;
  font-size: 0.85rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 6px rgba(12, 41, 90, 0.18);
  opacity: 0.92;
}

button.cw-btn.cw-chart-reset-fab:hover:not(:disabled) {
  opacity: 1;
  border-color: var(--dc-teal);
  color: var(--dc-teal);
}

.cw-btn--primary {
  background: var(--dc-navy);
  border-color: var(--dc-navy);
  color: var(--dc-white);
  box-shadow: var(--dc-shadow);
}

.cw-btn--primary:hover:not(:disabled) {
  background: var(--dc-teal);
  border-color: var(--dc-teal);
  box-shadow: var(--dc-shadow-active);
}

.cw-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.panel-fold {
  margin-bottom: 0.35rem;
}

.panel-fold:last-child {
  margin-bottom: 0;
}

/* Section header: Lexend Bold 16px, navy (spec) */
.panel-fold-summary {
  font-family: "Lexend", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.02em;
  color: var(--dc-navy);
  cursor: pointer;
  list-style: none;
  padding: 0.45rem 0;
  margin: 0 0 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  border-bottom: 2px solid transparent;
}

.panel-fold-summary::-webkit-details-marker {
  display: none;
}

.panel-fold-summary::after {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--dc-teal);
  border-bottom: 2px solid var(--dc-teal);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
  flex-shrink: 0;
  opacity: 0.9;
}

.panel-fold[open] > .panel-fold-summary {
  margin-bottom: 0.5rem;
  border-bottom-color: var(--dc-navy);
}

.panel-fold[open] > .panel-fold-summary::after {
  transform: rotate(-135deg);
}

.panel-fold-body > .preset-row:last-child,
.panel-fold-body > .export-row:last-child {
  margin-bottom: 0;
}

@media (min-width: 841px) {
  .panel-fold {
    margin-bottom: 0;
  }

  .panel-fold + .panel-fold {
    margin-top: 1.15rem;
  }

  .panel-fold-summary {
    pointer-events: none;
    cursor: default;
    padding: 0;
    margin: 0 0 0.65rem;
    border-bottom: none;
  }

  .panel-fold-summary::after {
    display: none;
  }

  .panel-fold[open] > .panel-fold-summary {
    margin-bottom: 0.65rem;
  }
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.15rem;
}

/* Presets: tab-like — inactive gray, active navy + underline feel */
button.preset {
  font-family: "Comfortaa", sans-serif;
  font-size: 0.8125rem;
  font-weight: 400;
  cursor: pointer;
  padding: 0.45rem 0.8rem;
  border-radius: 8px;
  border: 1px solid var(--dc-gray-border);
  background: var(--dc-gray-light);
  color: var(--dc-navy);
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease,
    box-shadow 0.18s ease, transform 0.12s ease;
}

button.preset:hover {
  border-color: var(--dc-teal);
  color: var(--dc-teal);
  background: var(--dc-white);
}

button.preset:active {
  transform: scale(0.98);
  box-shadow: var(--dc-shadow-active);
}

/* Active = primary navy (spec) */
button.preset.active {
  background: var(--dc-navy);
  color: var(--dc-white);
  border-color: var(--dc-navy);
  box-shadow: var(--dc-shadow-active);
}

/* Export = primary navy; hover to teal (spec example) */
button.export {
  font-family: "Comfortaa", sans-serif;
  font-size: 0.8125rem;
  font-weight: 400;
  cursor: pointer;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  border: 2px solid var(--dc-navy);
  background: var(--dc-navy);
  color: var(--dc-white);
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease,
    transform 0.12s ease;
  box-shadow: var(--dc-shadow);
}

button.export:hover {
  background: var(--dc-teal);
  border-color: var(--dc-teal);
  box-shadow: var(--dc-shadow-active);
}

button.export:active {
  transform: scale(0.98);
}

button.export:disabled {
  background: var(--dc-disabled-bg);
  border-color: var(--dc-gray-border);
  color: var(--dc-disabled-text);
  cursor: not-allowed;
  box-shadow: none;
  opacity: 1;
}

@media (max-width: 840px) {
  button.preset,
  button.export {
    min-height: 44px;
    padding: 0.5rem 0.9rem;
  }
}

.zone-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.zone-list-item {
  list-style: none;
}

button.zone-item {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.55rem 0.65rem;
  background: var(--dc-white);
  border-radius: var(--radius);
  border: 1px solid var(--dc-gray-border);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  text-align: left;
  font-family: "Comfortaa", sans-serif;
  font-size: 0.75rem;
  color: var(--dc-text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button.zone-item:hover {
  border-color: var(--dc-teal);
  box-shadow: var(--dc-shadow);
}

button.zone-item:active {
  border-color: var(--dc-orange);
  box-shadow: var(--dc-shadow-active);
}

button.zone-item:focus-visible {
  outline: 2px solid var(--dc-orange);
  outline-offset: 2px;
}

.zone-swatch {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 2px solid var(--dc-gray-border);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.zone-meta {
  min-width: 0;
}

.zone-id {
  display: block;
  font-family: "Lexend", sans-serif;
  font-size: 0.75rem;
  font-weight: 300;
  color: var(--dc-text-muted);
  margin-bottom: 0.15rem;
}

.zone-hex {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--dc-navy);
}

.zone-chevron {
  display: block;
  width: 0.4rem;
  height: 0.4rem;
  border-right: 2px solid var(--dc-teal);
  border-bottom: 2px solid var(--dc-teal);
  transform: rotate(-45deg);
  opacity: 0.85;
  margin-right: 0.15rem;
  flex-shrink: 0;
}

/* —— Color picker modal (spec: white, gray border; header navy; body teal accents) —— */
.cp-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(12, 41, 90, 0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1rem;
}

.cp-backdrop--sheet {
  align-items: flex-end;
  justify-content: stretch;
  padding: 0;
  padding-top: min(20vh, 6rem);
}

.cp-popover {
  position: fixed;
  z-index: 100001;
  width: min(280px, calc(100vw - 2rem));
  padding: 1rem;
  border-radius: 12px;
  background: var(--dc-white);
  border: 1px solid var(--dc-gray-border);
  box-shadow: 0 16px 48px rgba(12, 41, 90, 0.2);
  color: var(--dc-navy);
}

.cp-popover--sheet {
  left: 0 !important;
  right: 0;
  bottom: 0;
  top: auto !important;
  width: 100% !important;
  max-width: none;
  max-height: min(88dvh, 520px);
  overflow-x: hidden;
  overflow-y: auto;
  border-radius: 16px 16px 0 0;
  padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -8px 40px rgba(12, 41, 90, 0.18);
}

.cp-title {
  margin: 0 0 0.75rem;
  padding: 0 0 0.5rem;
  border-bottom: 1px solid var(--dc-gray-border);
  font-family: "Lexend", sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dc-navy);
}

.cp-sv-wrap {
  margin-bottom: 0.65rem;
}

.cp-sv-plane {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  max-height: 220px;
  border-radius: 8px;
  overflow: hidden;
  touch-action: none;
  cursor: crosshair;
  box-shadow: inset 0 0 0 1px var(--dc-gray-border);
  background: linear-gradient(to top, #000, transparent),
    linear-gradient(to right, #fff, hsl(var(--cp-hue, 0), 100%, 50%));
}

.cp-sv-plane:focus-visible {
  outline: 2px solid var(--dc-orange);
  outline-offset: 2px;
}

.cp-sv-thumb {
  position: absolute;
  width: 20px;
  height: 20px;
  margin: 0;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.25);
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: grab;
  box-sizing: border-box;
}

.cp-sv-thumb:active {
  cursor: grabbing;
}

.cp-hue-wrap {
  margin-bottom: 0.65rem;
}

.cp-hue {
  display: block;
  width: 100%;
  height: 14px;
  border-radius: 7px;
  appearance: none;
  cursor: pointer;
  background: linear-gradient(
    to right,
    #f00,
    #ff0,
    #0f0,
    #0ff,
    #00f,
    #f0f,
    #f00
  );
}

.cp-hue::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--dc-navy);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.cp-hue::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--dc-navy);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.cp-preview-row {
  display: flex;
  align-items: stretch;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.cp-preview-swatch {
  width: 44px;
  min-height: 44px;
  border-radius: 10px;
  border: 2px solid var(--dc-gray-border);
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.cp-hex-row {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.cp-hex-label {
  font-family: "Lexend", sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dc-teal);
}

.cp-hex-input {
  font-family: ui-monospace, monospace;
  font-size: max(16px, 0.95rem);
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  border: 2px solid var(--dc-navy);
  background: var(--dc-gray-light);
  color: var(--dc-navy);
  width: 100%;
  box-sizing: border-box;
}

.cp-hex-input:focus {
  outline: none;
  border-color: var(--dc-teal);
  box-shadow: 0 0 0 3px rgba(27, 154, 170, 0.25);
}

.cp-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
}

.cp-btn {
  font-family: "Comfortaa", sans-serif;
  font-size: 0.8125rem;
  cursor: pointer;
  padding: 0.5rem 0.95rem;
  border-radius: 8px;
  border: 2px solid transparent;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.cp-btn-secondary {
  background: var(--dc-teal);
  border-color: var(--dc-teal);
  color: var(--dc-white);
}

.cp-btn-secondary:hover {
  background: var(--dc-teal-hover);
  border-color: var(--dc-teal-hover);
}

.cp-btn-primary {
  background: var(--dc-navy);
  border-color: var(--dc-navy);
  color: var(--dc-white);
  font-weight: 700;
}

.cp-btn-primary:hover {
  background: var(--dc-teal);
  border-color: var(--dc-teal);
}

.empty-state {
  font-family: "Comfortaa", sans-serif;
  color: var(--dc-text-muted);
  font-size: 0.8125rem;
  line-height: 1.55;
}
