:root {
    --bg-top: #0d0015;
    --bg-mid: #1a0a2e;
    --bg-bottom: #050010;
    --panel: rgba(26, 10, 46, 0.82);
    --panel-border: rgba(255, 255, 255, 0.12);
    --text-main: #f8f7ff;
    --text-muted: #9ca3af;
    --accent: #c084fc;
    --accent-soft: #9333ea;
    --accent-hot: #8b1a3a;
    --good: #6ce0c7;
    --warning: #f5a623;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Space Grotesk", "Segoe UI", "Helvetica Neue", sans-serif;
    color-scheme: dark;
    background: #000;
    color: var(--text-main);
}

body.modal-open {
    overflow: hidden;
}

body.opaque-ui {
    --panel: #1a0a2e;
    background: #000;
}

body.opaque-ui.colorful-background .logo-watermark {
    opacity: 0.32;
}

body.colorful-background {
    background:
            radial-gradient(circle at 12% 14%, rgba(30, 58, 95, 0.34), transparent 28%),
            radial-gradient(circle at 78% 18%, rgba(75, 0, 130, 0.34), transparent 34%),
            radial-gradient(circle at 88% 28%, rgba(139, 26, 58, 0.26), transparent 26%),
            linear-gradient(165deg, var(--bg-top) 0%, var(--bg-mid) 42%, var(--bg-bottom) 100%);
}

body.opaque-ui .panel,
body.opaque-ui .ribbon-panel,
body.opaque-ui .graph-canvas-panel,
body.opaque-ui .graph-detail-panel,
body.opaque-ui .legion-modal,
body.opaque-ui .chip,
body.opaque-ui .graph-canvas-scroll,
body.opaque-ui .ribbon-submenu,
body.opaque-ui .panel-submenu,
body.opaque-ui .panel-submenu-group,
body.opaque-ui .panel-submenu-item,
body.opaque-ui .screenshot-modal-body,
body.opaque-ui #screenshot-modal-image,
body.opaque-ui .scheduler-form input,
body.opaque-ui .scheduler-form select,
body.opaque-ui .scheduler-form textarea,
body.opaque-ui .action-block input,
body.opaque-ui .action-block select,
body.opaque-ui .action-block textarea,
body.opaque-ui .startup-step input,
body.opaque-ui .startup-step select,
body.opaque-ui .startup-step textarea,
body.opaque-ui select,
body.opaque-ui input,
body.opaque-ui textarea {
    backdrop-filter: none;
}

body.opaque-ui .panel,
body.opaque-ui .ribbon-panel,
body.opaque-ui .graph-canvas-panel,
body.opaque-ui .graph-detail-panel,
body.opaque-ui .legion-modal {
    background: #160821;
}

body.opaque-ui .chip,
body.opaque-ui .scheduler-form input,
body.opaque-ui .scheduler-form select,
body.opaque-ui .scheduler-form textarea,
body.opaque-ui .action-block input,
body.opaque-ui .action-block select,
body.opaque-ui .action-block textarea,
body.opaque-ui .startup-step input,
body.opaque-ui .startup-step select,
body.opaque-ui .startup-step textarea,
body.opaque-ui select,
body.opaque-ui input,
body.opaque-ui textarea,
body.opaque-ui .screenshot-modal-body,
body.opaque-ui #screenshot-modal-image {
    background: #0d0717;
}

body.opaque-ui .ribbon-submenu,
body.opaque-ui .panel-submenu,
body.opaque-ui .graph-canvas-scroll {
    background: #080510;
}

body.opaque-ui button,
body.opaque-ui .ribbon-submenu-item {
    background: linear-gradient(135deg, #34205e 0%, #5c2790 58%, #6e1639 100%);
}

.background-glow {
    position: fixed;
    inset: 0;
    pointer-events: none;
    display: none;
    background:
            radial-gradient(circle at 8% 12%, rgba(30, 58, 95, 0.24), transparent 34%),
            radial-gradient(circle at 62% 18%, rgba(75, 0, 130, 0.2), transparent 36%),
            radial-gradient(circle at 92% 22%, rgba(139, 26, 58, 0.18), transparent 24%);
}

body.colorful-background .background-glow {
    display: block;
}

.logo-watermark {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    overflow: hidden;
    padding: clamp(0.5rem, 1.2vw, 1.25rem);
    opacity: 0.5;
}

.logo-watermark pre {
    margin: 0;
    white-space: pre;
    line-height: 1;
    letter-spacing: 0;
    font-variant-ligatures: none;
    font-family: "Consolas", "Menlo", "Monaco", monospace;
    font-size: clamp(4px, 1.04vw, 20px);
    color: rgba(174, 183, 240, 0.78);
    text-shadow: 0 0 18px rgba(93, 103, 219, 0.28);
    user-select: none;
}

.shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: clamp(0.9rem, 1.2vw, 1.4rem);
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1rem;
}

.topbar-brand h1,
.topbar h1 {
    margin: 0;
    font-size: clamp(2rem, 1.8vw, 2.4rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.eyebrow {
    margin: 0;
    color: var(--text-muted);
    letter-spacing: 0.2em;
    font-size: 0.75rem;
}

.topbar-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ribbon-panel {
    padding: 0.75rem 1rem;
    position: relative;
    z-index: 20;
    overflow: visible;
}

.state-cache {
    display: none;
}

.ribbon {
    --ribbon-menu-row-height: 88px;
    --ribbon-lower-row-height: 185px;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: stretch;
}

.ribbon-column {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-self: stretch;
}

.ribbon-main-column {
    flex: 1 1 980px;
    min-width: min(100%, 760px);
}

.ribbon-lower-row {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
    min-height: 0;
    min-block-size: var(--ribbon-lower-row-height);
}

.ribbon-group {
    display: flex;
    gap: 0.45rem;
    padding: 0.45rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(13, 0, 21, 0.68);
    flex-wrap: wrap;
}

.ribbon-menu-group {
    align-items: stretch;
    min-block-size: var(--ribbon-menu-row-height);
}

.ribbon-project-group {
    flex: 0 1 380px;
    max-width: 420px;
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
    min-height: 0;
    min-block-size: var(--ribbon-lower-row-height);
}

.ribbon-project-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
}

.ribbon-project-header h2 {
    margin: 0;
    font-size: 1.05rem;
}

.ribbon-project-header p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.76rem;
    text-align: right;
    word-break: break-all;
}

.ribbon-project-meta {
    gap: 0.35rem;
}

.ribbon-project-body {
    display: grid;
    gap: 0.5rem;
    min-height: 0;
    max-height: 145px;
    overflow: auto;
    padding-right: 0.15rem;
    scrollbar-gutter: stable;
}

.ribbon-project-lines {
    display: grid;
    gap: 0.28rem;
}

.ribbon-project-lines .meta-note {
    margin: 0;
    font-size: 0.82rem;
}

.ribbon-rationale-group {
    flex: 1 1 520px;
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
    min-height: 0;
    min-block-size: var(--ribbon-lower-row-height);
}

.ribbon-rationale-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
}

.ribbon-rationale-header h2,
.ribbon-rationale-header p {
    margin: 0;
}

