body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(180deg, #eef5f1 0%, #f8fbf9 100%);
    color: #173126;
}

a {
    color: #0f5d44;
}

.shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
}

.panel {
    width: 100%;
    max-width: 1080px;
    background: #ffffff;
    border: 1px solid #d5e2db;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(23, 49, 38, 0.08);
    overflow: hidden;
}

.panel.compact {
    max-width: 460px;
}

.panel-header {
    padding: 24px 28px 0;
}

.panel-body {
    padding: 24px 28px 28px;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

.lede {
    color: #4e675d;
}

.flash {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 14px;
}

.flash-success {
    background: #e8f7ef;
    border: 1px solid #b8e2c7;
    color: #155935;
}

.flash-error {
    background: #fdeceb;
    border: 1px solid #efc7c3;
    color: #8a2b24;
}

.flash-warning {
    background: #fff5de;
    border: 1px solid #f1d89a;
    color: #7f5d16;
}

.field {
    margin-bottom: 16px;
}

.field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.field input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #bfd1c7;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 15px;
}

.field select,
.field textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #bfd1c7;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 15px;
    font-family: inherit;
    background: #ffffff;
    color: #173126;
}

.field input[readonly],
.field textarea[readonly] {
    background: #f3f7f5;
    color: #4a6358;
}

.button-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.button {
    appearance: none;
    border: 0;
    border-radius: 10px;
    padding: 11px 16px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.button-primary {
    background: #0f5d44;
    color: #ffffff;
}

.button-secondary {
    background: #edf3ef;
    color: #173126;
}

.button-danger {
    background: #fdeceb;
    color: #8a2b24;
    border: 1px solid #efc7c3;
}

.button-row a {
    text-decoration: none;
    font-weight: 600;
}

a.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 24px;
}

.card {
    border: 1px solid #d5e2db;
    border-radius: 14px;
    padding: 18px;
    background: #fcfdfc;
}

.meta-list {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 10px 14px;
    font-size: 14px;
}

.meta-list strong {
    color: #3c5a4e;
}

.stacked-form {
    margin-top: 14px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
}

.form-grid label {
    display: grid;
    gap: 6px;
    font-weight: 600;
    color: #3c5a4e;
}

.form-grid input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #bfd1c7;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    color: #173126;
}

.form-grid .check-row {
    align-content: end;
    grid-template-columns: auto 1fr;
    align-items: center;
}

.form-grid .check-row input {
    width: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    padding: 10px 8px;
    border-bottom: 1px solid #e2ece6;
    font-size: 14px;
}

th {
    color: #4e675d;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mono {
    font-family: Consolas, "Courier New", monospace;
}

.muted {
    color: #647a70;
}

.state-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
}

.state-active {
    background: #e8f7ef;
    border-color: #b8e2c7;
    color: #155935;
}

.state-disabled {
    background: #fdeceb;
    border-color: #efc7c3;
    color: #8a2b24;
}

.state-archived {
    background: #f0eef8;
    border-color: #d3caef;
    color: #4b3a8d;
}

.state-setup {
    background: #fff5de;
    border-color: #f1d89a;
    color: #7f5d16;
}

.state-unknown {
    background: #edf3ef;
    border-color: #d5e2db;
    color: #4e675d;
}

.channel-live {
    background: #e8f7ef;
    border-color: #b8e2c7;
    color: #155935;
}

.channel-preview {
    background: #fff5de;
    border-color: #f1d89a;
    color: #7f5d16;
}

.channel-dev {
    background: #e4f0ff;
    border-color: #bfd7ff;
    color: #214b83;
}

.channel-unknown {
    background: #edf3ef;
    border-color: #d5e2db;
    color: #4e675d;
}

.channel-status-manual_required,
.channel-readiness-planning,
.rollout-state-metadata_only,
.rollout-state-staged {
    background: #fff5de;
    border-color: #f1d89a;
    color: #7f5d16;
}

.channel-status-generated,
.channel-status-validated,
.build-status-uploaded,
.build-status-validated {
    background: #e4f0ff;
    border-color: #bfd7ff;
    color: #214b83;
}

