.isp-deck-builder-modal {
    box-sizing: border-box;
    min-width: 0;
    overflow-x: hidden;
}

.isp-deck-builder-modal .isp-deck-builder {
    --deck-red: #ff4b42;
    --deck-red-soft: rgba(255, 75, 66, 0.14);
    --deck-blue: #79c6ff;
    --deck-ink: #0d0f12;
    --deck-panel: rgba(255, 255, 255, 0.045);
    --deck-line: rgba(255, 255, 255, 0.12);
    color: #f8f8f5;
    display: grid;
    font-family: sans_serif_normal, Arial, sans-serif;
    gap: 18px;
    grid-template-columns: minmax(0, 1.05fr) minmax(430px, 0.95fr);
    margin-top: 20px;
    position: relative;
}

.isp-deck-builder-controls,
.isp-deck-preview-column {
    min-width: 0;
}

.isp-deck-section,
.isp-deck-preview-card {
    background:
        radial-gradient(circle at 100% 0, rgba(255, 75, 66, 0.075), transparent 34%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.062), rgba(255, 255, 255, 0.025));
    border: 1px solid var(--deck-line);
    border-radius: 13px;
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.18);
    box-sizing: border-box;
    margin-bottom: 14px;
    padding: 17px;
}

.isp-deck-preset-section {
    background:
        linear-gradient(120deg, rgba(255, 75, 66, 0.12), transparent 48%),
        rgba(255, 255, 255, 0.04);
}

.isp-deck-section-header {
    margin-bottom: 13px;
}

.isp-deck-eyebrow {
    color: var(--deck-red);
    font-family: sans_serif_bold, Arial, sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.15em;
    line-height: 1.2;
    margin-bottom: 4px;
}

.isp-deck-section-title {
    color: #fff;
    font-family: sans_serif_bold, Arial, sans-serif;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
}

.isp-deck-section-note {
    color: rgba(255, 255, 255, 0.58);
    font-size: 12px;
    line-height: 1.35;
    margin-top: 5px;
}

.isp-deck-preset-row {
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto auto;
}

.isp-deck-select,
.isp-deck-proof-grid input,
.isp-deck-proof-grid textarea {
    background: rgba(5, 6, 8, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    box-sizing: border-box;
    color: #f7f7f4;
    font: 13px sans_serif_normal, Arial, sans-serif;
    min-height: 36px;
    outline: none;
    padding: 8px 10px;
    transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
    width: 100%;
}

.isp-deck-select:focus,
.isp-deck-proof-grid input:focus,
.isp-deck-proof-grid textarea:focus {
    background: rgba(5, 6, 8, 0.86);
    border-color: rgba(121, 198, 255, 0.78);
    box-shadow: 0 0 0 3px rgba(121, 198, 255, 0.1);
}

.isp-deck-select.compact {
    min-height: 34px;
    width: auto;
}

.isp-deck-mini-button,
.isp-deck-segmented button,
.isp-deck-preview-nav {
    appearance: none;
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.84);
    cursor: pointer;
    font: 12px sans_serif_bold, Arial, sans-serif;
    min-height: 34px;
    padding: 7px 12px;
    transition: transform 130ms ease, background 130ms ease, border-color 130ms ease, color 130ms ease;
}

.isp-deck-mini-button:hover,
.isp-deck-segmented button:hover,
.isp-deck-preview-nav:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.26);
    color: #fff;
    transform: translateY(-1px);
}

.isp-deck-mini-button.danger:not(:disabled) {
    color: #ff8d85;
}

.isp-deck-mini-button:disabled,
.isp-deck-preview-nav:disabled,
.isp-deck-select:disabled {
    cursor: default;
    opacity: 0.35;
}

