.dialog:has(.structure-program-review-content) {
    align-items: flex-start;
    overflow: auto;
    padding: 24px 0;
}

.structure-program-review-content {
    --structure-review-preview-size: clamp(
        120px,
        min(27vw, calc(50vh - 145px)),
        285px
    );
    --structure-review-units-width: clamp(170px, 19vw, 230px);
    display: flex;
    width: min(1240px, calc(100vw - 48px));
    max-width: min(1240px, calc(100vw - 48px));
    max-height: calc(100vh - 48px);
    box-sizing: border-box;
    flex-direction: column;
    overflow: hidden;
}

.structure-program-review-content > h3,
.structure-program-review-description {
    flex: 0 0 auto;
}

.structure-program-review-description {
    margin: -4px 0 16px;
    color: #5f6368;
    font-size: 13px;
    line-height: 1.5;
}

.structure-program-review-plan {
    display: inline-flex;
    margin-left: 8px;
    align-items: center;
    gap: 5px;
    color: #3c4043;
    font-weight: 650;
}

.structure-program-review-plan code {
    padding: 2px 5px;
    border-radius: 4px;
    background: #eef3fe;
    color: #185abc;
    font: 10px/1.35 Consolas, "SFMono-Regular", monospace;
}

.structure-program-review-program {
    min-height: 0;
    margin: 0;
    padding: 14px;
    overflow: auto;
    border: 1px solid #dfe3e8;
    border-radius: 7px;
    background: #f7f9fc;
    color: #202124;
    font: 12px/1.55 Consolas, "SFMono-Regular", monospace;
    white-space: pre;
    overflow-wrap: normal;
}

.structure-program-review-editor {
    display: flex;
    min-height: 0;
    flex: 1 1 0;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
}

.structure-program-review-editor.hidden {
    display: none;
}

.structure-program-review-tree-card {
    display: contents;
    min-width: 0;
    min-height: 0;
}

.structure-program-review-panel:not(.is-editing) .structure-program-review-tree-card .structure-program-review-tree {
    display: none;
}

.structure-program-review-program.hidden {
    display: none;
}

.structure-program-review-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.structure-program-review-editor-toolbar.hidden {
    display: none;
}

#structure-program-review-add-object {
    padding: 4px 10px;
    border: 1px solid #1a73e8;
    border-radius: 4px;
    background: #fff;
    color: #1a73e8;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

#structure-program-review-add-object[aria-pressed="true"] {
    border-color: #1a73e8;
    background: #e8f0fe;
    color: #174ea6;
}

.structure-program-review-add-object-kind {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #3c4043;
    font-size: 12px;
}

.structure-program-review-add-object-kind select {
    min-height: 1.75rem;
    padding: 0 6px;
}

.structure-program-review-add-object-hint {
    color: #5f6368;
    font-size: 12px;
}

.structure-program-review-add-object-hint.hidden {
    display: none;
}

.structure-program-review-bbox-svg.is-adding-object,
.structure-program-review-original-add {
    cursor: crosshair;
}

.structure-program-review-figure.is-add-object-target figcaption {
    color: #174ea6;
}

.structure-program-review-figure.is-add-object-target .structure-program-review-preview {
    outline: 3px solid #1a73e8;
    outline-offset: 0;
    box-shadow: 0 0 0 4px #e8f0fe;
}

.structure-program-review-detected-bbox.is-adding {
    stroke-dasharray: 0.6 0.4;
    pointer-events: none;
}

.structure-program-review-panel.is-editing .structure-program-review-program {
    display: none;
}

.structure-program-review-tree {
    min-height: 0;
    flex: 1 1 0;
    overflow: auto;
    padding: 6px 0;
    border: 1px solid #dadce0;
    border-radius: 8px;
    background: #fafbff;
}

.structure-program-review-tree-row,
.structure-program-review-tree-drop {
    display: flex;
    width: 100%;
    box-sizing: border-box;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 4px 8px 4px calc(8px + var(--tree-depth, 0) * 14px);
    border: 0;
    border-left: 3px solid transparent;
    background: transparent;
    color: #202124;
    font: 12px/1.35 "Segoe UI", sans-serif;
    text-align: left;
    cursor: pointer;
}

.structure-program-review-tree-row:hover,
.structure-program-review-tree-drop:hover {
    background: #eef3fe;
}

.structure-program-review-tree-row.is-selected {
    border-left-color: #1a73e8;
    background: #e8f0fe;
}

.structure-program-review-tree-row.is-drop-target,
.structure-program-review-tree-drop.is-drop-target {
    background: #d2e3fc;
}

.structure-program-review-tree-id {
    margin-left: auto;
    color: #80868b;
    font-family: Consolas, "SFMono-Regular", monospace;
    font-size: 10px;
}

.structure-program-review-tree-row .collab-fit-status {
    flex: 0 0 auto;
}

.structure-program-review-tree-badge {
    flex: 0 0 auto;
    min-width: 16px;
    padding: 0 3px;
    border-radius: 3px;
    background: #e8eaed;
    color: #3c4043;
    font-size: 10px;
    font-weight: 700;
    text-align: center;
}

.structure-program-review-tree-badge.is-leftover {
    background: #fce8e6;
    color: #c5221f;
}

.structure-program-review-tree-badge.is-structure {
    background: #7c3aed;
    color: #fff;
}

.structure-program-review-tree-badge.is-object {
    background: #188038;
    color: #fff;
}

.structure-program-review-tree-badge.is-primitive {
    background: #5f6368;
    color: #fff;
}

.structure-program-review-inspector {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 10px;
    align-items: end;
    padding: 8px 10px;
    border: 1px solid #dadce0;
    border-radius: 8px;
    background: #fff;
}

.comica-review-inspector-section {
    min-width: 0;
}

.comica-review-section-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 7px;
    color: #3c4043;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.comica-review-section-heading strong {
    min-width: 0;
    overflow: hidden;
    color: #5f6368;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 10px;
    text-overflow: ellipsis;
    text-transform: none;
    white-space: nowrap;
}

.comica-review-patch-section {
    padding-bottom: 9px;
    border-bottom: 1px solid #e8eaed;
}

.comica-review-patch-list,
.comica-review-constraint-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.comica-review-patch-item {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 8px;
    width: 100%;
    padding: 7px 8px;
    border: 1px solid #dfe3e8;
    border-radius: 7px;
    background: #f8fafd;
    color: #202124;
    text-align: left;
    cursor: pointer;
}

.comica-review-patch-item:disabled {
    cursor: default;
}

.comica-review-patch-item:hover:not(:disabled) {
    border-color: #8ab4f8;
    background: #f1f6ff;
}

.comica-review-patch-item strong,
.comica-review-patch-item small {
    display: block;
    overflow-wrap: anywhere;
}

