:root {
  --cpe-cream: #fbf5ef;
  --cpe-cream-2: #fffaf6;
  --cpe-pink: #f2c2d3;
  --cpe-pink-2: #ffe7ef;
  --cpe-berry: #6f1238;
  --cpe-berry-dark: #3f0a22;
  --cpe-plum: #863d60;
  --cpe-green: #4e795e;
  --cpe-coral: #c76c49;
  --cpe-ink: #371722;
  --cpe-border: rgba(111,18,56,.72);
  --cpe-shadow: 0 12px 28px rgba(63,10,34,.12);
  --cpe-radius: 18px;
}

body.cpe-pattern-page {
  background: var(--cpe-cream);
  color: var(--cpe-ink);
}
body.cpe-pattern-page .site-main,
body.cpe-pattern-page main { max-width: none; }
body.cpe-pattern-page .content-area,
body.cpe-pattern-page .site-content { width: 100%; }

.cpe-wrap { padding: 32px 16px 90px; }
.cpe-container { width: min(1240px, 100%); margin: 0 auto; }

.cpe-hero { text-align: center; padding: 30px 0 18px; }
.cpe-badges { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; margin-bottom: 24px; }
.cpe-badge { display: inline-flex; align-items: center; gap: 8px; background: var(--cpe-pink-2); border: 2px dashed var(--cpe-berry-dark); border-radius: 999px; padding: 10px 20px; font-weight: 800; transform: rotate(-2deg); box-shadow: var(--cpe-shadow); }
.cpe-badge:nth-child(2) { transform: rotate(2deg); }
.cpe-badge:nth-child(3) { transform: rotate(-1deg); }
.cpe-hero h1 { color: var(--cpe-berry-dark); font-size: clamp(2rem, 5vw, 4rem); line-height: 1.05; margin: 0 auto 26px; max-width: 1000px; letter-spacing: -0.035em; text-wrap: balance; }