.channel-status-deployed,
.channel-readiness-ready,
.rollout-state-ready,
.rollout-state-active,
.build-status-promoted,
.runtime-assignment-follows_channel {
    background: #e8f7ef;
    border-color: #b8e2c7;
    color: #155935;
}

.channel-status-failed,
.channel-readiness-blocked,
.rollout-state-rolled_back,
.build-status-blocked {
    background: #fdeceb;
    border-color: #efc7c3;
    color: #8a2b24;
}

.channel-status-unknown,
.channel-readiness-unknown,
.rollout-state-unknown,
.build-status-unknown,
.runtime-assignment-unknown {
    background: #edf3ef;
    border-color: #d5e2db;
    color: #4e675d;
}

.build-status-draft,
.runtime-assignment-pinned_build {
    background: #fff5de;
    border-color: #f1d89a;
    color: #7f5d16;
}

.build-status-retired {
    background: #f0eef8;
    border-color: #d3caef;
    color: #4b3a8d;
}

.access-mode-shared_domain_primary {
    background: #f0eef8;
    border-color: #d3caef;
    color: #4b3a8d;
}

.access-mode-unknown {
    background: #edf3ef;
    border-color: #d5e2db;
    color: #4e675d;
}

.identity-status-active,
.membership-status-active {
    background: #e8f7ef;
    border-color: #b8e2c7;
    color: #155935;
}

.identity-status-invited,
.membership-status-invited {
    background: #fff5de;
    border-color: #f1d89a;
    color: #7f5d16;
}

.identity-status-disabled,
.membership-status-revoked {
    background: #fdeceb;
    border-color: #efc7c3;
    color: #8a2b24;
}

.membership-status-suspended {
    background: #f0eef8;
    border-color: #d3caef;
    color: #4b3a8d;
}

.identity-status-unknown,
.membership-status-unknown {
    background: #edf3ef;
    border-color: #d5e2db;
    color: #4e675d;
}

.issue-status-open {
    background: #edf3ef;
    border-color: #d5e2db;
    color: #355145;
}

.issue-status-in_progress {
    background: #e4f0ff;
    border-color: #bfd7ff;
    color: #214b83;
}

.issue-status-under_review,
.issue-status-planned {
    background: #eef4f8;
    border-color: #c9d7e2;
    color: #29485d;
}

.issue-status-waiting_tenant {
    background: #fff5de;
    border-color: #f1d89a;
    color: #7f5d16;
}

.issue-status-released,
.issue-status-resolved {
    background: #e8f7ef;
    border-color: #b8e2c7;
    color: #155935;
}

.issue-status-closed {
    background: #f0eef8;
    border-color: #d3caef;
    color: #4b3a8d;
}

.issue-status-unknown {
    background: #edf3ef;
    border-color: #d5e2db;
    color: #4e675d;
}

.provision-status-pending,
.ops-status-pending {
    background: #edf3ef;
    border-color: #d5e2db;
    color: #4e675d;
}

.provision-status-executing,
.provision-status-executed,
.ops-status-generated,
.ops-status-executed {
    background: #e4f0ff;
    border-color: #bfd7ff;
    color: #214b83;
}

.provision-status-verified,
.ops-status-verified {
    background: #e8f7ef;
    border-color: #b8e2c7;
    color: #155935;
}

.provision-status-failed,
.ops-status-failed {
    background: #fdeceb;
    border-color: #efc7c3;
    color: #8a2b24;
}

.ops-status-manual_required {
    background: #fff5de;
    border-color: #f1d89a;
    color: #7f5d16;
}

.provision-status-unknown,
.ops-status-unknown {
    background: #edf3ef;
    border-color: #d5e2db;
    color: #4e675d;
}

.issue-priority-low {
    background: #edf3ef;
    border-color: #d5e2db;
    color: #4e675d;
}

.issue-priority-normal {
    background: #e4f0ff;
    border-color: #bfd7ff;
    color: #214b83;
}

.issue-priority-high {
    background: #fff5de;
    border-color: #f1d89a;
    color: #7f5d16;
}

.issue-priority-urgent {
    background: #fdeceb;
    border-color: #efc7c3;
    color: #8a2b24;
}

.issue-priority-unknown {
    background: #edf3ef;
    border-color: #d5e2db;
    color: #4e675d;
}