.ribbon-rationale-header h2 {
    font-size: 1.05rem;
}

.ribbon-rationale-header p {
    color: var(--text-muted);
    font-size: 0.76rem;
}

.ribbon-rationale-body {
    display: grid;
    gap: 0.45rem;
    min-height: 0;
    max-height: 145px;
    overflow: auto;
    padding-right: 0.15rem;
    scrollbar-gutter: stable;
}

.rationale-entry {
    display: grid;
    gap: 0.32rem;
    padding: 0.45rem 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 9px;
    background: linear-gradient(135deg, rgba(18, 8, 34, 0.9) 0%, rgba(40, 15, 61, 0.6) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.rationale-entry-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}

.rationale-entry-heading {
    display: grid;
    gap: 0.1rem;
    min-width: 0;
}

.rationale-entry-prefix,
.rationale-entry-summary {
    margin: 0;
}

.rationale-entry-prefix {
    color: var(--text-muted);
    font-size: 0.73rem;
    line-height: 1.2;
}

.rationale-entry-title {
    font-size: 0.86rem;
    line-height: 1.2;
    word-break: break-word;
}

.rationale-entry-time {
    color: var(--text-muted);
    font-size: 0.72rem;
    white-space: nowrap;
}

.rationale-entry-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.28rem;
}

.rationale-chip {
    font-size: 0.66rem;
    padding: 0.16rem 0.42rem;
}

.rationale-entry-summary {
    font-size: 0.81rem;
    line-height: 1.35;
}

.rationale-entry-details {
    display: grid;
    gap: 0.18rem;
}

.rationale-entry-line,
.rationale-empty {
    color: var(--text-muted);
    font-size: 0.75rem;
    line-height: 1.3;
}

.ribbon-process-group {
    flex: 0 1 744px;
    min-width: min(100%, 620px);
    flex-direction: column;
    flex-wrap: nowrap;
    align-self: stretch;
    gap: 0.45rem;
    height: calc(var(--ribbon-menu-row-height) + var(--ribbon-lower-row-height) + 0.75rem);
    min-height: calc(var(--ribbon-menu-row-height) + var(--ribbon-lower-row-height) + 0.75rem);
    overflow: hidden;
}

.ribbon-process-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.ribbon-process-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
}

.ribbon-process-icon {
    width: 1.8rem;
    height: 1.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(192, 132, 252, 0.22);
    border-radius: 999px;
    background: rgba(45, 27, 105, 0.34);
    color: var(--text-muted);
}

.ribbon-process-count {
    font-size: 1rem;
    line-height: 1;
    color: var(--text-main);
}

.ribbon-process-actions {
    margin-bottom: 0;
    justify-content: flex-end;
    flex-shrink: 0;
}

.ribbon-process-table-wrap {
    margin-top: 0;
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    width: 100%;
    min-width: 0;
    border: 1px solid rgba(173, 181, 227, 0.12);
    border-radius: 10px;
    background: rgba(10, 7, 24, 0.38);
    overflow-x: hidden;
    overflow-y: auto;
}

.ribbon-process-table-wrap table {
    font-size: 0.8rem;
    table-layout: fixed;
}

.ribbon-process-table-wrap th,
.ribbon-process-table-wrap td {
    padding: 0.42rem 0.38rem;
}

.ribbon-process-table-wrap th:nth-child(1),
.ribbon-process-table-wrap td:nth-child(1) {
    width: 4.2rem;
}

.ribbon-process-table-wrap th:nth-child(2),
.ribbon-process-table-wrap td:nth-child(2) {
    width: 19%;
}

.ribbon-process-table-wrap th:nth-child(4),
.ribbon-process-table-wrap td:nth-child(4) {
    width: 7.4rem;
}

.ribbon-process-table-wrap th:nth-child(5),
.ribbon-process-table-wrap td:nth-child(5) {
    width: 4rem;
}

.ribbon-process-table-wrap th:nth-child(6),
.ribbon-process-table-wrap td:nth-child(6) {
    width: 4.8rem;
}

.ribbon-process-table-wrap th:nth-child(7),
.ribbon-process-table-wrap td:nth-child(7) {
    width: 8.8rem;
}

.ribbon-process-table-wrap .process-name-cell,
.ribbon-process-table-wrap .process-target-cell {
    min-width: 0;
}

.ribbon-process-table-wrap .process-status-cell,
.ribbon-process-table-wrap .process-percent-cell,
.ribbon-process-table-wrap .process-eta-cell {
    white-space: nowrap;
}