.cpe-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-bottom: 30px; }
.cpe-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 20px; border-radius: 999px; border: 2px solid var(--cpe-berry); color: var(--cpe-berry-dark); background: #fff; font-weight: 800; text-decoration: none; cursor: pointer; box-shadow: 0 7px 16px rgba(63,10,34,.10); transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.cpe-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(63,10,34,.16); }
.cpe-btn-primary { background: var(--cpe-berry); color: #fff; }
.cpe-btn-jump { background: var(--cpe-plum); color: #fff; }

.cpe-hero-image { position: relative; max-width: 760px; margin: 0 auto; border: 3px solid var(--cpe-berry-dark); border-radius: 26px; overflow: hidden; box-shadow: 0 20px 45px rgba(63,10,34,.18); background: #fff; }
.cpe-hero-image img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.cpe-pin-chip { position: absolute; left: 16px; top: 16px; background: #e51e3f; color: white; border-radius: 999px; padding: 7px 12px; font-weight: 800; font-size: .85rem; }

/* Quick-fact chip row directly under the hero image */
.cpe-chip-row { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin: 26px 0 6px; }
.cpe-chip { background: #fff4df; border: 2px solid var(--cpe-berry-dark); border-radius: 16px; padding: 12px 22px; text-align: center; min-width: 120px; box-shadow: 0 8px 18px rgba(0,0,0,.08); }
.cpe-chip strong { display: block; color: var(--cpe-berry-dark); font-size: 1.15rem; }
.cpe-chip span { font-size: .78rem; opacity: .75; text-transform: uppercase; letter-spacing: .04em; }

/* Highlight band: three descriptive cards on a full-bleed maroon background */
.cpe-highlight-band { margin: 32px calc(50% - 50vw) 0; padding: 34px max(16px, calc((100vw - 1240px)/2)); background: var(--cpe-berry); display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.cpe-highlight-card { border: 2px solid var(--cpe-berry-dark); border-radius: 18px; padding: 22px; box-shadow: 0 8px 18px rgba(0,0,0,.10); }
.cpe-highlight-icon { font-size: 26px; margin-bottom: 8px; }
.cpe-highlight-card h3 { margin: 0 0 8px; color: var(--cpe-berry-dark); font-size: 1.15rem; }
.cpe-highlight-card p { margin: 0; line-height: 1.55; font-size: .93rem; }
.cpe-swatch-yellow { background: #fdf3cf; }
.cpe-swatch-green { background: #dcf1e4; }
.cpe-swatch-purple { background: #ecdffb; }
.cpe-swatch-pink { background: var(--cpe-pink-2); }

.cpe-toc { margin: 12px auto 38px; background: #fff; border: 1px solid rgba(111,18,56,.22); border-radius: 12px; overflow: hidden; box-shadow: 0 6px 15px rgba(63,10,34,.06); }
.cpe-toc-title { padding: 12px 16px; font-weight: 800; color: var(--cpe-berry); background: var(--cpe-pink-2); }
.cpe-toc-links { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; padding: 12px 16px; }
.cpe-toc-links a { font-size: .9rem; color: var(--cpe-berry); font-weight: 700; }

.cpe-main-grid { display: grid; grid-template-columns: minmax(0, 1fr) 315px; gap: 22px; align-items: start; }
.cpe-article { display: grid; gap: 18px; }
.cpe-card, .cpe-wide-card { background: var(--cpe-cream-2); border: 2px solid var(--cpe-border); border-radius: var(--cpe-radius); padding: 24px; box-shadow: 0 7px 18px rgba(63,10,34,.08); }
.cpe-card h2, .cpe-wide-card h2 { color: var(--cpe-berry-dark); margin: 0 0 15px; font-size: clamp(1.35rem, 2.5vw, 2rem); }
.cpe-card p:last-child { margin-bottom: 0; }
.cpe-card p, .cpe-card li { line-height: 1.72; }
.cpe-inline-figure { position: relative; margin: 18px 0 0; }
.cpe-inline-image, .cpe-inline-figure img { display: block; width: 100%; max-height: 560px; object-fit: cover; border-radius: 14px; }

/* Gallery grid used inside "Why You'll Love It" */
.cpe-gallery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 18px; }
.cpe-gallery-grid .cpe-inline-figure { margin: 0; }
.cpe-gallery-grid img { height: 220px; }

/* Common mistakes list with an X mark */
.cpe-x-list { display: grid; gap: 10px; }
.cpe-x-item { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; line-height: 1.6; }
.cpe-x-mark { color: var(--cpe-coral); font-weight: 900; }

.cpe-sidebar { display: grid; gap: 18px; position: sticky; top: 20px; }
.cpe-author-card { text-align: center; }
.cpe-author-avatar img { border-radius: 50%; border: 3px solid var(--cpe-pink); }
.cpe-author-card h3 { color: var(--cpe-berry); margin: 10px 0 5px; }
.cpe-related-list { display: grid; gap: 10px; }
.cpe-related-item { display: grid; grid-template-columns: 70px 1fr; gap: 10px; align-items: center; text-decoration: none; border: 1px dashed var(--cpe-pink); border-radius: 12px; padding: 8px; background: #fff; }
.cpe-related-item img { width: 70px; height: 70px; object-fit: cover; border-radius: 10px; }
.cpe-related-item span { color: var(--cpe-berry); font-weight: 800; line-height: 1.2; }
.cpe-muted { opacity: .7; }

.cpe-pattern-shell { margin-top: 52px; padding: 36px; background: #fff2f7; border: 2px dashed #f3a3bf; border-radius: 22px; }
.cpe-pattern-intro { text-align: center; max-width: 800px; margin: 0 auto 26px; }
.cpe-eyebrow { color: var(--cpe-plum); font-size: .78rem; font-weight: 900; letter-spacing: .16em; margin-bottom: 8px; text-transform: uppercase; }
.cpe-eyebrow-pill { display: inline-block; background: #fff; border: 1px solid var(--cpe-pink); border-radius: 999px; padding: 5px 16px; font-weight: 900; color: var(--cpe-berry); font-size: .8rem; letter-spacing: .1em; margin-bottom: 10px; }
.cpe-pattern-intro h2 { color: var(--cpe-berry-dark); font-size: clamp(1.8rem, 4vw, 3rem); margin: 0 0 10px; }
.cpe-pattern-summary { max-width: 720px; margin: 0 auto 16px; line-height: 1.7; }
.cpe-mini-meta { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.cpe-mini-meta span { background: #fff; border: 1px solid var(--cpe-pink); border-radius: 999px; padding: 6px 11px; font-size: .88rem; }
.cpe-mini-pill { background: var(--cpe-plum) !important; color: #fff; border-color: var(--cpe-plum) !important; font-weight: 800; }
.cpe-pattern-grid { display: grid; grid-template-columns: minmax(0,1fr) 290px; gap: 22px; }
.cpe-pattern-card, .cpe-abbr-card { background: #fff8fb; border: 1px solid rgba(111,18,56,.20); border-radius: 18px; padding: 22px; box-shadow: 0 6px 14px rgba(63,10,34,.06); }
.cpe-pattern-card + .cpe-pattern-card { margin-top: 18px; }
.cpe-pattern-card h3, .cpe-abbr-card h3 { color: var(--cpe-berry); margin: 0 0 16px; }
.cpe-group-label { color: var(--cpe-plum); font-weight: 900; letter-spacing: .03em; margin: 0 0 12px; }
.cpe-group-label-spaced { margin-top: 22px; }
.cpe-list { display: grid; gap: 8px; }
.cpe-list-row { display: grid; grid-template-columns: 32px 1fr; align-items: start; gap: 8px; border: 1px solid #f2cad7; border-radius: 10px; background: #fff; padding: 10px 12px; line-height: 1.5; }
.cpe-number { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--cpe-berry); color: white; font-size: .72rem; font-weight: 800; }
.cpe-abbr-card { position: sticky; top: 20px; }
.cpe-abbr-list { display: grid; gap: 9px; }
.cpe-abbr-row { display: grid; grid-template-columns: 26px 1fr; align-items: start; gap: 9px; line-height: 1.5; }
.cpe-tips { display: grid; gap: 9px; }
.cpe-tips > div { background: #fff7ce; border-left: 4px solid #e2b52f; border-radius: 9px; padding: 10px 12px; }
.cpe-note-box { margin-top: 15px; padding: 14px; border-radius: 10px; background: #f0f9f1; border: 1px solid #a9d0ae; }

/* Progress tracker card, sitting under materials/tools */
.cpe-progress-card h3 { margin-bottom: 12px; }
.cpe-progress { width: 100%; }
.cpe-progress-track { height: 14px; background: #f2cedc; border-radius: 999px; overflow: hidden; }
.cpe-progress-track span { display: block; height: 100%; width: 0; background: var(--cpe-berry); border-radius: inherit; transition: width .25s ease; }
.cpe-progress-label { display: block; text-align: center; font-weight: 800; color: var(--cpe-berry); margin-top: 8px; }

/* Info callout boxes (Overview & Gauge, and inline round notes) */
.cpe-info-list { display: grid; gap: 12px; }
.cpe-info-box { background: #fff; border: 1px solid #f2cad7; border-radius: 12px; padding: 14px 16px; line-height: 1.65; }
.cpe-info-label { display: block; color: var(--cpe-plum); font-weight: 900; margin-bottom: 4px; }

.cpe-instructions-section { margin-top: 44px; }
.cpe-instructions-header { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin-bottom: 18px; }
.cpe-instructions-header h2 { margin: 0; color: var(--cpe-berry-dark); font-size: clamp(2rem, 4vw, 3rem); }

.cpe-pattern-section { margin-bottom: 34px; }
.cpe-section-title { color: var(--cpe-berry-dark); text-align: center; font-size: 1.3rem; margin: 0 0 16px; }
.cpe-steps { display: grid; gap: 14px; }
.cpe-step { background: #fff; border: 2px solid rgba(111,18,56,.35); border-radius: 16px; padding: 16px 20px; box-shadow: 0 5px 14px rgba(63,10,34,.06); }
.cpe-step.is-complete { opacity: .72; background: #f2f8f3; border-color: #8eb398; }
.cpe-step-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.cpe-step h4 { margin: 0; color: var(--cpe-berry-dark); font-size: 1.1rem; }
.cpe-step-body { line-height: 1.75; margin-top: 8px; }
.cpe-check { border: 2px solid var(--cpe-berry); background: #fff; color: var(--cpe-berry); width: 38px; height: 38px; border-radius: 10px; font-size: 1.1rem; cursor: pointer; flex: 0 0 auto; }
.cpe-step.is-complete .cpe-check { background: var(--cpe-green); color: #fff; border-color: var(--cpe-green); }
.cpe-round-info { margin: 4px 0; }
.cpe-empty { padding: 22px; border: 2px dashed var(--cpe-pink); border-radius: 16px; }

/* Bulleted lists used for Assembly Instructions and Important Notes */
.cpe-bullet-list { display: grid; gap: 10px; margin-top: 6px; }
.cpe-bullet-item { display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: start; line-height: 1.65; background: #fff; border: 1px solid #f2cad7; border-radius: 12px; padding: 12px 14px; }
.cpe-bullet-icon { font-size: 1rem; }

.cpe-wide-card { margin-top: 20px; }
.cpe-faq { margin-top: 26px; text-align: left; }
.cpe-faq-heading { text-align: center; margin-bottom: 22px; }
.cpe-faq-heading h2 { margin: 0; color: var(--cpe-berry-dark); font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.05; }
.cpe-faq-item { background: #fff7ce; border-radius: 14px; padding: 16px 18px; margin-bottom: 12px; }
.cpe-faq-item summary { cursor: pointer; font-weight: 800; color: var(--cpe-berry-dark); }
.cpe-faq-item[open] { background: #eaf7ec; }
.cpe-faq-item > div { padding-top: 10px; line-height: 1.7; }

.cpe-footer-cta { text-align: center; margin-top: 44px; padding: 36px 20px; background: var(--cpe-pink-2); border-radius: 22px; border: 2px dashed #e698b6; }
.cpe-footer-cta h2 { color: var(--cpe-berry-dark); margin: 0 0 10px; }
.cpe-footer-cta p { margin: 0 auto 18px; max-width: 660px; }

.cpe-wrap button:focus-visible, .cpe-wrap a:focus-visible, .cpe-wrap summary:focus-visible { outline: 3px solid #f0a400; outline-offset: 3px; }

@media (max-width: 980px) {
  .cpe-main-grid, .cpe-pattern-grid { grid-template-columns: 1fr; }
  .cpe-sidebar, .cpe-abbr-card { position: static; }
  .cpe-highlight-band { grid-template-columns: 1fr; }
  .cpe-gallery-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .cpe-wrap { padding: 18px 12px 60px; }
  .cpe-badges { gap: 8px; }
  .cpe-badge { padding: 8px 13px; }
  .cpe-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .cpe-btn { width: 100%; padding: 11px 12px; font-size: .9rem; }
  .cpe-btn-jump { grid-column: 1 / -1; }
  .cpe-chip-row { gap: 10px; }
  .cpe-chip { min-width: 92px; padding: 10px 14px; }
  .cpe-toc-links { justify-content: flex-start; }
  .cpe-pattern-shell { padding: 18px; }
  .cpe-instructions-header { display: grid; }
}

@media print {
  .cpe-badges, .cpe-actions, .cpe-chip-row, .cpe-highlight-band, .cpe-toc, .cpe-sidebar, .cpe-pin-chip, .cpe-footer-cta, .cpe-progress-card, .cpe-check { display: none !important; }
  .cpe-wrap { padding: 0; }
  .cpe-main-grid, .cpe-pattern-grid { grid-template-columns: 1fr; }
  .cpe-card, .cpe-pattern-card, .cpe-abbr-card, .cpe-step { box-shadow: none; break-inside: avoid; }
  body.cpe-pattern-page { background: white; }
}
