.rc17-container {
    --rc17-primary: #4F46E5;
    --rc17-primary-hover: #4338CA;
    --rc17-dark: #111827;
    --rc17-rack-bg: #1F2937;
    --rc17-surface: #F9FAFB;
    --rc17-border: #E5E7EB;
    --rc17-text: #1F2937;
    --rc17-muted: #6B7280;
    --rc17-danger: #EF4444;
    --rc17-warn: #F59E0B;
    --rc17-ok: #10B981;

    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--rc17-text);
    background: #F3F4F6;
    -webkit-font-smoothing: antialiased;
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: auto;
    border: 1px solid var(--rc17-border);
    border-radius: 14px;
    box-sizing: border-box;
    line-height: 1.4;
}

.rc17-container *,
.rc17-container *::before,
.rc17-container *::after {
    box-sizing: border-box;
}

/* Fullscreen mode when used inside standalone preview.html */
.rc17-standalone .rc17-container {
    min-height: 100vh;
    height: auto;
    border: none;
    border-radius: 0;
}

.rc17-container .rc17-app {
    display: flex;
    align-items: stretch;
    flex: 1 1 auto;
    width: 100%;
}

/* TOAST */
.rc17-container .rc17-toast {
    position: absolute;
    top: 16px;
    right: 20px;
    z-index: 3000;
    background: #111827;
    color: #fff;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.22);
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.rc17-container .rc17-toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* SIDEBAR */
.rc17-container .rc17-sidebar {
    width: 316px;
    flex: 0 0 316px;
    background: #fff;
    border-right: 1px solid var(--rc17-border);
    border-radius: 14px 0 0 14px;
    padding: 18px 18px 26px;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.03);
    position: relative;
    z-index: 5;
}

.rc17-standalone .rc17-container .rc17-sidebar {
    border-radius: 0;
}

.rc17-container .rc17-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--rc17-dark);
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--rc17-border);
}

.rc17-container .rc17-brand-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--rc17-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.18);
}

.rc17-container .rc17-ver {
    margin-left: auto;
    font-size: 10px;
    font-weight: 700;
    color: var(--rc17-primary);
    background: #EEF2FF;
    padding: 2px 7px;
    border-radius: 999px;
}

.rc17-container .rc17-label {
    font-size: 10px;
    font-weight: 800;
    color: #9CA3AF;
    text-transform: uppercase;
    margin: 0 0 10px 0;
    letter-spacing: 0.06em;
}

.rc17-container .rc17-group {
    background: var(--rc17-surface);
    border: 1px solid var(--rc17-border);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 20px;
}

.rc17-container .rc17-divider {
    margin: 12px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.rc17-container .rc17-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.rc17-container .input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 5px;
    min-width: 0;
}

.rc17-container .input-group label {
    font-size: 11px;
    font-weight: 600;
    color: #4B5563;
    margin: 0;
    white-space: nowrap;
}

.rc17-container .label-with-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
}

.rc17-container .rc17-inline-link {
    background: #EEF2FF;
    color: var(--rc17-primary);
    border: none;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1.3;
}

.rc17-container .rc17-inline-link:hover {
    background: #E0E7FF;
}

.rc17-container .input-group input,
.rc17-container .popover-body input {
    width: 100%;
    border: 1px solid var(--rc17-border);
    border-radius: 7px;
    padding: 7px 9px;
    font-size: 12px;
    color: var(--rc17-text);
    background: #fff;
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s;
}

