.exam-interactive-shell {
    margin: 22px 0 28px;
}

.exam-interactive-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
}

.exam-interactive-edit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid #93c5fd;
    border-radius: 9px;
    background: #eff6ff;
    color: #1d4ed8;
    text-decoration: none;
    font-size: 13px;
    font-weight: 800;
}

.exam-interactive-edit:hover {
    background: #dbeafe;
}

.exam-interactive {
    width: 100%;
    margin: 22px 0 28px;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    background: #f8fafc;
    overflow: hidden;
    box-sizing: border-box;
}

.exam-interactive-shell .exam-interactive {
    margin: 0;
}

.exam-interactive__scale-shell {
    position: relative;
    margin: 0 auto;
    overflow: visible;
}

.exam-interactive__canvas {
    position: relative;
    transform-origin: top left;
    overflow: hidden;
    border-radius: 15px;
    box-sizing: border-box;
}

.exam-interactive__element {
    position: absolute;
    box-sizing: border-box;
    overflow: hidden;
}

.exam-interactive__text-block {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    color: #334155;
    line-height: 1.45;
    white-space: normal;
}

.exam-interactive__text-block.is-title {
    color: #0f172a;
    font-weight: 800;
}

.exam-interactive__text-block.is-intro {
    align-items: flex-start;
    color: #475569;
}

.exam-interactive__text-block.is-note {
    align-items: flex-start;
    color: #64748b;
}

.exam-interactive__control-card {
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
}

.exam-interactive__control-card label {
    display: block;
    margin-bottom: 8px;
    color: #0f172a;
    font-weight: 800;
}

.exam-interactive__control-card input[type="range"] {
    width: 100%;
}

.exam-interactive__control-card select {
    width: 100%;
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    background: #fff;
    color: #0f172a;
    font: inherit;
}

.exam-interactive__output {
    display: inline-block;
    margin-top: 7px;
    color: #1d4ed8;
    font-weight: 800;
}

.exam-interactive__gauge {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
}

.exam-interactive__gauge svg {
    display: block;
    width: 100%;
    height: 100%;
}

.exam-interactive__dynamic-text {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0f172a;
    text-align: center;
    font-weight: 800;
    line-height: 1.2;
    pointer-events: none;
}

.exam-interactive__dynamic-text.is-band {
    color: #9a3412;
}

.exam-interactive__dynamic-text.is-gauge-value {
    color: #0f172a;
}

.exam-interactive__metric-card {
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
}

.exam-interactive__metric-card span {
    display: block;
    margin-bottom: 6px;
    color: #64748b;
    font-size: 0.72em;
    line-height: 1.2;
}

.exam-interactive__metric-card strong {
    display: block;
    color: #0f172a;
    font-size: 1em;
    line-height: 1.3;
    word-break: break-word;
}

.exam-interactive__formula-box {
    padding: 13px 15px;
    border-left: 4px solid #7c3aed;
    border-radius: 9px;
    background: #f5f3ff;
    color: #4c1d95;
    font-weight: 700;
    line-height: 1.5;
}

.exam-interactive__error {
    margin: 16px;
    padding: 12px 14px;
    border: 1px solid #fecaca;
    border-radius: 10px;
    background: #fff1f2;
    color: #9f1239;
    font-weight: 700;
}

.exam-interactive.is-editor-preview {
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    overflow: visible;
}

.exam-interactive.is-editor-preview .exam-interactive__canvas {
    box-shadow:
        0 0 0 1px #cbd5e1,
        0 10px 30px rgba(15, 23, 42, 0.08);
}

.exam-interactive.is-editor-preview
.exam-interactive__element {
    cursor: move;
    pointer-events: auto;
}

.exam-interactive.is-editor-preview
.exam-interactive__element:hover {
    outline: 2px dashed #60a5fa;
    outline-offset: -2px;
}

.exam-interactive.is-editor-preview
.exam-interactive__element.is-selected {
    outline: 3px solid #2563eb;
    outline-offset: -3px;
    z-index: 999 !important;
}

.exam-interactive.is-editor-preview
.exam-interactive__element.is-selected::before {
    content: attr(data-interactive-element);
    position: absolute;
    top: 2px;
    left: 4px;
    z-index: 20;
    padding: 2px 5px;
    border-radius: 4px;
    background: rgba(37, 99, 235, 0.92);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    pointer-events: none;
}

.exam-interactive-editor-resize-handle {
    position: absolute;
    right: -1px;
    bottom: -1px;
    z-index: 40;
    width: 18px;
    height: 18px;
    border: 2px solid #ffffff;
    border-radius: 5px 0 0 0;
    background: #2563eb;
    cursor: nwse-resize;
    box-shadow: 0 0 0 1px #1d4ed8;
}

@media (max-width: 760px) {
    .exam-interactive-shell {
        margin: 16px 0 22px;
    }

    .exam-interactive-actions {
        justify-content: stretch;
    }

    .exam-interactive-edit {
        width: 100%;
        justify-content: center;
    }
}
