/* ====================================================
   ui-planning-prototype.css
   네임스페이스: .prototype__
   디자인: Angular (border-radius: 0), Indigo #6366F1
   폰트: Pretendard Variable
   ==================================================== */

/* ====================================================
   1. 루트 컨테이너
   ==================================================== */
.prototype-root {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    font-family: 'Pretendard Variable', 'Pretendard', sans-serif;
    background: #F5F5F5;
    border-radius: 0;
}

/* ====================================================
   2. Prototype 모드 전용 헤더 컨트롤
   (공용 .project-header 위에 얹는 추가 버튼들)
   ==================================================== */
.project-header__proto-tabs {
    display: flex;
    border: 1px solid #E5E7EB;
    border-radius: 0;
    overflow: hidden;
}

.project-header__proto-tab {
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #6B7280;
    background: #fff;
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.project-header__proto-tab:not(.project-header__proto-tab--active):hover {
    background: #F9FAFB;
    color: #111827;
}

.project-header__proto-tab--active {
    background: #6366F1;
    color: #fff;
}

.project-header__start-info {
    font-size: 12px;
    color: #6B7280;
    padding: 0 8px;
    white-space: nowrap;
}

.project-header__start-info #startFrameLabel {
    color: #111827;
    font-weight: 600;
}
/* 시작 화면 미지정 시 강조 — 사용자가 다음 액션을 인지하도록 */
.project-header__start-info.is-empty #startFrameLabel {
    color: #EF4444;
    font-weight: 700;
}

.project-header__help-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    color: #6B7280;
    cursor: pointer;
    transition: color 0.15s;
}

.project-header__help-toggle:hover {
    color: #111827;
}

.project-header__reset-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 500;
    color: #6B7280;
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    white-space: nowrap;
}

.project-header__reset-btn:hover {
    color: #DC2626;
    border-color: #DC2626;
    background: #FEF2F2;
}

.project-header__play-btn {
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: #6366F1;
    border: 1px solid #6366F1;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    white-space: nowrap;
}

.project-header__play-btn:hover:not(:disabled) {
    background: #4F46E5;
    border-color: #4F46E5;
}

.project-header__play-btn:disabled {
    background: #D1D5DB;
    border-color: #D1D5DB;
    color: #fff;
    cursor: not-allowed;
}

/* === 시연 모드 컨트롤 — 헤더 내부에서 .prototype-root--playing 일 때만 visible === */
.project-header__editing-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}
.project-header__player-controls {
    display: none;
    align-items: center;
    gap: 8px;
    flex: 1;
}
.prototype-root--playing .project-header__player-controls { display: flex; }
.prototype-root--playing .project-header__editing-controls { display: none; }
/* 시연 모드: 좌측(뒤로가기/프로젝트명) 숨기고 우측 그룹이 헤더 전체 폭 사용 */
.prototype-root--playing .project-header-left { display: none; }
.prototype-root--playing .project-header-right { flex: 1; }

