/* Compacked configurator — everything scoped under .ccfg so the theme is untouched. */
.ccfg {
  --ccfg-teal: #35b5ae;
  --ccfg-teal-strong: #1f7a75;
  --ccfg-teal-soft: #e6f5f4;
  --ccfg-ink: #1d2327;
  --ccfg-muted: #56626c;
  --ccfg-line: #dde3e8;
  --ccfg-bg: #f6f8f9;
  --ccfg-warn: #8a5a00;
  --ccfg-warn-bg: #fff6e0;
  --ccfg-err: #b42318;
  --ccfg-radius: 12px;
  color: var(--ccfg-ink);
  font-family: Montserrat, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.ccfg *, .ccfg *::before, .ccfg *::after { box-sizing: border-box; }
/* neutralise theme-wide form/button styles. :where() keeps this at one-class specificity, so it beats the
   theme's bare element selectors but loses to our own component classes declared below. */
.ccfg :where(button, input, select, textarea) {
  font: inherit; color: inherit; letter-spacing: normal; text-transform: none; margin: 0;
  box-shadow: none; text-shadow: none; min-height: 0; width: auto;
}
.ccfg :where(button) { background: none; border: 0; padding: 0; cursor: pointer; border-radius: 0; line-height: inherit; }
.ccfg button:disabled { cursor: not-allowed; }
.ccfg :focus-visible { outline: 3px solid var(--ccfg-teal-strong); outline-offset: 2px; }
.ccfg :where(h2, h3, p, dl, dd, ol) { margin: 0; padding: 0; }
.ccfg [hidden] { display: none !important; }
.ccfg-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- layout ---------- */
.ccfg-app {
  display: grid; grid-template-columns: minmax(360px, 440px) 1fr; min-height: min(860px, 100vh);
  background: #fff; border: 1px solid var(--ccfg-line); border-radius: var(--ccfg-radius);
  overflow: clip; /* not hidden: hidden creates a scroll container and breaks the sticky mobile nav */
}
.ccfg-panel { display: flex; flex-direction: column; border-right: 1px solid var(--ccfg-line); min-width: 0; max-height: min(860px, 100vh); }
.ccfg-stage { position: relative; background: var(--ccfg-bg); min-height: 420px; }
.ccfg-preview { position: absolute; inset: 0; }
.ccfg-preview canvas { width: 100%; height: 100%; display: block; cursor: grab; }
.ccfg-preview.is-2d { display: grid; place-items: center; padding: 24px; }
.ccfg-preview.is-2d svg { width: 100%; max-width: 680px; height: auto; }

.ccfg-toolbar { display: flex; flex-direction: column; gap: 8px; padding: 18px 24px 0; }
.ccfg-toolbar-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px; }
.ccfg-brand { font-weight: 700; color: var(--ccfg-teal-strong); text-transform: uppercase; letter-spacing: .06em; font-size: 13px; }
.ccfg-tools { display: flex; gap: 8px; white-space: nowrap; }
.ccfg-intro { font-size: 14px; color: var(--ccfg-muted); line-height: 1.45; padding-bottom: 16px; border-bottom: 1px solid var(--ccfg-line); }