.cell-truncate {
    display: block;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ribbon-panel:has(.ribbon-menu.is-open) {
    z-index: 45;
}

.ribbon-group:has(.ribbon-menu.is-open) {
    position: relative;
    z-index: 46;
}

.ribbon-summary-group {
    display: grid;
    grid-template-columns: repeat(3, minmax(88px, 1fr));
    gap: 0.42rem;
    align-content: start;
    min-width: min(100%, 340px);
    max-width: 340px;
    flex: 0 0 340px;
    min-block-size: var(--ribbon-lower-row-height);
}

.ribbon-stat-card {
    min-height: 67px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.12rem;
    padding: 0.4rem 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 9px;
    background: linear-gradient(135deg, rgba(20, 10, 38, 0.82) 0%, rgba(58, 18, 90, 0.52) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.ribbon-stat-label {
    color: var(--text-muted);
    font-size: 0.66rem;
    line-height: 1.1;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ribbon-stat-value {
    color: var(--good);
    font-size: 1.18rem;
    font-weight: 700;
    line-height: 1.1;
}

.credential-capture-panel {
    display: grid;
    gap: 0.85rem;
}

.credential-capture-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.85rem;
}

.credential-capture-heading h2,
.credential-capture-heading p {
    margin: 0;
}

.credential-capture-heading p {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.credential-capture-header-actions {
    margin-bottom: 0;
    justify-content: flex-end;
}

.credential-capture-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.credential-capture-card {
    display: grid;
    gap: 0.6rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(18, 8, 34, 0.9) 0%, rgba(40, 15, 61, 0.6) 100%);
}

.credential-capture-card h3,
.credential-capture-card p {
    margin: 0;
}

.credential-capture-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}

.credential-capture-card-header p {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.credential-capture-inline-select {
    display: grid;
    gap: 0.28rem;
    min-width: 7.5rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.credential-capture-inline-select select {
    min-width: 0;
}

.credential-capture-recent-list {
    display: grid;
    gap: 0.42rem;
    max-height: 180px;
    overflow: auto;
    padding-right: 0.15rem;
}

.credential-capture-recent-item {
    display: grid;
    gap: 0.12rem;
    padding: 0.45rem 0.55rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 9px;
    background: rgba(12, 6, 22, 0.7);
}

.credential-capture-recent-item strong {
    font-size: 0.82rem;
}

.credential-capture-recent-item span,
.credential-capture-recent-item small,
.credential-capture-empty {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.ribbon-btn {
    min-width: 98px;
    min-height: 74px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.28rem;
    border: 1px solid rgba(192, 132, 252, 0.28);
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(45, 27, 105, 0.72) 0%, rgba(147, 51, 234, 0.34) 55%, rgba(139, 26, 58, 0.4) 100%);
    color: var(--text-main);
    padding: 0.5rem 0.45rem;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.ribbon-btn i {
    font-size: 1.02rem;
}

.ribbon-btn span {
    font-size: 0.72rem;
    text-align: center;
    line-height: 1.2;
}

.ribbon-btn:hover {
    filter: brightness(1.12);
    transform: translateY(-1px);
}

.ribbon-btn-toggle[aria-pressed="true"],
.ribbon-btn-toggle.is-active {
    border-color: rgba(34, 197, 94, 0.48);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 0 0 1px rgba(34, 197, 94, 0.18);
    background: linear-gradient(135deg, rgba(8, 41, 24, 0.82) 0%, rgba(21, 128, 61, 0.42) 58%, rgba(13, 64, 39, 0.72) 100%);
}

.ribbon-menu {
    position: relative;
    z-index: 1;
}

.ribbon-btn-menu {
    position: relative;
    padding-bottom: 0.4rem;
}

.ribbon-caret {
    margin-top: 0.05rem;
    font-size: 0.62rem;
    color: var(--text-muted);
}

.ribbon-submenu {
    display: none;
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    min-width: 170px;
    padding: 0.35rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: rgba(13, 0, 21, 0.96);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.38);
    z-index: 30;
    gap: 0.25rem;
}

.ribbon-menu.is-open .ribbon-submenu {
    display: grid;
    z-index: 40;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.ribbon-submenu-item {
    width: 100%;
    border: 1px solid rgba(192, 132, 252, 0.22);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(45, 27, 105, 0.5) 0%, rgba(139, 26, 58, 0.28) 100%);
    color: var(--text-main);
    text-align: left;
    padding: 0.45rem 0.55rem;
    font-size: 0.78rem;
}

.ribbon-submenu-item:hover {
    filter: brightness(1.12);
}

.ribbon-submenu-item.is-active {
    border-color: rgba(126, 227, 203, 0.55);
    box-shadow: 0 0 0 1px rgba(126, 227, 203, 0.18) inset;
}

.panel-header-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.panel-inline-select {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.panel-inline-select select {
    min-width: 10rem;
}

.panel-scope-label {
    color: var(--text-muted);
    font-size: 0.78rem;
    margin: 0;
    max-width: 16rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.panel-filter-dropdown {
    position: relative;
}

.panel-filter-button {
    min-height: 1.9rem;
    padding: 0.34rem 0.72rem;
}

.panel-filter-button.is-active {
    border-color: rgba(126, 227, 203, 0.55);
    box-shadow: 0 0 0 1px rgba(126, 227, 203, 0.18) inset;
}

.panel-filter-dropdown-menu .panel-filter-button {
    width: 100%;
}

.panel-filter-dropdown-menu .panel-filter-popover {
    top: 0;
    right: calc(100% + 0.5rem);
}

.panel-filter-popover {
    position: absolute;
    top: calc(100% + 0.45rem);
    right: 0;
    z-index: 35;
    width: min(18rem, 80vw);
    padding: 0.75rem;
    border: 1px solid rgba(126, 227, 203, 0.22);
    border-radius: 0.85rem;
    background: rgba(13, 8, 23, 0.98);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
}

.panel-filter-popover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.55rem;
}

.panel-filter-list {
    display: grid;
    gap: 0.35rem;
    max-height: 18rem;
    overflow: auto;
    padding-right: 0.65rem;
}

.panel-filter-option {
    display: grid;
    grid-template-columns: 1rem minmax(0, 1fr) 2.25rem;
    align-items: center;
    column-gap: 0.6rem;
    padding: 0.28rem 0.1rem;
    color: var(--text-main);
    font-size: 0.84rem;
}

.panel-filter-option input {
    justify-self: start;
}

.panel-filter-option-name {
    min-width: 0;
    overflow: hidden;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.panel-filter-option-count {
    color: var(--text-muted);
    font-size: 0.76rem;
    font-variant-numeric: tabular-nums;
    justify-self: end;
    text-align: right;
}

.panel-header-actions .icon-btn {
    margin-right: 0;
}

.panel-menu {
    position: relative;
}

.panel:has(.panel-menu.is-open) {
    z-index: 45;
}

.panel-menu-button,
.graph-icon-button,
.icon-btn {
    border: 1px solid rgba(192, 132, 252, 0.26);
    border-radius: 9px;
    background: linear-gradient(135deg, rgba(45, 27, 105, 0.58) 0%, rgba(139, 26, 58, 0.28) 100%);
    color: var(--text-main);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.panel-menu-button {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.panel-menu-button:hover,
.graph-icon-button:hover,
.icon-btn:hover {
    filter: brightness(1.12);
}

.panel-menu-button.is-collapsed i {
    transform: rotate(-90deg);
}

.scheduler-provider-notice {
    grid-column: span 4;
    margin: 0;
}

.panel-submenu {
    right: 0;
    left: auto;
    min-width: 190px;
}

.panel-submenu-group {
    display: grid;
    gap: 0.25rem;
}

.panel-submenu-title {
    margin: 0.1rem 0 0.15rem;
    padding: 0 0.2rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.chip {
    border: 1px solid var(--panel-border);
    border-radius: 999px;
    padding: 0.25rem 0.7rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    background: rgba(13, 0, 21, 0.72);
}

.text-muted {
    color: var(--text-muted);
}

.grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: clamp(0.7rem, 0.8vw, 1rem);
}

.panel {
    position: relative;
    z-index: 1;
    grid-column: span 6;
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: 14px;
    padding: 1rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.panel-full {
    grid-column: span 12;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
}

.panel h2,
.panel h3 {
    margin: 0;
}

.panel-header p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.meta-note {
    margin: 0.65rem 0 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.scheduler-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.65rem;
}

.scheduler-meta .chip strong {
    color: var(--text-main);
    font-weight: 600;
}

.scheduler-form {
    margin-top: 0.8rem;
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 0.7rem;
}

.scheduler-form label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.scheduler-form .scheduler-provider-field {
    display: none;
}

.scheduler-form .scheduler-provider-field.is-active {
    display: flex;
}

.scheduler-form input,
.scheduler-form select,
.scheduler-form textarea,
.action-block input,
.action-block select,
.action-block textarea {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(13, 0, 21, 0.84);
    color: var(--text-main);
    padding: 0.45rem 0.55rem;
}

textarea,
select,
input {
    color: var(--text-main);
}

select,
input,
textarea {
    transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 2rem;
    background-image:
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0)),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7l5 6 5-6' stroke='%23c084fc' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat, no-repeat;
    background-position: 0 0, calc(100% - 0.65rem) 50%;
    background-size: 100% 100%, 0.9rem;
}

select::-ms-expand {
    display: none;
}

option,
optgroup {
    background: #0d0015;
    color: #f8f7ff;
}

select:focus,
input:focus,
textarea:focus {
    outline: none;
    border-color: rgba(192, 132, 252, 0.62);
    box-shadow: 0 0 0 1px rgba(192, 132, 252, 0.22), 0 0 22px rgba(147, 51, 234, 0.16);
}

.ansi-output-view {
    width: 100%;
    display: block;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(13, 0, 21, 0.84);
    color: var(--text-main);
    padding: 0.45rem 0.55rem;
    font-family: "Consolas", "Menlo", monospace;
    font-size: 0.8rem;
    line-height: 1.35;
    white-space: pre-wrap;
    word-break: break-word;
    overflow: auto;
    user-select: text;
    tab-size: 4;
}

.process-command-block {
    margin-bottom: 0.6rem;
}

.process-command-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-bottom: 0.35rem;
    color: var(--text-muted);
    font-size: 0.84rem;
}

#process-output-command-copy,
#script-output-command-copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 1.8rem;
    padding: 0;
}

.process-command-text {
    width: 100%;
    min-height: 2.1rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(13, 0, 21, 0.84);
    color: var(--text-main);
    padding: 0.45rem 0.55rem;
    font-family: "Consolas", "Menlo", monospace;
    font-size: 0.8rem;
    line-height: 1.35;
    white-space: pre-wrap;
    word-break: break-all;
}

.output-modal {
    width: min(980px, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.output-modal .modal-header,
.output-modal .modal-actions,
.output-modal .process-command-block {
    flex: 0 0 auto;
}

.output-modal .process-command-text {
    max-height: min(18vh, 8rem);
    overflow: auto;
}

.process-output-block {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    margin-bottom: 0;
}

.process-output-block .ansi-output-view {
    flex: 1 1 auto;
    min-height: 0;
}

.action-grid {
    margin-top: 0.8rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 0.8rem;
}

.action-block {
    border: 1px solid rgba(173, 181, 227, 0.2);
    border-radius: 12px;
    padding: 0.75rem;
    background: rgba(16, 20, 44, 0.5);
}

.action-block h3 {
    margin-bottom: 0.65rem;
}

.action-block label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.action-block .checkbox {
    flex-direction: row;
}

.action-block .scheduler-actions {
    grid-column: auto;
    margin-bottom: 0.6rem;
}

.checkbox {
    flex-direction: row !important;
    align-items: center;
    gap: 0.45rem;
}

.checkbox input {
    width: auto;
}

.danger-group {
    grid-column: span 2;
    border: 1px solid rgba(173, 181, 227, 0.2);
    border-radius: 10px;
    padding: 0.6rem;
}

.scheduler-settings-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    gap: 0.7rem;
    align-content: start;
    background: rgba(16, 20, 44, 0.45);
}

.scheduler-settings-group label {
    margin-bottom: 0;
}

.scheduler-group-note,
.scheduler-field-span-2 {
    grid-column: 1 / -1;
}

.scheduler-group-note {
    margin: 0;
}

.scheduler-policy-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.scheduler-policy-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.6rem;
    border: 1px solid rgba(173, 181, 227, 0.18);
    border-radius: 999px;
    background: rgba(10, 14, 32, 0.5);
    color: var(--text-muted);
    font-size: 0.82rem;
}

.scheduler-policy-chip strong {
    color: var(--text-main);
    font-weight: 600;
}

.project-report-headers-label {
    grid-column: span 2;
}

#project-report-headers {
    min-height: 6.4rem;
    font-family: "Consolas", "Menlo", monospace;
    resize: vertical;
}

.danger-group legend {
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: 0 0.3rem;
}

.scheduler-actions {
    grid-column: span 2;
    display: flex;
    align-items: flex-end;
}

.scheduler-actions button {
    border: 1px solid var(--accent-soft);
    background: linear-gradient(135deg, var(--accent) 0%, #5d67db 100%);
    color: var(--text-main);
    border-radius: 9px;
    padding: 0.55rem 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

.scheduler-actions button:hover {
    filter: brightness(1.1);
}

.graph-panel-actions .graph-icon-button,
.graph-panel-actions .panel-menu-button,
.graph-detail-shell-actions .graph-icon-button {
    border: 1px solid rgba(192, 132, 252, 0.26);
    background: linear-gradient(135deg, rgba(45, 27, 105, 0.58) 0%, rgba(139, 26, 58, 0.28) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    padding: 0;
    font-weight: 400;
}

.graph-panel-actions .graph-icon-button:hover,
.graph-panel-actions .panel-menu-button:hover,
.graph-detail-shell-actions .graph-icon-button:hover {
    filter: brightness(1.12);
}

.scheduler-actions button:disabled,
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: none;
}

button {
    border: 1px solid rgba(192, 132, 252, 0.3);
    background: linear-gradient(135deg, rgba(45, 27, 105, 0.8) 0%, rgba(147, 51, 234, 0.34) 55%, rgba(139, 26, 58, 0.44) 100%);
    color: var(--text-main);
    border-radius: 8px;
    padding: 0.35rem 0.55rem;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

button:hover {
    filter: brightness(1.08);
}

.action-block .scheduler-actions {
    gap: 0.45rem;
    flex-wrap: wrap;
}

.approval-action-buttons {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    flex-wrap: wrap;
    min-width: 240px;
}

.nmap-wizard {
    border: 1px solid rgba(173, 181, 227, 0.2);
    border-radius: 10px;
    background: rgba(13, 16, 34, 0.48);
    padding: 0.65rem;
    margin-bottom: 0.65rem;
}

.wizard-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.35rem;
    margin-bottom: 0.6rem;
}

.wizard-step {
    width: 100%;
    font-size: 0.76rem;
    line-height: 1.15;
    padding: 0.42rem 0.4rem;
    border-radius: 8px;
    border: 1px solid rgba(123, 131, 255, 0.28);
    background: rgba(33, 37, 73, 0.65);
    white-space: nowrap;
}

.wizard-step.is-active {
    border-color: var(--accent-soft);
    background: linear-gradient(135deg, rgba(123, 131, 255, 0.38) 0%, rgba(95, 103, 214, 0.45) 100%);
}

.wizard-page {
    display: none;
}

.wizard-page.is-active {
    display: block;
}

.wizard-subgrid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem;
    margin-bottom: 0.5rem;
}

#nmap-rfc-target-controls {
    margin-top: 0.55rem;
}

#nmap-passive-target-controls {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.mode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.5rem;
}

.mode-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    border: 1px solid rgba(173, 181, 227, 0.23);
    border-radius: 10px;
    background: rgba(16, 20, 44, 0.62);
    padding: 0.55rem;
    cursor: pointer;
}

.mode-card span {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.mode-card input {
    width: auto;
}

.mode-options {
    display: none;
}

.mode-options.is-active {
    display: block;
}

.mode-options h4 {
    margin-bottom: 0.45rem;
}

.nmap-final-controls {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin-top: 0.7rem;
}

#nmap-easy-preset-note {
    margin-bottom: 0.55rem;
}

.wizard-nav {
    display: flex;
    justify-content: space-between;
    gap: 0.4rem;
    margin-top: 0.65rem;
}

.wizard-nav button[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

.screenshot-list {
    margin-top: 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.screenshot-list a {
    color: var(--good);
    text-decoration: none;
    word-break: break-all;
}

.screenshot-list a:hover {
    text-decoration: underline;
}

#host-ai-analysis-status {
    word-break: break-word;
}

.host-ai-report-actions {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin: 0.45rem 0 0.75rem;
}

.graph-panel {
    --graph-workspace-height: 680px;
    overflow: visible;
}

.graph-filters-panel {
    margin-top: 0.8rem;
    padding-top: 0.15rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.graph-filters-panel[hidden] {
    display: none;
}

.graph-toolbar {
    display: grid;
    grid-template-columns: repeat(6, minmax(150px, 1fr));
    gap: 0.65rem;
}

.graph-toolbar label,
.graph-action-group label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.graph-confidence-label span {
    color: var(--text-main);
    font-size: 0.82rem;
    font-weight: 600;
}

.graph-checkbox {
    align-self: end;
}

.graph-action-bar {
    margin-top: 0.8rem;
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.graph-action-footer {
    margin-top: 0.9rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(173, 181, 227, 0.12);
    margin-bottom: 0.2rem;
    align-items: center;
    justify-content: center;
}

.graph-action-group {
    display: flex;
    align-items: flex-end;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.graph-action-buttons .graph-icon-button {
    margin-right: 0;
}

.graph-action-footer-left {
    align-items: center;
    flex: 0 1 auto;
}

.graph-status-note {
    margin: 0.1rem 0 0;
    white-space: nowrap;
    text-align: left;
}

.graph-action-group label {
    min-width: 150px;
}

.graph-footer-separator {
    width: 1px;
    min-height: 44px;
    align-self: stretch;
    background: linear-gradient(180deg, rgba(173, 181, 227, 0.04), rgba(173, 181, 227, 0.22), rgba(173, 181, 227, 0.04));
    border-radius: 999px;
    flex-shrink: 0;
}

.graph-action-group-separated {
    padding-left: 0.15rem;
}

.graph-workspace {
    margin-top: 0.8rem;
    display: grid;
    grid-template-columns: minmax(0, 2.3fr) minmax(320px, 1fr);
    gap: 0.85rem;
    align-items: start;
}

.graph-workspace.graph-workspace-detail-floating {
    grid-template-columns: 1fr;
}

.graph-canvas-panel,
.graph-detail-panel {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    background: rgba(13, 0, 21, 0.7);
    padding: 0.75rem;
}

.graph-canvas-panel {
    position: relative;
    min-height: calc(var(--graph-workspace-height) + 32px);
}

.graph-sidebar {
    position: sticky;
    top: 1rem;
    max-height: var(--graph-workspace-height);
    overflow: auto;
}

.graph-sidebar[hidden] {
    display: none;
}

.graph-workspace.graph-workspace-detail-docked .graph-sidebar {
    display: block;
}

.graph-detail-panel {
    width: 100%;
}

.graph-detail-panel[hidden] {
    display: none;
}

.graph-detail-panel.is-floating {
    position: absolute;
    width: min(520px, calc(100% - 1rem));
    max-height: calc(var(--graph-workspace-height) - 18px);
    overflow: auto;
    background: linear-gradient(180deg, rgba(27, 9, 42, 1) 0%, rgba(17, 3, 27, 1) 100%);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    z-index: 32;
}

.graph-detail-floating-layer {
    position: absolute;
    inset: 0;
    overflow: visible;
    pointer-events: none;
    z-index: 20;
}

.graph-detail-floating-layer[hidden] {
    display: none;
}

.graph-detail-floating-layer .graph-detail-panel {
    pointer-events: auto;
}

.graph-detail-header {
    align-items: flex-start;
}

.graph-detail-heading {
    min-width: 0;
}

.graph-detail-shell-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.35rem;
    margin-left: auto;
}

.graph-icon-button {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 10px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.graph-icon-button i {
    pointer-events: none;
}

.graph-icon-button.is-active {
    border-color: rgba(108, 224, 199, 0.55);
    box-shadow: 0 0 0 1px rgba(108, 224, 199, 0.18) inset;
}

.graph-canvas-scroll {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background:
        radial-gradient(circle at top left, rgba(30, 58, 95, 0.2), transparent 34%),
        radial-gradient(circle at top right, rgba(75, 0, 130, 0.16), transparent 32%),
        radial-gradient(circle at bottom right, rgba(139, 26, 58, 0.14), transparent 30%),
        rgba(5, 0, 16, 0.92);
    overflow: auto;
    height: var(--graph-workspace-height);
    min-height: 520px;
    cursor: grab;
}

.graph-canvas-scroll:active,
body.graph-workspace-panning .graph-canvas-scroll {
    cursor: grabbing;
}

.graph-canvas {
    width: 100%;
    min-width: 0;
    min-height: calc(var(--graph-workspace-height) - 40px);
    display: block;
    touch-action: none;
}

.graph-matrix-view {
    min-width: 1180px;
    min-height: calc(var(--graph-workspace-height) - 40px);
    padding: 0.4rem 0.2rem 0.2rem;
}

.graph-matrix-note {
    margin: 0 0 0.55rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.graph-matrix-table {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.74rem;
}

.graph-matrix-table th,
.graph-matrix-table td {
    min-width: 44px;
    max-width: 140px;
    padding: 0.35rem 0.4rem;
    text-align: center;
    border: 1px solid rgba(173, 181, 227, 0.1);
}

.graph-matrix-table thead th,
.graph-matrix-table tbody th {
    position: sticky;
    background: rgba(10, 13, 27, 0.96);
    color: var(--text-muted);
    z-index: 2;
}

.graph-matrix-table thead th {
    top: 0;
}

.graph-matrix-table tbody th {
    left: 0;
    text-align: left;
    z-index: 1;
}

.graph-matrix-cell {
    color: rgba(7, 10, 20, 0.92);
    font-weight: 700;
}

.graph-empty-state {
    margin-bottom: 0.65rem;
    border: 1px dashed rgba(192, 132, 252, 0.28);
    border-radius: 10px;
    padding: 0.55rem 0.7rem;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.graph-group-label {
    fill: rgba(180, 187, 221, 0.84);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.graph-group {
    cursor: grab;
}

.graph-group:active {
    cursor: grabbing;
}

.graph-node {
    cursor: grab;
}

.graph-node:active {
    cursor: grabbing;
}

.graph-node-type {
    fill: rgba(180, 187, 221, 0.92);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.graph-node-label {
    fill: var(--text-main);
    font-size: 12px;
    font-weight: 600;
}

.graph-edge-hitbox {
    cursor: pointer;
}

.graph-edge.is-selected,
.graph-node.is-selected rect {
    filter: drop-shadow(0 0 12px rgba(238, 241, 255, 0.18));
}

.graph-edge.is-connected-selected {
    filter: drop-shadow(0 0 10px rgba(255, 159, 67, 0.3));
}

.graph-node.is-host-selected rect {
    stroke: #dfff73;
    stroke-width: 2.8;
    filter: drop-shadow(0 0 16px rgba(223, 255, 115, 0.28));
}

.graph-node.is-summary rect {
    stroke-dasharray: 7 5;
}

.graph-resize-handle {
    height: 18px;
    margin-top: 0.15rem;
    position: relative;
    cursor: ns-resize;
}

.graph-resize-handle::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 96px;
    height: 6px;
    transform: translate(-50%, -50%);
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(126, 227, 203, 0.24), rgba(192, 132, 252, 0.42), rgba(126, 227, 203, 0.24));
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 0 12px rgba(147, 51, 234, 0.18);
}

body.graph-workspace-resizing,
body.graph-workspace-resizing * {
    cursor: ns-resize !important;
    user-select: none !important;
}

.graph-selection-badges {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin: 0.15rem 0 0.75rem;
}

.graph-badge {
    border: 1px solid rgba(123, 131, 255, 0.26);
    border-radius: 999px;
    padding: 0.2rem 0.6rem;
    background: rgba(123, 131, 255, 0.18);
    font-size: 0.72rem;
    color: var(--text-main);
}

.graph-badge-pinned {
    border-color: rgba(108, 224, 199, 0.26);
    background: rgba(108, 224, 199, 0.16);
}

.graph-detail-list {
    margin: 0;
    display: grid;
    grid-template-columns: minmax(110px, auto) 1fr;
    gap: 0.35rem 0.65rem;
}

.graph-detail-list dt {
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.graph-detail-list dd {
    margin: 0;
    word-break: break-word;
    font-size: 0.84rem;
}

.graph-detail-block {
    margin-top: 0.85rem;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(173, 181, 227, 0.14);
}

.graph-detail-block h4 {
    margin: 0 0 0.45rem;
    font-size: 0.86rem;
}

.graph-content-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.graph-content-card {
    border: 1px solid rgba(173, 181, 227, 0.16);
    border-radius: 10px;
    background: rgba(22, 26, 55, 0.46);
    padding: 0.55rem 0.6rem;
}

.graph-content-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
}

.graph-content-kind,
.graph-content-meta {
    color: var(--text-muted);
    font-size: 0.72rem;
}

.graph-content-meta {
    margin-top: 0.2rem;
    word-break: break-word;
}

.graph-content-image {
    display: block;
    width: 100%;
    max-height: 220px;
    object-fit: contain;
    margin-top: 0.45rem;
    border: 1px solid rgba(173, 181, 227, 0.18);
    border-radius: 10px;
    background: rgba(8, 10, 24, 0.94);
    cursor: zoom-in;
}

.graph-content-text {
    margin: 0.45rem 0 0;
    max-height: 240px;
    overflow: auto;
    border: 1px solid rgba(173, 181, 227, 0.16);
    border-radius: 10px;
    background: rgba(10, 13, 27, 0.72);
    color: var(--text-main);
    padding: 0.55rem;
    font-family: "Consolas", "Menlo", monospace;
    font-size: 0.76rem;
    line-height: 1.35;
    white-space: pre-wrap;
    word-break: break-word;
}

.graph-content-actions {
    display: flex;
    align-items: center;
    margin-top: 0.5rem;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.graph-content-actions .icon-btn {
    margin-right: 0;
}

.graph-detail-evidence {
    margin: 0;
    padding-left: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.32rem;
    font-size: 0.84rem;
}

.graph-detail-properties {
    margin: 0;
    min-height: 110px;
    max-height: 220px;
    overflow: auto;
    border: 1px solid rgba(173, 181, 227, 0.18);
    border-radius: 10px;
    background: rgba(10, 13, 27, 0.72);
    color: var(--text-main);
    padding: 0.55rem;
    font-family: "Consolas", "Menlo", monospace;
    font-size: 0.76rem;
    line-height: 1.35;
    white-space: pre-wrap;
    word-break: break-word;
}

.graph-annotations-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-bottom: 0.55rem;
}

.graph-annotation-card {
    border: 1px solid rgba(173, 181, 227, 0.14);
    border-radius: 10px;
    background: rgba(22, 26, 55, 0.52);
    padding: 0.5rem 0.6rem;
}

.graph-annotation-meta {
    color: var(--text-muted);
    font-size: 0.72rem;
    margin-bottom: 0.28rem;
}

.graph-annotation-body {
    font-size: 0.82rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.graph-detail-actions {
    margin-top: 0.6rem;
    gap: 0.45rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.graph-detail-actions .graph-icon-button {
    margin-left: 0.1rem;
}

.graph-host-actions {
    margin-top: 0.2rem;
}

.graph-node-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}

.graph-action-menu {
    position: relative;
}

.graph-action-menu.is-open {
    z-index: 6;
}

.graph-action-menu.is-open .ribbon-submenu {
    display: grid;
    z-index: 12;
}

.graph-action-menu .panel-submenu {
    left: 0;
    right: auto;
    min-width: 220px;
    max-width: min(320px, 72vw);
    max-height: 260px;
    overflow: auto;
}

.graph-action-menu .ribbon-submenu-item {
    text-align: left;
}

.graph-action-menu-status {
    padding: 0.4rem 0.45rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.table-wrap {
    margin-top: 0.75rem;
    max-height: 420px;
    overflow: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
}

th,
td {
    text-align: left;
    padding: 0.55rem 0.45rem;
    border-bottom: 1px solid rgba(173, 181, 227, 0.15);
}

th {
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
}

tbody tr:hover {
    background: rgba(123, 131, 255, 0.14);
}

#hosts-body tr.is-selected td {
    background: rgba(216, 255, 118, 0.12);
    border-top: 1px solid rgba(216, 255, 118, 0.42);
    border-bottom: 1px solid rgba(216, 255, 118, 0.42);
}

#hosts-body tr.is-selected td:first-child {
    border-left: 2px solid rgba(216, 255, 118, 0.72);
}

#hosts-body tr.is-selected td:last-child {
    border-right: 2px solid rgba(216, 255, 118, 0.72);
}

#hosts-body tr.is-selected:hover td {
    background: rgba(216, 255, 118, 0.16);
}

td button {
    margin-right: 0.35rem;
}

.process-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.ribbon-process-table-wrap td.process-actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.25rem;
    white-space: nowrap;
}

.process-bulk-actions {
    margin-bottom: 0.85rem;
}

.process-actions .icon-btn {
    margin-right: 0;
}

.ribbon-process-table-wrap .process-actions .icon-btn {
    flex: 0 0 auto;
    width: 1.9rem;
    height: 1.8rem;
}

.process-status {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
}

.process-status-running {
    color: #86d993;
}

.process-status-running .process-spinner {
    border-color: rgba(134, 217, 147, 0.28);
    border-top-color: #86d993;
}

.process-status-crashed {
    color: #ff8f8f;
}

.process-status-problem {
    color: #f1cd6b;
}

.host-ip-with-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.host-os-icon {
    color: #98a2ff;
    min-width: 0.95rem;
}

.host-actions {
    white-space: nowrap;
}

.category-chip-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.6rem;
}

.category-chip {
    display: inline-flex;
    align-items: center;
    min-height: 1.75rem;
    padding: 0.2rem 0.62rem;
    border-radius: 999px;
    border: 1px solid rgba(126, 227, 203, 0.26);
    background: rgba(21, 12, 37, 0.76);
    color: #d8fff4;
    font-size: 0.8rem;
    line-height: 1.1;
}

.category-chip-empty {
    border-style: dashed;
    color: var(--text-muted);
}

.category-cell {
    min-width: 12rem;
}

.category-cell .category-chip-list,
.category-cell .category-chip {
    margin-bottom: 0;
}

.icon-btn {
    width: 2rem;
    height: 1.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin-right: 0.28rem;
}

.icon-btn.is-active {
    border-color: rgba(126, 227, 203, 0.55);
    box-shadow: 0 0 0 1px rgba(126, 227, 203, 0.18) inset;
}

.icon-btn i {
    pointer-events: none;
}

.icon-btn-danger {
    border-color: rgba(245, 119, 141, 0.58);
    background: rgba(245, 119, 141, 0.2);
}

.service-filter-cell {
    width: 2.4rem;
    text-align: center;
}

.host-filter-cell {
    width: 2.4rem;
    text-align: center;
}

.host-filter-cell .icon-btn,
.service-filter-cell .icon-btn {
    margin-right: 0;
}

.process-spinner {
    width: 0.82rem;
    height: 0.82rem;
    border: 2px solid rgba(123, 131, 255, 0.35);
    border-top-color: #9fa6ff;
    border-radius: 999px;
    animation: legion-spin 0.8s linear infinite;
}

@keyframes legion-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.legion-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(10, 12, 23, 0.68);
}

.legion-modal-overlay.is-open {
    display: flex;
}

.legion-modal {
    width: min(980px, 96vw);
    max-height: 90vh;
    position: relative;
    border-radius: 14px;
    border: 1px solid var(--panel-border);
    background: rgba(22, 26, 55, 0.96);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
    padding: 1rem;
    overflow: auto;
}

.scheduler-modal {
    width: min(1180px, 97vw);
}

.device-category-modal {
    width: min(1220px, 97vw);
}

.device-category-modal-body {
    display: grid;
    grid-template-columns: minmax(220px, 0.9fr) minmax(0, 1.9fr);
    gap: 1rem;
}

.device-category-panel {
    border: 1px solid rgba(160, 180, 255, 0.14);
    border-radius: 12px;
    padding: 0.9rem;
    background: rgba(16, 12, 34, 0.42);
}

.device-category-panel table input {
    width: 100%;
}

.device-category-panel .table-wrap {
    max-height: 46vh;
}

.report-provider-modal {
    width: min(1120px, 97vw);
}

.settings-modal {
    width: min(1080px, 97vw);
}

.compact-modal {
    width: min(720px, 94vw);
}

.settings-tool-audit {
    margin-bottom: 1rem;
}

.settings-display-panel {
    margin-bottom: 1rem;
}

.settings-inline-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    margin: 0.35rem 0 0.85rem;
}

.modal-log-block {
    min-height: 8rem;
    max-height: min(34vh, 320px);
    overflow: auto;
    margin: 0.65rem 0 0.9rem;
    padding: 0.8rem;
    border-radius: 12px;
    border: 1px solid rgba(173, 181, 227, 0.12);
    background: rgba(13, 0, 21, 0.78);
    color: var(--text-muted);
    font-family: var(--font-mono);
    white-space: pre-wrap;
    word-break: break-word;
}

.tool-install-controls {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.tool-install-script-block {
    display: block;
    margin-bottom: 0.9rem;
}

.tool-install-script-block textarea {
    min-height: 10rem;
    font-family: var(--font-mono);
}

.tool-audit-table-wrap {
    max-height: min(28vh, 280px);
}

.tool-audit-table-wrap code {
    white-space: pre-wrap;
    word-break: break-word;
}

.tool-audit-status-ok {
    color: #7ef3d0;
    font-weight: 700;
}

.tool-audit-status-warn {
    color: #ffd166;
    font-weight: 700;
}

.tool-audit-status-missing {
    color: #ff9b9b;
    font-weight: 700;
}

.empty-cell {
    color: var(--text-dim);
    text-align: center;
    padding: 0.75rem;
}

.scan-modal {
    width: min(1120px, 97vw);
}

.manual-scan-modal {
    width: min(760px, 96vw);
}

.host-selection-modal {
    width: min(760px, 96vw);
}

.script-cve-modal {
    width: min(820px, 96vw);
}

.screenshot-modal {
    width: min(1180px, 98vw);
}

.provider-logs-modal {
    width: min(1220px, 98vw);
}

.modal-table-modal {
    width: min(1440px, 98vw);
}

.host-remove-modal {
    width: min(560px, 94vw);
}

.graph-note-modal {
    width: min(680px, 95vw);
}

#screenshot-modal-image {
    display: block;
    max-width: 100%;
    max-height: 68vh;
    height: auto;
    margin: 0 auto;
    border: 1px solid rgba(173, 181, 227, 0.25);
    border-radius: 10px;
    background: rgba(8, 10, 24, 0.95);
}

.screenshot-modal-body {
    border: 1px solid rgba(173, 181, 227, 0.18);
    border-radius: 10px;
    padding: 0.7rem;
    background: rgba(11, 14, 31, 0.75);
    overflow: auto;
    max-height: 72vh;
}

.host-screenshot-trigger {
    border: none;
    background: transparent;
    color: var(--accent);
    text-decoration: underline;
    padding: 0;
    cursor: pointer;
    font-size: 0.8rem;
}

.host-screenshot-trigger:hover {
    color: #9fa6ff;
}

#settings-config-text {
    width: 100%;
    border: 1px solid rgba(173, 181, 227, 0.25);
    border-radius: 8px;
    background: rgba(13, 16, 34, 0.66);
    color: var(--text-main);
    padding: 0.5rem 0.6rem;
    font-family: "Consolas", "Menlo", monospace;
    font-size: 0.8rem;
    resize: vertical;
}

#provider-logs-text {
    font-size: 0.78rem;
    min-height: 60vh;
    max-height: 72vh;
}