.comica-review-patch-item small {
    margin-top: 2px;
    color: #5f6368;
}

.comica-review-patch-op,
.comica-review-constraint-op {
    color: #1a73e8;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.is-add > .comica-review-patch-op,
.comica-review-constraint-card.is-add .comica-review-constraint-op {
    color: #188038;
}

.is-remove > .comica-review-patch-op,
.comica-review-constraint-card.is-remove .comica-review-constraint-op {
    color: #c5221f;
}

.comica-review-node-grid {
    display: grid;
    grid-template-columns: minmax(88px, auto) minmax(0, 1fr);
    gap: 7px 12px;
    align-items: start;
}

.comica-review-node-grid code {
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.comica-review-raw-details {
    margin-top: 8px;
    color: #5f6368;
    font-size: 11px;
}

.comica-review-raw-details summary {
    cursor: pointer;
    font-weight: 650;
}

.comica-review-raw-details pre {
    max-height: 220px;
    margin: 7px 0 0;
    overflow: auto;
    padding: 9px;
    border-radius: 6px;
    background: #f6f8fa;
    color: #202124;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.structure-program-review-inspector.is-empty {
    color: #5f6368;
    font-size: 12px;
}

.structure-program-review-inspector label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: #3c4043;
    font-size: 11px;
    font-weight: 650;
}

.structure-program-review-inspector select,
.structure-program-review-inspector input {
    min-width: 0;
    padding: 4px 6px;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font: 12px/1.3 "Segoe UI", sans-serif;
}

.structure-program-review-inspector-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    grid-column: 1 / -1;
}

.structure-program-review-inspector-actions button {
    padding: 4px 8px;
    border: 1px solid #dadce0;
    border-radius: 4px;
    background: #fff;
    color: #3c4043;
    font-size: 12px;
    cursor: pointer;
}

.structure-program-review-inspector-actions button[data-danger] {
    border-color: #f6aea9;
    color: #c5221f;
}

.structure-program-review-bbox-handle {
    fill: #fff;
    stroke: #1a73e8;
    stroke-width: 0.18;
    pointer-events: all;
    cursor: nwse-resize;
}

.structure-program-review-bbox-handle[data-handle="n"],
.structure-program-review-bbox-handle[data-handle="s"] {
    cursor: ns-resize;
}

.structure-program-review-bbox-handle[data-handle="e"],
.structure-program-review-bbox-handle[data-handle="w"] {
    cursor: ew-resize;
}

.structure-program-review-bbox-svg {
    overflow: hidden;
}

.structure-program-review-layout:has(.structure-program-review-panel.is-editing) .structure-program-review-bbox-svg {
    pointer-events: auto;
}

.structure-program-review-layout {
    display: grid;
    grid-template-columns:
        var(--structure-review-preview-size, 285px)
        var(--structure-review-units-width, 230px)
        minmax(0, 1fr);
    gap: 18px;
    height: calc(
        var(--structure-review-preview-size, 285px) +
        var(--structure-review-preview-size, 285px) +
        57px
    );
    min-height: 0;
    max-height: 100%;
    flex: 1 1 auto;
    align-items: stretch;
    margin-bottom: 18px;
}

.structure-program-review-layout.is-comica-tree-review {
    --comica-review-gap: 10px;
    --comica-drawing-size: clamp(260px, 19vw, 310px);
    grid-template-columns:
        var(--comica-drawing-size)
        minmax(380px, 1.2fr)
        minmax(340px, 0.9fr);
    gap: var(--comica-review-gap);
    height: clamp(460px, calc(100vh - 280px), 620px);
}

.structure-program-review-layout.is-comica-tree-review .structure-program-review-units-panel {
    display: none;
}

.structure-program-review-layout.is-comica-tree-review .structure-program-review-tree {
    min-height: 260px;
}

.structure-program-review-content:has(.is-comica-tree-review) .structure-program-review-description {
    display: none;
}

.structure-program-review-content:has(.is-comica-tree-review) > h3 {
    text-align: center;
}

.structure-program-review-layout.is-comica-tree-review .structure-program-review-figure figcaption,
.structure-program-review-layout.is-comica-tree-review .structure-program-review-tree-card > h4,
.structure-program-review-layout.is-comica-tree-review .comica-tree-review-detail-panel > h4 {
    font-size: 16px;
}

.structure-program-review-layout.is-comica-tree-review .structure-program-review-tree,
.structure-program-review-layout.is-comica-tree-review .structure-program-review-inspector,
.structure-program-review-layout.is-comica-tree-review .comica-tree-review-detail-content {
    border: 3px solid #202124;
    background: #ffffff;
}

.structure-program-review-layout.is-comica-tree-review .structure-program-review-tree-row,
.structure-program-review-layout.is-comica-tree-review .structure-program-review-tree-drop {
    font-size: 14px;
}

.structure-program-review-layout.is-comica-tree-review .comica-review-section-heading {
    font-size: 14px;
}

.structure-program-review-layout.is-comica-tree-review .comica-review-section-heading strong,
.structure-program-review-layout.is-comica-tree-review .structure-program-review-tree-id {
    font-size: 12px;
}

.structure-program-review-layout.is-comica-tree-review .comica-tree-review-parameter,
.structure-program-review-layout.is-comica-tree-review .comica-review-node-grid code {
    font-size: 13px;
}

/* COMICA review cards: title bar and content share one outlined surface. */
.structure-program-review-layout.is-comica-tree-review .structure-program-review-figure {
    width: var(--comica-drawing-size);
    min-height: 0;
    flex: none;
    overflow: hidden;
    box-sizing: border-box;
    border: 3px solid #202124;
    border-radius: 8px;
    background: #ffffff;
}

.structure-program-review-layout.is-comica-tree-review .structure-program-review-figure:first-child {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) minmax(76px, auto);
}

.structure-program-review-layout.is-comica-tree-review .structure-program-review-figure figcaption,
.structure-program-review-layout.is-comica-tree-review .structure-program-review-tree-card > h4,
.structure-program-review-layout.is-comica-tree-review .comica-tree-review-detail-panel > h4 {
    margin: 0;
    padding: 9px 12px;
    box-sizing: border-box;
    border-bottom: 3px solid #202124;
    background: #ffffff;
    line-height: 1.2;
    text-align: center;
}

.structure-program-review-layout.is-comica-tree-review .structure-program-review-preview {
    width: calc(100% - 24px);
    height: auto;
    max-height: none;
    aspect-ratio: 1 / 1;
    flex: 0 0 auto;
    box-sizing: border-box;
    border: 2px solid #202124;
    border-radius: 7px;
}

.structure-program-review-layout.is-comica-tree-review .structure-program-review-figure:first-child .structure-program-review-preview {
    width: auto;
    height: 100%;
    max-width: calc(100% - 24px);
    max-height: calc(100% - 12px);
    aspect-ratio: 1 / 1;
    align-self: center;
    justify-self: center;
    margin: 12px auto 0;
}

