/* ============================================================
   RSB.ir — Interactive 3D Service Factory (rsb-factory-3d)
   Overlay styles for the vanilla three.js machine.
   Scoped to .rsb-factory-3d — nothing leaks to the page.
   Mirrors the 21st.dev "agentic-factory-3d" overlay, RTL-aware.
   ============================================================ */

.rsb-f3d-wrap {
    margin-top: 22px;
}

.rsb-factory-3d {
    --amber: #ff7a1a;
    --white: #f4f1ea;
    --muted: #81848b;
    --line: rgba(244, 241, 234, 0.11);
    color-scheme: dark;
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #05070a;
    border-radius: 20px;
    border: 1px solid rgba(13, 126, 162, 0.22);
    box-shadow: 0 24px 70px rgba(2, 14, 24, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    color: var(--white);
    font-size: 13px;
    -webkit-font-smoothing: antialiased;
    contain: layout;
}

.rsb-factory-3d,
.rsb-factory-3d * {
    box-sizing: border-box;
}

.rsb-factory-3d button,
.rsb-factory-3d a {
    -webkit-tap-highlight-color: transparent;
}

.rsb-factory-3d button {
    font: inherit;
    color: inherit;
    cursor: pointer;
}

.rsb-factory-3d button:focus-visible,
.rsb-factory-3d a:focus-visible {
    outline: 2px solid var(--amber);
    outline-offset: 5px;
}

.rsb-factory-3d .f3d-scene {
    position: absolute;
    inset: 0;
    /* pan-y keeps vertical swipes scrolling the page; horizontal drags still
       rotate via OrbitControls and two-finger pinch is handled in JS. */
    touch-action: pan-y;
    outline: none;
    cursor: grab;
}

.rsb-factory-3d .f3d-scene canvas {
    touch-action: pan-y;
}

.rsb-factory-3d .f3d-scene:active {
    cursor: grabbing;
}

.rsb-factory-3d .f3d-scene canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.rsb-factory-3d .f3d-vignette {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(
        ellipse at 50% 48%,
        transparent 30%,
        rgba(0, 0, 0, 0.12) 64%,
        rgba(0, 0, 0, 0.65) 100%
    );
}

/* ---------- top bar ---------- */
.rsb-factory-3d .f3d-topbar {
    position: absolute;
    inset: 26px 30px auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
}

.rsb-factory-3d .f3d-identity {
    display: flex;
    gap: 13px;
    align-items: center;
}

.rsb-factory-3d .f3d-mark {
    width: 30px;
    height: 30px;
    border: 1px solid #55502f;
    border-radius: 9px;
    display: grid;
    place-items: center;
    color: var(--amber);
    background: #1c1b14;
    flex-shrink: 0;
}

.rsb-factory-3d .f3d-identity strong {
    display: block;
    font-weight: 600;
    letter-spacing: -0.2px;
    font-size: 13px;
}

.rsb-factory-3d .f3d-identity small {
    display: block;
    margin-top: 5px;
    font-size: 9px;
    letter-spacing: 1.55px;
    color: #73777f;
}

.rsb-factory-3d .f3d-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
    letter-spacing: 0.1px;
    color: #a6a79f;
}

.rsb-factory-3d .f3d-status i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--amber);
    box-shadow: 0 0 10px rgba(255, 122, 26, 0.38);
}

.rsb-factory-3d .f3d-status.paused i {
    background: #777;
    box-shadow: none;
}

.rsb-factory-3d .f3d-status .f3d-serial {
    font-variant-numeric: tabular-nums;
    color: #646971;
    margin-inline-start: 12px;
    direction: ltr;
}

/* ---------- headings ---------- */
.rsb-factory-3d .f3d-heading {
    position: absolute;
    top: 106px;
    left: 24%;
    right: 24%;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 10px;
    letter-spacing: 1px;
    color: #959790;
    text-align: right;
}

.rsb-factory-3d .f3d-heading::before {
    content: '';
    width: 22px;
    height: 1px;
    background: var(--amber);
    flex-shrink: 0;
}