.modal-header {
    position: relative;
    padding-right: 2.8rem;
    margin-bottom: 0.7rem;
    align-items: flex-start;
}

.modal-close-btn {
    position: absolute;
    top: -0.2rem;
    right: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    border: 1px solid rgba(173, 181, 227, 0.35);
    background: rgba(22, 26, 55, 0.88);
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    cursor: pointer;
}

.modal-close-btn:hover {
    background: rgba(123, 131, 255, 0.28);
    border-color: rgba(159, 166, 255, 0.62);
    filter: none;
}

.modal-close-btn i {
    pointer-events: none;
}

.graph-detail-shell-actions .graph-detail-close-btn {
    position: static;
    top: auto;
    right: auto;
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    border: 1px solid rgba(173, 181, 227, 0.35);
    background: rgba(22, 26, 55, 0.88);
    color: var(--text-main);
    padding: 0;
    line-height: 1;
    filter: none;
}

.graph-detail-shell-actions .graph-detail-close-btn:hover {
    background: rgba(123, 131, 255, 0.28);
    border-color: rgba(159, 166, 255, 0.62);
    filter: none;
}

.modal-actions {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin-bottom: 0.7rem;
}

.modal-toolbar-actions {
    justify-content: flex-start;
}

.modal-toolbar-actions .icon-btn {
    margin-right: 0;
}

