.esj {
    --esj-gold: #f5c46b;
    --esj-background: #09090b;
    --esj-line: rgba(255, 255, 255, 0.1);
    --esj-muted: #b6b6bf;
    position: relative;
    container: esj / inline-size;
    color: #f4f4f5;
    font-size: 0.8125rem;
    line-height: 1.4;
    color-scheme: dark;
}

.esj [hidden],
.esj .esj-marker[hidden],
.esj.esj-ready .esj-yedek {
    display: none;
}

.esj .esj-stage,
.esj > .esj-yedek {
    position: relative;
    width: 100%;
    height: clamp(460px, 74vh, 760px);
    overflow: hidden;
    border-radius: 20px;
    background: var(--esj-background);
    box-shadow: inset 0 0 0 1px var(--esj-line);
}

.esj .esj-yedek {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    color: var(--esj-muted);
}

.esj > .esj-yedek {
    height: clamp(460px, 74vh, 760px);
}

.esj .esj-live,
.esj .esj-markers {
    position: absolute;
    inset: 0;
}

.esj .esj-canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: grab;
}

.esj .esj-canvas:active {
    cursor: grabbing;
}

.esj .esj-status {
    margin: 0.65rem 0 0;
    color: var(--esj-muted);
}

.esj .esj-panel,
.esj .esj-legend {
    border: 1px solid var(--esj-line);
    background: rgba(9, 9, 11, 0.78);
    backdrop-filter: blur(12px);
}

.esj .esj-panel {
    position: absolute;
    z-index: 2;
    bottom: 14px;
    left: 14px;
    width: min(310px, calc(100% - 28px));
    box-sizing: border-box;
    padding: 12px 14px;
    border-radius: 16px;
}

.esj .esj-panel-heading {
    margin: 0 0 8px;
    color: #fff;
    font-size: 0.97rem;
    font-weight: 650;
}

.esj .esj-slider {
    display: block;
    margin: 0 0 3px;
}