.impact-low,
.release-status-draft {
    background: #edf3ef;
    border-color: #d5e2db;
    color: #4e675d;
}

.impact-normal,
.release-status-scheduled,
.release-type-improved {
    background: #e4f0ff;
    border-color: #bfd7ff;
    color: #214b83;
}

.impact-high,
.release-type-maintenance {
    background: #fff5de;
    border-color: #f1d89a;
    color: #7f5d16;
}

.impact-critical,
.release-type-fixed {
    background: #fdeceb;
    border-color: #efc7c3;
    color: #8a2b24;
}

.release-type-new,
.release-status-published {
    background: #e8f7ef;
    border-color: #b8e2c7;
    color: #155935;
}

.release-status-archived {
    background: #f0eef8;
    border-color: #d3caef;
    color: #4b3a8d;
}

.pipeline-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.pipeline-tab {
    display: inline-flex;
    align-items: center;
    border: 1px solid #d5e2db;
    border-radius: 8px;
    padding: 8px 12px;
    background: #f8fbf9;
    color: #173126;
    font-weight: 700;
    text-decoration: none;
}

.pipeline-tab.active {
    background: #2a3f54;
    border-color: #2a3f54;
    color: #ffffff;
}

.pipeline-toolbar {
    display: grid;
    grid-template-columns: repeat(6, minmax(140px, 1fr));
    gap: 12px;
    align-items: end;
}

.dense-table th,
.dense-table td {
    padding: 8px 10px;
    font-size: 13px;
    vertical-align: top;
}

.lifecycle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.lifecycle-card {
    border: 1px solid #d5e2db;
    border-radius: 14px;
    padding: 16px;
    background: #f8fbf9;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.security-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.security-card {
    border: 1px solid #d5e2db;
    border-radius: 14px;
    padding: 16px;
    background: #f8fbf9;
}

.text-input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #bfd1c7;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    background: #ffffff;
    color: #173126;
}

.text-input:focus {
    outline: 2px solid rgba(15, 93, 68, 0.16);
    outline-offset: 1px;
    border-color: #0f5d44;
}

.issues-form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.field-span-2 {
    grid-column: span 2;
}

.field-span-3 {
    grid-column: span 3;
}

.thread-stack {
    display: grid;
    gap: 16px;
}

.ops-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.code-block {
    margin: 0;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid #d5e2db;
    background: #f3f7f5;
    color: #173126;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    line-height: 1.5;
}

.thread-message {
    border: 1px solid #d5e2db;
    border-radius: 14px;
    padding: 16px;
    background: #f8fbf9;
}

.thread-message-body {
    line-height: 1.6;
    white-space: normal;
}

.drift-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.file-drift-same {
    background: #edf3ef;
    border-color: #d5e2db;
    color: #355145;
}

.file-drift-changed {
    background: #fff5de;
    border-color: #f1d89a;
    color: #7f5d16;
}

.file-drift-missing_in_tenant {
    background: #e4f0ff;
    border-color: #bfd7ff;
    color: #214b83;
}

.file-drift-extra_in_tenant {
    background: #f0eef8;
    border-color: #d3caef;
    color: #4b3a8d;
}

.file-drift-excluded {
    background: #fdeceb;
    border-color: #efc7c3;
    color: #8a2b24;
}

.file-drift-unknown {
    background: #edf3ef;
    border-color: #d5e2db;
    color: #4e675d;
}

.plain-list {
    margin: 0;
    padding-left: 20px;
}

.plain-list li {
    margin-bottom: 8px;
}

.schema-diff-cell {
    line-height: 1.5;
    vertical-align: top;
}

details.card summary {
    cursor: pointer;
}

.setup-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    align-items: start;
}

.setup-card {
    display: grid;
    gap: 16px;
}

.setup-card form {
    display: grid;
    gap: 0;
}

.field-error {
    margin-top: 6px;
    font-size: 13px;
    color: #8a2b24;
}

.field-help,
.field-tip {
    margin-top: 6px;
    margin-bottom: 0;
    font-size: 13px;
    color: #647a70;
    line-height: 1.5;
}

.field-tip {
    margin-top: 16px;
}

.checkbox-field .field-help {
    margin-top: 0;
}