.modal-table-wrap {
    margin-top: 0;
    max-height: min(60vh, 720px);
}

.output-modal #process-output-text,
.output-modal #script-output-text {
    min-height: 0;
    max-height: none;
}

.ansi-segment {
    color: inherit;
    background: transparent;
}

.ansi-bold {
    font-weight: 700;
}

.ansi-fg-black {
    color: #1d2338;
}

.ansi-fg-red {
    color: #ff6d7d;
}

.ansi-fg-green {
    color: #7fe79b;
}

.ansi-fg-yellow {
    color: #ffd166;
}

.ansi-fg-blue {
    color: #74b9ff;
}

.ansi-fg-magenta {
    color: #e39df6;
}

.ansi-fg-cyan {
    color: #67e8f9;
}

.ansi-fg-white {
    color: #e5ecff;
}

.ansi-fg-bright-black {
    color: #8a93b6;
}

.ansi-fg-bright-red {
    color: #ff8f9d;
}

.ansi-fg-bright-green {
    color: #9effb7;
}

.ansi-fg-bright-yellow {
    color: #ffe28a;
}

.ansi-fg-bright-blue {
    color: #9fc7ff;
}

.ansi-fg-bright-magenta {
    color: #f0b7ff;
}

.ansi-fg-bright-cyan {
    color: #9af4ff;
}

