/* Shape Generator (Task 78). Kerangka dari kit UI (src/ui/kit); di sini
   hanya bagian khusus bentuk. Warna lewat token tema — tanpa hex telanjang
   (themeContrast). Chromium 88: tanpa :has, nesting, color-mix, dvh. */

.shape-generator { display: flex; flex-direction: column; gap: 12px; }
.shp-layout .kit-card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
[hidden].shp-shape__dir, [hidden].shp-shape__notice, [hidden].shp-mat__axis,
[hidden].shp-mat__seed, [hidden].shp-preview__slider, [hidden].shp-preview__overlay,
[hidden].shp-preview__flat, [hidden].shp-circ__sliders input, [hidden].kit-card { display: none; }

/* ── Pemilih bentuk: 2×3, glyph CSS murni (tanpa font ikon) ── */
.shp-shape__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.shp-shape__btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 8px 4px; border: 1px solid var(--wb-rule); border-radius: var(--radius-sm);
  background: var(--bg-inset); color: var(--text-secondary); cursor: pointer;
}
.shp-shape__btn:hover { border-color: var(--accent); }
.shp-shape__btn.is-active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); color: var(--text-primary); }
.shp-shape__name { font-size: 11px; font-weight: 600; letter-spacing: 0.02em; }

/* Glyph: <span> 16×16 dibentuk CSS — bola, elips, kubah, tabung, kerucut, donat */
.shp-shape__glyph { position: relative; width: 18px; height: 16px; flex-shrink: 0; }
.shp-shape__glyph::before { content: ""; position: absolute; inset: 0; background: currentColor; }
.shp-shape__glyph--sphere::before { border-radius: 50%; }
.shp-shape__glyph--ellipsoid::before { left: 0; right: 0; top: 3px; bottom: 3px; border-radius: 50%; }
.shp-shape__glyph--dome::before { left: 0; right: 0; top: 2px; bottom: 0; border-radius: 9px 9px 0 0; }
.shp-shape__glyph--cylinder::before { left: 3px; right: 3px; border-radius: 3px; }
.shp-shape__glyph--cone::before {
  left: 1px; right: 1px; top: 0; bottom: 0; border-radius: 0;
  background: none; border-left: 8px solid transparent; border-right: 8px solid transparent;
  border-bottom: 16px solid currentColor;
}
.shp-shape__glyph--pyramid::before {
  left: 1px; right: 1px; top: 0; bottom: 0; border-radius: 0;
  background: none; border-left: 8px solid transparent; border-right: 8px solid transparent;
  border-bottom: 16px solid currentColor;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.shp-shape__glyph--box::before { background: none; border: 2px solid currentColor; border-radius: 1px; }
.shp-shape__glyph--capsule::before { left: 5px; right: 5px; border-radius: 9px; }
.shp-shape__glyph--octahedron::before {
  background: none; border: 2px solid currentColor;
  transform: rotate(45deg) scale(0.72);
}
.shp-shape__glyph--torus::before { border-radius: 50%; box-shadow: inset 0 0 0 4px var(--bg-inset); background: currentColor; }
.shp-shape__glyph--ramp::before { clip-path: polygon(0 100%, 100% 0, 100% 100%); }
.shp-shape__glyph--stairs::before { clip-path: polygon(0 100%, 0 78%, 28% 78%, 28% 56%, 52% 56%, 52% 34%, 76% 34%, 76% 12%, 100% 12%, 100% 100%); }
.shp-shape__glyph--spiralStairs::before { inset: 1px 2px; border: 3px solid currentColor; border-radius: 50%; background: none; }
.shp-shape__glyph--spiralStairs::after { content: ""; position: absolute; left: 5px; right: 4px; top: 5px; bottom: 4px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; transform: rotate(-35deg); }
.shp-shape__glyph--arch::before { border-radius: 9px 9px 0 0; }
.shp-shape__glyph--arch::after { content: ""; position: absolute; left: 5px; right: 5px; top: 6px; bottom: 0; border-radius: 5px 5px 0 0; background: var(--bg-inset); }
.shp-shape__glyph--prism::before { clip-path: polygon(0 100%, 50% 0, 100% 100%); }
.shp-shape__glyph--frustum::before { clip-path: polygon(30% 0, 70% 0, 100% 100%, 0 100%); }

.shp-shape__params { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.shp-shape__params .kit-slider, .shp-shape__fill, .shp-shape__dir { flex-shrink: 0; }
.shp-shape__fill, .shp-shape__dir { margin-top: 10px; }

/* ── Dome Generator khusus ── */
.shp-dome .kit-card__body { display: flex; flex-direction: column; gap: 10px; }
.shp-dome__intro, .shp-dome__feature-note { margin: 0; color: var(--text-secondary); font-size: 12px; line-height: 1.5; }
.shp-dome__section-label { margin: 2px 0 -4px; color: var(--text-secondary); font-size: 11px; font-weight: 700; }
.shp-dome__presets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.shp-dome__presets .btn { min-width: 0; padding-inline: 8px; }
.shp-dome__seg { margin-top: 2px; }
.shp-dome__profile-hint { margin: -4px 0 0; }
.shp-dome__group { display: flex; flex-direction: column; gap: 10px; padding: 10px; border: 1px solid var(--wb-rule); border-radius: var(--radius-sm); background: var(--bg-inset); }
.shp-dome__group-title { margin: 0; font-size: 12px; }
.shp-dome__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.shp-dome__notice { margin-top: 2px; }
.shape-generator.is-dome { gap: 16px; }
.shape-generator.is-dome .shp-header { padding-bottom: 14px; border-bottom: 1px solid var(--wb-rule-soft); }
@media (max-width: 420px) {
  .shp-dome__stats { grid-template-columns: 1fr; }
}

/* ── Komposer multi-bagian ── */
.shp-assembly .kit-card__body { display: flex; flex-direction: column; gap: 10px; }
.shp-assembly__intro, .shp-assembly__summary { margin: 0; font-size: 12px; line-height: 1.5; color: var(--text-secondary); }
.shp-assembly__toolbar { display: flex; flex-wrap: wrap; gap: 8px; }
.shp-assembly__toolbar .btn { flex: 1 1 150px; }
.shp-assembly__list { display: flex; flex-direction: column; gap: 8px; }
.shp-assembly__item { min-width: 0; padding: 10px; border: 1px solid var(--wb-rule); border-radius: var(--radius-sm); background: var(--bg-inset); }
.shp-assembly__item-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.shp-assembly__title { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.shp-assembly__title strong { overflow-wrap: anywhere; font-size: 12px; }
.shp-assembly__shape, .shp-assembly__base { color: var(--text-muted); font-size: 11px; }
.shp-assembly__base { margin: 7px 0 0; }
.shp-assembly__remove { flex: 0 0 auto !important; min-height: 32px; padding: 5px 9px; }
.shp-assembly__operation { margin: 9px 0; }
.shp-assembly__position { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 9px; }
.shp-assembly__offset { display: flex; align-items: center; gap: 6px; min-width: 0; }
.shp-assembly__axis { color: var(--text-muted); font-family: var(--font-mono); font-size: 10px; }
.shp-assembly__number { box-sizing: border-box; width: 100%; min-width: 0; min-height: 36px; padding: 6px; text-align: right; font-family: var(--font-mono); font-size: 12px; }
.shp-assembly__rotation { margin-top: 8px; }
.shp-assembly__mirrors { display: flex; flex-wrap: wrap; gap: 10px 14px; margin-top: 8px; }
.shp-assembly__mirror { display: inline-flex; align-items: center; gap: 5px; color: var(--text-secondary); font-size: 11px; cursor: pointer; }
.shp-assembly__mirror input { width: 16px; height: 16px; accent-color: var(--accent); }
.shp-assembly button:disabled { opacity: 0.48; cursor: not-allowed; }

/* ── Preset 3D pengguna ── */
.shp-presets .kit-card__body { display: flex; flex-direction: column; gap: 10px; }
.shp-presets__intro, .shp-presets__status, .shp-presets__empty { margin: 0; color: var(--text-secondary); font-size: 12px; line-height: 1.5; }
.shp-presets__form { display: flex; flex-wrap: wrap; gap: 8px; }
.shp-presets__name { flex: 1 1 180px; min-width: 0; min-height: 40px; }
.shp-presets__form .btn { flex: 1 1 160px; }
.shp-presets__list { display: flex; flex-direction: column; gap: 7px; }
.shp-presets__item { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; padding: 8px; border: 1px solid var(--wb-rule); border-radius: var(--radius-sm); background: var(--bg-inset); }
.shp-presets__item.is-favorite { border-color: var(--accent); }
.shp-presets__info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.shp-presets__title { overflow-wrap: anywhere; font-size: 12px; }
.shp-presets__detail { color: var(--text-muted); font-size: 10px; }
.shp-presets__actions { display: flex; flex: 0 0 auto; align-items: center; gap: 4px; }
.shp-presets__actions .btn { min-height: 34px; padding: 6px 10px; }
.shp-presets__icon { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 1px solid var(--wb-rule); border-radius: var(--radius-sm); background: var(--bg-surface-2); color: var(--text-secondary); cursor: pointer; }
.shp-presets__icon:hover, .shp-presets__icon.is-on { border-color: var(--accent); color: var(--accent); }
.shp-presets__icon:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 520px) {
  .shp-presets__item { align-items: flex-start; flex-direction: column; }
  .shp-presets__actions { width: 100%; }
  .shp-presets__actions .btn { flex: 1 1 auto; }
}

/* ── Material ── */
.shp-mat__count { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.shp-mat__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.shp-mat__chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px;
  border: 1px solid var(--wb-rule); border-radius: var(--radius-sm); background: var(--bg-inset);
  font-size: 12px; flex-shrink: 0;
}
.shp-mat__swatch { width: 12px; height: 12px; border-radius: 2px; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18); flex-shrink: 0; }
.shp-mat__chip-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shp-mat__chip-idx { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); }
.shp-mat__chip-x {
  border: 0; background: none; color: var(--text-muted); cursor: pointer;
  font-size: 14px; line-height: 1; padding: 0 2px;
}
.shp-mat__chip-x:hover { color: var(--danger, #e06c5a); }
.shp-mat__add { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.shp-mat__group { max-width: 170px; }
.shp-mat__block { flex: 1 1 140px; min-width: 0; }
.shp-mat__quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.shp-mat__quick-btn { display: inline-flex; align-items: center; gap: 6px; }
.shp-mat__rainbow { display: inline-flex; width: 16px; height: 12px; border-radius: 2px; overflow: hidden; flex-shrink: 0; }
.shp-gradient { margin-top: 10px; }
.shp-gradient__intro, .shp-gradient__status { margin: 0; color: var(--text-secondary); font-size: 11.5px; line-height: 1.5; }
.shp-gradient__status.is-success { color: var(--success, #4c9b68); }
.shp-gradient__status.is-error { color: var(--danger, #df6255); }
.shp-gradient__endpoints { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.shp-gradient__endpoint { display: flex; flex-direction: column; gap: 7px; min-width: 0; padding: 9px; border: 1px solid var(--wb-rule); border-radius: var(--radius-sm); background: var(--bg-inset); }
.shp-gradient__endpoint-title { margin: 0; font-size: 12px; }
.shp-gradient__field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.shp-gradient__field-label { color: var(--text-muted); font-size: 10px; }
.shp-gradient__group, .shp-gradient__block { width: 100%; min-width: 0; min-height: 36px; }
.shp-gradient__actions { display: flex; flex-wrap: wrap; gap: 7px; }
.shp-gradient__actions .btn { flex: 1 1 150px; min-width: 0; }
.shp-gradient__preview { display: flex; gap: 6px; min-width: 0; padding: 2px 0 6px; overflow-x: auto; overscroll-behavior-inline: contain; }
.shp-gradient__preview[hidden] { display: none; }
.shp-gradient__stop { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 6px; flex: 0 0 150px; min-width: 0; padding: 7px; border: 1px solid var(--wb-rule); border-radius: var(--radius-sm); background: var(--bg-surface-2); }
.shp-gradient__swatch { width: 26px; height: 26px; border: 1px solid rgb(255 255 255 / 18%); border-radius: 4px; box-shadow: inset 0 0 0 1px rgb(0 0 0 / 10%); }
.shp-gradient__stop-text { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.shp-gradient__stop-name { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.shp-gradient__stop-hex { color: var(--text-muted); font: 9px var(--font-mono); }
.shp-gradient__stop-index { align-self: start; color: var(--text-muted); font: 9px var(--font-mono); }
.shp-mat__rainbow-seg { flex: 1 1 0; }
.shp-mat__axis { margin-top: 10px; }
.shp-mat__seed { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.shp-mat__seed .kit-note { margin: 0; }

/* ── Pratinjau ── */
.shp-preview__badge { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.shp-preview__stage {
  position: relative; min-height: 300px; border: 1px solid var(--wb-rule);
  border-radius: var(--radius-sm); background: var(--bg-surface-2); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.shp-preview__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.shp-preview__overlay {
  position: absolute; left: 12px; right: 12px; bottom: 10px; margin: 0; text-align: center;
  font-size: 12px; color: var(--text-muted); pointer-events: none; z-index: 2;
}
/* ⚠️ di ATAS kanvas WebGL (absolute): tanpa ini 3D menimpa mode per-lapis */
.shp-preview__flat { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; padding: 8px; position: relative; z-index: 1; background: inherit; }
.shp-preview__flat canvas { max-width: 100%; max-height: 100%; image-rendering: pixelated; border-radius: var(--radius-sm); }
.shp-ctl { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.shp-ctl__btn { flex-shrink: 0; }
.shp-ctl__btn.is-on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.shp-ctl__btn--sq { width: 34px; padding-left: 0; padding-right: 0; justify-content: center; }
.shp-preview__slider { margin-top: 10px; }
.shp-preview__slider .kit-slider__input { width: 100%; }
.shp-preview__layer-info { display: block; margin-top: 4px; font-size: 12px; color: var(--text-muted); }
.shp-preview__pick { margin: 8px 0 0; min-height: 16px; font-size: 12px; font-family: var(--font-mono); color: var(--text-secondary); }

/* ── Ekspor ── */
.shp-export .kit-card__body { display: flex; flex-direction: column; gap: 10px; }
.shp-export .kit-seg { flex-wrap: wrap; }
.shp-export__panel { display: flex; flex-direction: column; gap: 10px; }
[hidden].shp-export__panel { display: none; }
.shp-export__summary { margin: 0; font-size: 12px; color: var(--text-secondary); }
.shp-export__warn { margin: 0; font-size: 12px; color: var(--text-primary); }
.shp-export__label { margin: 4px 0 0; font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.shp-export__send { display: flex; flex-wrap: wrap; gap: 8px; }
.shp-export__send .btn { flex-shrink: 0; }
.shp-wedit__list { display: flex; flex-direction: column; gap: 6px; }
.shp-wedit__row {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  border: 1px solid var(--wb-rule); border-radius: var(--radius-sm); background: var(--bg-inset);
}
.shp-wedit__cmd {
  flex: 1 1 auto; min-width: 0; overflow-x: auto; white-space: nowrap;
  font-family: var(--font-mono); font-size: 12px; color: var(--text-primary);
}
.shp-wedit__copy { flex-shrink: 0; }
.shp-java__downloads { display: flex; flex-wrap: wrap; gap: 8px; }
.shp-java__downloads .btn { flex: 1 1 160px; }
.shp-guide__intro { margin: 0; line-height: 1.5; }
.shp-guide__controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.shp-guide__select-label { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); font-size: 12px; }
.shp-guide__select { width: auto; min-width: 150px; min-height: 38px; }
.shp-guide__layer-info { margin: 0; }
.shp-guide__materials { display: flex; flex-direction: column; gap: 7px; }
.shp-guide__material { min-width: 0; padding: 8px; border: 1px solid var(--wb-rule); border-radius: var(--radius-sm); background: var(--bg-inset); }
.shp-guide__material-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.shp-guide__name { min-width: 0; overflow-wrap: anywhere; font-family: var(--font-mono); font-size: 11px; }
.shp-guide__count { flex-shrink: 0; color: var(--text-secondary); font-size: 11px; }
.shp-guide__coords { margin: 6px 0 0; overflow-wrap: anywhere; color: var(--text-muted); font-family: var(--font-mono); font-size: 10px; line-height: 1.5; }
.shp-guide__more { color: var(--text-secondary); font-family: var(--font-body); }
.shp-blok__list { display: flex; flex-direction: column; gap: 6px; }
.shp-blok__row {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  border: 1px solid var(--wb-rule); border-radius: var(--radius-sm); background: var(--bg-inset);
  font-size: 12px;
}
.shp-blok__name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shp-blok__qty { font-family: var(--font-mono); color: var(--text-secondary); flex-shrink: 0; }

/* ── Circle Generator (mode 2D) ── */
.shape-generator.is-circle { gap: 16px; }
.shape-generator.is-circle .shp-header { padding-bottom: 14px; border-bottom: 1px solid var(--wb-rule-soft); }
.shape-generator.is-circle .shp-circctl,
.shape-generator.is-circle .shp-circprev { border-color: var(--border-strong); }
.shp-circctl .kit-card__body { display: flex; flex-direction: column; gap: 14px; }
.shp-circctl__intro { max-width: 48ch; margin: 0; color: var(--text-secondary); font-size: 12.5px; line-height: 1.5; }
.shp-circctl__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.shp-circctl__family {
  min-height: 92px; align-items: flex-start; gap: 5px; padding: 10px 12px;
  text-align: left; background: var(--bg-surface-2); transition: border-color var(--duration-fast) var(--ease-standard), background var(--duration-fast) var(--ease-standard);
}
.shp-circctl__family.is-active { background: var(--bg-active); }
.shp-circctl__family .shp-shape__glyph { margin-bottom: 2px; }
.shp-circctl__family .shp-shape__name { font-size: 12px; }
.shp-shape__hint { color: var(--text-muted); font-size: 10.5px; font-weight: 400; line-height: 1.35; text-align: left; }
.shp-shape__glyph--circle2d::before { border-radius: 50%; box-shadow: inset 0 0 0 3px var(--bg-inset); }
.shp-shape__glyph--ellipse2d::before { left: 0; right: 0; top: 3px; bottom: 3px; border-radius: 50%; }
.shp-shape__glyph--half2d::before { left: 2px; top: 0; bottom: 0; right: 0; border-radius: 0 9px 9px 0; }
.shp-shape__glyph--arc2d::before {
  background: none; border: 3px solid currentColor; border-radius: 50%;
  border-bottom-color: transparent; border-left-color: transparent; transform: rotate(-45deg);
}
.shp-shape__glyph--rounded2d::before { background: none; border: 2px solid currentColor; border-radius: 6px; }
.shp-circ__sliders { display: flex; flex-direction: column; gap: 12px; }
.shp-circ__sliders > * { flex-shrink: 0; }
.shp-circ__param { display: grid; grid-template-columns: minmax(0, 1fr) 78px; align-items: end; gap: 12px; }
.shp-circ__param .kit-slider { min-width: 0; }
.shp-circ__exact { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.shp-circ__exact-label { color: var(--text-muted); font-size: 10px; line-height: 1.2; }
.shp-circ__number { width: 100%; min-width: 0; min-height: 38px; padding: 7px 8px; text-align: right; font-family: var(--font-mono); font-size: 13px; font-variant-numeric: tabular-nums; }
.shp-circ__dir { flex-wrap: wrap; }
.shp-circ__fill { margin-top: 2px; }
.shp-circ__smooth { min-height: 52px; }
.shp-circ__quick-section,
.shp-circ__lift-section { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--wb-rule-soft); }
.shp-circ__quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.shp-circ__preset {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  min-width: 0; min-height: 54px; padding: 8px 10px; text-align: left;
}
.shp-circ__preset.is-active { border-color: var(--accent); background: var(--bg-active); box-shadow: inset 0 0 0 1px var(--accent); }
.shp-circ__preset-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shp-circ__preset-detail { max-width: 100%; color: var(--text-muted); font-size: 10px; font-weight: 500; line-height: 1.35; }
.shp-circ__lift { display: flex; flex-wrap: wrap; gap: 8px; }
.shp-circ__lift .btn { flex: 1 1 90px; }
.shp-circ__lift-note { margin: 0; color: var(--text-muted); font-size: 11px; line-height: 1.4; }
.shp-circctl__note { padding-top: 2px; }

.shp-circprev .kit-card__body { display: flex; flex-direction: column; gap: 12px; }
.shp-circprev__stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.shp-circprev__stats .kit-stat { min-width: 0; padding: 8px 10px; border: 1px solid var(--wb-rule-soft); }
.shp-circprev__stats .kit-stat__value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.shp-circprev__stats .kit-stat__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shp-circprev__stage {
  position: relative; display: block; box-sizing: border-box; min-height: 280px;
  max-height: min(68vh, 620px); padding: 12px; overflow: auto; overscroll-behavior: contain;
  border: 1px solid var(--wb-rule); border-radius: var(--radius-md);
  background: radial-gradient(ellipse at 50% 46%, rgba(114,201,95,0.06), transparent 60%), var(--bg-inset);
}
.shp-circprev__canvas { display: block; width: auto; max-width: none; height: auto; margin: 0 auto; image-rendering: pixelated; }
.shp-circprev__toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.shp-circprev__tools,
.shp-circprev__zoom,
.shp-circprev__downloads { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.shp-circprev__zoom { padding: 3px; border: 1px solid var(--wb-rule-soft); border-radius: var(--radius-sm); background: var(--bg-inset); }
.shp-circprev__zoom-btn { min-width: 36px; padding-left: 8px; padding-right: 8px; justify-content: center; }
.shp-circprev__zoom-value { min-width: 42px; color: var(--text-secondary); font-family: var(--font-mono); font-size: 11px; text-align: center; }
.shp-circprev__tools .btn.is-active { color: var(--accent); border-color: var(--accent); background: var(--bg-active); }
.shp-circprev__downloads .btn { flex-shrink: 0; }
.shp-circprev__stage .shp-preview__overlay { position: static; margin: 96px 12px 0; text-align: center; }
.shp-circprev__note { max-width: 76ch; }
.shp-circprev .btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* Kartu mode tersembunyi (ganti Bentuk 3D ↔ Lingkaran) — aturan eksplisit. */
.shp-layout .kit-card[hidden] { display: none; }

@media (max-width: 720px) {
  .shp-circprev__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shp-circprev__toolbar { align-items: flex-start; }
  .shp-circprev__downloads { flex: 1 1 100%; }
  .shp-circprev__downloads .btn { flex: 1 1 130px; }
}

@media (max-width: 520px) {
  .shp-circctl__grid { gap: 6px; }
  .shp-circctl__family { min-height: 104px; padding: 9px; }
  .shp-shape__hint { font-size: 10px; }
  .shp-circ__param { grid-template-columns: minmax(0, 1fr) 70px; gap: 8px; }
  .shp-circ__quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shp-circprev__stage { min-height: 240px; max-height: 58vh; padding: 8px; }
  .shp-circprev__tools .btn { padding-left: 9px; padding-right: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .shp-circctl__family { transition: none; }
}