.project-header__player-back-btn,
.project-header__player-next-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    font-size: 13px;
    color: #374151;
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 0;
    cursor: pointer;
    font-family: inherit;
    line-height: 1;
    white-space: nowrap;
}
.project-header__player-back-btn:hover:not(:disabled),
.project-header__player-next-btn:hover:not(:disabled) {
    background: #F9FAFB;
    border-color: #D1D5DB;
    color: #111827;
}
.project-header__player-back-btn:disabled,
.project-header__player-next-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.project-header__player-frame-name {
    flex: 1;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    padding: 0 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* 아이콘 전용 버튼 (처음으로) — 정사각 28px */
.project-header__player-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    color: #374151;
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 0;
    cursor: pointer;
    font-family: inherit;
    line-height: 1;
}
.project-header__player-icon-btn:hover:not(:disabled) {
    background: #F9FAFB;
    border-color: #D1D5DB;
    color: #111827;
}
.project-header__player-icon-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* 커스텀 속도 드롭다운 */
.project-header__player-speed {
    position: relative;
}
.project-header__player-speed-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 0;
    cursor: pointer;
    font-family: inherit;
    line-height: 1;
    white-space: nowrap;
}
.project-header__player-speed-trigger:hover,
.project-header__player-speed-trigger[aria-expanded="true"] {
    background: #F9FAFB;
    border-color: #D1D5DB;
    color: #111827;
}
.project-header__player-speed-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 96px;
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 0;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    z-index: 10;
    padding: 4px 0;
    display: flex;
    flex-direction: column;
}
.project-header__player-speed-menu[hidden] { display: none; }
.project-header__player-speed-option {
    padding: 8px 12px;
    font-size: 13px;
    color: #374151;
    background: transparent;
    border: none;
    border-radius: 0;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    line-height: 1.2;
}
.project-header__player-speed-option:hover { background: #F9FAFB; color: #111827; }
.project-header__player-speed-option.is-active {
    color: #4F46E5;
    font-weight: 600;
}

/* 자동재생 / 일시정지 토글 — 디자인 시스템 내 Primary + outlined 변형 */
.project-header__player-autoplay-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: #6366F1;
    border: 1px solid #6366F1;
    border-radius: 0;
    cursor: pointer;
    font-family: inherit;
    line-height: 1;
}
.project-header__player-autoplay-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.project-header__player-autoplay-icon--pause { display: none; }
.project-header__player-autoplay-btn[data-playing="true"] .project-header__player-autoplay-icon--play { display: none; }
.project-header__player-autoplay-btn[data-playing="true"] .project-header__player-autoplay-icon--pause { display: inline-flex; }
.project-header__player-autoplay-btn:hover { background: #4F46E5; border-color: #4F46E5; }
.project-header__player-autoplay-btn[data-playing="true"] {
    background: #fff;
    border-color: #4F46E5;
    color: #4F46E5;
}
.project-header__player-autoplay-btn[data-playing="true"]:hover {
    background: #EEF2FF;
    border-color: #4F46E5;
    color: #4F46E5;
}

/* ====================================================
   3. 편집 캔버스
   ==================================================== */
.prototype__edit-canvas {
    position: fixed;
    top: 48px;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: auto;
    background-color: #F5F5F5;
    background-image:
        radial-gradient(circle, #C4C4C4 1px, transparent 1px);
    background-size: 24px 24px;
    border-radius: 0;
}

.prototype__connections-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    overflow: visible;
}

/* ====================================================
   4. 프레임 카드
   ==================================================== */
.prototype__frame-card {
    position: absolute;
    background: #fff;
    border: 2px solid #E5E7EB;
    box-sizing: content-box;
    z-index: 5;
    border-radius: 0;
}

.prototype__frame-card--start {
    border-color: #6366F1;
}

.prototype__frame-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    border-bottom: 1px solid #E5E7EB;
    background: #FAFAFA;
    border-radius: 0;
}

.prototype__frame-name {
    font-size: 11px;
    font-weight: 500;
    color: #374151;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 8px;
}

.prototype__start-toggle {
    border: none;
    background: none;
    cursor: pointer;
    color: #9CA3AF;
    padding: 2px;
    border-radius: 0;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.prototype__start-toggle--active {
    color: #6366F1;
}

.prototype__frame-viewport {
    position: relative;
    overflow: hidden;
    border-radius: 0;
}

.prototype__hotspot-layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    cursor: crosshair;
}
.prototype__hotspot-layer:hover {
    background: rgba(99, 102, 241, 0.04);
    outline: 1px dashed rgba(99, 102, 241, 0.35);
    outline-offset: -1px;
}

.prototype__frame-card--drop-target {
    outline: 3px solid #6366F1;
    outline-offset: -3px;
}