.rc17-container .input-group input:focus,
.rc17-container .popover-body input:focus,
.rc17-container .rc17-select:focus {
    border-color: var(--rc17-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.rc17-container .popover-body input[type="color"] {
    height: 36px;
    padding: 3px;
    cursor: pointer;
}

.rc17-container input::-webkit-outer-spin-button,
.rc17-container input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

.rc17-container input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.rc17-container .rc17-select {
    padding: 8px 10px;
    border: 1px solid var(--rc17-border);
    border-radius: 8px;
    font-size: 12.5px;
    color: var(--rc17-text);
    width: 100%;
    background: #fff;
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s;
}

.rc17-container .rc17-select-sm {
    padding: 6.5px 8px;
    font-size: 12px;
}

.rc17-container .lib-vendor-tabs {
    display: flex;
    background: #EEF2F6;
    padding: 3px;
    border-radius: 9px;
    gap: 3px;
    margin-bottom: 10px;
}

.rc17-container .lib-vendor-tab {
    flex: 1;
    background: transparent;
    color: #4B5563;
    padding: 6px 6px;
    border-radius: 7px;
    font-size: 11.5px;
    font-weight: 700;
}

.rc17-container .lib-vendor-tab:hover {
    color: #111827;
}

.rc17-container .lib-vendor-tab.active {
    background: #fff;
    color: var(--rc17-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.rc17-container .lib-search-wrap {
    position: relative;
    margin-bottom: 10px;
}

.rc17-container .lib-search-input {
    width: 100%;
    border: 1px solid var(--rc17-border);
    border-radius: 8px;
    padding: 7.5px 28px 7.5px 10px;
    font-size: 12px;
    color: var(--rc17-text);
    background: #fff;
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s;
}

.rc17-container .lib-search-input:focus {
    border-color: var(--rc17-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.rc17-container .lib-search-clear {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    padding: 0;
    border-radius: 50%;
    background: #E5E7EB;
    color: #4B5563;
    font-size: 13px;
    line-height: 1;
}

.rc17-container .lib-search-clear:hover {
    background: #D1D5DB;
    color: #111827;
}

.rc17-container .lib-search-results {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 8px;
}

.rc17-container .lib-hit {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: #fff;
    border: 1px solid var(--rc17-border);
    border-radius: 8px;
    padding: 6px 8px;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s;
}

.rc17-container .lib-hit:hover,
.rc17-container .lib-hit.selected {
    border-color: var(--rc17-primary);
    background: #F5F7FF;
}

.rc17-container .lib-hit-info {
    flex: 1;
    min-width: 0;
}

.rc17-container .lib-hit-title {
    font-size: 11.5px;
    font-weight: 700;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rc17-container .lib-hit-meta {
    font-size: 10px;
    color: #6B7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rc17-container .lib-hit-add {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    padding: 0;
    border-radius: 6px;
    background: var(--rc17-primary);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
}

.rc17-container .lib-hit-add:hover {
    background: var(--rc17-primary-hover);
}

.rc17-container .lib-search-more {
    font-size: 10.5px;
    color: #6B7280;
    text-align: center;
    padding: 2px 0;
}

.rc17-container .lib-spec-preview {
    font-size: 11px;
    color: #3730A3;
    background: #EEF2FF;
    border: 1px solid #E0E7FF;
    border-radius: 7px;
    padding: 7px 10px;
    font-weight: 600;
    line-height: 1.4;
}

.rc17-container .lib-spec-note {
    display: block;
    font-size: 10px;
    font-weight: 500;
    color: #4F46E5;
    margin-top: 2px;
}

/* METRICS & AUDIT */
.rc17-container .rc17-metrics {
    background: var(--rc17-dark);
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 20px;
    color: #fff;
    box-shadow: 0 10px 18px -4px rgba(0, 0, 0, 0.16);
}

.rc17-container .metric-block {
    margin-bottom: 10px;
}

.rc17-container .metric-item {
    font-size: 12px;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.rc17-container .metric-item strong {
    color: #9CA3AF;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.04em;
}

.rc17-container .metric-item span {
    font-weight: 600;
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11.5px;
    text-align: right;
}

.rc17-container .metric-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    overflow: hidden;
}

.rc17-container .metric-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--rc17-ok);
    border-radius: 999px;
    transition: width 0.25s ease, background-color 0.25s ease;
}

.rc17-container .metric-bar-fill.warn {
    background: var(--rc17-warn);
}

.rc17-container .metric-bar-fill.danger {
    background: var(--rc17-danger);
}

.rc17-container .rc17-tips-list {
    margin: 12px 0 0 0;
    padding: 10px 0 0 0;
    list-style: none;
    font-size: 11px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    color: #F3F4F6;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.rc17-container .rc17-tips-list li {
    line-height: 1.4;
}

.rc17-container .rc17-tips-list .sub-tip {
    margin-left: 12px;
    opacity: 0.78;
    font-size: 10px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* SCOPED BUTTONS */
.rc17-container button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    transition: all 0.18s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.rc17-container .rc17-btn-primary {
    background: var(--rc17-primary);
    color: #fff;
    width: 100%;
    margin-top: 6px;
}

.rc17-container .rc17-btn-primary:hover {
    background: var(--rc17-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.22);
}

.rc17-container .rc17-utility-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.rc17-container .rc17-btn-ghost {
    flex: 1;
    background: #F9FAFB;
    color: #374151;
    border: 1px solid var(--rc17-border);
    padding: 8px 10px;
    font-size: 11.5px;
}

.rc17-container .rc17-btn-ghost:hover {
    background: #F3F4F6;
    border-color: #D1D5DB;
}

.rc17-container .rc17-actions {
    display: flex;
    gap: 10px;
}

.rc17-container .rc17-reset {
    background: #fff;
    color: var(--rc17-danger);
    border: 1px solid #FECACA;
    flex: 0 0 92px;
}

.rc17-container .rc17-reset:hover {
    background: #FEF2F2;
}

.rc17-container .rc17-btn-pdf {
    background: var(--rc17-dark);
    color: #fff;
    flex: 1;
}

.rc17-container .rc17-btn-pdf:hover {
    background: #000;
}

/* MAIN COLUMN & TOOLBAR */
.rc17-container .rc17-main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #F3F4F6;
    border-radius: 0 14px 14px 0;
}

.rc17-standalone .rc17-container .rc17-main {
    border-radius: 0;
}

.rc17-container .rc17-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 28px;
    background: #fff;
    border-bottom: 1px solid var(--rc17-border);
    border-radius: 0 14px 0 0;
    flex-wrap: wrap;
}

.rc17-standalone .rc17-container .rc17-toolbar {
    border-radius: 0;
}

.rc17-container .rc17-tabs {
    display: inline-flex;
    background: #F3F4F6;
    padding: 4px;
    border-radius: 10px;
    gap: 4px;
    flex-wrap: wrap;
}

.rc17-container .rc17-tab {
    background: transparent;
    color: #4B5563;
    padding: 7px 13px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
}

.rc17-container .rc17-tab:hover {
    color: #111827;
}

.rc17-container .rc17-tab.active {
    background: #fff;
    color: var(--rc17-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.rc17-container .tab-badge {
    background: rgba(79, 70, 229, 0.12);
    color: var(--rc17-primary);
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 999px;
    font-weight: 700;
}

.rc17-container .rc17-toolbar-meta {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--rc17-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* VIEWPORT & STAGE */
.rc17-container .rc17-viewport {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    padding: 32px 24px 52px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.rc17-container .rc17-stage {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
    min-width: 0;
}

.rc17-container .rc17-stage.view-dual {
    gap: 20px;
}

.rc17-container .rc17-stage.view-front #rack-col-rear,
.rc17-container .rc17-stage.view-rear #rack-col-front,
.rc17-container .rc17-stage.view-bom .rc17-rack-col {
    display: none;
}

.rc17-container .rc17-rack-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 464px;
    min-width: 0;
}

.rc17-container .rc17-stage.view-dual .rc17-rack-col {
    flex: 1 1 300px;
    max-width: 450px;
}

.rc17-container .rc17-frame-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    margin-bottom: 10px;
    padding: 0 4px;
}

.rc17-container .rc17-frame-title strong {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #1F2937;
    white-space: nowrap;
}

.rc17-container .rc17-frame-title span {
    font-size: 11px;
    color: #6B7280;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* RACK VISUALS */
.rc17-container .rc17-rack {
    border: 10px solid #374151;
    border-bottom: 6px solid #111827;
    border-radius: 12px;
    background: #111827;
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.38);
    position: relative;
    width: 100%;
}

.rc17-container .rc17-rack-rear {
    border-color: #1E293B;
    border-bottom-color: #0F172A;
}

.rc17-container .rc17-rack-body {
    position: relative;
    width: 100%;
}

.rc17-container .rc17-rack-base {
    height: 26px;
    background: #111827;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
}

.rc17-container .rc17-cog-base {
    font-size: 10px;
    font-weight: 700;
    color: #9CA3AF;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.rc17-container .rc17-cog-base.cog-active {
    color: #34D399;
}

.rc17-container .rc17-cog-base.cog-warn {
    color: #F87171;
}

/* CENTER OF GRAVITY BEZEL TICKS (outside canvas — never overlaps devices) */
.rc17-container .rc17-cog-marker {
    position: absolute;
    left: -10px;
    right: -10px;
    height: 0;
    z-index: 60;
    pointer-events: none;
    transition: bottom 0.25s ease;
}

.rc17-container .rc17-cog-marker::before,
.rc17-container .rc17-cog-marker::after {
    content: "";
    position: absolute;
    top: -2px;
    width: 10px;
    height: 4px;
    border-radius: 2px;
    background: #10B981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.85);
}

.rc17-container .rc17-cog-marker::before {
    left: 0;
}

.rc17-container .rc17-cog-marker::after {
    right: 0;
}

.rc17-container .rc17-cog-marker.cog-warn::before,
.rc17-container .rc17-cog-marker.cog-warn::after {
    background: #EF4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.9);
}

.rc17-container .rc17-canvas {
    position: relative;
    width: 100%;
    background: #fff;
    margin: 0 auto;
    border-left: 2px solid #1F2937;
    border-right: 2px solid #1F2937;
    user-select: none;
}

.rc17-container .u-slot {
    height: 30px;
    border-bottom: 1px solid #F1F5F9;
    position: relative;
    width: 100%;
    background: #fff;
}

.rc17-container .u-slot:nth-child(even) {
    background: #FCFDFF;
}

.rc17-container .u-tag {
    position: absolute;
    left: 7px;
    color: #9CA3AF;
    font-size: 9px;
    line-height: 30px;
    pointer-events: none;
    font-weight: 700;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.rc17-container .u-tag-right {
    left: auto;
    right: 7px;
}

/* OPPOSITE-FRAME GHOST OCCUPANCY */
.rc17-container .u-ghost {
    position: absolute;
    left: 26px;
    right: 26px;
    border: 1px dashed #CBD5E1;
    background: repeating-linear-gradient(
        -45deg,
        rgba(241, 245, 249, 0.78),
        rgba(241, 245, 249, 0.78) 6px,
        rgba(226, 232, 240, 0.58) 6px,
        rgba(226, 232, 240, 0.58) 12px
    );
    border-radius: 5px;
    padding: 0 9px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 10px;
    color: #64748B;
    font-weight: 600;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

.rc17-container .u-ghost-name {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rc17-container .u-ghost-depth {
    flex: 0 0 auto;
    white-space: nowrap;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 9.5px;
    color: #475569;
}

/* MOUNTED DEVICE */
.rc17-container .device {
    position: absolute;
    left: 24px;
    right: 24px;
    border-radius: 6px;
    cursor: grab;
    border: 1px solid rgba(0, 0, 0, 0.32);
    box-shadow: 0 3px 6px -1px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.28);
    padding: 0 10px;
    display: flex;
    align-items: center;
    overflow: hidden;
    z-index: 10;
    background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(0, 0, 0, 0.14) 100%);
    touch-action: none;
}

.rc17-container .device.is-dragging {
    cursor: grabbing;
    opacity: 0.92;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.35);
}

.rc17-container .device.drag-invalid {
    outline: 2px solid #EF4444;
    filter: saturate(0.7);
}

.rc17-container .device.device-conflict {
    box-shadow: 0 0 0 2px #EF4444, 0 4px 10px rgba(239, 68, 68, 0.35);
}

.rc17-container .d-head {
    display: flex;
    align-items: center;
    width: 100%;
    justify-content: space-between;
    gap: 8px;
}

.rc17-container .d-name-label {
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.rc17-container .d-info-tag {
    font-size: 9.5px;
    background: rgba(0, 0, 0, 0.38);
    padding: 2px 6px;
    border-radius: 4px;
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.rc17-container .d-ctrls {
    display: flex;
    gap: 3px;
}

.rc17-container .d-ctrls button {
    width: 22px;
    height: 22px;
    padding: 0;
    border-radius: 5px;
    font-size: 11px;
    background: rgba(255, 255, 255, 0.92);
    color: #1F2937;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14);
}

.rc17-container .d-ctrls .d-flip:hover { background: #E0F2FE; color: #0284C7; }
.rc17-container .d-ctrls .d-copy:hover { background: #ECFDF5; color: #059669; }
.rc17-container .d-ctrls .d-gear:hover { background: #EEF2FF; color: var(--rc17-primary); }
.rc17-container .d-ctrls .d-del:hover  { background: #FEF2F2; color: var(--rc17-danger); }

/* BOM SPECIFICATION PANEL */
.rc17-container .rc17-bom-panel {
    width: 100%;
    max-width: 980px;
    background: #fff;
    border: 1px solid var(--rc17-border);
    border-radius: 14px;
    padding: 24px 28px;
    box-shadow: 0 12px 28px -8px rgba(0, 0, 0, 0.08);
}

.rc17-container .rc17-bom-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.rc17-container .rc17-bom-header h3 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 800;
    color: var(--rc17-dark);
}

.rc17-container .rc17-bom-header p {
    margin: 0;
    font-size: 12px;
    color: var(--rc17-muted);
}

.rc17-container .rc17-bom-actions {
    display: flex;
    gap: 10px;
}

.rc17-container .rc17-bom-table-wrap {
    overflow-x: auto;
}

.rc17-container .rc17-bom-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.rc17-container .rc17-bom-table th {
    text-align: left;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6B7280;
    background: #F9FAFB;
    padding: 10px 12px;
    border-bottom: 1px solid var(--rc17-border);
}

.rc17-container .rc17-bom-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #F3F4F6;
    color: #1F2937;
}

.rc17-container .rc17-bom-table tfoot td {
    font-weight: 800;
    background: #F9FAFB;
    border-top: 2px solid var(--rc17-border);
}

.rc17-container .bom-frame-pill {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.rc17-container .bom-frame-front {
    background: #EEF2FF;
    color: #4338CA;
}

.rc17-container .bom-frame-rear {
    background: #FEF3C7;
    color: #B45309;
}

.rc17-container .bom-swatch {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 3px;
    margin-right: 7px;
    vertical-align: middle;
}

/* POPOVER */
.rc17-container .rc17-popover {
    position: absolute;
    width: 344px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 30px -6px rgba(0, 0, 0, 0.16), 0 8px 12px -4px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--rc17-border);
    z-index: 1000;
}

.rc17-container .popover-header {
    padding: 13px 18px;
    border-bottom: 1px solid var(--rc17-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 800;
    font-size: 11px;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.rc17-container .popover-close {
    background: #F3F4F6;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    padding: 0;
    font-size: 16px;
    color: #6B7280;
}

.rc17-container .popover-close:hover {
    background: #E5E7EB;
    color: #111827;
}

.rc17-container .popover-body {
    padding: 18px;
}

.rc17-container .pop-swatches {
    display: flex;
    gap: 6px;
    align-items: center;
    height: 36px;
}

.rc17-container .pop-swatch {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    padding: 0;
    border: 2px solid rgba(0, 0, 0, 0.12);
}

.rc17-container .pop-swatch:hover {
    transform: scale(1.1);
}

.rc17-container .pop-del-btn {
    width: 100%;
    background: #FEF2F2;
    color: var(--rc17-danger);
    margin-top: 14px;
    padding: 10px;
    border: 1px solid #FECACA;
}

.rc17-container .pop-del-btn:hover {
    background: var(--rc17-danger);
    color: #fff;
}

.rc17-container .popover-arrow {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #fff;
    transform: rotate(45deg);
    border-left: 1px solid var(--rc17-border);
    border-bottom: 1px solid var(--rc17-border);
    left: -7px;
    top: 24px;
}

.rc17-container .pop-left .popover-arrow {
    left: auto;
    right: -7px;
    border-left: none;
    border-bottom: none;
    border-right: 1px solid var(--rc17-border);
    border-top: 1px solid var(--rc17-border);
}

/* CUSTOM MODAL */
.rc17-container .rc17-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.55);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2500;
}

.rc17-container .rc17-modal {
    background: #fff;
    width: 340px;
    max-width: 92vw;
    padding: 28px;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.28);
    text-align: center;
}

.rc17-container .rc17-modal-msg {
    font-size: 14.5px;
    font-weight: 600;
    color: #1F2937;
    margin-bottom: 22px;
    line-height: 1.5;
}

.rc17-container .rc17-modal-btns {
    display: flex;
    gap: 10px;
}

.rc17-container .rc17-modal-btns button {
    flex: 1;
}

.rc17-container .modal-confirm {
    background: var(--rc17-primary);
    color: #fff;
}

.rc17-container .modal-cancel {
    background: #F3F4F6;
    color: #4B5563;
}

/* RESPONSIVE */
@media (max-width: 1280px) {
    .rc17-container .rc17-stage.view-dual {
        flex-wrap: wrap;
    }
}

@media (max-width: 900px) {
    .rc17-container {
        height: auto;
        min-height: 0;
    }
    .rc17-container .rc17-app {
        flex-direction: column;
        overflow: visible;
    }
    .rc17-container .rc17-sidebar {
        width: 100%;
        flex: none;
        border-right: none;
        border-bottom: 1px solid var(--rc17-border);
        border-radius: 14px 14px 0 0;
    }
    .rc17-container .rc17-main {
        border-radius: 0 0 14px 14px;
    }
    .rc17-container .rc17-toolbar {
        border-radius: 0;
    }
    .rc17-container .rc17-viewport {
        padding: 24px 12px 40px;
    }
}

/* PRINT FALLBACK */
@media print {
    .rc17-container {
        height: auto !important;
        border: none !important;
        overflow: visible !important;
    }
    .rc17-container .rc17-app,
    .rc17-container .rc17-viewport {
        height: auto !important;
        overflow: visible !important;
    }
    .rc17-container .no-pdf {
        display: none !important;
    }
}


.rc17-container,
.rc17-container .rc17-app,
.rc17-container .rc17-sidebar,
.rc17-container .rc17-main,
.rc17-container .rc17-viewport {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}
