.operation-card {
    position: relative;
    overflow: hidden;
}

.operation-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: linear-gradient(180deg, #d8b000, rgba(216, 176, 0, .18));
}

.operation-card > h3 {
    display: flex;
    align-items: center;
    gap: .65rem;
}

.operation-card > h3::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d8b000;
    box-shadow: 0 0 12px rgba(216, 176, 0, .75);
}

.operation-summary {
    display: grid;
    gap: 1.25rem;
}

.operation-summary__heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.operation-summary__label {
    color: rgba(255, 255, 255, .48);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .14em;
}

.operation-summary h2 {
    margin: .35rem 0 0;
    color: #eef4f8;
    font-size: clamp(1.25rem, 2vw, 1.7rem);
    line-height: 1.25;
}

.operation-status {
    flex: 0 0 auto;
    margin: 0;
    padding: .42rem .75rem;
    border: 1px solid rgba(92, 255, 122, .35);
    border-radius: 999px;
    color: #7dff96;
    background: rgba(92, 255, 122, .08);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .12em;
}

.operation-status.is-closed {
    border-color: rgba(255, 255, 255, .16);
    color: rgba(255, 255, 255, .55);
    background: rgba(255, 255, 255, .04);
}

.operation-status.is-error {
    border-color: rgba(255, 98, 98, .34);
    color: #ff6262;
    background: rgba(255, 98, 98, .08);
}

.operation-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
    margin: 0;
}

.operation-details > div {
    min-width: 0;
    padding: .85rem;
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 9px;
    background: rgba(3, 10, 16, .28);
}

.operation-details dt {
    margin-bottom: .35rem;
    color: rgba(255, 255, 255, .45);
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.operation-details dd {
    overflow-wrap: anywhere;
    color: rgba(255, 255, 255, .88);
    font-size: .9rem;
    font-weight: 600;
}

.operation-actions {
    display: grid;
    gap: .7rem;
    margin-top: 1.2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, .07);
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
    visibility: visible;
}