.prototype__help-banner {
    position: fixed;
    top: 56px;
    left: 50%;
    transform: translateX(-50%);
    background: #111827;
    color: #F9FAFB;
    padding: 10px 16px;
    font-size: 13px;
    font-family: 'Pretendard Variable', 'Pretendard', sans-serif;
    z-index: 1500;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    border: 1px solid #374151;
    border-radius: 0;
}
.prototype__help-banner strong { color: #A5B4FC; font-weight: 600; }
.prototype__help-banner button {
    background: transparent;
    color: #9CA3AF;
    border: 1px solid #4B5563;
    padding: 2px 8px;
    font-size: 11px;
    cursor: pointer;
    border-radius: 0;
    font-family: inherit;
    white-space: nowrap;
    flex-shrink: 0;
}
.prototype__help-banner button:hover { color: #fff; background: #1F2937; }

/* ====================================================
   5. 핫스팟
   ==================================================== */
.prototype__hotspot {
    position: absolute;
    box-sizing: border-box;
    background: rgba(99, 102, 241, 0.1);
    border: 2px dashed #6366F1;
    cursor: pointer;
    z-index: 21;
    border-radius: 0;
}

.prototype__hotspot--selected {
    background: rgba(99, 102, 241, 0.2);
    border-style: solid;
}

.prototype__hotspot--linked {
    border-style: solid;
    background: rgba(99, 102, 241, 0.15);
}

/* 프레임 전체 연결 핫스팟 — 편집 모드에서 테두리 outline만 표시 */
.prototype__hotspot--frame-full {
    background: transparent !important;
    border: 2px dashed #6366F1 !important;
    pointer-events: auto;
}
.prototype__hotspot--frame-full .prototype__hotspot-label { display: none; }
.prototype__hotspot--frame-full .prototype__resize-handle { display: none !important; }

.prototype__hotspot-label {
    position: absolute;
    top: -18px;
    left: 0;
    font-size: 10px;
    color: #6366F1;
    white-space: nowrap;
    background: #fff;
    padding: 1px 4px;
    border: 1px solid #C7D2FE;
    border-radius: 0;
    font-family: 'Pretendard Variable', 'Pretendard', sans-serif;
    pointer-events: none;
}

.prototype__hotspot-grip {
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: #6366F1;
    border: 2px solid #fff;
    cursor: crosshair;
    z-index: 22;
    border-radius: 0;
}

.prototype__hotspot--selected { cursor: move; }

.prototype__resize-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #6366F1;
    border: 1px solid #fff;
    border-radius: 0;
    z-index: 23;
    display: none;
}
.prototype__hotspot--selected .prototype__resize-handle { display: block; }
.prototype__resize-handle--nw { top: -5px; left: -5px; cursor: nwse-resize; }
.prototype__resize-handle--n  { top: -5px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
.prototype__resize-handle--ne { top: -5px; right: -5px; cursor: nesw-resize; }
.prototype__resize-handle--e  { top: 50%; right: -5px; transform: translateY(-50%); cursor: ew-resize; }
.prototype__resize-handle--se { bottom: -5px; right: -5px; cursor: nwse-resize; }
.prototype__resize-handle--s  { bottom: -5px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
.prototype__resize-handle--sw { bottom: -5px; left: -5px; cursor: nesw-resize; }
.prototype__resize-handle--w  { top: 50%; left: -5px; transform: translateY(-50%); cursor: ew-resize; }

/* ====================================================
   6. 인스펙터 패널
   ==================================================== */
.prototype__inspector {
    position: fixed;
    right: 0;
    top: 48px;
    bottom: 0;
    width: 240px;
    background: #fff;
    border-left: 1px solid #E5E7EB;
    display: none;
    flex-direction: column;
    z-index: 1000;
    border-radius: 0;
}

.prototype__inspector.is-open {
    display: flex;
}

.prototype__inspector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #E5E7EB;
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    border-radius: 0;
}

.prototype__inspector-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
}

.prototype__inspector-label {
    font-size: 12px;
    color: #6B7280;
    display: block;
    margin-bottom: 4px;
}

.prototype__inspector-input,
.prototype__inspector-select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #D1D5DB;
    font-size: 13px;
    background: #fff;
    appearance: auto;
    border-radius: 0;
    font-family: 'Pretendard Variable', 'Pretendard', sans-serif;
    color: #111827;
    outline: none;
}

.prototype__inspector-input:focus,
.prototype__inspector-select:focus {
    border-color: #6366F1;
    outline: none;
}