.rsb-factory-3d .f3d-heading .f3d-index {
    margin-inline-start: auto;
    color: #4e535b;
    font-size: 9px;
    letter-spacing: 1px;
    white-space: nowrap;
}

.rsb-factory-3d .f3d-coords {
    position: absolute;
    top: 146px;
    inset-inline-end: 32px;
    color: #52575f;
    writing-mode: vertical-rl;
    font: 9px ui-monospace, Menlo, SFMono-Regular, monospace;
    letter-spacing: 1.5px;
    pointer-events: none;
    direction: ltr;
}

/* ---------- controls ---------- */
.rsb-factory-3d .f3d-controls {
    position: absolute;
    bottom: 76px;
    left: 26px;
    right: 26px;
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 16px;
    z-index: 5;
}

.rsb-factory-3d .f3d-mode-bar {
    display: flex;
    gap: 3px;
    align-items: center;
    padding: 5px;
    border: 1px solid rgba(255, 255, 255, 0.075);
    border-radius: 12px;
    background: rgba(25, 28, 32, 0.87);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(16px);
}

.rsb-factory-3d .f3d-mode-bar button {
    border: 0;
    background: none;
    color: #a2a4a8;
    white-space: nowrap;
    padding: 11px 15px;
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 11px;
    font-weight: 500;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
}

.rsb-factory-3d .f3d-mode-bar button:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--white);
}

.rsb-factory-3d .f3d-mode-bar button[aria-pressed='true'] {
    background: var(--amber);
    color: #211c0d;
    box-shadow: 0 2px 12px rgba(255, 122, 26, 0.07);
}

.rsb-factory-3d svg {
    flex-shrink: 0;
    display: block;
}

.rsb-factory-3d .f3d-mode-bar svg {
    width: 14px;
    height: 14px;
}

.rsb-factory-3d .f3d-camera-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.rsb-factory-3d .f3d-camera-row .f3d-caption {
    font-size: 9px;
    letter-spacing: 1.4px;
    color: #555b65;
    margin-inline-end: 9px;
    direction: ltr;
}

.rsb-factory-3d .f3d-camera-row button {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #78818a;
    padding: 6px 9px;
    font-size: 10px;
    white-space: nowrap;
    transition: color 180ms ease, background 180ms ease;
}

.rsb-factory-3d .f3d-camera-row button svg {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
}

.rsb-factory-3d .f3d-camera-row button:hover,
.rsb-factory-3d .f3d-camera-row button[aria-pressed='true'] {
    color: var(--white);
}

.rsb-factory-3d .f3d-camera-row button[aria-pressed='true'] {
    background: rgba(255, 255, 255, 0.055);
}

.rsb-factory-3d .f3d-camera-row button[aria-pressed='true']::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 4px;
    height: 4px;
    transform: translateX(-50%);
    background: var(--amber);
    border-radius: 50%;
}

.rsb-factory-3d .f3d-camera-row .f3d-divider {
    width: 1px;
    height: 13px;
    background: var(--line);
    margin: 0 8px;
}

.rsb-factory-3d .f3d-camera-row .f3d-play {
    padding: 5px;
    width: 25px;
    height: 25px;
    display: grid;
    place-items: center;
}

/* ---------- footer ---------- */
.rsb-factory-3d .f3d-footer {
    position: absolute;
    bottom: 24px;
    left: 32px;
    right: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    pointer-events: none;
}

.rsb-factory-3d .f3d-wordmark {
    font-size: 11px;
    letter-spacing: -0.1px;
    color: #6d7178;
    text-decoration: none;
    pointer-events: auto;
}

.rsb-factory-3d .f3d-wordmark span {
    color: #a1a49f;
    direction: ltr;
    unicode-bidi: embed;
}

.rsb-factory-3d .f3d-hint {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #636972;
    font-size: 10px;
}

.rsb-factory-3d .f3d-hint svg {
    color: #8c8f91;
}

.rsb-factory-3d .f3d-footer-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font: 9px ui-monospace, Menlo, SFMono-Regular, monospace;
    letter-spacing: 1.5px;
    color: #3f454d;
}