.ansi-fg-bright-white {
    color: #ffffff;
}

.ansi-bg-black {
    background: #1d2338;
}

.ansi-bg-red {
    background: rgba(255, 109, 125, 0.22);
}

.ansi-bg-green {
    background: rgba(127, 231, 155, 0.22);
}

.ansi-bg-yellow {
    background: rgba(255, 209, 102, 0.22);
}

.ansi-bg-blue {
    background: rgba(116, 185, 255, 0.22);
}

.ansi-bg-magenta {
    background: rgba(227, 157, 246, 0.22);
}

.ansi-bg-cyan {
    background: rgba(103, 232, 249, 0.22);
}

.ansi-bg-white {
    background: rgba(229, 236, 255, 0.22);
}

.ansi-bg-bright-black {
    background: rgba(138, 147, 182, 0.22);
}

.ansi-bg-bright-red {
    background: rgba(255, 143, 157, 0.22);
}

.ansi-bg-bright-green {
    background: rgba(158, 255, 183, 0.22);
}

.ansi-bg-bright-yellow {
    background: rgba(255, 226, 138, 0.22);
}

.ansi-bg-bright-blue {
    background: rgba(159, 199, 255, 0.22);
}

.ansi-bg-bright-magenta {
    background: rgba(240, 183, 255, 0.22);
}