.structure-program-review-layout.is-comica-tree-review .structure-program-review-figure:nth-child(2) .structure-program-review-preview {
    width: auto;
    height: min(88%, calc(100% - 48px));
    max-width: 88%;
    margin: auto;
}

.structure-program-review-layout.is-comica-tree-review .structure-program-review-preview.is-expandable {
    position: relative;
    cursor: zoom-in;
    pointer-events: auto;
}

.structure-program-review-layout.is-comica-tree-review .structure-program-review-preview.is-expandable::after {
    position: absolute;
    right: 8px;
    bottom: 8px;
    padding: 4px 7px;
    border-radius: 4px;
    background: rgba(32, 33, 36, 0.82);
    color: #ffffff;
    content: "Click to enlarge";
    font-size: 10px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 120ms ease;
}

.structure-program-review-layout.is-comica-tree-review .structure-program-review-preview.is-expandable:hover::after,
.structure-program-review-layout.is-comica-tree-review .structure-program-review-preview.is-expandable:focus-visible::after {
    opacity: 1;
}

.cad-preview-lightbox {
    position: fixed;
    z-index: 1100;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    box-sizing: border-box;
    background: rgba(20, 22, 26, 0.66);
}

.cad-preview-lightbox.hidden {
    display: none;
}

.cad-preview-lightbox-card {
    display: flex;
    width: min(760px, calc(100vw - 64px));
    max-height: calc(100vh - 64px);
    flex-direction: column;
    overflow: hidden;
    border: 3px solid #202124;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
}

.cad-preview-lightbox-header {
    position: relative;
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    border-bottom: 3px solid #202124;
}

.cad-preview-lightbox-header h3 {
    margin: 0;
    font-size: 18px;
}

.cad-preview-lightbox-header button {
    position: absolute;
    top: 7px;
    right: 9px;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #3c4043;
    cursor: pointer;
    font-size: 27px;
    line-height: 1;
}

.cad-preview-lightbox-header button:hover,
.cad-preview-lightbox-header button:focus-visible {
    background: #f1f3f4;
}

.cad-preview-lightbox-content {
    display: flex;
    width: min(70vmin, 680px);
    aspect-ratio: 1 / 1;
    align-self: center;
    align-items: center;
    justify-content: center;
    margin: 20px;
    overflow: hidden;
    border: 3px solid #202124;
    border-radius: 8px;
    background: #ffffff;
}

.cad-preview-lightbox-content svg {
    display: block;
    width: 100%;
    height: 100%;
}

.cad-preview-lightbox-content .structure-program-review-fit-curve,
.cad-preview-lightbox-content .structure-program-review-fit-curve.is-hot {
    stroke-width: 1.8px;
}

.structure-program-review-layout.is-comica-tree-review .structure-program-review-tree-card > h4 {
    border: 3px solid #202124;
    border-bottom-width: 3px;
    border-radius: 8px 8px 0 0;
}

.structure-program-review-layout.is-comica-tree-review .structure-program-review-tree {
    border: 3px solid #202124;
    border-top: 0;
    border-radius: 0 0 8px 8px;
}

.structure-program-review-layout.is-comica-tree-review .structure-program-review-panel {
    display: grid;
    gap: var(--comica-review-gap);
    grid-template-rows: minmax(0, 3fr) minmax(0, 2fr);
}

.structure-program-review-layout.is-comica-tree-review .structure-program-review-tree-card {
    display: flex;
    height: auto;
    min-height: 0;
    flex: none;
    flex-direction: column;
    overflow: hidden;
}

.structure-program-review-layout.is-comica-tree-review .structure-program-review-panel.is-editing .structure-program-review-editor {
    display: flex;
    height: 100%;
    min-height: 0;
    flex: none;
    flex-direction: column;
    overflow: hidden;
}

.structure-program-review-layout.is-comica-tree-review .structure-program-review-program {
    display: none;
}

.structure-program-review-layout.is-comica-tree-review .structure-program-review-tree-card {
    gap: 0;
}

.structure-program-review-layout.is-comica-tree-review .structure-program-review-inspector {
    max-height: none;
    flex: 1 1 0;
}

.structure-program-review-layout.is-comica-tree-review .comica-tree-review-detail-panel {
    overflow: hidden;
    box-sizing: border-box;
    border: 3px solid #202124;
    border-radius: 8px;
    background: #ffffff;
}

.structure-program-review-layout.is-comica-tree-review .comica-tree-review-detail-content {
    border: 0;
    border-radius: 0;
}

.structure-program-review-layout.is-comica-tree-review .structure-program-review-inspector {
    gap: 0;
    overflow: hidden;
    padding: 0;
    box-sizing: border-box;
    border: 3px solid #202124;
    background: #ffffff;
}

.structure-program-review-layout.is-comica-tree-review .comica-review-section-heading {
    position: relative;
    justify-content: center;
    margin: 0;
    padding: 9px 12px;
    border-bottom: 3px solid #202124;
    background: #ffffff;
    text-align: center;
}

.structure-program-review-layout.is-comica-tree-review .comica-bootstrap-node-editor > .comica-review-section-heading {
    grid-column: 1 / -1;
}

.structure-program-review-layout.is-comica-tree-review .structure-program-review-inspector.is-empty {
    display: flex;
    align-items: stretch;
    flex-direction: column;
}

.comica-review-node-empty {
    display: flex;
    min-height: 0;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
    color: #5f6368;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
}

.structure-program-review-layout.is-comica-tree-review .comica-review-node-grid {
    padding: 12px;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
}

.structure-program-review-layout.is-comica-tree-review .comica-review-node-section {
    display: flex;
    width: 100%;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
    overflow: hidden;
}

.structure-program-review-layout.is-comica-tree-review .comica-tree-review-inspector {
    align-items: stretch;
    max-height: none;
    flex: 1 1 auto;
}

.structure-program-review-human-instruction {
    display: flex;
    min-height: 76px;
    max-height: 104px;
    flex: 0 0 auto;
    flex-direction: column;
    padding: 9px 12px 10px;
    overflow: hidden;
    box-sizing: border-box;
    border-top: 0;
    background: #ffffff;
}

.structure-program-review-layout.is-comica-tree-review .structure-program-review-visuals {
    display: grid;
    gap: var(--comica-review-gap);
    grid-template-rows: minmax(0, 3fr) minmax(0, 2fr);
}

.structure-program-review-human-instruction.hidden {
    display: none;
}

.structure-program-review-human-instruction strong {
    display: block;
    margin-bottom: 4px;
    color: #3c4043;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: none;
}

