.dd2 {
    --dd2-border: rgba(15, 23, 42, 0.14);
    --dd2-accent: rgba(88, 80, 218, 0.95);
    --dd2-wrong: rgba(220, 38, 38, 0.95);
    --dd2-zone: rgba(88, 80, 218, 0.22);
    --dd2-zone-active: rgba(88, 80, 218, 0.38);
    --dd2-surface: #ffffff;
    --dd2-text: #1f2a44;
    --dd2-muted: #6c7a92;
}

.dd2-stage {
    margin-top: 8px;
    text-align: center;
}

.dd2-imageWrap {
    position: relative;
    display: inline-block;
    max-width: 100%;
    border-radius: 20px;
    border: 1px solid var(--dd2-border);
    overflow: hidden;
    background: var(--dd2-surface);
}

.dd2-image {
    display: block;
    max-width: 100%;
    max-height: 400px;
    width: auto;
    height: auto;
    user-select: none;
    -webkit-user-drag: none;
    touch-action: none;
}

@media (max-width: 768px) {
    .dd2-image {
        max-height: 260px;
    }
}

.dd2-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.dd2-zones,
.dd2-markers,
.dd2-placed {
    position: absolute;
    inset: 0;
}

.dd2-zone {
    position: absolute;
    border: 2px dashed var(--dd2-zone);
    border-radius: 12px;
    box-sizing: border-box;
    opacity: 0.0;
    transition: opacity 140ms ease, border-color 140ms ease, background 140ms ease;
}

.dd2.is-dragging .dd2-zone {
    opacity: 1;
}

.dd2-zone.is-hot {
    border-color: var(--dd2-zone-active);
    background: rgba(88, 80, 218, 0.08);
}

.dd2-zone.dd2-zone--circle {
    border-radius: 999px;
}

.dd2-zoneSvg {
    width: 100%;
    height: 100%;
}

.dd2-zonePoly {
    fill: rgba(88, 80, 218, 0.06);
    stroke: var(--dd2-zone);
    stroke-width: 2;
    stroke-dasharray: 7 6;
    opacity: 0.0;
    transition: opacity 140ms ease, stroke 140ms ease;
}

.dd2.is-dragging .dd2-zonePoly {
    opacity: 1;
}

.dd2-zonePoly.is-hot {
    stroke: var(--dd2-zone-active);
}

.dd2-tray {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

.dd2-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 44px;
    border-radius: 14px;
    border: 1px solid var(--dd2-border);
    background: #fff;
    color: var(--dd2-text);
    font-weight: 900;
    letter-spacing: -0.02em;
    cursor: grab;
    user-select: none;
    touch-action: none;
    transform: translate3d(0, 0, 0);
    transition: box-shadow 160ms ease, transform 160ms ease, opacity 160ms ease;
    box-shadow: 0 10px 24px rgba(24, 33, 66, 0.07);
}

.dd2-item:focus-visible {
    outline: 2px solid rgba(88, 80, 218, 0.35);
    outline-offset: 2px;
}

.dd2-item.is-placed {
    cursor: grab;
}

.dd2-item.is-dragging {
    cursor: grabbing;
    z-index: 3;
    box-shadow: 0 16px 36px rgba(24, 33, 66, 0.16);
}

.dd2-item.is-disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.dd2-placed .dd2-item {
    position: absolute;
    left: 0;
    top: 0;
    transform: translate3d(-50%, -50%, 0);
    pointer-events: auto;
}

.dd2-status {
    margin-top: 10px;
    text-align: center;
    font-weight: 700;
    color: var(--dd2-muted);
    font-size: 13px;
    min-height: 18px;
}

.exam-btn.is-disabled,
.exam-btn[aria-disabled="true"] {
    opacity: 0.55;
    pointer-events: none;
}