/* ---------- station labels ---------- */
.rsb-factory-3d .f3d-labels {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.rsb-factory-3d .station-label {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    transition: opacity 0.3s;
    will-change: transform;
    pointer-events: none;
    min-width: 138px;
}

.rsb-factory-3d .station-label.visible {
    opacity: 1;
}

.rsb-factory-3d .station-label .stem {
    height: 26px;
    width: 1px;
    background: linear-gradient(rgba(255, 122, 26, 0), rgba(255, 122, 26, 0.44));
    margin: 0 0 0 10px;
}

.rsb-factory-3d .station-label .label-card {
    background: rgba(20, 23, 27, 0.93);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 122, 26, 0.25);
    border-radius: 6px;
    padding: 10px 13px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.rsb-factory-3d .station-label .label-title {
    font-weight: 600;
    font-size: 12px;
    display: flex;
    gap: 10px;
    align-items: center;
    white-space: nowrap;
}

.rsb-factory-3d .station-label .label-title span {
    color: var(--amber);
    font: 9px ui-monospace, Menlo, monospace;
}

.rsb-factory-3d .station-label .label-meta {
    font-size: 9px;
    color: #8e939c;
    margin: 6px 0 0;
    white-space: nowrap;
}

/* ---------- tooltip ---------- */
.rsb-factory-3d .f3d-tooltip {
    position: absolute;
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.15s;
    padding: 11px 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(23, 26, 32, 0.93);
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.33);
    border-radius: 7px;
    max-width: 240px;
}

.rsb-factory-3d .f3d-tooltip.visible {
    opacity: 1;
}

.rsb-factory-3d .f3d-tooltip strong {
    font-size: 12px;
    font-weight: 600;
}

.rsb-factory-3d .f3d-tooltip strong span {
    font-size: 10px;
    color: var(--amber);
    margin-inline-end: 8px;
}

.rsb-factory-3d .f3d-tooltip p {
    font-size: 10px;
    color: #9b9fa7;
    margin: 6px 0 0;
    line-height: 1.7;
}

/* ---------- journey bar (order mode) ---------- */
.rsb-factory-3d .f3d-journey {
    position: absolute;
    z-index: 4;
    left: 26px;
    top: 138px;
    width: min(360px, 26%);
    max-height: calc(100% - 205px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 15px;
    background: linear-gradient(150deg, rgba(19, 24, 31, 0.94), rgba(9, 13, 18, 0.9));
    box-shadow: 0 18px 52px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(18px) saturate(125%);
    opacity: 0;
    transform: translateX(-8px) scale(0.985);
    transform-origin: left top;
    transition: opacity 220ms ease, transform 280ms cubic-bezier(0.2, 0.75, 0.25, 1);
    pointer-events: none;
}

.rsb-factory-3d .f3d-journey.visible {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.rsb-factory-3d .f3d-journey-head {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: start;
    gap: 11px;
    padding: 15px 15px 12px;
    flex: 0 0 auto;
}

.rsb-factory-3d .f3d-journey-icon {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 122, 26, 0.3);
    border-radius: 11px;
    display: grid;
    place-items: center;
    color: var(--amber);
    background: rgba(255, 122, 26, 0.08);
}

.rsb-factory-3d .f3d-journey-icon svg {
    width: 19px;
    height: 19px;
}

.rsb-factory-3d .f3d-journey-head-copy {
    min-width: 0;
}

.rsb-factory-3d .f3d-journey-kicker {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: #9ba2a9;
    font-size: 9px;
    line-height: 1.5;
}

.rsb-factory-3d .f3d-journey-kicker span:last-child {
    color: var(--amber);
    white-space: nowrap;
}

.rsb-factory-3d .f3d-journey h3 {
    margin: 5px 0 0;
    color: var(--white);
    font-size: 14px;
    line-height: 1.5;
    font-weight: 700;
}

.rsb-factory-3d .f3d-journey-head-copy p {
    margin: 4px 0 0;
    color: #a2a7ad;
    font-size: 10px;
    line-height: 1.7;
}

.rsb-factory-3d .f3d-journey-live {
    grid-column: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 7px;
    color: #9aab9c;
    font-size: 9px;
}

.rsb-factory-3d .f3d-journey-live i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #72c99a;
    box-shadow: 0 0 10px rgba(114, 201, 154, 0.45);
}