.prototype__inspector-dropdown {
    position: relative;
    width: 100%;
}
.prototype__inspector-dropdown-btn {
    width: 100%;
    height: 34px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: #fff;
    border: 1px solid #D1D5DB;
    color: #111827;
    font-size: 13px;
    font-family: 'Pretendard Variable', 'Pretendard', sans-serif;
    cursor: pointer;
    border-radius: 0;
    outline: none;
}
.prototype__inspector-dropdown-btn:hover {
    border-color: #9CA3AF;
}
.prototype__inspector-dropdown-btn[aria-expanded="true"],
.prototype__inspector-dropdown-btn:focus {
    border-color: #6366F1;
}
.prototype__inspector-dropdown-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    text-align: left;
}
.prototype__inspector-dropdown-menu {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #E5E7EB;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    max-height: 240px;
    overflow-y: auto;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    border-radius: 0;
}
.prototype__inspector-dropdown-menu[hidden] { display: none; }
.prototype__inspector-dropdown-item {
    padding: 8px 12px;
    background: #fff;
    border: none;
    text-align: left;
    font-size: 13px;
    color: #111827;
    font-family: 'Pretendard Variable', 'Pretendard', sans-serif;
    cursor: pointer;
    border-radius: 0;
    line-height: 1.4;
}
.prototype__inspector-dropdown-item:hover {
    background: #F3F4F6;
}
.prototype__inspector-dropdown-item.is-selected {
    background: #EEF2FF;
    color: #4338CA;
    font-weight: 600;
}

.prototype__inspector-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.prototype__inspector-save-btn {
    flex: 1;
    padding: 8px;
    background: #6366F1;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 13px;
    border-radius: 0;
    font-family: 'Pretendard Variable', 'Pretendard', sans-serif;
}

.prototype__inspector-save-btn:hover {
    background: #4F46E5;
}

.prototype__inspector-delete-btn {
    padding: 8px 12px;
    background: #fff;
    color: #EF4444;
    border: 1px solid #EF4444;
    cursor: pointer;
    font-size: 13px;
    border-radius: 0;
    font-family: 'Pretendard Variable', 'Pretendard', sans-serif;
}

.prototype__inspector-delete-btn:hover {
    background: #FEF2F2;
}

/* ====================================================
   7. 시연(플레이어) 모드
   ==================================================== */