.structure-program-review-human-instruction p {
    min-height: 0;
    max-height: none;
    flex: 1 1 auto;
    margin: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    color: #3c4043;
    font-size: 13px;
    line-height: 1.4;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.structure-program-review-human-instruction p.is-drawing-only {
    color: #80868b;
    font-style: italic;
}

.structure-program-review-content:has(.is-comica-tree-review) {
    width: min(1180px, calc(100vw - 120px));
    max-width: min(1180px, calc(100vw - 120px));
}

.comica-tree-review-details {
    display: none;
    min-width: 0;
    min-height: 0;
    height: 100%;
    grid-template-rows: minmax(0, 1fr);
    gap: 14px;
    overflow: hidden;
}

.comica-tree-review-details.hidden {
    display: none;
}

.structure-program-review-layout.is-comica-tree-review .comica-tree-review-details {
    display: grid;
}

.structure-program-review-layout.is-bootstrap-tree-review {
    grid-template-columns: minmax(320px, 0.9fr) minmax(520px, 1.6fr);
    grid-template-areas: "visuals units";
}

.structure-program-review-layout.is-bootstrap-tree-review .comica-tree-review-details {
    display: none;
}

.comica-tree-review-detail-panel {
    display: flex;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
}

.comica-tree-review-detail-panel h4 {
    flex: 0 0 auto;
    margin: 0 0 7px;
    color: #3c4043;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.comica-tree-review-detail-content {
    min-width: 0;
    min-height: 0;
    flex: 1 1 0;
    overflow: auto;
    padding: 10px 12px;
    box-sizing: border-box;
    border: 1px solid #dadce0;
    border-radius: 8px;
    background: #fafbff;
    scrollbar-gutter: stable;
}

.comica-tree-review-detail-content code {
    display: block;
    min-width: max-content;
    color: #202124;
    font: 11px/1.45 Consolas, "SFMono-Regular", monospace;
    white-space: pre;
}

.structure-program-review-layout.is-comica-tree-review .comica-tree-review-detail-content {
    padding: 0;
    overflow: auto;
    scrollbar-gutter: stable;
}

.comica-relation-table {
    display: flex;
    min-width: 650px;
    width: max-content;
    flex-direction: column;
    background: #ffffff;
}

.comica-relation-section-title {
    position: sticky;
    left: 0;
    display: flex;
    min-width: 650px;
    padding: 9px 12px;
    box-sizing: border-box;
    border-bottom: 1px solid #c9d0d8;
    background: #eef1f5;
    color: #3c4043;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.comica-relation-object-heading {
    position: sticky;
    left: 0;
    display: flex;
    min-width: 650px;
    align-items: center;
    gap: 8px;
    padding: 8px 12px 7px 20px;
    box-sizing: border-box;
    border-bottom: 1px solid #e1e5ea;
    background: #fafbfc;
    color: #3c4043;
    font-size: 12px;
}

.comica-relation-object-heading::before {
    color: #6f7780;
    content: "↳";
    font-size: 10px;
}

.comica-relation-object-heading span {
    display: inline-flex;
    min-width: 22px;
    height: 18px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #e5e9ef;
    color: #5f6368;
    font-size: 10px;
    font-weight: 700;
}

.comica-relation-row {
    display: grid;
    min-width: 650px;
    width: max-content;
    grid-template-columns: 118px max-content 58px 120px;
    gap: 10px;
    align-items: center;
    margin: 0;
    padding: 9px 10px;
    box-sizing: border-box;
    border: 0;
    border-bottom: 1px solid #e1e5ea;
    background: #ffffff;
    color: #202124;
    cursor: pointer;
    font: 12px/1.35 "Segoe UI", sans-serif;
    text-align: left;
    white-space: nowrap;
}

.comica-relation-row:hover {
    background: #f6f8fb;
}

.comica-relation-row:focus-visible {
    position: relative;
    z-index: 1;
    outline: 2px solid #1a73e8;
    outline-offset: -2px;
}

.comica-relation-row.is-selected {
    background: #e8f0fe;
    box-shadow: inset 4px 0 0 #1a73e8;
}

.comica-relation-row.is-released {
    position: relative;
    border-bottom-color: #dadce0;
    background: #f1f3f4;
    color: #80868b;
    box-shadow: none;
}

.comica-relation-row.is-released:hover,
.comica-relation-row.is-released.is-selected {
    background: #e8eaed;
    box-shadow: none;
}

.comica-relation-row.is-released::after {
    position: absolute;
    right: 10px;
    left: calc(10px + var(--relation-depth, 0) * 18px);
    top: 50%;
    height: 2px;
    background: #9aa0a6;
    content: "";
    pointer-events: none;
}

.comica-relation-row.is-released .structure-program-review-tree-badge,
.comica-relation-row.is-released .comica-relation-type,
.comica-relation-row.is-released .comica-relation-description,
.comica-relation-row.is-released .comica-relation-confidence,
.comica-relation-row.is-released .comica-relation-source {
    color: #80868b;
    filter: grayscale(1);
    opacity: 0.78;
}

.comica-relation-type {
    position: sticky;
    left: 8px;
    z-index: 1;
    display: inline-flex;
    width: max-content;
    max-width: 108px;
    align-items: center;
    padding: 3px 8px;
    overflow: hidden;
    border: 1px solid #b8c4d6;
    border-radius: 999px;
    background: #eef3f8;
    color: #40556f;
    font-size: 11px;
    font-weight: 750;
    text-overflow: ellipsis;
}

.comica-relation-row:hover .comica-relation-type {
    background: #eef3f8;
}

.comica-relation-row.is-selected .comica-relation-type {
    background: #ffffff;
}

.comica-relation-type.is-equal,
.comica-relation-type.is-concentric {
    border-color: #c7a8ec;
    background: #f3e8fd;
    color: #7627bb;
}

.comica-relation-type.is-coincident,
.comica-relation-type.is-midpoint {
    border-color: #9ad5ad;
    background: #e6f4ea;
    color: #137333;
}

.comica-relation-type.is-parallel,
.comica-relation-type.is-horizontal,
.comica-relation-type.is-vertical {
    border-color: #a8c7fa;
    background: #e8f0fe;
    color: #185abc;
}

.comica-relation-type.is-perpendicular,
.comica-relation-type.is-angle,
.comica-relation-type.is-tangent {
    border-color: #f6c68f;
    background: #fef7e0;
    color: #b06000;
}

.comica-relation-description {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.comica-relation-confidence {
    color: #188038;
    font-weight: 700;
    text-align: right;
}

.comica-relation-source {
    overflow: hidden;
    color: #6f7780;
    font-size: 11px;
    text-overflow: ellipsis;
    text-transform: capitalize;
}

/* Mirror the COMICA Tree visual grammar: scopes are tree nodes and relations are leaves. */
.comica-relation-scope-row {
    display: flex;
    min-width: 650px;
    align-items: center;
    gap: 6px;
    padding: 7px 10px 7px calc(10px + var(--relation-depth, 0) * 18px);
    box-sizing: border-box;
    border-bottom: 1px solid #e1e5ea;
    background: #ffffff;
    color: #202124;
    font: 14px/1.2 "Segoe UI", sans-serif;
}

.comica-relation-scope-label {
    min-width: max-content;
}

.structure-program-review-tree-badge.is-relation {
    background: #1a73e8;
    color: #ffffff;
}

.comica-relation-row {
    grid-template-columns: 138px max-content 58px 120px;
    padding: 7px 10px 7px calc(10px + var(--relation-depth, 0) * 18px);
}

.comica-relation-type-cell {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.comica-relation-type {
    position: static;
    display: inline;
    width: auto;
    max-width: none;
    padding: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    font-size: 12px;
    text-overflow: clip;
}

.comica-relation-row:hover .comica-relation-type,
.comica-relation-row.is-selected .comica-relation-type {
    background: transparent;
}

.comica-relation-type.is-equal,
.comica-relation-type.is-concentric,
.comica-relation-type.is-coincident,
.comica-relation-type.is-midpoint,
.comica-relation-type.is-parallel,
.comica-relation-type.is-horizontal,
.comica-relation-type.is-vertical,
.comica-relation-type.is-perpendicular,
.comica-relation-type.is-angle,
.comica-relation-type.is-tangent {
    background: transparent;
}

/* Compact constraint list: keep the subject, relation, and state visible
   without requiring horizontal scrolling. */
.structure-program-review-layout.is-comica-tree-review .comica-tree-review-detail-content {
    overflow-x: hidden;
    overflow-y: auto;
}

.comica-relation-table {
    min-width: 0;
    width: 100%;
}

.comica-relation-row {
    display: grid;
    min-width: 0;
    width: 100%;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 10px;
    padding: 8px 10px 8px calc(10px + var(--relation-depth, 0) * 18px);
    white-space: normal;
}

.comica-relation-row.is-released::after {
    display: none;
}

.comica-relation-summary {
    display: flex;
    min-width: 0;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.comica-relation-subject {
    min-width: 0;
    color: #202124;
    font-weight: 650;
    overflow-wrap: anywhere;
}

.comica-relation-separator {
    color: #9aa0a6;
    font-weight: 800;
}

.comica-relation-type-cell {
    flex: 0 0 auto;
}

.comica-relation-status {
    align-self: center;
    padding: 2px 7px;
    border-radius: 999px;
    background: #f1f3f4;
    color: #5f6368;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.comica-relation-status.is-solver-active {
    background: transparent;
    color: #c5221f;
}

.comica-relation-status.is-released {
    background: #e8eaed;
    color: #5f6368;
}

.comica-relation-row.is-new-relation .comica-relation-status {
    background: #e6f4ea;
    color: #137333;
}

.comica-relation-details {
    display: none;
    min-width: 0;
    grid-column: 1 / -1;
    flex-direction: column;
    gap: 4px;
    padding: 7px 0 2px 25px;
    border-top: 1px solid rgba(95, 99, 104, 0.18);
}

.comica-relation-row.is-selected .comica-relation-details {
    display: flex;
}

.comica-relation-description,
.comica-relation-metadata {
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: normal;
}

.comica-relation-description {
    color: #3c4043;
    font: 11px/1.45 ui-monospace, "Cascadia Code", Consolas, monospace;
}

.comica-relation-metadata {
    color: #6f7780;
    font-size: 10px;
    line-height: 1.45;
}

.comica-relation-scope-row {
    min-width: 0;
    width: 100%;
    padding: 7px 10px 7px calc(10px + var(--relation-depth, 0) * 18px);
}

.comica-relation-scope-label {
    min-width: 0;
    overflow-wrap: anywhere;
}

.comica-relation-table-empty {
    display: flex;
    min-height: 100%;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
    color: #80868b;
    font-size: 13px;
    text-align: center;
}

.comica-tree-review-detail-content.is-empty {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: center;
    color: #80868b;
    font-size: 11px;
    text-align: center;
}

.comica-bootstrap-validation {
    margin-bottom: 8px;
    color: #137333;
    font-size: 12px;
    font-weight: 700;
}

.comica-bootstrap-validation.is-error {
    color: #c5221f;
}

.comica-bootstrap-tree-json {
    width: 100%;
    min-height: 360px;
    padding: 10px;
    box-sizing: border-box;
    resize: vertical;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    color: #202124;
    font: 11px/1.45 Consolas, "SFMono-Regular", monospace;
    white-space: pre;
}

.comica-bootstrap-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 8px;
}

.comica-tree-review-inspector {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    min-height: 110px;
    max-height: 40%;
    flex: 0 1 40%;
    grid-template-columns: minmax(90px, max-content) minmax(0, 1fr);
    align-items: baseline;
    overflow: auto;
}

.comica-tree-review-parameter {
    color: #5f6368;
    font-size: 11px;
    font-weight: 700;
}

.comica-tree-review-patch {
    max-height: 180px;
    overflow: auto;
    white-space: pre;
}

.comica-tree-review-inspector code {
    min-width: 0;
    color: #202124;
    font: 11px/1.35 Consolas, "SFMono-Regular", monospace;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.comica-bootstrap-node-editor {
    display: grid;
    grid-template-columns: minmax(90px, max-content) minmax(0, 1fr);
    gap: 8px 10px;
    align-items: baseline;
}

.comica-bootstrap-parameter-input {
    width: 100%;
    min-width: 0;
    padding: 5px 7px;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    color: #202124;
    font: 11px/1.35 Consolas, "SFMono-Regular", monospace;
}

.comica-bootstrap-edit-error {
    grid-column: 1 / -1;
    margin: 2px 0 0;
    color: #c5221f;
    font-size: 11px;
}

.comica-bootstrap-selection-summary {
    grid-column: 1 / -1;
    margin: 0;
    color: #5f6368;
    font-size: 12px;
}

.comica-bootstrap-context-menu {
    position: fixed;
    z-index: 1000;
    display: grid;
    min-width: 190px;
    padding: 5px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.comica-bootstrap-context-menu button {
    padding: 7px 10px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #202124;
    cursor: pointer;
    text-align: left;
}

.comica-bootstrap-context-menu button:hover:not(:disabled) {
    background: #e8f0fe;
}

.structure-program-review-visuals {
    display: flex;
    gap: 14px;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
}

.structure-program-review-figure.structure-program-review-fit-only {
    display: none;
}

.structure-program-review-layout.is-fit-review {
    grid-template-areas: "fit-visuals fit-matrices fit-tree";
    grid-template-columns:
        minmax(320px, 1.45fr)
        minmax(260px, 0.85fr)
        minmax(260px, 1fr);
    height: auto;
    max-height: none;
}

.structure-program-review-layout.is-fit-review .structure-program-review-visuals {
    grid-area: fit-visuals;
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, auto);
    align-content: start;
}

.structure-program-review-layout.is-fit-review .structure-program-review-preview {
    width: 100%;
    height: auto;
    max-height: none;
}

.structure-program-review-layout.is-fit-review > .structure-program-review-panel {
    grid-area: fit-tree;
}

.structure-program-review-layout.is-fit-review .structure-program-review-fit-only {
    display: flex;
}

.structure-program-review-correspondence {
    display: none;
    min-width: 0;
    min-height: 0;
}

.structure-program-review-layout.is-fit-review .structure-program-review-correspondence {
    grid-area: fit-matrices;
    display: grid;
    width: 100%;
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 14px;
    overflow: hidden;
}

.structure-program-review-matrix-panel {
    display: flex;
    min-width: 0;
    min-height: 0;
    margin: 0;
    flex-direction: column;
}

.structure-program-review-matrix-panel figcaption {
    margin-bottom: 8px;
    color: #3c4043;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.structure-program-review-matrix {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 0;
    flex: 1 1 0;
    overflow: auto;
    contain: inline-size;
    border: 2px solid #202124;
    border-radius: 6px;
    background: #fff;
}

.structure-program-review-matrix-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    background: #fff;
    color: #202124;
    font: 11px/1.25 "Segoe UI", sans-serif;
}

.structure-program-review-matrix-table th,
.structure-program-review-matrix-table td {
    min-width: 64px;
    height: 40px;
    padding: 0;
    border: 1px solid #202124;
    background: #fff;
    text-align: center;
    vertical-align: middle;
}

.structure-program-review-matrix-table th {
    position: sticky;
    z-index: 2;
    padding: 4px 6px;
    background: #fff;
    font-weight: 700;
    white-space: nowrap;
}

.structure-program-review-matrix-table thead th {
    top: 0;
}

.structure-program-review-matrix-table thead th:first-child {
    left: 0;
    z-index: 3;
}

.structure-program-review-matrix-table tbody th {
    left: 0;
    z-index: 1;
}

.structure-program-review-matrix-heading {
    width: 100%;
    min-width: 0;
    height: 100%;
    padding: 4px 6px;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: inherit;
    cursor: pointer;
}

.structure-program-review-matrix-heading:hover,
.structure-program-review-matrix-heading.is-selected {
    outline: 3px solid #1a73e8;
    outline-offset: -3px;
    background: #e8f0fe;
    color: #174ea6;
}

.structure-program-review-matrix-cell {
    width: 100%;
    height: 100%;
    padding: 3px 5px;
    border: 0;
    background: #fff;
    color: #202124;
    font: inherit;
    cursor: pointer;
}

.structure-program-review-matrix-cell:hover,
.structure-program-review-matrix-cell.is-selected {
    outline: 3px solid #1a73e8;
    outline-offset: -3px;
}

.structure-program-review-matrix-cell.is-matched {
    background: #d2e3fc;
    font-weight: 700;
}

.structure-program-review-matrix-cost,
.structure-program-review-matrix-relation {
    display: block;
}

.structure-program-review-matrix-relation {
    margin-top: 1px;
    color: #174ea6;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.structure-program-review-matrix-empty {
    display: flex;
    height: 100%;
    min-height: 120px;
    align-items: center;
    justify-content: center;
    padding: 12px;
    color: #80868b;
    font-size: 11px;
    text-align: center;
}

.structure-program-review-layout.is-fit-review .structure-program-review-units-panel,
.structure-program-review-layout.is-fit-review .structure-program-review-inspector,
.structure-program-review-layout.is-fit-review .structure-program-review-editor-toolbar,
.structure-program-review-layout.is-fit-review .structure-program-review-program {
    display: none;
}

.structure-program-review-content:has(.is-fit-review) {
    width: min(1580px, calc(100vw - 48px));
    max-width: min(1580px, calc(100vw - 48px));
}

.structure-program-review-figure,
.structure-program-review-units-panel,
.structure-program-review-panel {
    display: flex;
    min-width: 0;
    min-height: 0;
    margin: 0;
    flex-direction: column;
}

.structure-program-review-units-panel,
.structure-program-review-panel {
    height: 100%;
    overflow: hidden;
}

.structure-program-review-figure figcaption,
.structure-program-review-units-panel h4,
.structure-program-review-panel h4 {
    margin: 0 0 7px;
    color: #3c4043;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.structure-program-review-units {
    display: flex;
    min-height: 0;
    flex: 1;
    flex-direction: column;
    gap: 10px;
    padding-right: 5px;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-gutter: stable;
}

.structure-program-review-unit-card {
    display: flex;
    width: 100%;
    flex: 0 0 auto;
    flex-direction: column;
    gap: 7px;
    padding: 8px;
    border: 1px solid #c7ccd1;
    border-radius: 8px;
    background: #ffffff;
    color: #202124;
    cursor: pointer;
    text-align: left;
}

.structure-program-review-unit-group {
    display: flex;
    flex: 0 0 auto;
    min-width: 0;
    flex-direction: column;
    gap: 7px;
}

.structure-program-review-unit-card:hover,
.structure-program-review-unit-card.is-selected,
.structure-program-review-primitive-card:hover,
.structure-program-review-primitive-card.is-selected {
    border-color: #1a73e8;
    box-shadow: 0 0 0 1px #1a73e8;
}

.structure-program-review-unit-group.contains-selection > .structure-program-review-unit-card:not(.is-selected) {
    border-color: #8ab4f8;
}

.structure-program-review-unit-title {
    overflow: hidden;
    font-size: 12px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.structure-program-review-unit-previews {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    width: 100%;
}

.structure-program-review-unit-preview-cell {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 4px;
}

.structure-program-review-unit-preview-label {
    color: #5f6368;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.structure-program-review-fit-curve {
    fill: none;
    stroke-width: 0.34px;
    vector-effect: non-scaling-stroke;
}

.structure-program-review-fit-curve.is-dim {
    opacity: 0.18;
}

.structure-program-review-fit-curve.is-hot {
    stroke-width: 0.72px;
}

.structure-program-review-fit-curve.is-base {
    opacity: 1;
    stroke-width: 2px;
}

.structure-program-review-fit-curve.is-highlight {
    opacity: 1;
    stroke-width: 5px;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter:
        drop-shadow(0 0 0.8px var(--curve-highlight-color))
        drop-shadow(0 0 1.8px var(--curve-highlight-color));
}

.structure-program-review-highlight-layer {
    pointer-events: none;
}

.structure-program-review-layout.is-fit-review .structure-program-review-fit-curve {
    stroke-width: 0.62;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: none;
}

.structure-program-review-layout.is-fit-review .structure-program-review-fit-curve.is-hot {
    stroke-width: 0.82;
}

.structure-program-review-fit-empty {
    fill: #80868b;
    font: 1.2px/1 Arial, sans-serif;
}

.structure-program-review-unit-preview {
    display: flex;
    width: 100%;
    aspect-ratio: 1 / 1;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-sizing: border-box;
    border: 2px solid #202124;
    border-radius: 6px;
    background: #ffffff;
    color: #80868b;
    font-size: 11px;
}

.structure-program-review-unit-svg,
.structure-program-review-drawing-source {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    flex-shrink: 1;
    border: 0;
    border-radius: 4px;
    background: #ffffff;
    pointer-events: none;
}

.structure-program-review-context-stroke,
.structure-program-review-primitive-stroke {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.structure-program-review-primitive-bbox {
    fill-opacity: 0.07;
    stroke-width: 0.14;
    stroke-dasharray: 0.42 0.28;
    vector-effect: non-scaling-stroke;
}

.structure-program-review-all-drawing-stroke {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.structure-program-review-detected-bbox {
    fill-opacity: 0.035;
    stroke-width: 1.25px;
    stroke-dasharray: 5px 3px;
    opacity: 0.72;
    vector-effect: non-scaling-stroke;
    pointer-events: none;
}

.structure-program-review-detected-bbox.is-editable {
    pointer-events: all;
    cursor: move;
}

.structure-program-review-detected-bbox.is-selected {
    fill-opacity: 0.1;
    stroke-width: 2.25px;
    stroke-dasharray: none;
    opacity: 1;
}

.structure-program-review-primitive-label {
    pointer-events: none;
}

.structure-program-review-primitive-label text {
    fill: #ffffff;
    font: 700 0.82px/1 Arial, sans-serif;
    text-anchor: middle;
}

.structure-program-review-primitives {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 5px;
    padding: 0 3px 2px 13px;
}

.structure-program-review-primitive-card {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
    width: 100%;
    min-width: 0;
    padding: 7px 8px;
    border: 1px solid #d4d8dd;
    border-radius: 6px;
    background: #ffffff;
    color: #3c4043;
    cursor: pointer;
    text-align: left;
}

.structure-program-review-primitive-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.structure-program-review-primitive-title {
    overflow: hidden;
    font-size: 11px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.structure-program-review-primitive-warning {
    display: inline-flex;
    width: 16px;
    height: 16px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #fef7e0;
    color: #8a5a00;
    font-size: 11px;
    font-weight: 800;
}

.structure-program-review-units-empty {
    margin: 0;
    padding: 12px;
    border: 1px dashed #c7ccd1;
    border-radius: 7px;
    color: #80868b;
    font-size: 12px;
    line-height: 1.5;
}

.structure-program-review-preview {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 0;
    width: var(--structure-review-preview-size, 285px);
    height: var(--structure-review-preview-size, 285px);
    max-width: 100%;
    max-height: 100%;
    aspect-ratio: 1 / 1;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-sizing: border-box;
    border: 3px solid #202124;
    border-radius: 8px;
    background: #ffffff;
    pointer-events: none;
}

.structure-program-review-layout:has(.structure-program-review-panel.is-editing) .structure-program-review-preview {
    pointer-events: auto;
}

.structure-program-review-preview > .cad-canvas,
.structure-program-review-preview > .aux-preview-wrap {
    width: 100%;
    height: 100%;
}

.structure-program-review-preview > .cad-canvas {
    display: block;
}

.structure-program-review-preview > .aux-preview-wrap {
    position: relative;
    min-height: 0;
}

.structure-program-review-content .cad-canvas,
.structure-program-review-content .aux-preview-img,
.structure-program-review-content .aux-preview-svg,
.structure-program-review-content .structure-program-review-drawing-source {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    flex-shrink: 1;
    border: 0;
    border-radius: 5px;
    box-shadow: none;
}

.structure-program-review-preview-empty {
    padding: 16px;
    color: #80868b;
    font-size: 12px;
    text-align: center;
}

.structure-program-review-stage-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #ffffff;
}

.structure-program-review-unit-note {
    position: absolute;
    right: 7px;
    bottom: 7px;
    padding: 3px 6px;
    border-radius: 4px;
    background: rgba(32, 33, 36, 0.78);
    overflow: auto;
    padding: 10px;
    border: 1px solid #dadce0;
    border-radius: 9px;
    background: #f8fafd;
    color: #202124;
    font-size: 11px;
    line-height: 1.35;
}

.comica-review-constraint-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 9px;
}

.comica-review-constraint-summary > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
    padding: 7px;
    border: 1px solid #dfe3e8;
    border-radius: 7px;
    background: #fff;
}

.comica-review-constraint-summary strong {
    color: #1a73e8;
    font-size: 15px;
}

.comica-review-constraint-summary span {
    overflow: hidden;
    color: #5f6368;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.comica-review-constraint-summary .is-solver strong {
    color: #188038;
}

.comica-review-constraint-help {
    margin: 0 0 9px;
    color: #5f6368;
}

.comica-review-relation-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin: 12px 0 7px;
    color: #202124;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.035em;
}

.comica-review-relation-heading small {
    color: #80868b;
    font-size: 9px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
}

.comica-review-relation-empty {
    margin: 0;
    padding: 12px;
    border: 1px dashed #dfe3e8;
    border-radius: 8px;
    color: #80868b;
    text-align: center;
}

.comica-review-candidate-groups {
    display: grid;
    gap: 7px;
}

.comica-review-candidate-group {
    border: 1px solid #dfe3e8;
    border-radius: 8px;
    background: #f8fafd;
    overflow: hidden;
}

.comica-review-candidate-group > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 10px;
    color: #3c4043;
    cursor: pointer;
    font-weight: 650;
    list-style-position: inside;
}

.comica-review-candidate-group > summary strong {
    min-width: 24px;
    padding: 2px 6px;
    border-radius: 999px;
    background: #e8eaed;
    color: #5f6368;
    font-size: 10px;
    text-align: center;
}

.comica-review-candidate-group .comica-review-constraint-list {
    padding: 0 7px 7px;
}

.comica-review-constraint-card {
    display: grid;
    grid-template-columns: 60px minmax(0, 1fr);
    gap: 8px;
    width: 100%;
    padding: 9px;
    border: 1px solid #dfe3e8;
    border-left: 3px solid #9aa0a6;
    border-radius: 8px;
    background: #fff;
    color: #202124;
    text-align: left;
    cursor: pointer;
}

.comica-review-constraint-card.is-add {
    border-left-color: #188038;
}

.comica-review-constraint-card.is-remove {
    border-left-color: #c5221f;
}

.comica-review-constraint-card.is-observed {
    border-style: dashed;
    border-left-color: #f9ab00;
    background: #fffdf7;
}

.comica-review-constraint-card:hover,
.comica-review-constraint-card:focus-visible {
    border-color: #8ab4f8;
    outline: none;
    box-shadow: 0 1px 4px rgba(60, 64, 67, 0.15);
}

.comica-review-constraint-card.is-selected {
    border-color: #1a73e8;
    background: #eef4ff;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.16);
}

.comica-review-constraint-overlay {
    pointer-events: none;
}

.comica-review-feature-marker {
    fill: rgba(255, 255, 255, 0.92);
    stroke: #d93025;
    stroke-width: 0.22;
}

.comica-review-feature-marker.is-2 {
    fill: rgba(255, 255, 255, 0.92);
    stroke: #d93025;
}

.comica-review-feature-dot {
    fill: #d93025;
    stroke: #ffffff;
    stroke-width: 0.1;
}

.comica-review-constraint-guide {
    stroke: #d93025;
    stroke-width: 0.12;
    stroke-dasharray: 0.35 0.3;
}

.comica-review-constraint-badge rect {
    fill: #202124;
    opacity: 0.9;
}

.comica-review-constraint-badge text {
    fill: #ffffff;
    font: 1.05px/1 "Segoe UI", sans-serif;
    font-weight: 700;
}

.comica-review-constraint-body,
.comica-review-constraint-title,
.comica-review-constraint-relation,
.comica-review-constraint-status {
    display: block;
    min-width: 0;
}

.comica-review-constraint-title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 5px;
}

.comica-review-constraint-title code {
    color: #80868b;
    font-size: 9px;
    overflow-wrap: anywhere;
}

.comica-review-constraint-title em {
    padding: 1px 5px;
    border-radius: 999px;
    background: #fef7e0;
    color: #b06000;
    font-size: 9px;
    font-style: normal;
}

.comica-review-constraint-relation {
    margin-top: 4px;
    color: #3c4043;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    overflow-wrap: anywhere;
}

.comica-review-constraint-status {
    margin-top: 5px;
    color: #188038;
    font-size: 10px;
    font-weight: 650;
}

.comica-review-candidate-reason {
    display: block;
    margin-top: 4px;
    color: #80868b;
    font-size: 9px;
}

.comica-review-constraint-status.is-observed {
    color: #b06000;
}

.structure-program-review-panel .structure-program-review-program,
.structure-program-review-panel.is-editing .structure-program-review-editor {
    height: 0;
    flex: 1 1 0;
    min-height: 0;
    max-height: none;
    overflow: hidden;
}

.structure-program-review-panel .structure-program-review-program {
    overflow-x: auto;
    overflow-y: auto;
    scrollbar-gutter: stable;
}

.structure-program-review-parse-tree {
    display: block;
    line-height: 1.25;
    font-variant-ligatures: none;
}

.structure-program-review-code-highlight {
    border-radius: 3px;
    background: #fdd663;
    color: #202124;
    box-shadow: 0 0 0 2px rgba(253, 214, 99, 0.35);
}

.structure-program-review-actions {
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-start;
}

.structure-program-review-navigation,
.structure-program-review-decisions {
    display: flex;
    gap: 8px;
}

.structure-program-review-rating {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    width: min(100%, 900px);
    padding: 10px 14px;
    border: 2px solid #2b2d31;
    border-radius: 10px;
    background: #fff;
}

.structure-program-review-rating.hidden {
    display: none;
}

.structure-program-review-rating .speaker-round-review-continue {
    flex: 0 0 auto;
    min-width: 138px;
    min-height: 40px;
    padding: 8px 16px;
    border: 2px solid #2b2d31;
    border-radius: 8px;
    background: #ffffff;
    color: #202124;
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
}

.structure-program-review-rating .speaker-round-review-continue:hover,
.structure-program-review-rating .speaker-round-review-continue:focus-visible {
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, .18);
    outline: none;
}