.operation-log-button,
.operation-edit-button,
.operation-end-button {
    flex: 1 1 0;
    width: 100%;
    min-width: 0;
    min-height: 40px;
    padding: .62rem .9rem;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    font-size: .78rem;
    font-weight: 700;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.operation-log-button {
    border: 1px solid rgba(92, 197, 255, .45);
    color: #a9dcff;
    background: rgba(92, 197, 255, .08);
}

.operation-edit-button {
    border: 1px solid rgba(216, 176, 0, .55);
    color: #e7c743;
    background: rgba(216, 176, 0, .08);
}

.operation-end-button {
    border: 1px solid rgba(255, 87, 87, .4);
    color: #ffadad;
    background: rgba(255, 70, 70, .07);
}

.operation-log-button:hover,
.operation-edit-button:hover,
.operation-end-button:hover {
    transform: translateY(-1px);
}

.operation-log-button:disabled,
.operation-edit-button:disabled,
.operation-end-button:disabled {
    cursor: not-allowed;
    opacity: .42;
    transform: none;
}

.operation-dialog {
    width: min(560px, calc(100% - 2rem));
    padding: 0;
    border: 1px solid rgba(216, 176, 0, .3);
    border-radius: 14px;
    color: #eef4f8;
    background: #081522;
}

.operation-dialog--configuration {
    box-sizing: border-box;
    width: min(1080px, calc(100vw - 2rem));
    max-width: calc(100vw - 2rem);
    max-height: calc(100vh - 2rem);
    overflow: hidden;
}

html:has(.operation-dialog--configuration[open]),
body:has(.operation-dialog--configuration[open]) {
    overflow: hidden;
}

.operation-dialog--log {
    width: min(940px, calc(100vw - 2rem));
    max-width: calc(100vw - 2rem);
    max-height: calc(100vh - 2rem);
}

.operation-dialog::backdrop {
    background: rgba(2, 8, 15, .78);
    backdrop-filter: blur(4px);
}

.operation-dialog__body { padding: 1.5rem; }
.operation-dialog__heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.operation-dialog__close { width: 40px; height: 40px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; color: #eef4f8; background: rgba(255,255,255,.04); }
.operation-dialog__context { margin: .45rem 0 0; color: rgba(238, 244, 248, .58); font-size: .78rem; }
.operation-dialog__context strong { color: #eef4f8; }

.operation-end-dialog {
    width: min(500px, calc(100vw - 2rem));
    border-color: rgba(255, 157, 61, .46);
    box-shadow: 0 26px 80px rgba(0, 0, 0, .62);
}

.operation-end-dialog__body { display: grid; gap: 1.15rem; }

.operation-end-dialog__heading {
    display: flex;
    align-items: center;
    gap: .9rem;
}

.operation-end-dialog__heading small {
    display: block;
    margin-bottom: .2rem;
    color: #ffad5c;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .13em;
}

.operation-end-dialog__heading h2 {
    margin: 0;
    color: #eef4f8;
    font-size: 1.25rem;
}

.operation-end-dialog__icon {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border: 1px solid rgba(255, 157, 61, .58);
    border-radius: 50%;
    color: #ffad5c;
    background: rgba(255, 157, 61, .1);
    box-shadow: 0 0 18px rgba(255, 157, 61, .13);
    font-size: 1.15rem;
    font-weight: 900;
}

.operation-end-dialog__message {
    margin: 0;
    color: rgba(238, 244, 248, .72);
    line-height: 1.55;
}

.operation-end-dialog__message strong { color: #fff; }

.operation-end-dialog__notice {
    padding: .85rem 1rem;
    border: 1px solid rgba(255, 157, 61, .24);
    border-radius: 9px;
    color: rgba(238, 244, 248, .65);
    background: rgba(255, 157, 61, .055);
    font-size: .78rem;
    line-height: 1.5;
}

.operation-end-dialog__actions {
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
}

.operation-end-dialog__confirm {
    border-color: rgba(255, 157, 61, .72);
    color: #081522;
    background: #ff9d3d;
    box-shadow: 0 8px 22px rgba(255, 124, 31, .16);
}

.operation-end-dialog__confirm:hover {
    border-color: #ffc078;
    background: #ffad5c;
}
.operation-form { display: grid; gap: 1rem; }
.operation-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.operation-form label { display: grid; gap: .45rem; color: rgba(255,255,255,.65); }
.operation-form input,
.operation-form textarea { width: 100%; padding: .8rem; color: #eef4f8; border: 1px solid rgba(255,255,255,.12); border-radius: 8px; background: #0a1724; font: inherit; }
.operation-form textarea { min-height: 128px; resize: vertical; line-height: 1.5; }
.operation-form input:focus,
.operation-form textarea:focus { outline: 2px solid rgba(216, 176, 0, .62); outline-offset: 1px; }
.operation-form__actions { display: flex; justify-content: flex-end; gap: .75rem; }
.operation-feedback { min-height: 1.5rem; color: #7dff9b; }
.operation-form__hint { margin: -.2rem 0 0; color: rgba(238, 244, 248, .52); font-size: .76rem; line-height: 1.5; }

.operation-form .operation-test-flag {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: .75rem;
    padding: .85rem;
    border: 1px solid rgba(216, 176, 0, .3);
    border-radius: 9px;
    background: rgba(216, 176, 0, .055);
    cursor: pointer;
}

.operation-test-flag input {
    width: 1.1rem;
    height: 1.1rem;
    margin-top: .1rem;
    accent-color: #d8b000;
}

.operation-test-flag span { display: grid; gap: .25rem; }
.operation-test-flag strong { color: #f1d45c; font-size: .82rem; }
.operation-test-flag small { color: rgba(238, 244, 248, .58); font-size: .72rem; line-height: 1.45; }
.operation-test-flag:has(input:disabled) { cursor: not-allowed; opacity: .72; }

.operation-node-selector {
    min-width: 0;
    margin: .15rem 0;
    padding: 1rem;
    border: 1px solid rgba(216, 176, 0, .24);
    border-radius: 10px;
}

.operation-node-selector legend {
    padding: 0 .4rem;
    color: #e7c743;
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .08em;
}

.operation-node-selector > p {
    margin: 0 0 .8rem;
    color: rgba(238, 244, 248, .55);
    font-size: .74rem;
    line-height: 1.45;
}

.operation-node-list {
    display: grid;
    max-height: 230px;
    gap: .55rem;
    overflow: auto;
}

.operation-node-option {
    grid-template-columns: auto minmax(0, 1fr) !important;
    align-items: center;
    padding: .7rem;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
}

.operation-node-option input { width: auto; }
.operation-node-option span { display: grid; gap: .2rem; min-width: 0; }
.operation-node-option strong { color: #eef4f8; letter-spacing: .08em; }
.operation-node-option small { overflow-wrap: anywhere; color: rgba(238, 244, 248, .5); }
.operation-node-option:has(input:disabled) { opacity: .45; }
.operation-node-list__empty { margin: 0; color: rgba(238, 244, 248, .52); font-size: .78rem; }

.operation-dialog--configuration .operation-dialog__body {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    max-height: calc(100vh - 2rem);
    overflow: hidden;
}

.operation-form--configuration {
    grid-template-columns: minmax(0, .9fr) minmax(340px, 1.1fr);
    align-items: stretch;
    min-height: 0;
    padding-right: .35rem;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.operation-form__primary {
    display: grid;
    min-width: 0;
    min-height: 0;
    padding-right: .3rem;
    gap: 1rem;
    align-content: start;
    align-self: start;
    position: sticky;
    top: 0;
    z-index: 1;
    overflow: visible;
    background: #081522;
}

.operation-form--configuration > .operation-node-selector {
    display: grid;
    grid-template-rows: auto auto auto;
    min-height: 0;
    margin: 0;
    align-self: start;
    overflow: visible;
}

.operation-form--configuration > .operation-node-selector[hidden] { display: none; }

.operation-form--configuration .operation-node-list {
    max-height: none;
    min-height: 0;
    overflow: visible;
}

.operation-form--configuration .operation-form__actions {
    position: static;
    margin-top: .15rem;
    padding: .4rem 0 .1rem;
    background: #081522;
}

.operation-form .operation-action {
    min-height: 44px;
    padding: .72rem 1.1rem;
    border-radius: 9px;
    font-size: .76rem;
    font-weight: 850;
    letter-spacing: .075em;
    line-height: 1.15;
    text-transform: uppercase;
    transition: border-color .18s ease, background .18s ease,
        color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.operation-form .operation-action--cancel {
    min-width: 118px;
    border-color: rgba(238, 244, 248, .22);
    color: rgba(238, 244, 248, .78);
    background: rgba(238, 244, 248, .045);
}

.operation-form .operation-action--cancel:hover {
    border-color: rgba(238, 244, 248, .42);
    color: #ffffff;
    background: rgba(238, 244, 248, .09);
}

.operation-form .operation-action--start {
    min-width: 190px;
    border-color: #f0cf42;
    color: #07111b;
    background: linear-gradient(135deg, #f5dc65, #d8b000);
    box-shadow: 0 7px 18px rgba(216, 176, 0, .2), inset 0 1px 0 rgba(255, 255, 255, .38);
}

.operation-form .operation-action--start:hover {
    border-color: #ffe77b;
    background: linear-gradient(135deg, #ffe77b, #e7c743);
    box-shadow: 0 9px 23px rgba(216, 176, 0, .32), inset 0 1px 0 rgba(255, 255, 255, .5);
    transform: translateY(-1px);
}

.operation-form .operation-action:active { transform: translateY(0); }

.operation-form .operation-action:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

.operation-form .operation-action:disabled {
    box-shadow: none;
    cursor: wait;
    opacity: .58;
    transform: none;
}

.operation-dialog--log .operation-dialog__body {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    max-height: calc(100vh - 2rem);
    overflow: hidden;
}

.operation-form--log {
    grid-template-columns: minmax(280px, .8fr) minmax(360px, 1.2fr);
    align-items: start;
    min-height: 0;
    padding-right: .35rem;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.operation-log-form__details,
.operation-log-form__message {
    display: grid;
    min-width: 0;
    gap: 1rem;
    align-content: start;
}

.operation-log-form__details {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #081522;
}

.operation-log-form__message textarea {
    min-height: 250px;
}

.operation-form--log .operation-form__actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    padding: .8rem 0 .1rem;
    background: linear-gradient(to bottom, rgba(8, 21, 34, 0), #081522 28%);
}

@media (max-width: 820px) {
    .operation-end-dialog__actions { flex-direction: column-reverse; }
    .operation-end-dialog__actions button { width: 100%; }

    .operation-dialog--configuration .operation-dialog__body {
        display: block;
        overflow-y: auto;
    }

    .operation-form--configuration {
        grid-template-columns: 1fr;
        padding-right: 0;
        overflow: visible;
    }

    .operation-form__primary {
        padding-right: 0;
        position: static;
        overflow: visible;
    }

    .operation-form--configuration > .operation-node-selector {
        min-height: 0;
    }

    .operation-form--configuration .operation-node-list {
        max-height: none;
        overflow: visible;
    }

    .operation-dialog--log .operation-dialog__body {
        display: block;
        overflow-y: auto;
    }

    .operation-form--log {
        grid-template-columns: 1fr;
        padding-right: 0;
        overflow: visible;
    }

    .operation-log-form__details { position: static; }

    .operation-form--log .operation-form__actions {
        position: static;
        padding-top: .4rem;
        background: #081522;
    }
}

@media (max-width: 600px) {
    .operation-summary__heading { flex-direction: column; }
    .operation-details,
    .operation-form__row { grid-template-columns: 1fr; }
    .operation-form__actions { flex-direction: column; }
    .operation-form .operation-action { width: 100%; }
    .operation-edit-button,
    .operation-end-button,
    .operation-log-button {
        width: 100%;
        padding-inline: .55rem;
        font-size: .7rem;
    }
}
