/* Dashboard layout hotfix loaded after style.css.
   Keep page scrolling disabled on desktop-like viewports and put scrollbars inside cards. */

    .ops-layout:not(.screen-mode) {
        height: 100vh !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .ops-layout:not(.screen-mode) .ops-main {
        display: grid !important;
        grid-template-rows: auto auto minmax(0, 1fr) !important;
        height: 100% !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .ops-layout:not(.screen-mode) .module-panel.active {
        height: 100% !important;
        min-height: 0 !important;
        overflow: hidden !important;
        align-content: stretch !important;
        padding-bottom: 0 !important;
    }

    .ops-layout:not(.screen-mode) .module-panel[data-panel="devices"].active,
    .ops-layout:not(.screen-mode) .module-panel[data-panel="ota"].active,
    .ops-layout:not(.screen-mode) .module-panel[data-panel="monitor"].active {
        display: grid !important;
        grid-template-rows: auto minmax(0, 1fr) !important;
    }

    .ops-layout:not(.screen-mode) .module-panel[data-panel="license"].active,
    .ops-layout:not(.screen-mode) .module-panel[data-panel="terminal"].active,
    .ops-layout:not(.screen-mode) .module-panel[data-panel="audit"].active {
        display: grid !important;
        grid-template-rows: minmax(0, 1fr) !important;
    }

    .ops-layout:not(.screen-mode) .glass-card {
        min-height: 0 !important;
    }

    .ops-layout:not(.screen-mode) .module-panel[data-panel="monitor"] > .module-subpage.active {
        height: 100% !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .ops-layout:not(.screen-mode) .module-panel[data-panel="monitor"] > .module-subpage[data-subpage="overview"].active {
        display: grid !important;
        grid-template-rows: minmax(0, 1fr) !important;
        align-content: stretch !important;
    }

    .ops-layout:not(.screen-mode) .module-panel[data-panel="monitor"] .kpi-grid {
        align-self: start !important;
    }

    .monitor-metrics-card.module-subpage.active,
    .monitor-alerts-card.module-subpage.active {
        display: grid !important;
        grid-template-rows: auto minmax(0, 1fr) !important;
        height: 100% !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .monitor-metrics-card .table-wrap,
    .monitor-alerts-card .table-wrap {
        height: 100% !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: auto !important;
    }

    .monitor-agent-card.module-subpage.active {
        display: grid !important;
        grid-template-rows: auto auto minmax(0, 1fr) !important;
        height: 100% !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .monitor-agent-card .agent-grid {
        margin-bottom: 0 !important;
    }

    #agentCommandOutput {
        height: 100% !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: auto !important;
        resize: none !important;
    }

    .ops-layout:not(.screen-mode) .module-panel[data-panel="devices"] .workspace-grid {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        grid-template-rows: minmax(0, 1fr) !important;
        height: 100% !important;
        min-height: 0 !important;
        align-items: stretch !important;
    }

    .device-panel.module-subpage.active,
    .form-panel.module-subpage.active {
        display: grid !important;
        grid-template-rows: auto minmax(0, 1fr) !important;
        height: 100% !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .device-panel .table-wrap {
        height: 100% !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: auto !important;
        padding: 10px !important;
    }

    .device-panel table {
        min-width: 1260px !important;
    }

    .form-panel .device-form {
        height: 100% !important;
        min-height: 0 !important;
        overflow: auto !important;
        align-content: start !important;
        gap: 18px 22px !important;
        padding-right: 6px !important;
    }

    .terminal-card {
        display: grid !important;
        grid-template-rows: auto auto minmax(0, 1fr) !important;
        gap: 14px !important;
        height: 100% !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .terminal-card .card-title,
    .terminal-card .terminal-meta {
        margin-bottom: 0 !important;
    }

    #terminal {
        height: 100% !important;
        min-height: 0 !important;
        max-height: none !important;
    }

    .license-frame-card {
        display: grid !important;
        grid-template-rows: minmax(0, 1fr) !important;
        height: 100% !important;
        min-height: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
    }

    .license-frame-card > .license-tool-shell {
        display: grid !important;
        grid-template-rows: auto minmax(0, 1fr) !important;
        gap: 16px !important;
        height: 100% !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .license-tool-grid {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        grid-template-rows: minmax(0, 1fr) !important;
        height: 100% !important;
        min-height: 0 !important;
        padding: 0 18px 18px !important;
        overflow: hidden !important;
    }

    .license-subpage.active {
        height: 100% !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .license-subpage[data-license-subpage-panel="key"].active,
    .license-subpage[data-license-subpage-panel="generate"].active,
    .license-subpage[data-license-subpage-panel="records"].active {
        display: grid !important;
        grid-template-rows: auto minmax(0, 1fr) !important;
    }

    .license-subpage[data-license-subpage-panel="records"] .license-guide {
        display: grid !important;
        grid-template-rows: auto minmax(0, 1fr) !important;
        gap: 16px !important;
        height: 100% !important;
        min-height: 0 !important;
        overflow: hidden !important;
        padding-right: 0 !important;
    }

    .license-record-table {
        display: grid !important;
        grid-template-rows: auto minmax(0, 1fr) !important;
        align-content: stretch !important;
        height: 100% !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: hidden !important;
        gap: 10px !important;
    }

    .license-record-header {
        position: relative !important;
        top: auto !important;
    }

    .license-record-list {
        min-height: 0 !important;
        overflow: auto !important;
        align-content: start !important;
        gap: 10px !important;
        padding-right: 6px !important;
    }

    .license-record-item,
    .license-record-row {
        min-height: 54px !important;
    }

    .license-record-cell {
        min-height: 54px !important;
        padding: 0 14px !important;
    }

    .license-record-cell strong {
        line-height: 1.35 !important;
    }

    .ota-config-card.module-subpage.active {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        grid-template-rows: auto auto minmax(0, 1fr) minmax(0, 1fr) !important;
        height: 100% !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .release-library-card.module-subpage.active {
        display: grid !important;
        grid-template-rows: auto auto minmax(0, 1fr) !important;
        height: 100% !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .ota-task-card.module-subpage.active {
        display: grid !important;
        grid-template-rows: auto minmax(0, 1fr) auto minmax(0, 0.8fr) !important;
        height: 100% !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .release-library-card .table-wrap,
    .ota-task-card .table-wrap,
    .release-plan-list,
    .ota-device-list,
    #otaTaskOutput {
        min-height: 0 !important;
        max-height: none !important;
        overflow: auto !important;
    }

    .audit-card {
        display: grid !important;
        grid-template-rows: auto minmax(0, 1fr) !important;
        height: 100% !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .audit-card .table-wrap {
        height: 100% !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: auto !important;
    }

    body.license-tool-page {
        height: 100vh !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    body.license-tool-page .license-tool-shell {
        height: 100% !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

/* Form-heavy pages: spacious internal layouts inside the fixed-height cards. */
.form-panel {
    padding: 24px !important;
}

.form-panel .card-title,
.license-subpage[data-license-subpage-panel="generate"] .card-title,
.ota-config-card > .card-title:first-child,
.release-library-card > .card-title:first-child {
    margin-bottom: 18px !important;
    padding-bottom: 16px !important;
}

.form-panel .device-form {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(280px, 1fr)) !important;
    grid-auto-rows: max-content !important;
    gap: 18px 22px !important;
    align-content: start !important;
    padding: 4px 8px 18px 0 !important;
}

.form-panel .device-form > input[type="hidden"] {
    display: none !important;
}

.form-panel .form-field,
.form-panel .double-input,
.license-subpage[data-license-subpage-panel="generate"] .license-form label,
.release-library-card .release-upload-grid label {
    display: grid !important;
    gap: 10px !important;
    min-width: 0 !important;
    padding: 16px !important;
    border: 1px solid rgba(65, 113, 220, 0.28) !important;
    background:
        linear-gradient(180deg, rgba(15, 28, 64, 0.52), rgba(0, 0, 0, 0.24)) !important;
    box-shadow: inset 0 0 0 1px rgba(189, 207, 255, 0.04) !important;
}

.form-panel .form-field > span,
.license-subpage[data-license-subpage-panel="generate"] .license-form label,
.release-library-card .release-upload-grid label {
    color: rgba(205, 220, 255, 0.78) !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    letter-spacing: 0.03em !important;
}

.form-panel .form-field-wide,
.form-panel .device-switch-grid,
.form-panel .button-row {
    grid-column: 1 / -1 !important;
}

.form-panel .form-field-wide {
    display: grid !important;
}

.form-panel .device-switch-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 16px !important;
}

.form-panel .switch-row {
    min-height: 58px !important;
    justify-content: flex-start !important;
    padding: 0 16px !important;
    border: 1px solid rgba(65, 113, 220, 0.28) !important;
    background: rgba(5, 12, 30, 0.72) !important;
}

.form-panel .device-form input,
.form-panel .device-form textarea,
.form-panel .device-form select,
.license-subpage[data-license-subpage-panel="generate"] .license-form input,
.license-subpage[data-license-subpage-panel="generate"] .license-form textarea,
.release-library-card .release-upload-grid input,
.release-library-card .release-upload-grid select,
.release-library-card .release-upload-grid .file-input {
    min-height: 46px !important;
    width: 100% !important;
    border-color: rgba(86, 122, 204, 0.48) !important;
    background: rgba(0, 0, 0, 0.42) !important;
}

.form-panel #description {
    min-height: 112px !important;
    resize: vertical !important;
}

.form-panel .button-row,
.license-subpage[data-license-subpage-panel="generate"] .button-row {
    display: flex !important;
    justify-content: flex-end !important;
    gap: 14px !important;
    margin-top: 2px !important;
    padding-top: 6px !important;
}

.form-panel .primary-action,
.form-panel .secondary-btn,
.license-subpage[data-license-subpage-panel="generate"] .primary-action {
    min-width: 150px !important;
}

.license-subpage[data-license-subpage-panel="generate"] .license-tool-card-body {
    display: grid !important;
    align-content: start !important;
    overflow: auto !important;
    padding: 4px 8px 18px 0 !important;
}

.license-subpage[data-license-subpage-panel="generate"] .license-form {
    width: min(980px, 100%) !important;
    margin: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(280px, 1fr)) !important;
    gap: 18px 22px !important;
    align-content: start !important;
}

.license-subpage[data-license-subpage-panel="generate"] .license-form .switch-row {
    min-height: 78px !important;
    align-items: center !important;
    justify-content: space-between !important;
}

.license-subpage[data-license-subpage-panel="generate"] .license-form .license-remark-field,
.license-subpage[data-license-subpage-panel="generate"] .button-row {
    grid-column: 1 / -1 !important;
}

.license-subpage[data-license-subpage-panel="generate"] .license-remark-input {
    min-height: 130px !important;
    resize: vertical !important;
}

.ota-config-card.module-subpage.active {
    grid-template-columns: minmax(340px, 0.86fr) minmax(0, 1.14fr) !important;
    grid-template-rows: auto auto minmax(0, 1fr) !important;
    grid-template-areas:
        "title title"
        "basic devices"
        "plan devices" !important;
    gap: 20px 24px !important;
    padding: 24px !important;
}

.ota-config-card > .card-title:first-child {
    grid-area: title !important;
}

.ota-config-card > .ota-basic-grid {
    grid-area: basic !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    align-content: start !important;
    padding: 18px !important;
    border: 1px solid rgba(65, 113, 220, 0.28) !important;
    background: rgba(5, 12, 30, 0.62) !important;
}

.ota-config-card > .ota-basic-grid label,
.release-library-card .release-upload-grid label {
    display: grid !important;
    gap: 10px !important;
}

.ota-panel-section {
    padding: 18px !important;
    border: 1px solid rgba(65, 113, 220, 0.28) !important;
    background: rgba(5, 12, 30, 0.62) !important;
}

.ota-plan-section {
    grid-area: plan !important;
}

.ota-device-section {
    grid-area: devices !important;
}

.ota-plan-title,
.ota-device-title {
    margin-top: 0 !important;
    margin-bottom: 10px !important;
    padding-bottom: 12px !important;
}

.release-plan-list,
.ota-device-list {
    padding: 12px !important;
    border-color: rgba(65, 113, 220, 0.26) !important;
    background: rgba(0, 0, 0, 0.28) !important;
}

.release-library-card.module-subpage.active {
    padding: 24px !important;
    grid-template-rows: auto auto minmax(0, 1fr) !important;
    gap: 20px !important;
}

.release-library-card .release-upload-grid {
    display: grid !important;
    grid-template-columns: minmax(240px, 1fr) minmax(200px, 0.8fr) minmax(220px, 0.72fr) !important;
    gap: 18px 20px !important;
    margin-bottom: 0 !important;
    padding: 18px !important;
    border: 1px solid rgba(65, 113, 220, 0.28) !important;
    background: rgba(5, 12, 30, 0.62) !important;
}

.release-library-card .agent-span-full {
    grid-column: 1 / -1 !important;
}

.release-library-card .table-wrap {
    padding: 10px !important;
    border: 1px solid rgba(65, 113, 220, 0.28) !important;
    background: rgba(0, 0, 0, 0.24) !important;
}

@media (max-width: 1100px) {
    .form-panel .device-form,
    .license-subpage[data-license-subpage-panel="generate"] .license-form,
    .release-library-card .release-upload-grid,
    .ota-config-card.module-subpage.active {
        grid-template-columns: 1fr !important;
    }

    .ota-config-card.module-subpage.active {
        grid-template-areas:
            "title"
            "basic"
            "plan"
            "devices" !important;
        grid-template-rows: auto auto minmax(220px, 0.7fr) minmax(260px, 1fr) !important;
    }

    .form-panel .device-switch-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Compact form override: keep dense admin forms as one cohesive control surface. */
.ops-layout:not(.screen-mode) {
    --ops-form-line: rgba(76, 111, 190, 0.34);
    --ops-form-line-soft: rgba(76, 111, 190, 0.18);
    --ops-form-bg: linear-gradient(135deg, rgba(9, 20, 48, 0.76), rgba(2, 8, 22, 0.82));
    --ops-form-bg-flat: rgba(3, 12, 31, 0.68);
    --ops-field-bg: rgba(1, 8, 22, 0.54);
    --ops-field-focus: rgba(5, 20, 45, 0.78);
    --ops-label: rgba(203, 219, 255, 0.72);
    --ops-value: #e6f0ff;
}

.ops-layout:not(.screen-mode) .env-user-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
}

.ops-layout:not(.screen-mode) .env-user-row h3 {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.ops-layout:not(.screen-mode) .sidebar-logout-btn {
    flex: none !important;
    min-height: 28px !important;
    padding: 0 10px !important;
    border: 1px solid rgba(80, 135, 230, 0.44) !important;
    border-radius: 8px !important;
    background: rgba(6, 18, 42, 0.72) !important;
    color: rgba(218, 232, 255, 0.86) !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
}

.ops-layout:not(.screen-mode) .sidebar-logout-btn:hover {
    border-color: rgba(110, 178, 255, 0.76) !important;
    background: rgba(25, 62, 126, 0.64) !important;
    color: #ffffff !important;
}

.ops-layout:not(.screen-mode) .license-record-table {
    --license-col-detail: 96px !important;
}

.ops-layout:not(.screen-mode) .license-record-header,
.ops-layout:not(.screen-mode) .license-record-row {
    grid-template-columns: minmax(320px, 1.35fr) minmax(150px, 0.72fr) minmax(220px, 1fr) var(--license-col-detail) !important;
}

.ops-layout:not(.screen-mode) .license-record-head-cell-action,
.ops-layout:not(.screen-mode) .license-record-cell-action {
    justify-content: flex-end !important;
    padding-right: 16px !important;
}

.ops-layout:not(.screen-mode) .license-record-detail-btn {
    min-width: 64px !important;
}

.ops-layout:not(.screen-mode) .form-panel,
.ops-layout:not(.screen-mode) .ota-config-card,
.ops-layout:not(.screen-mode) .release-library-card {
    padding: 20px !important;
}

.ops-layout:not(.screen-mode) .form-panel .card-title,
.ops-layout:not(.screen-mode) .license-subpage[data-license-subpage-panel="generate"] .card-title,
.ops-layout:not(.screen-mode) .ota-config-card > .card-title:first-child,
.ops-layout:not(.screen-mode) .release-library-card > .card-title:first-child {
    min-height: 42px !important;
    margin: 0 0 14px !important;
    padding-bottom: 12px !important;
    border-bottom: 1px solid var(--ops-form-line-soft) !important;
}

.ops-layout:not(.screen-mode) .form-panel .device-form,
.ops-layout:not(.screen-mode) .license-subpage[data-license-subpage-panel="generate"] .license-form,
.ops-layout:not(.screen-mode) .release-library-card .release-upload-grid,
.ops-layout:not(.screen-mode) .ota-config-card > .ota-basic-grid {
    display: grid !important;
    align-content: start !important;
    min-width: 0 !important;
    border: 1px solid var(--ops-form-line) !important;
    border-radius: 18px !important;
    background: var(--ops-form-bg) !important;
    box-shadow:
        inset 0 1px 0 rgba(214, 229, 255, 0.05),
        0 18px 44px rgba(0, 0, 0, 0.18) !important;
}

.ops-layout:not(.screen-mode) .form-panel .device-form,
.ops-layout:not(.screen-mode) .license-subpage[data-license-subpage-panel="generate"] .license-form {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px 16px !important;
    padding: 2px 6px 14px 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: auto !important;
}

.ops-layout:not(.screen-mode) .form-panel .form-field,
.ops-layout:not(.screen-mode) .form-panel .double-input,
.ops-layout:not(.screen-mode) .license-subpage[data-license-subpage-panel="generate"] .license-form label,
.ops-layout:not(.screen-mode) .release-library-card .release-upload-grid label,
.ops-layout:not(.screen-mode) .ota-basic-grid label,
.ops-layout:not(.screen-mode) .release-plan-field {
    display: grid !important;
    gap: 6px !important;
    min-width: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--ops-label) !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em !important;
}

.ops-layout:not(.screen-mode) .form-panel .form-field > span {
    color: var(--ops-label) !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em !important;
}

.ops-layout:not(.screen-mode) .form-panel .device-form input,
.ops-layout:not(.screen-mode) .form-panel .device-form textarea,
.ops-layout:not(.screen-mode) .form-panel .device-form select,
.ops-layout:not(.screen-mode) .license-subpage[data-license-subpage-panel="generate"] .license-form input,
.ops-layout:not(.screen-mode) .license-subpage[data-license-subpage-panel="generate"] .license-form textarea,
.ops-layout:not(.screen-mode) .release-library-card .release-upload-grid input,
.ops-layout:not(.screen-mode) .release-library-card .release-upload-grid select,
.ops-layout:not(.screen-mode) .release-library-card .release-upload-grid .file-input,
.ops-layout:not(.screen-mode) .ota-basic-grid input,
.ops-layout:not(.screen-mode) .release-plan-field input,
.ops-layout:not(.screen-mode) .release-plan-field select {
    width: 100% !important;
    min-height: 40px !important;
    padding: 9px 12px !important;
    border: 1px solid rgba(94, 126, 199, 0.42) !important;
    border-radius: 11px !important;
    background: var(--ops-field-bg) !important;
    color: var(--ops-value) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03) !important;
}

.ops-layout:not(.screen-mode) .form-panel .device-form input:focus,
.ops-layout:not(.screen-mode) .form-panel .device-form textarea:focus,
.ops-layout:not(.screen-mode) .form-panel .device-form select:focus,
.ops-layout:not(.screen-mode) .license-subpage[data-license-subpage-panel="generate"] .license-form input:focus,
.ops-layout:not(.screen-mode) .license-subpage[data-license-subpage-panel="generate"] .license-form textarea:focus,
.ops-layout:not(.screen-mode) .release-library-card .release-upload-grid input:focus,
.ops-layout:not(.screen-mode) .release-library-card .release-upload-grid select:focus,
.ops-layout:not(.screen-mode) .ota-basic-grid input:focus,
.ops-layout:not(.screen-mode) .release-plan-field input:focus,
.ops-layout:not(.screen-mode) .release-plan-field select:focus {
    border-color: rgba(107, 180, 255, 0.72) !important;
    background: var(--ops-field-focus) !important;
    box-shadow: 0 0 0 3px rgba(70, 156, 255, 0.12) !important;
    outline: none !important;
}

.ops-layout:not(.screen-mode) .form-panel .form-field-wide,
.ops-layout:not(.screen-mode) .form-panel .device-select-grid,
.ops-layout:not(.screen-mode) .form-panel .device-option-field,
.ops-layout:not(.screen-mode) .form-panel .button-row,
.ops-layout:not(.screen-mode) .license-subpage[data-license-subpage-panel="generate"] .license-option-field,
.ops-layout:not(.screen-mode) .license-subpage[data-license-subpage-panel="generate"] .license-remark-field,
.ops-layout:not(.screen-mode) .license-subpage[data-license-subpage-panel="generate"] .button-row {
    grid-column: 1 / -1 !important;
}

.ops-layout:not(.screen-mode) .form-panel #description {
    min-height: 88px !important;
    resize: vertical !important;
}

.ops-layout:not(.screen-mode) .license-subpage[data-license-subpage-panel="generate"] .license-remark-input {
    min-height: 108px !important;
    resize: vertical !important;
}

.ops-layout:not(.screen-mode) .form-panel .device-select-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px 16px !important;
}

.ops-layout:not(.screen-mode) .form-panel .device-option-field,
.ops-layout:not(.screen-mode) .license-subpage[data-license-subpage-panel="generate"] .license-option-field {
    display: grid !important;
    gap: 6px !important;
    min-width: 0 !important;
    color: var(--ops-label) !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em !important;
}

.ops-layout:not(.screen-mode) .form-panel .switch-row,
.ops-layout:not(.screen-mode) .license-subpage[data-license-subpage-panel="generate"] .license-form .switch-row,
.ops-layout:not(.screen-mode) .ota-device-title .switch-row {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    gap: 9px !important;
    color: rgba(219, 231, 255, 0.82) !important;
}

.ops-layout:not(.screen-mode) .form-panel .button-row,
.ops-layout:not(.screen-mode) .license-subpage[data-license-subpage-panel="generate"] .button-row {
    display: flex !important;
    justify-content: flex-end !important;
    gap: 12px !important;
    margin-top: 2px !important;
    padding-top: 12px !important;
    border-top: 1px solid var(--ops-form-line-soft) !important;
}

.ops-layout:not(.screen-mode) .license-subpage[data-license-subpage-panel="generate"] .license-tool-card-body {
    display: block !important;
    min-height: 0 !important;
    overflow: auto !important;
    padding: 0 6px 14px !important;
}

.ops-layout:not(.screen-mode) .ota-config-card.module-subpage.active {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.48fr) !important;
    grid-template-rows: auto auto minmax(0, 1fr) !important;
    grid-template-areas:
        "title title"
        "basic devices"
        "plan devices" !important;
    gap: 14px 16px !important;
}

.ops-layout:not(.screen-mode) .ota-config-card > .card-title:first-child {
    grid-area: title !important;
}

.ops-layout:not(.screen-mode) .ota-config-card > .ota-basic-grid {
    grid-area: basic !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px 16px !important;
    padding: 16px !important;
}

.ops-layout:not(.screen-mode) .ota-panel-section {
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    min-height: 0 !important;
    gap: 10px !important;
    padding: 16px !important;
    border: 1px solid var(--ops-form-line) !important;
    border-radius: 18px !important;
    background: var(--ops-form-bg-flat) !important;
    overflow: hidden !important;
}

.ops-layout:not(.screen-mode) .ota-plan-section {
    grid-area: plan !important;
}

.ops-layout:not(.screen-mode) .ota-device-section {
    grid-area: devices !important;
}

.ops-layout:not(.screen-mode) .ota-plan-title,
.ops-layout:not(.screen-mode) .ota-device-title {
    min-height: 36px !important;
    margin: 0 !important;
    padding: 0 0 10px !important;
    border-bottom: 1px solid var(--ops-form-line-soft) !important;
}

.ops-layout:not(.screen-mode) .release-plan-list {
    display: grid !important;
    align-content: start !important;
    gap: 10px !important;
    min-height: 0 !important;
    padding: 0 4px 0 0 !important;
    border: 0 !important;
    background: transparent !important;
    overflow: auto !important;
}

.ops-layout:not(.screen-mode) .release-plan-item {
    padding: 12px !important;
    border: 1px solid var(--ops-form-line-soft) !important;
    border-radius: 14px !important;
    background: rgba(3, 13, 34, 0.58) !important;
}

.ops-layout:not(.screen-mode) .release-plan-row {
    grid-template-columns: minmax(180px, 0.9fr) minmax(220px, 1.1fr) auto !important;
    gap: 10px !important;
    align-items: end !important;
}

.ops-layout:not(.screen-mode) .release-plan-meta {
    margin-top: 7px !important;
    color: rgba(164, 190, 236, 0.72) !important;
    font-size: 12px !important;
    line-height: 1.55 !important;
}

.ops-layout:not(.screen-mode) .ota-device-list {
    display: grid !important;
    align-content: start !important;
    gap: 4px !important;
    min-height: 0 !important;
    padding: 8px !important;
    border: 1px solid var(--ops-form-line-soft) !important;
    border-radius: 14px !important;
    background: rgba(1, 8, 22, 0.32) !important;
    overflow: auto !important;
}

.ops-layout:not(.screen-mode) .ota-device-item {
    min-height: 32px !important;
    padding: 6px 8px !important;
    border-radius: 10px !important;
    color: rgba(226, 238, 255, 0.86) !important;
}

.ops-layout:not(.screen-mode) .ota-device-item:hover {
    background: rgba(75, 136, 230, 0.12) !important;
}

.ops-layout:not(.screen-mode) .release-library-card.module-subpage.active {
    grid-template-rows: auto auto minmax(0, 1fr) !important;
    gap: 14px !important;
}

.ops-layout:not(.screen-mode) .release-library-card .release-upload-grid {
    grid-template-columns: minmax(0, 1fr) minmax(170px, 0.46fr) minmax(180px, 0.46fr) !important;
    gap: 12px 16px !important;
    padding: 16px !important;
}

.ops-layout:not(.screen-mode) .release-library-card .agent-span-full {
    grid-column: 1 / -1 !important;
}

.ops-layout:not(.screen-mode) .release-library-card .table-wrap {
    min-height: 0 !important;
    padding: 8px !important;
    border: 1px solid var(--ops-form-line-soft) !important;
    border-radius: 16px !important;
    background: rgba(1, 8, 22, 0.26) !important;
    overflow: auto !important;
}

@media (max-width: 1200px) {
    .ops-layout:not(.screen-mode) .ota-config-card.module-subpage.active {
        grid-template-columns: minmax(0, 1fr) !important;
        grid-template-areas:
            "title"
            "basic"
            "plan"
            "devices" !important;
        grid-template-rows: auto auto minmax(220px, 0.9fr) minmax(220px, 0.8fr) !important;
    }
}

@media (max-width: 900px) {
    .ops-layout:not(.screen-mode) .form-panel .device-form,
    .ops-layout:not(.screen-mode) .license-subpage[data-license-subpage-panel="generate"] .license-form,
    .ops-layout:not(.screen-mode) .release-library-card .release-upload-grid,
    .ops-layout:not(.screen-mode) .ota-config-card > .ota-basic-grid {
        grid-template-columns: 1fr !important;
    }
}
