.print3d {
    --p3d-border: #e1e4e8;
    --p3d-bg: #fafbfc;
    --p3d-accent: #4a90d9;
}

.print3d__card {
    border: 1px solid var(--p3d-border);
    border-radius: 10px;
    padding: 18px;
    background: var(--p3d-bg);
}

/* Intro text */
.print3d__intro {
    font-size: 0.92em;
    color: #3a3f44;
    line-height: 1.5;
    margin: 0 0 14px;
}
.print3d__intro p { margin: 0 0 8px; }
.print3d__intro p:last-child { margin-bottom: 0; }

/* Material info button + dialog */
.print3d__info-btn {
    background: none;
    border: none;
    color: var(--p3d-accent);
    cursor: pointer;
    font-size: 0.8em;
    padding: 0 0 0 8px;
    text-decoration: underline;
}
.print3d__dialog {
    border: none;
    border-radius: 10px;
    padding: 0;
    max-width: 460px;
    width: 92%;
    box-shadow: 0 12px 44px rgba(0, 0, 0, 0.22);
}
.print3d__dialog::backdrop {
    background: rgba(0, 0, 0, 0.45);
}
.print3d__dialog-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 13px 16px;
    border-bottom: 1px solid var(--p3d-border);
}
.print3d__dialog-close {
    background: none;
    border: none;
    font-size: 1.5em;
    line-height: 1;
    cursor: pointer;
    color: #666;
    padding: 0 4px;
}
.print3d__dialog-body {
    padding: 16px;
    font-size: 0.9em;
    color: #333;
    line-height: 1.5;
}
.print3d__dialog-body p { margin: 0 0 10px; }
.print3d__dialog-body p:last-child { margin-bottom: 0; }

.print3d__hint {
    display: block;
    margin-top: 4px;
    color: #6a737d;
    font-size: 0.85em;
}

/* Loading */
.print3d__loading {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0;
    color: #444;
    font-size: 0.9em;
}
.print3d__spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #cbd2d9;
    border-top-color: var(--p3d-accent);
    border-radius: 50%;
    display: inline-block;
    animation: print3d-spin 0.8s linear infinite;
}
@keyframes print3d-spin {
    to { transform: rotate(360deg); }
}

/* Error */
.print3d__error {
    margin: 10px 0;
    padding: 10px 12px;
    border-radius: 6px;
    background: #fdecea;
    border: 1px solid #f5c6cb;
    color: #842029;
    font-size: 0.9em;
}

/* Result stage */
.print3d__stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
    margin-top: 14px;
    align-items: start;
}
@media (max-width: 600px) {
    .print3d__stage { grid-template-columns: 1fr; }
}

.print3d__viewer {
    position: relative;
    width: 100%;
    height: 280px;
    border: 1px solid var(--p3d-border);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    touch-action: none;
}
.print3d__viewer canvas { display: block; }
.print3d__viewer-label {
    position: absolute;
    left: 8px;
    bottom: 8px;
    padding: 3px 8px;
    background: rgba(33, 37, 41, 0.85);
    color: #fff;
    font-size: 0.82em;
    border-radius: 4px;
    pointer-events: none;
    max-width: calc(100% - 16px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.print3d__details {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.print3d__row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
}
.print3d__select {
    max-width: 220px;
    padding: 6px 8px;
}

/* Object table */
.print3d__objects {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
    margin: 0;
}
.print3d__objects th,
.print3d__objects td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--p3d-border);
    text-align: left;
    vertical-align: middle;
}
.print3d__objects thead th {
    font-weight: 600;
    color: #6a737d;
    font-size: 0.85em;
    border-bottom: 2px solid var(--p3d-border);
}
.print3d__objects td.print3d-line-price {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.print3d__objects tbody tr {
    transition: background 0.12s ease;
}
.print3d__objects tbody tr.print3d__row--active {
    background: #eef5fc;
}
.print3d-obj-cell {
    cursor: default;
}
.print3d-swatch {
    width: 11px;
    height: 11px;
    border-radius: 3px;
    margin-right: 6px;
    vertical-align: middle;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
}
.print3d-qty {
    width: 64px;
    padding: 4px 6px;
}
.print3d-note {
    display: block;
    width: 100%;
    margin-top: 5px;
    padding: 4px 7px;
    font-size: 0.92em;
    border: 1px solid var(--p3d-border);
    border-radius: 5px;
    box-sizing: border-box;
}
.print3d-note:focus {
    outline: none;
    border-color: var(--p3d-accent);
}
.print3d-note:disabled {
    background: #f1f2f4;
}
.print3d__note-hint {
    display: block;
    color: #6a737d;
    font-size: 0.82em;
    line-height: 1.45;
    margin-top: 2px;
}
.print3d__row--disabled {
    opacity: 0.5;
}
.print3d__toobig {
    color: #b02a37;
    font-size: 0.85em;
}

.print3d__total-line {
    margin: 4px 0 0;
    font-size: 1.15em;
}
.print3d__total-line strong {
    color: var(--p3d-accent);
}
.print3d__fee-note {
    display: block;
    color: #6a737d;
    font-size: 0.72em;
    margin-top: 2px;
}
.print3d__add {
    margin-top: 4px;
    align-self: flex-start;
}
.print3d__add:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.print3d__disclaimer {
    color: #6a737d;
    font-size: 0.8em;
}