/* step tracker: numbered circles joined by a line that fills as steps are completed */
.ccfg-progress { display: flex; list-style: none; padding: 22px 24px 6px; margin: 0; }
.ccfg-progress li { flex: 1; position: relative; }
.ccfg-progress li + li::before {
  content: ""; position: absolute; top: 16px; left: -50%; width: 100%; height: 3px; background: var(--ccfg-line); border-radius: 2px;
}
.ccfg-progress li.is-done + li::before { background: var(--ccfg-teal-strong); }
.ccfg-progress button { position: relative; z-index: 1; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--ccfg-ink); }
.ccfg-progress button:disabled { color: #7d8790; }
.ccfg-dot {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: 700;
  background: #fff; border: 2px solid #b9c3cb; color: #6b7680; transition: background .15s, box-shadow .15s;
}
.ccfg-progress button:not(:disabled):hover .ccfg-dot { border-color: var(--ccfg-teal-strong); }
.ccfg-progress .is-done .ccfg-dot { background: var(--ccfg-teal-soft); border-color: var(--ccfg-teal-strong); color: var(--ccfg-teal-strong); }
.ccfg-progress .is-current .ccfg-dot { background: var(--ccfg-teal-strong); border-color: var(--ccfg-teal-strong); color: #fff; box-shadow: 0 0 0 5px var(--ccfg-teal-soft); }
.ccfg-progress .is-current button { color: var(--ccfg-teal-strong); font-weight: 700; }
.ccfg-btn-sm { padding: 7px 14px; font-size: 13px; }

.ccfg-body { flex: 0 1 auto; overflow-y: auto; /* Next sits right under the content; long steps still scroll */ padding: 20px 24px 24px; display: flex; flex-direction: column; gap: 16px; }
.ccfg-stepnum { font-size: 12px; color: var(--ccfg-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.ccfg-h2 { font-size: 24px; line-height: 1.2; font-weight: 700; margin-top: -10px; }
.ccfg-h2:focus { outline: none; }
.ccfg-h3 { font-size: 15px; font-weight: 700; }
.ccfg-section { display: flex; flex-direction: column; gap: 10px; }

.ccfg-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 24px; border-top: 1px solid var(--ccfg-line); background: #fff; }
.ccfg-nav-btns { display: flex; gap: 8px; margin-left: auto; }
.ccfg-mini-price { display: none; font-weight: 700; color: var(--ccfg-teal-strong); text-align: left; }
.ccfg-helpline { padding: 0 24px 14px; font-size: 13px; color: var(--ccfg-muted); }
.ccfg-helpline a { color: var(--ccfg-teal-strong); font-weight: 600; }

/* ---------- controls ---------- */
.ccfg-btn { display: inline-flex; align-items: center; justify-content: center; padding: 12px 22px; border-radius: 999px; font-weight: 600; font-size: 15px; transition: background .15s, transform .1s; }
.ccfg-btn:active { transform: translateY(1px); }
.ccfg-btn-primary { background: var(--ccfg-teal-strong); color: #fff; }
.ccfg-btn-primary:hover { background: #18645f; }
.ccfg-btn-primary[aria-disabled="true"] { background: #8fb9b6; }
.ccfg-btn-ghost { border: 1.5px solid var(--ccfg-line); color: var(--ccfg-ink); background: #fff; }
.ccfg-btn-ghost:hover { border-color: var(--ccfg-teal-strong); }
.ccfg-btn-send { width: 100%; padding: 15px; font-size: 16px; }
.ccfg-btn-send:disabled { opacity: .7; }
.ccfg-link { color: var(--ccfg-teal-strong); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; font-size: 14px; }

.ccfg-cards { display: grid; gap: 10px; }
.ccfg-cols-2 { grid-template-columns: repeat(2, 1fr); }
.ccfg-cols-4 { grid-template-columns: repeat(4, 1fr); }
.ccfg-card {
  display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 12px; border: 1.5px solid var(--ccfg-line);
  border-radius: var(--ccfg-radius); background: #fff; transition: border-color .15s, box-shadow .15s; min-width: 0;
}
.ccfg-cols-1 .ccfg-card { flex-direction: row; align-items: center; gap: 12px; }
.ccfg-card:hover:not(:disabled) { border-color: var(--ccfg-teal); }
.ccfg-card[aria-pressed="true"] { border-color: var(--ccfg-teal-strong); box-shadow: inset 0 0 0 1.5px var(--ccfg-teal-strong); background: var(--ccfg-teal-soft); }
.ccfg-card:disabled { opacity: .55; background: var(--ccfg-bg); }
.ccfg-card-img { display: block; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: var(--ccfg-bg); }
.ccfg-cols-1 .ccfg-card-img { width: 72px; flex: none; }
.ccfg-card-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ccfg-card-icon { color: var(--ccfg-teal-strong); width: 64px; }
.ccfg-card-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ccfg-card-title { font-weight: 700; font-size: 15px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ccfg-card-desc { font-size: 13px; color: var(--ccfg-muted); line-height: 1.4; }
.ccfg-card-reason { font-size: 12px; color: var(--ccfg-warn); font-weight: 600; }
.ccfg-card-reason:empty { display: none; }
.ccfg-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--ccfg-teal-soft); color: var(--ccfg-teal-strong); white-space: nowrap; }

.ccfg-swatch { display: block; height: 44px; border-radius: 8px; border: 1px solid rgba(0, 0, 0, .08); }
.ccfg-cols-1 .ccfg-swatch { width: 72px; flex: none; }
.ccfg-sw-floor_checker5 { background: repeating-linear-gradient(45deg, #9aa3ab 0 6px, #7f8890 6px 9px), #8d969e; }
.ccfg-sw-floor_gridmesh { background: linear-gradient(90deg, #6d767e 2px, transparent 2px) 0 0 / 10px 10px, linear-gradient(#6d767e 2px, #c9cfd4 2px) 0 0 / 10px 10px; }
.ccfg-sw-floor_frp { background: linear-gradient(90deg, #4f6d2f 3px, transparent 3px) 0 0 / 12px 12px, linear-gradient(#4f6d2f 3px, #86a35a 3px) 0 0 / 12px 12px; }
.ccfg-sw-floor_frp_terragrate { background: linear-gradient(90deg, #33383c 3px, transparent 3px) 0 0 / 12px 12px, linear-gradient(#33383c 3px, #646a70 3px) 0 0 / 12px 12px; }
.ccfg-sw-floor_dovetail { background: repeating-linear-gradient(90deg, #8a9096 0 18px, #7b8187 18px 20px); }
.ccfg-sw-floor_cement22 { background: radial-gradient(circle at 30% 40%, #c7c3bb 0 2px, transparent 3px) 0 0 / 9px 9px, #b9b5ad; }
.ccfg-sw-floor_ply19, .ccfg-sw-floor_ply25 { background: repeating-linear-gradient(100deg, #d7b47e 0 8px, #c9a46c 8px 14px); }
.ccfg-sw-finish-black { background: #22282d; }
.ccfg-sw-finish-galv { background: linear-gradient(135deg, #c3cad0, #8f99a2); }
.ccfg-sw-finish-grey { background: #6b7680; }
.ccfg-sw-finish-yellow { background: #f2c200; }
.ccfg-cols-4 .ccfg-card { padding: 8px; }
.ccfg-cols-4 .ccfg-card-title { font-size: 12px; font-weight: 600; }

.ccfg-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ccfg-field > label, .ccfg-inline > label { font-weight: 600; font-size: 14px; }
.ccfg-help { font-size: 13px; color: var(--ccfg-muted); margin-top: -4px; }
.ccfg input[type="text"], .ccfg input[type="email"], .ccfg input[type="tel"], .ccfg select, .ccfg textarea {
  width: 100%; padding: 11px 12px; border: 1.5px solid #c9d1d8; border-radius: 10px; background: #fff; font-size: 16px; outline-offset: 0;
}
.ccfg input:focus, .ccfg select:focus, .ccfg textarea:focus { border-color: var(--ccfg-teal-strong); }
.ccfg input[aria-invalid="true"] { border-color: var(--ccfg-err); }
.ccfg .ccfg-input-short { max-width: 140px; }
.ccfg-num { display: flex; align-items: center; border: 1.5px solid #c9d1d8; border-radius: 10px; overflow: hidden; background: #fff; }
.ccfg-num:focus-within { border-color: var(--ccfg-teal-strong); }
.ccfg .ccfg-num input { border: 0; border-radius: 0; text-align: center; min-width: 0; flex: 1; padding: 11px 4px; }
.ccfg-unit { color: var(--ccfg-muted); font-size: 14px; padding-right: 6px; }
.ccfg-stepbtn { width: 44px; height: 44px; flex: none; font-size: 22px; font-weight: 500; color: var(--ccfg-teal-strong); }
.ccfg-stepbtn:hover:not(:disabled) { background: var(--ccfg-teal-soft); }
.ccfg-stepbtn:disabled { color: #b5bec6; }
.ccfg-counter { display: inline-flex; align-items: center; border: 1.5px solid #c9d1d8; border-radius: 10px; width: max-content; }
.ccfg-counter output { min-width: 32px; text-align: center; font-weight: 700; }
.ccfg-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ccfg-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ccfg-chip { padding: 7px 14px; border-radius: 999px; border: 1.5px solid var(--ccfg-line); font-size: 13px; font-weight: 600; }
.ccfg-chip[aria-pressed="true"] { border-color: var(--ccfg-teal-strong); background: var(--ccfg-teal-soft); color: var(--ccfg-teal-strong); }
.ccfg-switch { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.ccfg-switch input { width: 20px; height: 20px; accent-color: var(--ccfg-teal-strong); }
.ccfg-check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.ccfg-check input { width: 20px; height: 20px; flex: none; margin-top: 2px; accent-color: var(--ccfg-teal-strong); }
.ccfg-req { color: var(--ccfg-err); }
.ccfg-opt { color: var(--ccfg-muted); font-weight: 400; }
.ccfg-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.ccfg-readout { font-size: 14px; font-weight: 600; color: var(--ccfg-teal-strong); background: var(--ccfg-teal-soft); padding: 8px 12px; border-radius: 8px; }
.ccfg-readout:empty { display: none; }
.ccfg-note { font-size: 13px; color: var(--ccfg-muted); }
.ccfg-note-warn { color: var(--ccfg-warn); background: var(--ccfg-warn-bg); padding: 8px 12px; border-radius: 8px; font-weight: 500; }
.ccfg-note-placeholder { color: #6b3fa0; background: #f3ecfb; padding: 8px 12px; border-radius: 8px; }
.ccfg-err { color: var(--ccfg-err); font-size: 13px; font-weight: 600; }

/* edges & gates */
.ccfg-diagram { background: var(--ccfg-bg); border-radius: var(--ccfg-radius); padding: 8px; }
.ccfg-diagram svg { width: 100%; height: auto; display: block; }
.ccfg-edges { display: grid; gap: 8px; }
.ccfg-edge-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ccfg-edge-name { font-weight: 600; font-size: 14px; }
.ccfg-edge-name small { color: var(--ccfg-muted); font-weight: 400; }
.ccfg-seg { display: inline-flex; border: 1.5px solid var(--ccfg-line); border-radius: 999px; padding: 2px; }
.ccfg-seg button { padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--ccfg-muted); }
.ccfg-seg button[aria-pressed="true"] { background: var(--ccfg-teal-strong); color: #fff; }
.ccfg-gates { display: grid; gap: 12px; }
.ccfg-gate-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; padding: 12px; border: 1.5px solid var(--ccfg-line); border-radius: var(--ccfg-radius); }
.ccfg-gate-row .ccfg-inline { grid-column: 1 / 2; }
.ccfg-gate-row .ccfg-link { justify-self: end; }
.ccfg-gate-row .ccfg-err { grid-column: 1 / -1; }

/* plan svg */
.ccfg-plan { font-family: inherit; }
.ccfg-p-floor { fill: #fff; stroke: none; }
.ccfg-p-post { fill: #9aa4ad; }
.ccfg-p-open { stroke: var(--ccfg-teal-strong); stroke-width: 5; stroke-linecap: round; }
.ccfg-p-wall { stroke: #6b7680; stroke-width: 3; }
.ccfg-p-wallfill { stroke: #c5ccd2; stroke-width: 10; stroke-dasharray: 3 3; }
.ccfg-p-hit { stroke: transparent; stroke-width: 26; cursor: pointer; }
.ccfg-p-hit:hover { stroke: rgba(53, 181, 174, .25); }
.ccfg-p-stair { fill: #46505a; }
.ccfg-p-gate { fill: var(--ccfg-teal); }
.ccfg-p-tag { fill: #fff; font-size: 10px; font-weight: 700; text-anchor: middle; pointer-events: none; }
.ccfg-p-dim { fill: var(--ccfg-muted); font-size: 13px; font-weight: 600; text-anchor: middle; }
.ccfg-p-lbl { fill: #9aa4ad; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-anchor: middle; }
.ccfg-p-stairline { fill: none; stroke: var(--ccfg-teal-strong); stroke-width: 3; stroke-linejoin: round; }

/* price card */
.ccfg-views { position: absolute; left: 16px; top: 16px; display: flex; background: #fff; border-radius: 999px; padding: 3px; box-shadow: 0 2px 10px rgba(0, 0, 0, .08); }
.ccfg-views:empty { display: none; }
.ccfg-views button { padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.ccfg-views button:hover { background: var(--ccfg-teal-soft); }
.ccfg-price {
  position: absolute; right: 16px; top: 16px; width: 280px; background: #fff; border-radius: var(--ccfg-radius);
  padding: 16px 18px; box-shadow: 0 8px 30px rgba(16, 24, 32, .12); display: flex; flex-direction: column; gap: 4px;
}
.ccfg-price-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ccfg-muted); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ccfg-tag { font-size: 10px; background: #f3ecfb; color: #6b3fa0; padding: 2px 6px; border-radius: 4px; letter-spacing: 0; text-transform: none; }
.ccfg-price-total { font-size: 30px; font-weight: 800; line-height: 1.1; color: var(--ccfg-ink); }
.ccfg-price-total small, .ccfg-total small { font-size: 13px; font-weight: 600; color: var(--ccfg-muted); }
.ccfg-price-inc { font-size: 13px; color: var(--ccfg-muted); }
.ccfg-price-poa { font-size: 12px; color: var(--ccfg-warn); font-weight: 600; }
.ccfg-price-poa:empty { display: none; }
.ccfg-price-more summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ccfg-teal-strong); margin-top: 6px; }
.ccfg-cats { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 13px; margin-top: 8px; }
.ccfg-cats dt { color: var(--ccfg-muted); }
.ccfg-cats dd { text-align: right; font-weight: 600; }

/* review */
.ccfg-review { display: grid; gap: 10px; }
.ccfg-review-sec { border: 1px solid var(--ccfg-line); border-radius: 10px; padding: 10px 12px; }
.ccfg-review-head { display: flex; justify-content: space-between; align-items: center; }
.ccfg-review dl { display: grid; grid-template-columns: 120px 1fr; gap: 2px 10px; font-size: 14px; margin-top: 4px; }
.ccfg-review dt { color: var(--ccfg-muted); }
.ccfg-breakdown { background: var(--ccfg-bg); border-radius: var(--ccfg-radius); padding: 16px; display: grid; gap: 10px; }
.ccfg-total { display: grid; grid-template-columns: 1fr auto; align-items: baseline; border-top: 1px solid var(--ccfg-line); padding-top: 10px; font-weight: 600; }
.ccfg-total strong { font-size: 24px; font-weight: 800; }
.ccfg-inc { grid-column: 2; text-align: right; font-size: 13px; color: var(--ccfg-muted); font-weight: 500; }
.ccfg-disclaimer { font-size: 12px; color: var(--ccfg-muted); }
.ccfg-form { display: grid; gap: 14px; border-top: 1px solid var(--ccfg-line); padding-top: 16px; }

.ccfg-done { display: grid; gap: 12px; padding-top: 12px; }
.ccfg-ref { font-size: 14px; color: var(--ccfg-teal-strong); background: var(--ccfg-teal-soft); padding: 8px 12px; border-radius: 8px; width: max-content; }
.ccfg-next-steps { padding-left: 20px; display: grid; gap: 4px; }
.ccfg-done-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.ccfg-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ccfg-ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; transition: .2s; z-index: 9999;
}
.ccfg-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.ccfg-print { display: none; }

/* ---------- tablet & mobile ---------- */
@media (max-width: 1023px) {
  .ccfg-app { grid-template-columns: 1fr; border-radius: 0; border-left: 0; border-right: 0; }
  .ccfg-stage { order: -1; height: 38vh; min-height: 260px; }
  .ccfg-panel { max-height: none; border-right: 0; }
  .ccfg-body { overflow: visible; }
  .ccfg-price { display: none; }
  .ccfg-nav { position: sticky; bottom: 0; z-index: 5; box-shadow: 0 -6px 20px rgba(0, 0, 0, .06); }
  .ccfg-mini-price { display: block; }
  .ccfg-body:has(.ccfg-form) { padding-bottom: 40px; }
}
@media (max-width: 520px) {
  .ccfg-toolbar, .ccfg-progress, .ccfg-body, .ccfg-nav, .ccfg-helpline { padding-left: 16px; padding-right: 16px; }
  .ccfg-plabel { display: none; }
  .ccfg-dot { width: 30px; height: 30px; font-size: 13px; }
  .ccfg-progress li + li::before { top: 14px; }
  .ccfg-h2 { font-size: 21px; }
  .ccfg-cols-4 { grid-template-columns: repeat(2, 1fr); }
  .ccfg-grid2 { grid-template-columns: 1fr; }
  .ccfg-cols-2 .ccfg-card-desc { font-size: 12px; }
  .ccfg-btn { padding: 12px 18px; }
}

@media print {
  body * { visibility: hidden; }
  .ccfg-print, .ccfg-print * { visibility: visible; }
  .ccfg-print { display: block; position: absolute; left: 0; top: 0; width: 100%; color: #000; font-size: 12px; }
  .ccfg-print svg { width: 60%; height: auto; }
  .ccfg-print dl { display: grid; grid-template-columns: 160px 1fr; gap: 2px 10px; }
  .ccfg-print .ccfg-breakdown { background: none; padding: 0; }
}
@media (prefers-reduced-motion: reduce) { .ccfg * { transition: none !important; } }