.structure-program-review-input-svg {
    background: #ffffff;
}

.structure-program-review-input-drawing {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.structure-program-review-decisions {
    margin-left: auto;
}

.structure-program-review-navigation.hidden {
    display: none;
}

.structure-program-review-navigation button:disabled {
    border-color: #dfe3e8;
    background: #f1f3f4;
    color: #9aa0a6;
    cursor: default;
}

.dialog-buttons .structure-program-review-reject {
    border-color: #f0b8b5;
    color: #b3261e;
}

.dialog-buttons .structure-program-review-accept {
    border-color: #1a73e8;
    background: #1a73e8;
    color: #ffffff;
}

.dialog-buttons .structure-program-review-accept:hover {
    background: #1557b0;
    color: #ffffff;
}

@media (max-width: 1100px) {
    .structure-program-review-content:has(.is-comica-tree-review) {
        overflow-y: auto;
    }

    .structure-program-review-layout.is-comica-tree-review {
        grid-template-columns:
            var(--structure-review-preview-size, 285px)
            minmax(360px, 1fr);
        height: auto;
        max-height: none;
    }

    .structure-program-review-layout.is-comica-tree-review .comica-tree-review-details {
        grid-column: 1 / -1;
        min-height: 260px;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr);
    }
}

@media (max-width: 960px) {

    .structure-program-review-content:has(.is-fit-review) {
        overflow-y: auto;
    }

    .structure-program-review-layout.is-fit-review {
        grid-template-areas:
            "fit-visuals"
            "fit-matrices"
            "fit-tree";
        grid-template-columns: minmax(0, 1fr);
    }

    .structure-program-review-layout.is-fit-review .structure-program-review-visuals,
    .structure-program-review-layout.is-fit-review .structure-program-review-correspondence {
        width: min(720px, 100%);
        justify-self: center;
    }

    .structure-program-review-layout.is-fit-review .structure-program-review-correspondence {
        min-height: 520px;
        overflow: visible;
    }

    .structure-program-review-layout.is-fit-review > .structure-program-review-panel {
        min-height: 420px;
    }
}

@media (max-width: 460px) {
    .structure-program-review-content {
        overflow-y: auto;
    }

    .structure-program-review-layout {
        grid-template-columns: minmax(0, 1fr);
        height: auto;
    }

    .structure-program-review-layout.is-comica-tree-review {
        grid-template-columns: minmax(0, 1fr);
    }

    .structure-program-review-layout.is-comica-tree-review .comica-tree-review-details {
        grid-column: auto;
        min-height: 300px;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: minmax(260px, 1fr);
    }

    .structure-program-review-visuals {
        width: min(300px, 100%);
        justify-self: center;
    }

    .structure-program-review-units-panel {
        min-height: 300px;
    }

    .structure-program-review-panel .structure-program-review-program {
        min-height: 260px;
        max-height: 42vh;
    }
}