.ansi-bg-bright-cyan {
    background: rgba(154, 244, 255, 0.22);
}

.ansi-bg-bright-white {
    background: rgba(255, 255, 255, 0.2);
}

.startup-wizard-overlay {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(10, 12, 23, 0.78);
}

.startup-wizard-overlay.is-open {
    display: flex;
}

.startup-wizard {
    width: min(920px, 96vw);
    max-height: 92vh;
    overflow: auto;
    border-radius: 14px;
    border: 1px solid var(--panel-border);
    background: rgba(22, 26, 55, 0.98);
    box-shadow: 0 24px 46px rgba(0, 0, 0, 0.5);
    padding: 1rem;
}

.startup-step {
    display: none;
}

.startup-step.is-active {
    display: block;
}

.startup-step h3 {
    margin: 0 0 0.5rem;
}

.startup-step label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.55rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.startup-step .checkbox {
    flex-direction: row !important;
}

.startup-step input,
.startup-step select,
.startup-step textarea {
    border: 1px solid rgba(173, 181, 227, 0.25);
    border-radius: 8px;
    background: rgba(13, 16, 34, 0.66);
    color: var(--text-main);
    padding: 0.45rem 0.55rem;
}

.startup-summary {
    border: 1px solid rgba(173, 181, 227, 0.2);
    border-radius: 10px;
    background: rgba(16, 20, 44, 0.58);
    padding: 0.65rem;
    color: var(--text-muted);
    white-space: pre-line;
}