.isp-deck-asset-catalog {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.isp-deck-asset-card {
    appearance: none;
    background: rgba(0, 0, 0, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    display: grid;
    gap: 4px 8px;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 62px;
    padding: 10px 11px;
    position: relative;
    text-align: left;
    transition: border-color 150ms ease, background 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.isp-deck-asset-card::before {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 50%;
    content: "";
    height: 7px;
    position: absolute;
    right: 10px;
    top: 10px;
    width: 7px;
}

.isp-deck-asset-card:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-1px);
}

.isp-deck-asset-card.selected {
    background: linear-gradient(135deg, rgba(255, 75, 66, 0.16), rgba(255, 255, 255, 0.045));
    border-color: rgba(255, 75, 66, 0.76);
    box-shadow: inset 0 0 0 1px rgba(255, 75, 66, 0.13), 0 8px 20px rgba(0, 0, 0, 0.12);
}

.isp-deck-asset-card.selected::before {
    background: var(--deck-red);
    border-color: var(--deck-red);
    box-shadow: 0 0 0 3px rgba(255, 75, 66, 0.13);
}

.isp-deck-asset-title {
    font-family: sans_serif_bold, Arial, sans-serif;
    font-size: 13px;
    line-height: 1.2;
    overflow: hidden;
    padding-right: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.isp-deck-asset-coverage {
    color: rgba(255, 255, 255, 0.51);
    font-size: 11px;
    grid-column: 2;
    grid-row: 2;
    text-align: right;
}

.isp-deck-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    grid-column: 1;
    grid-row: 2;
}

.isp-deck-badge,
.isp-deck-motion-pill,
.isp-deck-preview-layout-pill {
    border: 1px solid currentColor;
    border-radius: 999px;
    color: var(--deck-blue);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1;
    padding: 3px 5px;
    text-transform: uppercase;
}

.isp-deck-badge.observed {
    color: #c7b4ff;
}

.isp-deck-selected-order {
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.09);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
    padding-top: 11px;
}

.isp-deck-order-label {
    color: rgba(255, 255, 255, 0.5);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-right: 2px;
    text-transform: uppercase;
}

.isp-deck-order-chip {
    align-items: center;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    display: flex;
    font-size: 10px;
    gap: 4px;
    padding: 4px 5px 4px 9px;
}

.isp-deck-order-chip button {
    background: transparent;
    border: 0;
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    font-size: 17px;
    line-height: 15px;
    padding: 0 2px;
}

.isp-deck-order-chip button:disabled {
    cursor: default;
    opacity: 0.2;
}

.isp-deck-segmented {
    display: grid;
    gap: 5px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-bottom: 8px;
}

.isp-deck-segmented.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.isp-deck-segmented button {
    padding-left: 5px;
    padding-right: 5px;
}

.isp-deck-segmented button.active {
    background: #f6f5ef;
    border-color: #f6f5ef;
    color: #151619;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.18);
}

.isp-deck-layout-options {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 11px;
}

.isp-deck-check {
    align-items: center;
    color: rgba(255, 255, 255, 0.72);
    cursor: pointer;
    display: inline-flex;
    font-size: 11px;
    gap: 6px;
}

.isp-deck-check input {
    accent-color: var(--deck-red);
}

.isp-deck-proof-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) auto;
}

.isp-deck-proof-grid textarea {
    grid-column: 1 / -1;
    min-height: 66px;
    resize: vertical;
}

.isp-deck-preview-column {
    align-self: start;
    position: sticky;
    top: 4px;
}

.isp-deck-preview-card {
    background:
        radial-gradient(circle at 10% -10%, rgba(121, 198, 255, 0.11), transparent 36%),
        linear-gradient(155deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.022));
    margin: 0;
    padding: 18px;
}

.isp-deck-preview-top {
    align-items: end;
    display: grid;
    gap: 15px;
    grid-template-columns: auto minmax(180px, 1fr);
    margin-bottom: 7px;
}

.isp-deck-preview-meta {
    color: rgba(255, 255, 255, 0.52);
    font-size: 11px;
    margin: 5px 0 9px;
    min-height: 15px;
}

.isp-deck-preview-canvas {
    aspect-ratio: 16 / 9;
    background:
        linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
        #020304;
    background-size: 22px 22px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.38);
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
    width: 100%;
}

.isp-deck-preview-page-header {
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-sizing: border-box;
    color: rgba(255, 255, 255, 0.75);
    display: flex;
    font-size: 7px;
    height: 8.3%;
    justify-content: space-between;
    left: 1.8%;
    padding: 0 1%;
    position: absolute;
    top: 0;
    width: 96.4%;
}

.isp-deck-preview-slot {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 3px;
    box-sizing: border-box;
    overflow: hidden;
    padding: 0.5%;
    position: absolute;
    transition: left 180ms ease, top 180ms ease, width 180ms ease, height 180ms ease;
}