.rsb-factory-3d .f3d-journey-live.paused i {
    background: #858d93;
    box-shadow: none;
}

.rsb-factory-3d .f3d-journey-progress {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 16px 12px;
    color: #c3c7ca;
    font-size: 9px;
    font-variant-numeric: tabular-nums;
    flex: 0 0 auto;
}

.rsb-factory-3d .f3d-journey-track {
    height: 4px;
    flex: 1;
    overflow: hidden;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.09);
}

.rsb-factory-3d .f3d-journey-track i {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #f6a235, var(--amber));
    box-shadow: 0 0 12px rgba(255, 122, 26, 0.45);
    transition: width 180ms linear;
}

.rsb-factory-3d .f3d-journey-list {
    display: grid;
    gap: 2px;
    min-height: 0;
    margin: 0;
    padding: 0 8px 9px;
    overflow-y: auto;
    list-style: none;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.rsb-factory-3d .f3d-journey-step {
    position: relative;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 9px;
    padding: 9px 8px;
    border: 1px solid transparent;
    border-radius: 10px;
    transition: background 180ms ease, border-color 180ms ease;
}

.rsb-factory-3d .f3d-journey-step.is-current {
    border-color: rgba(255, 122, 26, 0.2);
    background: linear-gradient(110deg, rgba(255, 122, 26, 0.1), rgba(255, 122, 26, 0.025));
}

.rsb-factory-3d .f3d-journey-step-mark {
    position: relative;
    width: 25px;
    height: 25px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 50%;
    color: #969da4;
    background: rgba(255, 255, 255, 0.035);
}

.rsb-factory-3d .f3d-journey-step-mark::after {
    content: '';
    position: absolute;
    top: 25px;
    left: 50%;
    height: calc(100% + 34px);
    border-left: 1px solid rgba(255, 255, 255, 0.09);
}

.rsb-factory-3d .f3d-journey-step:last-child .f3d-journey-step-mark::after {
    display: none;
}

.rsb-factory-3d .f3d-journey-step-number {
    font-size: 9px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.rsb-factory-3d .f3d-journey-check {
    display: none;
    width: 14px;
    height: 14px;
}

.rsb-factory-3d .f3d-journey-step.is-complete .f3d-journey-step-mark {
    color: #101713;
    border-color: #77c99a;
    background: #77c99a;
}

.rsb-factory-3d .f3d-journey-step.is-complete .f3d-journey-step-number {
    display: none;
}

.rsb-factory-3d .f3d-journey-step.is-complete .f3d-journey-check {
    display: block;
}

.rsb-factory-3d .f3d-journey-step.is-current .f3d-journey-step-mark {
    border-color: var(--amber);
    color: var(--amber);
    box-shadow: 0 0 0 4px rgba(255, 122, 26, 0.08);
}

.rsb-factory-3d .f3d-journey-step-body {
    min-width: 0;
}

.rsb-factory-3d .f3d-journey-step-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 7px;
}

.rsb-factory-3d .f3d-journey-step-title strong {
    color: #e8e9e7;
    font-size: 10px;
    line-height: 1.5;
    font-weight: 650;
}

.rsb-factory-3d .f3d-journey-step-title span {
    color: #777f87;
    font-size: 8px;
    white-space: nowrap;
}

.rsb-factory-3d .f3d-journey-step.is-current .f3d-journey-step-title span {
    color: var(--amber);
}

.rsb-factory-3d .f3d-journey-step-body > p {
    margin: 3px 0 5px;
    color: #9da4ab;
    font-size: 9px;
    line-height: 1.65;
}

.rsb-factory-3d .f3d-journey-tasks {
    display: grid;
    gap: 3px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.rsb-factory-3d .f3d-journey-tasks li {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    color: #c3c7c9;
    font-size: 9px;
    line-height: 1.55;
}

.rsb-factory-3d .f3d-journey-tasks svg {
    width: 12px;
    height: 12px;
    margin-top: 1px;
    flex: 0 0 auto;
    color: #747e83;
}

.rsb-factory-3d .f3d-journey-step.is-current .f3d-journey-tasks svg {
    color: var(--amber);
}

.rsb-factory-3d .f3d-journey-result {
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    color: #929ba0;
    font-size: 8px;
    line-height: 1.6;
}

.rsb-factory-3d .f3d-journey-result span {
    color: #c2c7c5;
    font-weight: 600;
}

/* ---------- loading & error ---------- */
.rsb-factory-3d .f3d-loading {
    position: absolute;
    left: 50%;
    top: 48%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 12px;
    color: #8c8f95;
    font-size: 11px;
    transition: opacity 0.4s;
    z-index: 20;
}

.rsb-factory-3d .f3d-loading i {
    height: 18px;
    width: 18px;
    border-radius: 50%;
    border: 1px solid rgba(255, 122, 26, 0.13);
    border-top-color: var(--amber);
    animation: rsb-f3d-spin 1s linear infinite;
}

@keyframes rsb-f3d-spin {
    to {
        transform: rotate(360deg);
    }
}

.rsb-factory-3d .f3d-loading.done {
    opacity: 0;
    pointer-events: none;
}

.rsb-factory-3d .f3d-error {
    position: absolute;
    left: 27.5%;
    right: 27.5%;
    top: 40%;
    border: 1px solid rgba(255, 122, 26, 0.19);
    background: #191b1f;
    padding: 24px;
    border-radius: 12px;
    display: none;
    font-size: 13px;
    line-height: 1.7;
    z-index: 21;
}

.rsb-factory-3d .f3d-error strong {
    color: var(--amber);
    font-weight: 500;
}

.rsb-factory-3d .f3d-error p {
    color: #9da1a8;
    margin: 8px 0 0;
}

.rsb-factory-3d .f3d-error button {
    border: 1px solid rgba(255, 255, 255, 0.13);
    background: #25292e;
    padding: 8px 14px;
    border-radius: 5px;
    margin-top: 14px;
}

/* ---------- responsive ---------- */
@media (min-width: 1600px) {
    .rsb-factory-3d .f3d-topbar {
        inset: 38px 46px auto;
    }
    .rsb-factory-3d .f3d-heading {
        top: 138px;
    }
    .rsb-factory-3d .f3d-controls {
        bottom: 96px;
        gap: 20px;
    }
    .rsb-factory-3d .f3d-mode-bar button {
        padding: 13px 20px;
        font-size: 12px;
    }
    .rsb-factory-3d .f3d-camera-row button {
        font-size: 11px;
        padding: 5px 12px;
    }
    .rsb-factory-3d .f3d-footer {
        bottom: 35px;
        left: 46px;
        right: 46px;
    }
    .rsb-factory-3d .f3d-journey {
        top: 178px;
    }
    .rsb-factory-3d .f3d-coords {
        inset-inline-end: 46px;
        top: 181px;
    }
}

@media (max-width: 900px) {
    .rsb-factory-3d .f3d-topbar {
        inset: 24px 22px auto;
    }
    .rsb-factory-3d .f3d-identity strong {
        font-size: 12px;
    }
    .rsb-factory-3d .f3d-identity small {
        font-size: 8px;
        letter-spacing: 1.1px;
    }
    .rsb-factory-3d .f3d-status {
        font-size: 9px;
    }
    .rsb-factory-3d .f3d-status .f3d-serial {
        display: none;
    }
    .rsb-factory-3d .f3d-heading {
        left: 22px;
        right: 22px;
        top: 100px;
        font-size: 9px;
        letter-spacing: 1px;
    }
    .rsb-factory-3d .f3d-coords {
        display: none;
    }
    .rsb-factory-3d .f3d-controls {
        left: 12px;
        right: 12px;
        bottom: 80px;
        gap: 18px;
    }
    .rsb-factory-3d .f3d-mode-bar {
        gap: 1px;
        padding: 4px;
        border-radius: 10px;
        max-width: 100%;
        overflow-x: auto;
        scrollbar-width: none;
    }
    .rsb-factory-3d .f3d-mode-bar::-webkit-scrollbar {
        display: none;
    }
    .rsb-factory-3d .f3d-mode-bar button {
        padding: 11px 10px;
        font-size: 10px;
        gap: 6px;
    }
    .rsb-factory-3d .f3d-mode-bar svg {
        width: 12px;
        height: 12px;
    }
    .rsb-factory-3d .f3d-camera-row {
        gap: 0;
    }
    .rsb-factory-3d .f3d-camera-row .f3d-caption {
        font-size: 8px;
        margin-inline-end: 6px;
    }
    .rsb-factory-3d .f3d-camera-row button {
        width: 32px;
        height: 30px;
        justify-content: center;
        padding: 5px;
        font-size: 9px;
    }
    .rsb-factory-3d .f3d-camera-row button span {
        display: none;
    }
    .rsb-factory-3d .f3d-camera-row button svg {
        width: 15px;
        height: 15px;
    }
    .rsb-factory-3d .f3d-camera-row .f3d-divider {
        margin: 0 5px;
    }
    .rsb-factory-3d .f3d-footer {
        bottom: 25px;
        left: 22px;
        right: 22px;
        align-items: flex-end;
    }
    .rsb-factory-3d .f3d-hint {
        font-size: 9px;
        max-width: 175px;
        line-height: 1.6;
    }
    .rsb-factory-3d .f3d-footer-center {
        display: none;
    }
    .rsb-factory-3d .f3d-vignette {
        background: radial-gradient(ellipse at 50% 47%, transparent 20%, rgba(0, 0, 0, 0.5) 100%);
    }
    .rsb-factory-3d .f3d-loading {
        left: 50%;
    }
    .rsb-factory-3d .f3d-error {
        left: 7%;
        right: 7%;
        top: 35%;
    }
    .rsb-factory-3d .f3d-journey {
        left: 12px;
        right: 12px;
        top: 132px;
        width: auto;
        max-height: calc(100% - 326px);
        border-radius: 13px;
        transform-origin: center top;
    }
    .rsb-factory-3d .f3d-journey-head {
        grid-template-columns: 34px minmax(0, 1fr);
        gap: 9px;
        padding: 11px 11px 8px;
    }
    .rsb-factory-3d .f3d-journey-icon {
        width: 32px;
        height: 32px;
    }
    .rsb-factory-3d .f3d-journey h3 {
        font-size: 12px;
    }
    .rsb-factory-3d .f3d-journey-head-copy p {
        font-size: 9px;
    }
    .rsb-factory-3d .f3d-journey-live {
        margin-top: 4px;
    }
    .rsb-factory-3d .f3d-journey-progress {
        padding: 0 12px 8px;
    }
    .rsb-factory-3d .f3d-journey-list {
        padding: 0 5px 6px;
    }
    .rsb-factory-3d .f3d-journey-step {
        grid-template-columns: 25px minmax(0, 1fr);
        gap: 7px;
        padding: 7px 6px;
    }
    .rsb-factory-3d .f3d-journey-step-title strong {
        font-size: 9px;
    }
    .rsb-factory-3d .f3d-journey-step-body > p,
    .rsb-factory-3d .f3d-journey-tasks li {
        font-size: 8px;
    }
    .rsb-factory-3d .f3d-journey-result {
        font-size: 8px;
    }
    .rsb-factory-3d .station-label {
        min-width: 100px;
    }
    .rsb-factory-3d .station-label .label-card {
        padding: 7px 9px;
    }
    .rsb-factory-3d .station-label .label-title {
        font-size: 10px;
        gap: 7px;
    }
    .rsb-factory-3d .station-label .label-meta {
        font-size: 8px;
    }
    .rsb-factory-3d .station-label .stem {
        height: 17px;
    }
}

@media (max-width: 360px) {
    .rsb-factory-3d .f3d-mode-bar button {
        padding: 10px 7px;
    }
    .rsb-factory-3d .f3d-mode-bar svg {
        display: none;
    }
    .rsb-factory-3d .f3d-camera-row .f3d-caption {
        display: none;
    }
    .rsb-factory-3d .f3d-status {
        display: none;
    }
}

@media (max-height: 570px) {
    .rsb-factory-3d .f3d-topbar {
        top: 16px;
    }
    .rsb-factory-3d .f3d-heading {
        top: 70px;
    }
    .rsb-factory-3d .f3d-controls {
        bottom: 50px;
        gap: 8px;
    }
    .rsb-factory-3d .f3d-footer {
        bottom: 14px;
    }
    .rsb-factory-3d .f3d-journey {
        top: 96px;
        max-height: calc(100% - 245px);
    }
    .rsb-factory-3d .f3d-mode-bar button {
        padding-top: 8px;
        padding-bottom: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rsb-factory-3d,
    .rsb-factory-3d * {
        transition: none !important;
    }
    .rsb-factory-3d .f3d-loading i {
        animation: none;
    }
}

.rsb-factory-3d {
    height: auto !important;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0,1fr) minmax(280px,340px);
    grid-template-areas: "top top" "heading heading" "scene journey" "controls controls" "footer footer";
    gap: 18px;
    padding: 24px;
}
.rsb-factory-3d > .f3d-topbar { grid-area: top; position: static; flex-wrap: wrap; gap: 16px; min-width: 0; }
.rsb-factory-3d .f3d-identity { min-width: 0; }
.rsb-factory-3d .f3d-identity strong { font-size: 15px; line-height: 1.8; overflow-wrap: anywhere; }
.rsb-factory-3d .f3d-identity small { font-size: 11px; letter-spacing: 0; color: #a9b0ba; }
.rsb-factory-3d > .f3d-heading { grid-area: heading; position: static; min-width: 0; flex-wrap: wrap; font-size: 12px; line-height: 1.8; letter-spacing: 0; color: #b9c2cf; }
.rsb-factory-3d .f3d-index { color: #a9b0ba; letter-spacing: 0; }
.rsb-factory-3d > .f3d-coords { display: none; }
.rsb-factory-3d > .f3d-scene { grid-area: scene; position: relative; inset: auto; height: clamp(380px,42vw,540px); min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: radial-gradient(ellipse at 50% 60%,rgba(255,255,255,.04),transparent 65%); }
.rsb-factory-3d .f3d-scene canvas { position: absolute; inset: 0; }
.rsb-factory-3d .f3d-scene .f3d-vignette { z-index: 1; }
.rsb-factory-3d > .f3d-journey { grid-area: journey; position: static; width: auto; max-height: 540px; min-width: 0; display: none; opacity: 1; transform: none; backdrop-filter: none; }
.rsb-factory-3d > .f3d-journey.visible { display: flex; }
.rsb-factory-3d:not([data-mode="order"]) > .f3d-scene { grid-column: 1/-1; }
.rsb-factory-3d .f3d-journey h3 { font-size: 16px; color: var(--white) !important; line-height: 1.8; }
.rsb-factory-3d .f3d-journey-head-copy p, .rsb-factory-3d .f3d-journey-step-body > p { color: #c0c8d2 !important; font-size: 12px; line-height: 1.9; }
.rsb-factory-3d .f3d-journey-step-title { flex-wrap: wrap; }
.rsb-factory-3d .f3d-journey-step-title strong { font-size: 13px; line-height: 1.8; color: var(--white); }
.rsb-factory-3d .f3d-journey-kicker, .rsb-factory-3d .f3d-journey-step-title > span, .rsb-factory-3d .f3d-journey-live { font-size: 11px; letter-spacing: 0; }
.rsb-factory-3d .f3d-journey-tasks li, .rsb-factory-3d .f3d-journey-result { font-size: 12px; line-height: 1.9; color: #b9c2cf; }
.rsb-factory-3d > .f3d-controls { grid-area: controls; position: static; min-width: 0; gap: 12px; }
.rsb-factory-3d .f3d-mode-bar { flex-wrap: wrap; justify-content: center; max-width: 100%; }
.rsb-factory-3d .f3d-mode-bar button { min-height: 46px; min-width: 44px; padding: 10px 16px; font-size: 12px; }
.rsb-factory-3d .f3d-camera-row { flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 100%; }
.rsb-factory-3d .f3d-camera-row button { min-width: 44px; min-height: 44px; height: auto; width: auto; padding: 10px 12px; font-size: 12px; }
.rsb-factory-3d .f3d-camera-row button span { display: inline; }
.rsb-factory-3d .f3d-camera-row .f3d-play { width: 44px; }
.rsb-factory-3d > .f3d-footer { grid-area: footer; position: static; flex-wrap: wrap; gap: 12px; min-width: 0; border-top: 1px solid var(--line); padding-top: 16px; }
.rsb-factory-3d .f3d-wordmark, .rsb-factory-3d .f3d-hint { font-size: 11px; line-height: 1.8; max-width: 100%; }
.rsb-factory-3d .f3d-tooltip { width: min(245px,calc(100% - 20px)); }
.rsb-factory-3d .station-label { width: 150px; min-width: 0; max-width: calc(100% - 18px); }
.rsb-factory-3d .station-label .label-title { overflow-wrap: anywhere; }
.rsb-factory-3d .f3d-error { inset-inline: 20px; top: 25%; }
.rsb-factory-3d .f3d-error p { color: #c0c8d2 !important; }
.rsb-factory-3d .f3d-error button { min-height: 44px; }
.rsb-service-slider:not(.owl-loaded) { display: block !important; }
.rsb-service-slider:not(.owl-loaded) > div:not(:first-child) { display: none; }
.rsb-service-slider img { display: block; width: 100%; height: auto; object-fit: contain; }
@media (max-width: 991px) {
    .rsb-factory-3d { grid-template-columns: minmax(0,1fr); grid-template-areas: "top" "heading" "scene" "controls" "journey" "footer"; padding: 18px; gap: 16px; }
    .rsb-factory-3d > .f3d-scene { height: clamp(300px,74vw,440px); }
    .rsb-factory-3d > .f3d-journey { max-height: 460px; }
    .rsb-factory-3d .f3d-mode-bar { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); width: 100%; overflow: visible; }
    .rsb-factory-3d .f3d-mode-bar button { justify-content: center; min-width: 0; }
    .rsb-factory-3d .f3d-camera-row { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; width: 100%; }
    .rsb-factory-3d .f3d-camera-row button { width: 100%; padding: 10px 6px; gap: 6px; font-size: 11px; }
    .rsb-factory-3d .f3d-camera-row button span { display: inline; }
    .rsb-factory-3d .f3d-camera-row .f3d-caption, .rsb-factory-3d .f3d-camera-row .f3d-divider { display: none; }
    .rsb-factory-3d .f3d-camera-row .f3d-play { width: 100%; }
    .rsb-factory-3d .f3d-status { display: flex; font-size: 11px; }
    .rsb-factory-3d .f3d-status .f3d-serial { display: none; }
    .rsb-factory-3d .f3d-journey-head { padding: 16px; }
    .rsb-factory-3d .f3d-journey-step { padding: 12px 8px; }
    body:has(.rsb-f3d-wrap) .rsb-service-hero h1 { font-size: clamp(25px,6vw,36px); line-height: 1.8; overflow-wrap: anywhere; }
    body:has(.rsb-f3d-wrap) .rsb-hero-highlights { flex-wrap: wrap; gap: 12px; }
    body:has(.rsb-f3d-wrap) .rsb-hero-highlights .hh-card { min-width: 0; flex: 1 1 130px; }
    body:has(.rsb-f3d-wrap) .rsb-step-card { min-width: 0; overflow-wrap: anywhere; }
}
@media (max-width: 360px) {
    .rsb-factory-3d { padding: 12px; }
    .rsb-factory-3d .f3d-mode-bar svg { display: block; }
    .rsb-factory-3d .f3d-camera-row { gap: 4px; }
    .rsb-factory-3d .f3d-camera-row .f3d-caption, .rsb-factory-3d .f3d-camera-row .f3d-divider { display: none; }
}