/* Results */
.dd2r {
    margin-top: 12px;
}
.dd2r-stage {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--ui-border, #e2e8f0);
    background: #fff;
}
.dd2r-img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}
.dd2r-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.dd2r-marker {
    position: absolute;
    left: 0;
    top: 0;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    transform: translate3d(-50%, -50%, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(88, 80, 218, 0.55);
    color: #111827;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.14);
}
.dd2r-marker.is-correctPos {
    background: rgba(88, 80, 218, 0.06);
    border-style: dashed;
}
.dd2r-marker.is-wrong {
    border-color: rgba(220, 38, 38, 0.75);
}
.dd2r-list {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.dd2r-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid var(--ui-border, #e2e8f0);
    background: #fff;
    flex-wrap: wrap;
}
.dd2r-chip {
    border-radius: 999px;
    padding: 6px 10px;
    font-weight: 800;
    border: 1px solid var(--ui-border, #e2e8f0);
    color: #dc2626;
    border-color: rgba(220, 38, 38, 0.25);
    background: rgba(220, 38, 38, 0.08);
}
.dd2r-muted {
    color: var(--ui-muted, #6b7280);
    font-weight: 700;
}

/* Admin editor */
.dd2a {
    margin-top: 12px;
    display: grid;
    grid-template-columns: minmax(320px, 1fr) 360px;
    gap: 14px;
    align-items: start;
}
@media (max-width: 991px) {
    .dd2a { grid-template-columns: 1fr; }
}
.dd2a-imageWrap {
    position: relative;
    border-radius: 16px;
    border: 1px solid rgba(15, 23, 42, 0.14);
    overflow: hidden;
    background: #fff;
}
.dd2a-img {
    display: block;
    width: 100%;
    height: auto;
}
.dd2a-overlay {
    position: absolute;
    inset: 0;
    touch-action: none;
}
.dd2a-zone {
    position: absolute;
    border: 2px dashed rgba(88, 80, 218, 0.65);
    background: rgba(88, 80, 218, 0.06);
    border-radius: 12px;
    overflow: hidden;
}
.dd2a-zone.is-circle { border-radius: 999px; }
.dd2a-zone.is-draft { opacity: 0.85; }
.dd2a-zoneLabel{
    position: absolute;
    left: 8px;
    top: 8px;
    border-radius: 999px;
    padding: 4px 8px;
    font-weight: 900;
    font-size: 12px;
    color: rgba(30, 41, 59, 1);
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(15, 23, 42, 0.12);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}
.dd2a-panel {
    border: 1px solid rgba(15, 23, 42, 0.14);
    background: #fff;
    border-radius: 16px;
    padding: 12px;
}
.dd2a-toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.dd2a-toolbar .admin-btn.is-active {
    border-color: rgba(88, 80, 218, 0.45);
    background: rgba(88, 80, 218, 0.10);
}
.dd2a-hint {
    margin-top: 8px;
    color: rgba(100, 116, 139, 1);
    font-weight: 700;
    font-size: 12px;
}
.dd2a-sectionTitle {
    margin-top: 12px;
    font-weight: 900;
}
.dd2a-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 10px;
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: #fff;
    margin-top: 8px;
}
.dd2a-rowTitle {
    font-weight: 800;
    font-size: 13px;
}
.dd2a-itemRow {
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}
.dd2a-itemAutoZone {
    font-size: 13px;
    color: rgba(100, 116, 139, 1);
}
.dd2a-itemIdx {
    width: 32px;
    height: 32px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    background: rgba(88, 80, 218, 0.10);
    color: rgba(88, 80, 218, 1);
}
.dd2a-itemId {
    font-size: 12px;
    color: rgba(100, 116, 139, 1);
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dd2a-svg {
    width: 100%;
    height: 100%;
}
.dd2a-poly {
    fill: rgba(88, 80, 218, 0.06);
    stroke: rgba(88, 80, 218, 0.70);
    stroke-width: 2;
    stroke-dasharray: 7 6;
}
.dd2a-polyText{
    font-size: 3.2px;
    font-weight: 900;
    fill: rgba(30, 41, 59, 1);
    paint-order: stroke;
    stroke: rgba(255, 255, 255, 0.92);
    stroke-width: 1.4px;
    dominant-baseline: middle;
    text-anchor: middle;
}