.esj .esj-slider-caption,
.esj .esj-readout,
.esj .esj-choice {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.esj .esj-slider-value,
.esj .esj-readout-value,
.esj .esj-ticks {
    font-variant-numeric: tabular-nums;
}

.esj .esj-slider-value {
    color: var(--esj-gold);
    font-weight: 600;
}

.esj .esj-range {
    display: block;
    width: 100%;
    height: 22px;
    margin: 0;
    accent-color: var(--esj-gold);
    cursor: pointer;
}

.esj .esj-range:focus-visible,
.esj button:focus-visible {
    outline: 2px solid var(--esj-gold);
    outline-offset: 2px;
}

.esj .esj-readouts {
    display: grid;
    gap: 3px;
    margin: 7px 0 5px;
    padding: 8px 0 0;
    border-top: 1px solid var(--esj-line);
}

.esj .esj-readout dt,
.esj .esj-choice-name {
    color: var(--esj-muted);
}

.esj .esj-readout-value {
    margin: 0;
    font-weight: 650;
    text-align: right;
}

.esj .esj-target-met {
    color: #34d399;
}

.esj .esj-target-missed {
    color: var(--esj-gold);
}

.esj .esj-source,
.esj .esj-hint {
    margin: 5px 0 0;
    color: var(--esj-muted);
    font-size: 0.6875rem;
    line-height: 1.4;
}

.esj .esj-choice {
    align-items: center;
    margin-top: 6px;
}

.esj .esj-segments,
.esj .esj-actions {
    display: flex;
    gap: 3px;
}

.esj .esj-segments {
    padding: 2px;
    border: 1px solid var(--esj-line);
    border-radius: 9px;
}

.esj .esj-camera-choice .esj-segments {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.esj .esj-actions {
    gap: 5px;
    margin-top: 7px;
}

.esj .esj-segments button,
.esj .esj-actions button {
    min-height: 26px;
    padding: 3px 8px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #ebebef;
    font: inherit;
    font-size: 0.75rem;
    cursor: pointer;
}

.esj .esj-segments button {
    white-space: nowrap;
}

.esj .esj-actions button {
    border-color: var(--esj-line);
    border-radius: 8px;
}

.esj .esj-segments button[aria-pressed="true"],
.esj .esj-actions button[aria-pressed="true"] {
    border-color: rgba(245, 196, 107, 0.34);
    background: rgba(245, 196, 107, 0.12);
    color: var(--esj-gold);
}

.esj .esj-segments button:hover,
.esj .esj-actions button:hover {
    border-color: rgba(245, 196, 107, 0.55);
}

.esj .esj-legend {
    position: absolute;
    z-index: 1;
    right: 14px;
    bottom: 14px;
    width: 15rem;
    max-width: calc(100% - 16px);
    box-sizing: border-box;
    padding: 8px 10px;
    border-radius: 12px;
    pointer-events: none;
}

.esj .esj-legend-title {
    margin: 0 0 4px;
    font-size: 0.6875rem;
    font-weight: 650;
}

.esj .esj-legend-bar {
    height: 5px;
    border-radius: 100px;
    background: linear-gradient(90deg, var(--esj-gradient));
}

.esj .esj-ticks {
    position: relative;
    height: 1.1rem;
    margin-top: 4px;
    color: var(--esj-muted);
    font-size: 0.625rem;
    white-space: nowrap;
}

.esj .esj-tick {
    position: absolute;
    left: var(--esj-tick);
    transform: translateX(-50%);
}

.esj .esj-tick:first-child {
    transform: none;
}

.esj .esj-tick:last-child {
    transform: translateX(-100%);
}

.esj .esj-markers {
    pointer-events: none;
}

.esj .esj-marker {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    display: grid;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    padding: 0;
    place-items: center;
    border: 1px solid var(--esj-gold);
    border-radius: 50%;
    background: #17130e;
    color: var(--esj-gold);
    font: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    pointer-events: auto;
}

.esj .esj-marker:hover,
.esj .esj-marker:focus-visible,
.esj .esj-marker[aria-expanded="true"] {
    z-index: 3;
}

.esj .esj-marker-text {
    position: absolute;
    top: 50%;
    left: calc(100% + 5px);
    width: max-content;
    padding: 4px 7px;
    transform: translateY(-50%);
    border: 1px solid var(--esj-line);
    border-radius: 7px;
    background: rgba(9, 9, 11, 0.9);
    color: #f4f4f5;
    font-size: 0.6875rem;
    font-weight: 500;
    line-height: 1.25;
    text-align: left;
}

.esj .esj-marker-left .esj-marker-text {
    right: calc(100% + 5px);
    left: auto;
}

@container esj (width >= 640px) {
    .esj .esj-camera-choice .esj-segments {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: min(12rem, 74%);
    }

    .esj .esj-camera-choice button {
        padding-inline: 5px;
    }

    .esj .esj-marker-text {
        white-space: nowrap;
    }
}

@container esj (640px <= width < 940px) {
    .esj .esj-panel-plant {
        position: relative;
        bottom: auto;
        left: auto;
        margin-top: 8px;
    }
}

@container esj (width < 640px) {
    .esj .esj-stage,
    .esj > .esj-yedek {
        height: clamp(380px, 68vh, 600px);
        border-radius: 16px;
    }

    .esj .esj-panel {
        position: relative;
        bottom: auto;
        left: auto;
        width: 100%;
        margin-top: 8px;
        padding: 12px;
    }

    .esj .esj-legend {
        right: 8px;
        bottom: 8px;
        width: 14.5rem;
    }

    .esj .esj-marker-text {
        visibility: hidden;
        max-width: 108px;
    }

    .esj .esj-marker[aria-expanded="true"] .esj-marker-text,
    .esj .esj-marker:focus-visible .esj-marker-text {
        visibility: visible;
    }
}

@media (pointer: coarse) {
    .esj .esj-range,
    .esj .esj-segments button,
    .esj .esj-actions button {
        min-height: 34px;
    }
}