.isp-deck-preview-image-box {
    align-items: center;
    display: flex;
    height: calc(100% - 15px);
    justify-content: center;
    min-height: 0;
    overflow: hidden;
    position: relative;
    width: 100%;
}

.isp-deck-preview-image-box img {
    height: 100%;
    object-fit: contain;
    width: 100%;
}

.isp-deck-preview-slot-label {
    align-items: center;
    background: rgba(0, 0, 0, 0.72);
    bottom: 0;
    color: rgba(255, 255, 255, 0.74);
    display: flex;
    font-size: 7px;
    height: 15px;
    left: 0;
    overflow: hidden;
    padding: 0 5px;
    position: absolute;
    right: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.isp-deck-preview-placeholder {
    align-items: center;
    color: rgba(255, 255, 255, 0.36);
    display: flex;
    flex-direction: column;
    font-size: 7px;
    gap: 4px;
    justify-content: center;
    letter-spacing: 0.12em;
    text-align: center;
}

.isp-deck-preview-placeholder strong {
    color: rgba(255, 255, 255, 0.7);
    font-size: 9px;
    letter-spacing: 0;
}

.isp-deck-motion-pill {
    background: rgba(0, 0, 0, 0.68);
    bottom: 5px;
    left: 5px;
    position: absolute;
}

.isp-deck-preview-layout-pill {
    background: rgba(0, 0, 0, 0.78);
    bottom: 7px;
    color: rgba(255, 255, 255, 0.54);
    position: absolute;
    right: 7px;
}

.isp-deck-preview-loading,
.isp-deck-preview-empty {
    align-items: center;
    background: rgba(2, 3, 4, 0.88);
    color: rgba(255, 255, 255, 0.54);
    display: flex;
    font-size: 12px;
    inset: 0;
    justify-content: center;
    position: absolute;
    z-index: 20;
}

.isp-deck-preview-loading::before {
    animation: isp-deck-orbit 900ms linear infinite;
    border: 2px solid rgba(255, 255, 255, 0.13);
    border-radius: 50%;
    border-top-color: var(--deck-red);
    content: "";
    height: 16px;
    margin-right: 8px;
    width: 16px;
}

@keyframes isp-deck-orbit {
    to { transform: rotate(360deg); }
}

.isp-deck-preview-footer {
    align-items: center;
    color: rgba(255, 255, 255, 0.68);
    display: flex;
    font-size: 11px;
    gap: 8px;
    margin-top: 10px;
}

.isp-deck-preview-nav {
    min-height: 28px;
    padding: 3px 9px;
}

.isp-deck-preview-estimate {
    color: var(--deck-blue);
    margin-left: auto;
}

.isp-deck-preview-warnings {
    color: #ffc483;
    font-size: 10px;
    line-height: 1.4;
    margin-top: 8px;
}

.isp-deck-preview-warnings div {
    background: rgba(255, 177, 92, 0.075);
    border-left: 2px solid rgba(255, 177, 92, 0.64);
    margin-top: 5px;
    padding: 5px 7px;
}

.isp-deck-builder .isp-deck-flash {
    background: #2b1413;
    border: 1px solid rgba(255, 75, 66, 0.7);
    border-radius: 999px;
    bottom: 14px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    color: #ffd8d5;
    display: none;
    font-size: 11px;
    left: 50%;
    padding: 8px 13px;
    position: fixed;
    transform: translateX(-50%);
    z-index: 100;
}

.isp-deck-builder .isp-deck-flash.good {
    background: #10241c;
    border-color: #50c98d;
    color: #c8f9df;
}

.isp-deck-builder-modal .isp-deck-submit {
    background: linear-gradient(90deg, #ff453d, #ff665d) !important;
    box-shadow: 0 12px 30px rgba(255, 75, 66, 0.2);
    font-family: sans_serif_bold, Arial, sans-serif;
    letter-spacing: 0.02em;
    margin-top: 2px !important;
}

@media (max-width: 1100px) {
    .isp-deck-builder-modal .isp-deck-builder {
        grid-template-columns: 1fr;
    }

    .isp-deck-preview-column {
        position: static;
    }
}

@media (prefers-reduced-motion: reduce) {
    .isp-deck-builder * {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
}