.checkbox-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 16px;
    color: #355145;
}

.checkbox-row input {
    margin-top: 3px;
}

.command-output {
    width: 100%;
    box-sizing: border-box;
    min-height: 320px;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid #d5e2db;
    background: #f3f7f5;
    color: #173126;
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    line-height: 1.5;
    resize: vertical;
}

.setup-empty {
    border: 1px dashed #bfd1c7;
    border-radius: 14px;
    padding: 18px;
    color: #647a70;
    background: #f8fbf9;
}

.setup-details {
    margin-top: 8px;
}

.advanced-section {
    border: 1px solid #d5e2db;
    border-radius: 14px;
    padding: 16px;
    background: #f8fbf9;
}

.advanced-section summary {
    cursor: pointer;
    font-weight: 700;
}

.status-block {
    border: 1px solid #d5e2db;
    border-radius: 14px;
    padding: 16px;
    background: #f8fbf9;
}

.guide-list {
    display: grid;
    gap: 16px;
}

.guide-entry {
    border-top: 1px solid #e2ece6;
    padding-top: 16px;
}

.guide-entry:first-child {
    border-top: 0;
    padding-top: 0;
}

.guide-section {
    margin-top: 24px;
}

.guide-section:first-of-type {
    margin-top: 0;
}

.guide-contents {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.guide-contents a {
    border: 1px solid #d5e2db;
    border-radius: 8px;
    padding: 8px 10px;
    background: #f8fbf9;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
}

.concept-grid,
.guidance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.concept-panel,
.guidance-panel {
    border: 1px solid #d5e2db;
    border-radius: 8px;
    padding: 14px;
    background: #f8fbf9;
}

.concept-panel h3,
.guidance-panel h3 {
    margin-bottom: 8px;
}

.concept-panel p,
.guidance-panel p {
    margin-bottom: 10px;
    line-height: 1.5;
}

.concept-panel p:last-child,
.guidance-panel p:last-child {
    margin-bottom: 0;
}

.operator-flow .flow-diagram {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.operator-flow .flow-step {
    border-left: 4px solid #0f5d44;
}

.operator-flow .flow-step:not(:last-child)::after {
    content: "";
}

.flow-image-panel {
    margin: 16px 0 0;
    border: 1px solid #d5e2db;
    border-radius: 8px;
    padding: 10px;
    background: #f8fbf9;
    overflow-x: auto;
}

.flow-image-panel img {
    display: block;
    width: 100%;
    min-width: 720px;
    height: auto;
    border-radius: 8px;
}

.flow-instructions {
    margin: 16px 0 0;
    padding-left: 22px;
}

.flow-instructions li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.boundary-note {
    margin-top: 14px;
    margin-bottom: 0;
    border-left: 4px solid #f1d89a;
    padding: 10px 12px;
    background: #fffaf0;
    color: #5d4615;
    line-height: 1.5;
}

.flow-diagram {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.flow-step {
    position: relative;
    border: 1px solid #d5e2db;
    border-radius: 8px;
    padding: 12px;
    background: #f8fbf9;
}

.flow-step:not(:last-child)::after {
    content: ">";
    position: absolute;
    right: -12px;
    top: 50%;
    width: 10px;
    transform: translateY(-50%);
    color: #0f5d44;
    font-weight: 700;
    text-align: center;
}

.flow-step strong,
.flow-step span {
    display: block;
}

.flow-step strong {
    margin-bottom: 6px;
    color: #173126;
}

.flow-step span {
    color: #4a6358;
    font-size: 13px;
    line-height: 1.45;
}

.conditional-field[hidden] {
    display: none !important;
}

@media (max-width: 1120px) {
    .flow-diagram {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .flow-step:not(:last-child)::after {
        content: "";
    }
}

@media (max-width: 860px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .meta-list {
        grid-template-columns: 1fr;
    }

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

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

    .flow-diagram {
        grid-template-columns: 1fr;
    }

    .flow-step:not(:last-child)::after {
        content: "v";
        left: 50%;
        right: auto;
        top: auto;
        bottom: -17px;
        transform: translateX(-50%);
    }

    .field-span-2,
    .field-span-3 {
        grid-column: span 1;
    }

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

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

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