@media (max-width: 1100px) {
    .panel {
        grid-column: span 12;
    }

    .scheduler-form {
        grid-template-columns: repeat(2, minmax(160px, 1fr));
    }

    .action-grid {
        grid-template-columns: 1fr;
    }

    .graph-toolbar {
        grid-template-columns: repeat(3, minmax(150px, 1fr));
    }

    .graph-workspace {
        grid-template-columns: 1fr;
    }

    .graph-sidebar {
        position: static;
        max-height: none;
    }

    .graph-detail-panel.is-floating {
        position: static;
        width: 100%;
        max-height: none;
    }

    .mode-grid {
        grid-template-columns: 1fr;
    }

    .ribbon {
        flex-direction: column;
        --ribbon-menu-row-height: auto;
        --ribbon-lower-row-height: auto;
    }

    .ribbon-column {
        width: 100%;
    }

    .ribbon-lower-row {
        min-block-size: 0;
    }

    .ribbon-group {
        width: 100%;
        justify-content: flex-start;
        overflow: visible;
    }

    .ribbon-process-group {
        min-width: 0;
        height: auto;
        min-height: 0;
        overflow: visible;
    }

    .ribbon-summary-group {
        grid-template-columns: repeat(3, minmax(92px, 1fr));
        min-width: 0;
        max-width: none;
        flex: 1 1 auto;
        min-block-size: 0;
    }

    .ribbon-menu-group,
    .ribbon-project-group,
    .ribbon-rationale-group {
        min-block-size: 0;
    }

    .ribbon-project-group,
    .ribbon-rationale-group {
        max-width: none;
        flex: 1 1 auto;
    }

    .ribbon-process-table-wrap {
        max-height: 172px;
    }
}


@media (max-width: 700px) {
    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .scheduler-form {
        grid-template-columns: 1fr;
    }

    .danger-group,
    .scheduler-actions,
    .project-report-headers-label {
        grid-column: span 1;
    }

    .scheduler-settings-group {
        grid-template-columns: 1fr;
    }

    .scheduler-group-note,
    .scheduler-field-span-2 {
        grid-column: span 1;
    }

    .graph-toolbar {
        grid-template-columns: 1fr;
    }

    .graph-action-bar {
        flex-direction: column;
    }

    .graph-action-group {
        width: 100%;
    }

    .graph-action-group label {
        min-width: 0;
        width: 100%;
    }

    .graph-action-footer-left,
    .graph-status-note {
        width: 100%;
        margin-left: 0;
    }

    .graph-footer-separator {
        display: none;
    }

    .graph-canvas {
        min-width: 0;
        min-height: 520px;
    }

    .wizard-steps {
        grid-template-columns: 1fr;
    }

    .wizard-subgrid {
        grid-template-columns: 1fr;
    }

    .legion-modal {
        width: 100%;
        max-height: 92vh;
        padding: 0.8rem;
    }

    .output-modal {
        width: 100%;
        max-height: calc(100vh - 2rem);
    }

    .modal-actions {
        flex-direction: column;
    }

    .startup-wizard {
        width: 100%;
        padding: 0.8rem;
    }

    .ribbon-btn {
        min-width: 88px;
        min-height: 68px;
    }

    .ribbon-lower-row {
        flex-direction: column;
    }

    .ribbon-summary-group {
        grid-template-columns: repeat(2, minmax(88px, 1fr));
        max-width: none;
        flex: 1 1 auto;
    }

    .ribbon-process-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .ribbon-process-actions {
        justify-content: flex-start;
    }
}