.prototype__player {
    position: fixed;
    top: 48px;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #F5F5F5;
    background-image: radial-gradient(circle, #C4C4C4 1px, transparent 1px);
    background-size: 24px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
    border-radius: 0;
}

/* 시연 중엔 도움말 배너 숨김 (플레이어가 전체 화면 차지) */
.prototype-root--playing .prototype__help-banner {
    display: none !important;
}

.prototype__device-container {
    flex: 1;
    display: grid;
    place-items: center;
    grid-template-areas: "stage";
    width: 100%;
    padding: 32px 16px;
    overflow: auto;
}

.prototype__device-container > .prototype__device {
    grid-area: stage;
}

/* ====================================================
   8. 디바이스 목업 — 리얼한 iPhone/iPad/macOS 스타일
   (시연 뷰는 "실제 기기 위에서 앱이 돌아가는 것처럼 보여야"
    하므로 이 블록은 프로젝트의 각진 디자인 규칙에서 예외)
   ==================================================== */
.prototype__device {
    position: relative;
    display: inline-block;
}

.prototype__device--leaving {
    pointer-events: none;
}

/* 화면 전환 — 진입(enter)/이탈(leave). 지속시간은 인라인 animation-duration로 덮어씀 */
.prototype__device--enter-dissolve    { animation: prototype-frame-fade-in 240ms ease-out both; }
.prototype__device--leave-dissolve    { animation: prototype-frame-fade-out 240ms ease-out both; }
.prototype__device--enter-slide-left  { animation: prototype-slide-in-from-right 280ms ease-out both; }
.prototype__device--leave-slide-left  { animation: prototype-slide-out-to-left 280ms ease-out both; }
.prototype__device--enter-slide-right { animation: prototype-slide-in-from-left 280ms ease-out both; }
.prototype__device--leave-slide-right { animation: prototype-slide-out-to-right 280ms ease-out both; }
.prototype__device--enter-slide-up    { animation: prototype-slide-in-from-bottom 280ms ease-out both; }
.prototype__device--leave-slide-up    { animation: prototype-slide-out-to-top 280ms ease-out both; }
.prototype__device--enter-slide-down  { animation: prototype-slide-in-from-top 280ms ease-out both; }
.prototype__device--leave-slide-down  { animation: prototype-slide-out-to-bottom 280ms ease-out both; }

@keyframes prototype-frame-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes prototype-frame-fade-out {
    from { opacity: 1; }
    to   { opacity: 0; }
}

@keyframes prototype-slide-in-from-right { from { opacity: 0; transform: translateX(8%); }  to { opacity: 1; transform: translateX(0); } }
@keyframes prototype-slide-out-to-left   { from { opacity: 1; transform: translateX(0); }   to { opacity: 0; transform: translateX(-8%); } }
@keyframes prototype-slide-in-from-left  { from { opacity: 0; transform: translateX(-8%); } to { opacity: 1; transform: translateX(0); } }
@keyframes prototype-slide-out-to-right  { from { opacity: 1; transform: translateX(0); }   to { opacity: 0; transform: translateX(8%); } }
@keyframes prototype-slide-in-from-bottom { from { opacity: 0; transform: translateY(8%); }  to { opacity: 1; transform: translateY(0); } }
@keyframes prototype-slide-out-to-top     { from { opacity: 1; transform: translateY(0); }   to { opacity: 0; transform: translateY(-8%); } }
@keyframes prototype-slide-in-from-top    { from { opacity: 0; transform: translateY(-8%); } to { opacity: 1; transform: translateY(0); } }
@keyframes prototype-slide-out-to-bottom  { from { opacity: 1; transform: translateY(0); }   to { opacity: 0; transform: translateY(8%); } }

/* ---------- Mobile (iPhone Pro 스타일: Dynamic Island + 홈 인디케이터 + 사이드 버튼) ---------- */
.prototype__device--mobile .prototype__device-shell {
    position: relative;
    background: #0a0a0a;
    border-radius: 52px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    box-shadow:
      0 0 0 1px #2a2a2a,
      0 40px 80px -20px rgba(0,0,0,0.75),
      0 20px 40px -10px rgba(0,0,0,0.5);
}
.prototype__device--mobile .prototype__device-top-bezel {
    position: relative;
    height: 40px;
    background: #000;
    border-radius: 42px 42px 0 0;
}
.prototype__device--mobile .prototype__device-island {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 110px;
    height: 28px;
    background: #000;
    border-radius: 100px;
    box-shadow:
      inset 0 0 0 1px #161616,
      inset 2px 0 3px rgba(255,255,255,0.02);
}
.prototype__device--mobile .prototype__device-island::before,
.prototype__device--mobile .prototype__device-island::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 50%;
    background: #0e0e0e;
}
.prototype__device--mobile .prototype__device-island::before {
    left: 14px;
    width: 6px;
    height: 6px;
    box-shadow: inset 0 0 0 1px #1a1a1a;
}
.prototype__device--mobile .prototype__device-island::after {
    right: 14px;
    width: 10px;
    height: 10px;
    background: radial-gradient(circle at 35% 30%, #1a1a1a 0%, #050505 70%);
    box-shadow: inset 0 0 0 1px #1f1f1f;
}
.prototype__device--mobile .prototype__device-bottom-bezel {
    position: relative;
    height: 28px;
    background: #000;
    border-radius: 0 0 42px 42px;
}
.prototype__device--mobile .prototype__device-home-indicator {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 134px;
    height: 5px;
    background: rgba(255,255,255,0.92);
    border-radius: 100px;
}
.prototype__device--mobile .prototype__device-screen {
    position: relative;
    overflow: auto;
    background: #000;
}

/* 사이드 버튼 */
.prototype__device--mobile .prototype__device-btn {
    position: absolute;
    background: linear-gradient(90deg, #1a1a1a 0%, #2a2a2a 50%, #1a1a1a 100%);
    z-index: 0;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.6);
}
.prototype__device--mobile .prototype__device-btn--power {
    right: -2px;
    top: 160px;
    width: 4px;
    height: 88px;
    border-radius: 0 2px 2px 0;
}
.prototype__device--mobile .prototype__device-btn--mute {
    left: -2px;
    top: 100px;
    width: 4px;
    height: 28px;
    border-radius: 2px 0 0 2px;
}
.prototype__device--mobile .prototype__device-btn--volup {
    left: -2px;
    top: 140px;
    width: 4px;
    height: 52px;
    border-radius: 2px 0 0 2px;
}
.prototype__device--mobile .prototype__device-btn--voldown {
    left: -2px;
    top: 204px;
    width: 4px;
    height: 52px;
    border-radius: 2px 0 0 2px;
}

/* ---------- Tablet (iPad Pro 스타일: 얇은 베젤 + 전면 카메라) ---------- */
.prototype__device--tablet .prototype__device-shell {
    position: relative;
    background: #0a0a0a;
    border-radius: 38px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    box-shadow:
      0 0 0 1px #2a2a2a,
      0 40px 80px -20px rgba(0,0,0,0.7),
      0 20px 40px -10px rgba(0,0,0,0.4);
}
.prototype__device--tablet .prototype__device-top-bezel {
    position: relative;
    height: 12px;
    background: #000;
}
.prototype__device--tablet .prototype__device-camera {
    position: absolute;
    top: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: radial-gradient(circle at 30% 30%, #2a2a2a 0%, #060606 70%);
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px #1a1a1a;
}
.prototype__device--tablet .prototype__device-bottom-bezel {
    height: 12px;
    background: #000;
}
.prototype__device--tablet .prototype__device-screen {
    position: relative;
    overflow: auto;
    background: #000;
}

/* ---------- Desktop (macOS Safari 스타일 브라우저 창) ---------- */
.prototype__device--desktop .prototype__device-shell {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #e4e4e7;
    border-radius: 12px;
    box-shadow:
      0 0 0 1px rgba(0,0,0,0.08),
      0 30px 60px -15px rgba(0,0,0,0.55),
      0 15px 30px -10px rgba(0,0,0,0.3);
    overflow: hidden;
}
.prototype__device--desktop .prototype__device-chrome {
    height: 44px;
    background: linear-gradient(180deg, #f2f2f4 0%, #e6e6e9 100%);
    border-bottom: 1px solid rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    padding: 0 14px;
    gap: 10px;
}
.prototype__device--desktop .prototype__device-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-shadow: inset 0 0 0 0.5px rgba(0,0,0,0.2);
}
.prototype__device--desktop .prototype__device-dot--red    { background: #ff5f57; }
.prototype__device--desktop .prototype__device-dot--yellow { background: #febc2e; }
.prototype__device--desktop .prototype__device-dot--green  { background: #28c840; }
.prototype__device--desktop .prototype__device-url {
    flex: 1;
    height: 26px;
    margin: 0 80px 0 14px;
    max-width: 480px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #d4d4d8;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    color: #52525b;
    font-family: -apple-system, 'SF Pro Text', 'Pretendard Variable', sans-serif;
}
.prototype__device--desktop .prototype__device-url::before {
    content: '';
    width: 10px;
    height: 10px;
    border: 1.5px solid #71717a;
    border-radius: 50%;
    position: relative;
}
.prototype__device--desktop .prototype__device-screen {
    position: relative;
    overflow: auto;
    background: #fff;
}

/* 공통: 화면 영역 */
.prototype__device-screen {
    position: relative;
    overflow: auto;
    background: #000;
}

.prototype__device-scroll-content {
    position: relative;
    width: 100%;
    min-height: 100%;
}

.prototype__device-hotspot-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
}

/* 시연 모드 핫스팟 — 평상시 완전 투명, 이벤트 시 펄스 */
.prototype__play-hotspot {
    position: absolute;
    cursor: pointer;
    z-index: 10;
    background: transparent;
    border: none;
    box-sizing: border-box;
}

@keyframes prototype-hotspot-tap {
    0%   { background: rgba(99,102,241,0);    box-shadow: inset 0 0 0 0 rgba(99,102,241,0); }
    40%  { background: rgba(99,102,241,0.45); box-shadow: inset 0 0 0 2px #6366F1; }
    100% { background: rgba(99,102,241,0);    box-shadow: inset 0 0 0 0 rgba(99,102,241,0); }
}
.prototype__play-hotspot--tap {
    animation: prototype-hotspot-tap 0.35s ease-out;
}

@keyframes prototype-hotspot-reveal {
    0%   { background: rgba(99,102,241,0);    box-shadow: inset 0 0 0 0 rgba(99,102,241,0); }
    35%  { background: rgba(99,102,241,0.35); box-shadow: inset 0 0 0 2px #6366F1; }
    100% { background: rgba(99,102,241,0);    box-shadow: inset 0 0 0 0 rgba(99,102,241,0); }
}
.prototype__play-hotspot--reveal {
    animation: prototype-hotspot-reveal 1.1s ease-out;
}

/* ====================================================
   9. SVG 연결선 (JS에서 속성으로 적용, 클래스 참고용)
   ==================================================== */
/* .prototype__temp-line — SVG <line> 엘리먼트에 JS로 직접 적용:
   stroke: #6366F1
   stroke-dasharray: 4
   stroke-width: 2
   stroke-linecap: square
   fill: none
*/
.prototype__temp-line {
    stroke: #6366F1;
    stroke-dasharray: 4;
    stroke-width: 2;
    stroke-linecap: square;
    fill: none;
}

/* ====================================================
   10. 공통 유틸
   ==================================================== */
.prototype__hidden {
    display: none !important;
}

.prototype__sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ====================================================
   KlavyAgent 우측 플로팅 레일
   ==================================================== */
.prototype__agent-rail {
    position: fixed;
    top: 72px;
    right: 16px;
    bottom: 16px;
    z-index: 900;
    display: flex;
    align-items: stretch;
    pointer-events: none;
}
.prototype__agent-rail #ka-wrapper {
    position: relative;
    top: 0;
    height: 100%;
    max-height: 100%;
    pointer-events: auto;
}

/* 시연 모드 진입 시 에이전트 자동 숨김 */
.prototype-root--playing .prototype__agent-rail,
.prototype-root--playing #ka-toggle-btn { display: none !important; }

/* ====================================================
   캔버스 스테이지 — 줌 transform 적용 대상
   ==================================================== */
.prototype__canvas-stage {
    position: relative;
    transform-origin: 0 0;
    /* width / height / transform 은 JS 에서 동적 설정 */
    min-width: 100%;
    min-height: 100%;
}

/* ====================================================
   핸드툴 — 편집 캔버스 드래그 패닝
   ==================================================== */
.prototype__edit-canvas.is-hand-mode,
.prototype__edit-canvas.is-hand-mode * { cursor: grab; }
.prototype__edit-canvas.is-hand-mode.is-panning,
.prototype__edit-canvas.is-hand-mode.is-panning * { cursor: grabbing; }

/* 핸드툴 활성 시 프레임/핫스팟 이벤트 차단 (드래그 충돌 방지) */
.prototype__edit-canvas.is-hand-mode .prototype__frame-card,
.prototype__edit-canvas.is-hand-mode .prototype__hotspot-layer {
    pointer-events: none;
}

/* ── 프레임 포트 (우측 연결 핸들) ── */
.prototype__frame-port {
    position: absolute;
    top: 50%;
    right: -8px;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    background: #6366F1;
    border: 2px solid #fff;
    border-radius: 0;
    cursor: crosshair;
    opacity: 0;
    transition: opacity 120ms ease;
    z-index: 30;
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.18);
}
.prototype__frame-card:hover .prototype__frame-port,
.prototype__frame-card--drop-target .prototype__frame-port,
.prototype__frame-card.is-port-dragging .prototype__frame-port {
    opacity: 1;
}
.prototype__edit-canvas.is-hand-mode .prototype__frame-port { display: none; }

/* 시연 모드 frame-full: 콘텐츠 가리지 않게 투명, 테두리만 힌트 */
.prototype__play-hotspot--frame-full {
    background: transparent !important;
    box-shadow: inset 0 0 0 3px rgba(99, 102, 241, 0.18) !important;
}
.prototype__play-hotspot--frame-full.prototype__play-hotspot--reveal {
    background: transparent !important;
    box-shadow: inset 0 0 0 3px rgba(99, 102, 241, 0.35) !important;
}
