.ei-lab { border: 1px solid var(--border); border-radius: 12px; background: #121217; overflow: hidden; }
.ei-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: #16151b; border-bottom: 1px solid var(--border); }
.ei-tabs button { min-width: 0; padding: 16px 10px; color: var(--muted); font-size: 14px; border-bottom: 2px solid transparent; }
.ei-tabs button[aria-pressed="true"] { color: var(--ink); background: #d9d9030d; border-bottom-color: #d9d903; }
.ei-tabs button:hover { color: var(--ink); background: #6360bf14; }
.ei-tabs button[aria-pressed="true"]:hover { color: #f8f6ff; background: #d9d90317; }
.ei-workspace { display: grid; grid-template-columns: minmax(0, .8fr) 144px minmax(0, 1.4fr); gap: 16px; padding: 28px 24px; align-items: start; }
.ei-source, .ei-destination { min-width: 0; }
.ei-source-header, .ei-target-header { display: flex; align-items: flex-start; align-content: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 6px 10px; margin-bottom: 14px; min-height: 54px; }
.ei-source-header h3, .ei-target-header h3 { font-size: 18px; letter-spacing: 0; margin: 0; }
.ei-source-header > span { color: var(--muted); font-size: 14px; }
.ei-foreground { display: block; position: relative; width: 100%; height: 230px; padding: 12px 30px; background: #101014; border: 1px solid #322e3d; border-radius: 8px; user-select: none; }
.ei-foreground img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; filter: url(#explorer-sticker-shadow); }
.ei-foreground-items { display: grid; grid-template-columns: repeat(var(--foreground-count, 1), minmax(0, 1fr)); gap: 12px; width: 100%; height: 100%; }
.ei-foreground-item { display: flex; flex-direction: column; min-width: 0; min-height: 0; gap: 6px; }
.ei-foreground-image { display: block; position: relative; flex: 1; min-height: 0; }
.ei-foreground-image > img { position: absolute; inset: 0; transition: opacity .35s ease; }
.ei-foreground-after { opacity: 0; }
.ei-lab.is-edited .has-edited-preview > .ei-foreground-before { opacity: 0; }
.ei-lab.is-edited .ei-foreground-after { opacity: 1; }
.ei-foreground-name { color: var(--ink); font-size: 14px; line-height: 1.4; }
.ei-lab.has-pair .ei-foreground { padding-inline: 12px; }
.ei-drag-label { margin: 10px 0 20px; text-align: center; color: var(--muted); font-size: 14px; min-height: 21px; }
.ei-lab.is-edited .ei-drag-label { color: var(--pale); }
.ei-edit-control { display: block; width: 100%; padding: 14px; border: 1px solid #625a80; border-radius: 8px; background: #1b1825; text-align: left; user-select: none; -webkit-user-select: none; }
.ei-edit-control:focus-visible { outline: 2px solid var(--pale); outline-offset: 3px; }
.ei-lab.is-edited .ei-edit-control { touch-action: none; cursor: grab; }
.ei-lab.is-edited .ei-edit-control:hover { border-color: #b6a9ec; }
.ei-lab.is-edited .ei-edit-control.is-dragging { cursor: grabbing; }
.ei-edit-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 10px; margin-bottom: 38px; font-size: 14px; color: var(--ink); }
.ei-edit-action-wrap { position: relative; display: inline-flex; margin-left: auto; }
.ei-edit-action { padding: 5px 7px; color: #ddd4ff; border: 1px solid #756aa3; border-radius: 4px; background: #6360bf17; font-size: 14px; line-height: 1.5; white-space: nowrap; }
.ei-edit-action:hover { color: #fff; background: #6360bf38; }
.ei-click-guide { position: absolute; left: 50%; top: calc(100% - 4px); z-index: 2; width: 0; height: 0; pointer-events: none; }
.ei-click-guide > img { position: absolute; left: -14px; top: -9px; width: 44px; height: 44px; max-width: none; filter: drop-shadow(0 3px 3px #0009); transform-origin: 14px 9px; animation: ei-click-guide 2.8s ease-in-out infinite; }
.ei-click-ring { position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; border: 2px solid #ded7ff; border-radius: 50%; animation: ei-click-ring 2.8s ease-out infinite; }
.ei-lab:not(.is-edited) .ei-edit-action { animation: ei-click-press 2.8s ease-in-out infinite; }
.ei-lab.is-edited .ei-click-guide { display: none; }
.ei-map-grid { display: grid; grid-template-columns: repeat(var(--edit-count, 1), minmax(0, 1fr)); gap: 12px; }
.ei-map-grid figure { margin: 0; min-width: 0; }
.ei-map-toggle { display: block; width: 100%; padding: 0; border-radius: 5px; }
.ei-lab.is-edited .ei-map-toggle { cursor: grab; }
.ei-map-toggle:hover .ei-map-pair { box-shadow: 0 0 0 1px #b6a9ec; }
.ei-map-object { display: block; min-height: 40px; margin-bottom: 8px; color: var(--ink); font-size: 14px; line-height: 1.4; text-align: center; }
.ei-map-pair { display: block; position: relative; width: 100%; aspect-ratio: 1; max-width: 190px; margin-inline: auto; border-radius: 5px; overflow: hidden; background: #605e69; }
.ei-map-pair img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transition: opacity .35s ease; pointer-events: none; }
.ei-map-after { opacity: 0; }
.ei-lab.is-edited .ei-map-before { opacity: 0; }
.ei-lab.is-edited .ei-map-after { opacity: 1; }
.ei-map-grid figcaption { text-align: center; padding-top: 9px; line-height: 1.5; font-size: 14px; }
.ei-map-setting { display: block; color: var(--muted); }
.ei-lab.is-edited .ei-map-setting { color: var(--pale); }
.ei-unchanged { margin-top: 18px; padding-top: 12px; border-top: 1px solid #443d53; }
.ei-unchanged[hidden] { display: none; }
.ei-unchanged > p { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.ei-unchanged-groups { display: grid; gap: 10px; }
.ei-unchanged-object { display: block; margin-bottom: 5px; font-size: 12px; color: #c4bfd0; }
.ei-unchanged-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
.ei-unchanged-grid figure { margin: 0; min-width: 0; text-align: center; }
.ei-unchanged-grid img { width: 40px; max-width: 100%; aspect-ratio: 1; margin-inline: auto; object-fit: contain; border: 1px solid #5e576c; border-radius: 3px; background: #605e69; pointer-events: none; }
.ei-unchanged-grid figcaption { margin-top: 3px; font-size: 12px; line-height: 1.4; color: #c4bfd0; }
.ei-insert-bridge { display: flex; flex-direction: column; align-items: center; gap: 16px; margin-top: var(--ei-guide-offset, 365px); min-width: 0; color: var(--muted); text-align: center; font-size: 14px; pointer-events: none; }
.ei-flow-guide { width: 100%; }
.ei-lab:not(.is-edited) .ei-flow-guide, .ei-lab.is-inserted .ei-flow-guide { visibility: hidden; }
.ei-flow-guide > p { margin: 0 0 6px; color: #ded7ff; font-size: 14px; line-height: 1.5; }
.ei-guide-arrow { display: block; width: 100%; height: 54px; color: #aaa0f4; }
.ei-arrow-vertical { display: none; }
.ei-hand-track { display: block; position: relative; height: 48px; margin: 3px 7px 0; }
.ei-drag-hand { position: absolute; top: 0; left: 0; width: 44px; height: 44px; object-fit: contain; filter: drop-shadow(0 4px 4px #0009); animation: ei-drag-guide 2.6s ease-in-out infinite; }
.ei-insert-brand { display: flex; align-items: center; justify-content: center; gap: 7px; flex-wrap: wrap; width: 100%; font-size: 14px; }
.ei-insert-brand > img { width: 30px; height: 30px; object-fit: contain; }
@keyframes ei-click-guide {
  0%, 10% { transform: translate(6px, 14px); opacity: 0; }
  25%, 40% { transform: translate(0, 0); opacity: 1; }
  47% { transform: scale(.9); opacity: 1; }
  55%, 74% { transform: translate(0, 0); opacity: 1; }
  100% { transform: translate(6px, 10px); opacity: 0; }
}
@keyframes ei-click-ring {
  0%, 43% { transform: scale(.5); opacity: 0; }
  47% { transform: scale(1); opacity: .9; }
  70%, 100% { transform: scale(3); opacity: 0; }
}
@keyframes ei-click-press {
  0%, 40%, 58%, 100% { background: #6360bf17; }
  47% { background: #9184d957; }
}
@keyframes ei-drag-guide {
  0%, 8% { left: 0; opacity: 0; }
  18% { left: 0; opacity: 1; }
  66%, 78% { left: calc(100% - 44px); opacity: 1; }
  94%, 100% { left: calc(100% - 44px); opacity: 0; }
}
.ei-target-header button { color: var(--muted); padding: 4px 0; font-size: 14px; border-bottom: 1px solid #514a61; }
.ei-target-header button:hover { color: var(--ink); }
.ei-target { display: block; position: relative; width: 100%; aspect-ratio: 1; padding: 0; overflow: hidden; border: 1px solid #514a61; border-radius: 8px; background: #101014; touch-action: manipulation; scroll-margin-block: 90px 20px; }
.ei-target > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.ei-target-result { opacity: 0; transition: opacity .45s ease; }
.ei-lab.is-inserted .ei-target-result { opacity: 1; }
.ei-target.is-drop-ready { outline: 3px solid var(--pale); outline-offset: -4px; }
.ei-drop-hint { position: absolute; inset: auto 12px 12px; padding: 9px 12px; border: 1px solid #a99dd65c; border-radius: 5px; background: #17131ed9; color: var(--ink); font-size: 14px; line-height: 1.5; pointer-events: none; }
.ei-lab.is-inserted .ei-drop-hint { display: none; }
.ei-target-caption { min-height: 22px; margin: 12px 0 0; text-align: center; color: var(--muted); font-size: 14px; }
.ei-lab[aria-busy="true"] .ei-workspace { opacity: .35; pointer-events: none; }
.ei-crop-ghost { position: fixed; z-index: 210; width: min(224px, calc(100vw - 24px)); padding: 10px; border: 1px solid #afa2e6; border-radius: 8px; background: #211b30f5; box-shadow: 0 12px 32px #0007; pointer-events: none; }
.ei-ghost-title { display: block; margin-bottom: 7px; color: #eee9fb; font: 12px/1.4 var(--body); }
.ei-ghost-maps { display: grid; grid-template-columns: repeat(var(--edit-count, 1), minmax(0, 1fr)); gap: 6px; }
.ei-ghost-maps img { width: 100%; height: 82px; min-width: 0; object-fit: contain; background: #605e69; border-radius: 3px; }
.ei-ghost-unchanged { display: flex; gap: 5px; margin-top: 6px; }
.ei-ghost-unchanged img { width: 26px; height: 26px; object-fit: contain; background: #605e69; border-radius: 2px; }
.ei-lab.is-edit-prompt .ei-edit-control { outline: 2px solid var(--pale); outline-offset: 3px; }
@media (max-width: 1000px) {
  .ei-workspace { grid-template-columns: minmax(0, .8fr) 126px minmax(0, 1.4fr); gap: 12px; padding: 24px 18px; }
  .ei-foreground { height: 200px; padding: 12px; }
  .ei-edit-control { padding: 12px; }
}
@media (max-width: 760px) {
  .ei-workspace { grid-template-columns: 1fr; gap: 24px; padding: 22px 16px; }
  .ei-foreground { height: 230px; }
  .ei-insert-bridge { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: center; gap: 12px; margin: 0; }
  .ei-insert-brand { grid-column: 1; grid-row: 1; flex-direction: column; gap: 8px; }
  .ei-insert-brand > img { width: 34px; height: 34px; }
  .ei-flow-guide { grid-column: 2; grid-row: 1; }
  .ei-guide-arrow { height: 48px; }
  .ei-arrow-horizontal { display: none; }
  .ei-arrow-vertical { display: block; }
  .ei-hand-track { height: 52px; width: 44px; margin: 0 auto; }
  .ei-drag-hand { animation-name: ei-drag-guide-down; }
  .ei-map-pair { max-width: 170px; }
  .ei-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ei-tabs button { padding: 13px 6px; }
}
@keyframes ei-drag-guide-down {
  0%, 8% { left: 0; top: 0; opacity: 0; }
  18% { left: 0; top: 0; opacity: 1; }
  66%, 78% { left: 0; top: 8px; opacity: 1; }
  94%, 100% { left: 0; top: 8px; opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .ei-map-pair img, .ei-foreground-image > img, .ei-target-result { transition: none; }
  .ei-drag-hand { animation: none; left: calc(50% - 22px); top: 0; opacity: 1; }
  .ei-click-guide > img, .ei-lab:not(.is-edited) .ei-edit-action { animation: none; }
  .ei-click-ring { display: none; }
}
