/* ==========================================================================
   v3 최종본 전용 (html[data-final="3"])
   1) Features — 위젯 선택 → 영역 그리기 → 위젯 생성 데모 (.ed-draw)
   2) 문의 영역 '제품 도입 문의' 버튼 강조
   ========================================================================== */

/* ---------- 1. 위젯 배치 데모 ---------- */
.ed-draw { position: relative; }
.ed-draw .ed-top b { transition: transform .15s, box-shadow .2s; }
.ed-draw .ed-top b.is-press { transform: scale(.92); box-shadow: 0 0 0 4px rgba(124, 92, 255, .35); }

/* 왼쪽 위젯 목록: 클릭해서 선택 */
.dw-pal span { position: relative; transition: background-color .2s, color .2s, transform .15s, box-shadow .2s; }
.dw-pal span.is-press { transform: scale(.95); }
.dw-pal span.is-sel { background: rgba(124, 92, 255, .38); color: #fff; box-shadow: inset 0 0 0 1.5px #9d8bff, 0 6px 16px -6px rgba(124, 92, 255, .8); }
.dw-check { margin-left: auto; display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: #7c5cff; font-size: 9px; font-weight: 900; color: #fff; opacity: 0; transform: scale(.4); transition: opacity .2s, transform .25s cubic-bezier(.34, 1.56, .64, 1); }
.dw-pal span.is-sel .dw-check { opacity: 1; transform: none; }

/* 가운데 캔버스 */
.dw-canvas { display: block; position: relative; padding: 0; overflow: hidden; background-image: radial-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px); background-size: 16px 16px; transition: box-shadow .3s; }
.dw-canvas.is-armed { box-shadow: inset 0 0 0 1.5px rgba(124, 92, 255, .55); }
.dw-hint { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; margin: 0; font-size: 12px; font-weight: 600; color: #6b6b80; transition: opacity .35s; pointer-events: none; }
.dw-hint span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; border: 1.5px dashed rgba(255, 255, 255, .2); font-size: 18px; }
.dw-hint b { font-weight: 600; }
.dw-canvas.is-armed .dw-hint { color: #c4b5fd; }
.dw-canvas.is-armed .dw-hint span { border-color: rgba(157, 139, 255, .7); }
.dw-canvas.has-any .dw-hint, .dw-canvas.is-drawing .dw-hint { opacity: 0; }

/* 위젯: 그린 영역(left/top/width/height)에 그대로 생성 */
.dw-w { position: absolute; left: calc(12px + (100% - 24px) * var(--x)); top: calc(12px + (100% - 24px) * var(--y)); width: calc((100% - 24px) * var(--w)); height: calc((100% - 24px) * var(--h));
  border-radius: 8px; background: #11111b; border: 1px solid rgba(255, 255, 255, .06); opacity: 0; transition: opacity .35s, box-shadow .4s, border-color .4s; }
.dw-w.is-on { opacity: 1; }
.dw-w.is-new { border-color: #9d8bff; box-shadow: 0 0 0 1px #9d8bff, 0 10px 30px rgba(124, 92, 255, .4); }
.dw-in { position: absolute; inset: 0; padding: 10px 12px; overflow: hidden; border-radius: inherit; transform: scale(.94); opacity: 0; transition: transform .45s cubic-bezier(.34, 1.56, .64, 1), opacity .3s; }
.dw-w.is-on .dw-in { transform: none; opacity: 1; }
.dw-handles i { position: absolute; width: 7px; height: 7px; border-radius: 2px; background: #fff; box-shadow: 0 0 0 1.5px #7c5cff; opacity: 0; transition: opacity .2s; }
.dw-handles i:nth-child(1) { left: -4px; top: -4px; } .dw-handles i:nth-child(2) { right: -4px; top: -4px; } .dw-handles i:nth-child(3) { left: -4px; bottom: -4px; } .dw-handles i:nth-child(4) { right: -4px; bottom: -4px; }
.dw-w.is-new .dw-handles i { opacity: 1; }
.dw-in small { display: block; font-size: 9.5px; font-weight: 600; color: #a3a3b8; white-space: nowrap; }
.dw-kpi b { display: block; margin-top: 4px; font-size: 22px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: #f3f3f8; }
.dw-kpi em { font-style: normal; font-size: 10px; font-weight: 800; color: #34d399; }
.dw-in svg { position: absolute; left: 12px; right: 12px; bottom: 10px; width: calc(100% - 24px); height: calc(100% - 34px); }
.dw-line { stroke-dasharray: 400; stroke-dashoffset: 400; }
.dw-w.is-on .dw-line { stroke-dashoffset: 0; transition: stroke-dashoffset 1.4s .2s ease-out; }
.dw-w.is-on .dw-line--2 { transition-delay: .5s; }
.dw-map { opacity: 0; transition: opacity .6s .2s; }
.dw-w.is-on .dw-map { opacity: 1; }
.dw-bars { position: absolute; left: 12px; right: 12px; bottom: 10px; top: 30px; display: flex; align-items: flex-end; gap: 8%; }
.dw-bars i { flex: 1; height: var(--h); border-radius: 3px 3px 0 0; background: #7c5cff; transform: scaleY(0); transform-origin: bottom; transition: transform .6s var(--d) cubic-bezier(.34, 1.3, .64, 1); }
.dw-w.is-on .dw-bars i { transform: none; }
.dw-grid .g-row { display: flex; align-items: center; justify-content: space-between; height: 14.5%; margin-top: 2px; padding: 0 6px; border-radius: 4px; font-size: 10px; font-weight: 600; color: #d4d4e0; opacity: 0; transform: translateY(4px); transition: opacity .3s var(--d), transform .3s var(--d); }
.dw-grid .g-head { margin-top: 6px; background: rgba(124, 92, 255, .25); color: #c4b5fd; font-weight: 800; }
.dw-grid .g-row:not(.g-head):nth-child(odd) { background: rgba(255, 255, 255, .03); }
.dw-grid .g-row i { width: 7px; height: 7px; border-radius: 50%; }
.dw-w.is-on .dw-grid .g-row, .dw-w.is-on.dw-grid .g-row { opacity: 1; transform: none; }

/* 드래그 중 선택 영역: 반투명 채움 + 테두리 + 크기 표시 */
.dw-sel { position: absolute; z-index: 3; left: 0; top: 0; width: 0; height: 0; border: 1.5px solid #9d8bff; border-radius: 4px; background: rgba(124, 92, 255, .2); box-shadow: 0 0 0 1px rgba(124, 92, 255, .25), inset 0 0 24px rgba(124, 92, 255, .18); opacity: 0; pointer-events: none; }
.dw-sel.is-on { opacity: 1; }
.dw-sel.is-drop { opacity: 0; transition: opacity .3s .1s !important; }
.dw-sel::before, .dw-sel::after { content: ""; position: absolute; width: 6px; height: 6px; border-radius: 1.5px; background: #fff; box-shadow: 0 0 0 1.5px #7c5cff; }
.dw-sel::before { left: -4px; top: -4px; } .dw-sel::after { right: -4px; bottom: -4px; }
.dw-size { position: absolute; right: 0; bottom: -24px; padding: 3px 8px; border-radius: 5px; background: #7c5cff; font-family: var(--mono); font-size: 10px; font-weight: 700; color: #fff; white-space: nowrap; font-variant-numeric: tabular-nums; box-shadow: 0 4px 12px rgba(0, 0, 0, .3); }
.dw-sel.is-up .dw-size { bottom: auto; top: -24px; }

/* 오른쪽 속성 패널: 선택한 위젯과 위치·크기 */
.dw-props .dw-lab { margin-top: 12px; font-size: 10px; font-weight: 600; color: #a3a3b8; }
.dw-props .dw-lab:first-of-type { margin-top: 0; }
.dw-kind { display: flex; align-items: center; gap: 7px; height: 26px; margin-top: 6px; padding: 0 8px; border-radius: 5px; background: rgba(255, 255, 255, .06); font-size: 11px; font-weight: 700; color: #6b6b80; transition: box-shadow .2s, color .2s; }
.dw-kind i { width: 10px; height: 10px; border-radius: 3px; background: var(--kc, rgba(255, 255, 255, .15)); }
.dw-kind.is-set { color: #f3f3f8; box-shadow: inset 0 0 0 1px rgba(157, 139, 255, .8); }
.dw-xy { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
.dw-xy span { display: flex; align-items: center; justify-content: space-between; height: 24px; padding: 0 7px; border-radius: 5px; background: rgba(255, 255, 255, .06); font-size: 9.5px; font-weight: 700; color: #6b6b80; transition: box-shadow .2s; }
.dw-xy b { font-family: var(--mono); font-size: 10.5px; font-weight: 600; color: #f3f3f8; font-variant-numeric: tabular-nums; }
.dw-props.is-live .dw-xy span { box-shadow: inset 0 0 0 1px rgba(157, 139, 255, .75); }
.dw-tip { display: flex; gap: 6px; margin: 16px 0 0; font-size: 10px; font-weight: 600; line-height: 1.5; color: #a3a3b8; }
.dw-tip i { flex: none; width: 12px; height: 9px; margin-top: 3px; border: 1.5px solid #9d8bff; border-radius: 2px; background: rgba(124, 92, 255, .25); }

/* 마우스 커서: 목록에서는 화살표, 캔버스에서 그릴 때는 십자 */
.dw-cursor { position: absolute; z-index: 6; left: 50%; top: 50%; width: 22px; height: 22px; margin: -3px 0 0 -4px; color: #7c5cff; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .5)); pointer-events: none; transition: transform .12s; }
.dw-cursor .c-cross { display: none; }
.dw-cursor.is-cross { margin: -11px 0 0 -11px; }
.dw-cursor.is-cross .c-arrow { display: none; }
.dw-cursor.is-cross .c-cross { display: inline; }
.dw-cursor.is-press { transform: scale(.82); }

.dw-toast { position: absolute; z-index: 5; left: 50%; bottom: 14px; padding: 9px 16px; border-radius: 999px; background: #34d399; color: #062b1e; font-size: 12px; font-weight: 800; white-space: nowrap; box-shadow: 0 10px 30px rgba(52, 211, 153, .35); opacity: 0; transform: translate(-50%, 10px); transition: opacity .3s, transform .3s; }
.dw-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* 시안 4 화이트: Features 카드 색(v2 보정)과 맞춤 */
:root[data-v="4"][data-theme="light"] #features .dw-w { background: #232a6e; border-color: rgba(165, 175, 255, .12); }
:root[data-v="4"][data-theme="light"] #features .dw-w.is-new { border-color: #9d8bff; }

/* 모바일: 위젯 목록을 위쪽 가로줄로 */
@media (max-width: 700px) {
  .ed-draw .ed-body { grid-template-rows: auto 1fr; }
  .ed-draw .dw-pal { display: flex; gap: 6px; overflow: hidden; padding: 8px 10px 0; background: none; }
  .ed-draw .dw-pal em { display: none; }
  .ed-draw .dw-pal span { flex: none; height: 28px; margin: 0; font-size: 11px; }
  .ed-draw .dw-check { display: none; }
  .ed-draw .dw-canvas { height: 300px; margin: 6px 10px 10px; }
}

/* ---------- 2. 문의 영역: '제품 도입 문의' 버튼 ---------- */
/* 보라 그라데이션 배경과 같은 계열이던 버튼을 흰 바탕 + 진한 인디고 글자로 바꿔 대비를 키운다 */
:root[data-final] .cta .actions { align-items: center; }
:root[data-final] .cta .btn--primary {
  position: relative; min-height: 60px; padding: 0 12px 0 30px; gap: 14px;
  background: #fff; border: 0; color: #2a2486; font-size: 17px; font-weight: 800; letter-spacing: -.01em;
  box-shadow: 0 0 0 5px rgba(255, 255, 255, .22), 0 16px 36px -8px rgba(18, 10, 74, .55);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background-color .25s;
}
:root[data-final] .cta .btn--primary .arr {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(120deg, #3f5bff, #a855f7); color: #fff; font-size: 16px;
}
:root[data-final] .cta .btn--primary:hover { transform: translateY(-3px); background: #fff; box-shadow: 0 0 0 7px rgba(255, 255, 255, .32), 0 22px 44px -10px rgba(18, 10, 74, .65); }
:root[data-final] .cta .btn--primary:active { transform: translateY(-1px); }
:root[data-final] .cta .btn--primary:focus-visible { outline: 3px solid #fde68a; outline-offset: 6px; }
/* 보조 버튼은 그대로 두되, 주 버튼과 높이만 맞춘다 */
:root[data-final] .cta .btn--secondary { min-height: 52px; }
@media (max-width: 560px) {
  :root[data-final] .cta .actions { flex-direction: column; align-items: stretch; }
  :root[data-final] .cta .btn--primary { justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) { :root[data-final] .cta .btn--primary:hover { transform: none; } }

/* ---------- 차트 월: BrokenAxis 끊김 표시를 타일 배경색으로 ---------- */
.cw { --surface-solid: #fff; }
[data-theme="dark"] .cw { --surface-solid: #15151f; }
/* 좁은 화면에서도 KPI 숫자가 위젯 폭 안에 들어가게 */
.dw-kpi { container-type: inline-size; }
.dw-kpi b { font-size: min(22px, 17cqw); }
