/* ==========================================================================
   FiveMRides Debadger — overrides + viewer layout
   Reuses --fro-* variables from optimizer.css (must be enqueued together).
   ========================================================================== */

.fro-debadger {
    max-width: 1600px;
}

.fro-credits-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    margin-top: 1rem;
    background: var(--fro-surface);
    border: 1px solid var(--fro-border);
    border-radius: var(--fro-radius-sm);
    color: var(--fro-text-muted);
    font-size: 0.875rem;
}

/* --------- Picker layout ------------------------------------------------- */
.frd-picker-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.25rem;
    align-items: stretch;
}

@media (max-width: 960px) {
    .frd-picker-grid { grid-template-columns: 1fr; }
}

.frd-viewer-wrap {
    position: relative;
    background: var(--fro-surface);
    border: 1px solid var(--fro-border);
    border-radius: var(--fro-radius);
    overflow: hidden;
    min-height: 720px;       /* taller — was 560 */
    display: flex;
    flex-direction: column;
}

.frd-canvas {
    width: 100%;
    flex: 1;
    min-height: 700px;       /* taller — was 520 */
    display: block;
    background: #060a10;
    touch-action: none;
    outline: none;
    cursor: pointer;
}

/* Side panel can grow taller to match the bigger viewer */
.frd-side {
    max-height: 720px;
}

.frd-viewer-hud {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
    z-index: 2;
}

.frd-viewer-hint {
    padding: 0.6rem 0.85rem;
    background: rgba(0,0,0,0.4);
    border-top: 1px solid var(--fro-border);
    font-size: 0.78rem;
    color: var(--fro-text-muted);
}

/* --------- Side panel ---------------------------------------------------- */
.frd-side {
    background: var(--fro-surface);
    border: 1px solid var(--fro-border);
    border-radius: var(--fro-radius);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 720px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Keep the action button reachable no matter how long the candidate/texture
   lists get — pin it to the bottom of the scrolling panel. */
#frd-submit {
    position: sticky;
    bottom: 0;
    z-index: 3;
    box-shadow: 0 -8px 16px -6px var(--fro-surface, rgba(0,0,0,0.6));
}

.frd-side-header { display: flex; gap: 0.5rem; }
.frd-model-select {
    flex: 1;
    background: var(--fro-surface-2);
    color: var(--fro-text);
    border: 1px solid var(--fro-border);
    border-radius: var(--fro-radius-xs);
    padding: 0.45rem 0.6rem;
    font-size: 0.85rem;
}

.frd-summary {
    background: var(--fro-surface-2);
    border: 1px solid var(--fro-border);
    border-radius: var(--fro-radius-sm);
    padding: 0.5rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.frd-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}
.frd-summary-label { color: var(--fro-text-muted); }
.frd-summary-value {
    font-weight: 700;
    color: var(--fro-accent);
    font-family: 'Rajdhani', sans-serif;
}

.frd-section-title {
    margin: 0.5rem 0 0;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--fro-text-muted);
}

.frd-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}
.frd-bulk-actions {
    display: flex;
    gap: 0.35rem;
}
.frd-mini-btn {
    background: transparent;
    border: 1px solid var(--fro-border-light);
    color: var(--fro-text-muted);
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
    border-radius: var(--fro-radius-xs);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: var(--fro-transition);
}
.frd-mini-btn:hover {
    border-color: var(--fro-accent);
    color: var(--fro-accent);
    background: var(--fro-accent-glow);
}

.frd-candidate-hint {
    margin: 0.5rem 0 0;
    font-size: 0.72rem;
    color: var(--fro-text-muted);
    padding: 0.4rem 0.5rem;
    background: var(--fro-surface-2);
    border-left: 2px solid var(--fro-success);
    border-radius: 0 var(--fro-radius-xs) var(--fro-radius-xs) 0;
}

.frd-candidate-list,
.frd-other-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.frd-candidate {
    border-bottom: 1px solid var(--fro-border);
}
.frd-candidate-row {
    display: grid;
    grid-template-columns: 22px 1fr auto;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.25rem;
    cursor: pointer;
}
.frd-candidate-row:hover { background: var(--fro-surface-2); }
.frd-candidate-cb { accent-color: var(--fro-accent); }
.frd-candidate-name {
    color: var(--fro-text);
    font-size: 0.85rem;
    font-family: monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.frd-candidate-meta {
    color: var(--fro-text-muted);
    font-size: 0.7rem;
    text-align: right;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.frd-candidate.frd-empty {
    padding: 0.6rem 0.25rem;
    color: var(--fro-text-muted);
    font-size: 0.85rem;
    text-align: center;
}

.frd-other {
    border-top: 1px solid var(--fro-border);
    padding-top: 0.5rem;
}
.frd-other summary {
    cursor: pointer;
    color: var(--fro-text-muted);
    font-size: 0.85rem;
}
.frd-other-list {
    max-height: 160px;
    margin-top: 0.5rem;
}
.frd-other-item {
    padding: 0.2rem 0.25rem;
    font-size: 0.78rem;
    font-family: monospace;
}
.frd-other-item label {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    color: var(--fro-text);
    cursor: pointer;
}

.frd-cost-note {
    text-align: center;
    color: var(--fro-text-muted);
    font-size: 0.78rem;
    margin: 0.25rem 0 0;
}

/* --------- Done / error ------------------------------------------------- */
.frd-done {
    text-align: center;
    padding: 2.5rem 1rem;
}
.frd-done-icon {
    margin-bottom: 1rem;
    display: inline-flex;
}
.frd-error {
    text-align: center;
    padding: 2.5rem 1rem;
}

/* --------- Progress block ----------------------------------------------- */
.fro-progress-block {
    text-align: center;
    padding: 3rem 1rem;
}
.fro-progress-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--fro-border);
    border-top-color: var(--fro-accent);
    border-radius: 50%;
    animation: frd-spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}
@keyframes frd-spin {
    to { transform: rotate(360deg); }
}

.fro-btn--ghost {
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--fro-border-light);
    color: var(--fro-text);
    padding: 0.4rem 0.7rem;
    font-size: 0.78rem;
}
.fro-btn--ghost:hover {
    background: var(--fro-surface-2);
}
.fro-btn--ghost.frd-btn-on {
    background: var(--fro-accent-glow);
    border-color: var(--fro-accent);
    color: var(--fro-accent);
}

/* --------- View preset buttons (top-left of viewer) --------------------- */
.frd-view-presets {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    z-index: 2;
}

/* +/- zoom buttons stacked on right side, middle-vertical */
.frd-zoom-stack {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    z-index: 2;
}
.frd-zoom-fab {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid var(--fro-border-light);
    color: var(--fro-text);
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--fro-transition);
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.frd-zoom-fab:hover {
    background: var(--fro-accent-glow);
    border-color: var(--fro-accent);
    color: var(--fro-accent);
    transform: scale(1.1);
}
.frd-zoom-fab:active { transform: scale(0.95); }
.frd-vp-btn {
    background: rgba(0,0,0,0.5);
    border: 1px solid var(--fro-border-light);
    color: var(--fro-text);
    padding: 0.35rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-radius: var(--fro-radius-xs);
    cursor: pointer;
    min-width: 56px;
    transition: var(--fro-transition);
    font-family: 'Rajdhani', sans-serif;
}
.frd-vp-btn:hover {
    background: var(--fro-accent-glow);
    border-color: var(--fro-accent);
    color: var(--fro-accent);
}

/* --------- Hint legend dots ------------------------------------------- */
.frd-hint-key {
    display: inline-block;
    padding: 0.05rem 0.4rem;
    background: var(--fro-surface-2);
    border: 1px solid var(--fro-border);
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--fro-text);
}
.frd-legend-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}
.frd-legend-green { background: #34d399; box-shadow: 0 0 6px rgba(52,211,153,0.6); }
.frd-legend-red   { background: #f87171; box-shadow: 0 0 6px rgba(248,113,113,0.6); }

/* --------- Floating callouts (badge labels in 3D space) --------------- */
.frd-callout-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
    overflow: hidden;
}
.frd-callout {
    position: absolute;
    transform: translate(-50%, -100%);
    background: rgba(8, 12, 20, 0.92);
    border: 1px solid var(--fro-accent);
    color: var(--fro-text);
    padding: 0.35rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: var(--fro-radius-xs);
    box-shadow: 0 4px 14px rgba(0,0,0,0.5);
    /* Labels only: clicks go through to the car so the badge under the label
       is what gets removed (same result, exact geometry). */
    pointer-events: none;
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.15s ease;
}
.frd-callout::after {
    /* leader line dot */
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 8px;
    background: var(--fro-accent);
}
.frd-callout::before {
    /* target dot */
    content: '';
    position: absolute;
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    background: var(--fro-accent);
    border-radius: 50%;
    border: 2px solid var(--fro-bg);
}
.frd-callout--selected {
    border-color: var(--fro-error);
    color: var(--fro-error);
    background: rgba(40, 10, 10, 0.92);
}
.frd-callout--selected::after,
.frd-callout--selected::before { background: var(--fro-error); }
.frd-callout--hidden { opacity: 0; pointer-events: none; }

/* Pulse animation on un-selected candidates to draw eye */
.frd-callout:not(.frd-callout--selected):not(.frd-callout--hidden) {
    animation: frd-pulse 1.8s ease-in-out infinite;
}
@keyframes frd-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 240, 255, 0.4), 0 4px 14px rgba(0,0,0,0.5); }
    50%      { box-shadow: 0 0 0 8px rgba(0, 240, 255, 0), 0 4px 14px rgba(0,0,0,0.5); }
}
.frd-callout:hover {
    transform: translate(-50%, -100%) scale(1.08);
    z-index: 10;
}

/* --------- Hover tooltip (mesh name) ----------------------------------- */
.frd-tooltip {
    position: fixed;
    background: rgba(0,0,0,0.9);
    border: 1px solid var(--fro-border-light);
    color: var(--fro-text);
    padding: 0.35rem 0.55rem;
    font-size: 0.72rem;
    font-family: monospace;
    border-radius: 4px;
    pointer-events: none;
    z-index: 9999;
    display: none;
    white-space: nowrap;
}

/* --------- Toast notification ----------------------------------------- */
.frd-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--fro-surface);
    border: 1px solid var(--fro-warning);
    color: var(--fro-warning);
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    border-radius: var(--fro-radius-sm);
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}
.frd-toast--show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* --------- Zoom button inline in lists ---------------------------------- */
.frd-zoom-btn {
    background: transparent;
    border: none;
    color: var(--fro-text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0 0.3rem;
    line-height: 1;
    transition: var(--fro-transition);
}
.frd-zoom-btn:hover {
    color: var(--fro-accent);
    transform: scale(1.15);
}

/* Tweak existing candidate-row to fit new layout (label + name + zoom) */
.frd-candidate-row {
    grid-template-columns: 22px 1fr 28px !important;
}
.frd-candidate-meta {
    color: var(--fro-text-muted);
    font-size: 0.68rem;
    text-align: left;
    padding: 0 0.5rem 0.4rem 1.85rem;
    margin-top: -0.25rem;
    max-width: 100%;
    white-space: normal;
}

.frd-other-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.frd-other-item label {
    flex: 1;
    min-width: 0;
}
.frd-other-item .frd-other-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    max-width: 100%;
}

/* ============================================================
   Texture-baked badges (logos painted into the YTD)
   ============================================================ */
.frd-texbadges {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--fro-border, rgba(255,255,255,0.08));
}
.frd-texgroup {
    margin-bottom: 0.75rem;
}
.frd-texgroup-label {
    font-size: 0.72rem;
    color: var(--fro-text-muted);
    margin: 0.25rem 0 0.4rem;
    font-weight: 600;
    word-break: break-all;
}
.frd-precision-bar {
    position: absolute;
    left: 50%;
    bottom: 4.2rem;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.55rem;
    background: rgba(10, 14, 20, 0.86);
    border: 1px solid var(--fro-accent, #3fd0c9);
    color: #eaf6f5;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    z-index: 6;
    box-shadow: 0 4px 18px rgba(0,0,0,0.4);
}
.frd-precision-dot {
    width: 9px; height: 9px; border-radius: 50%;
    background: #ff1a40;
    box-shadow: 0 0 8px #ff1a40;
    animation: frd-pulse 1.1s ease-in-out infinite;
}
@keyframes frd-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
.fro-btn--sm { padding: 0.18rem 0.55rem !important; font-size: 0.7rem !important; }
#frd-precision-toggle.frd-btn-on {
    background: var(--fro-accent, #3fd0c9);
    color: #06201f;
    border-color: var(--fro-accent, #3fd0c9);
}

.frd-texselbar {
    display: flex;
    justify-content: flex-end;
    margin: 0 0 0.4rem;
}
.frd-texselall {
    background: transparent;
    border: 1px solid var(--fro-accent, #3fd0c9);
    color: var(--fro-accent, #3fd0c9);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 0.22rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.frd-texselall:hover {
    background: var(--fro-accent, #3fd0c9);
    color: #06201f;
}
.frd-texgrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 0.5rem;
}
.frd-texcard {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.4rem;
    border: 1px solid var(--fro-border, rgba(255,255,255,0.1));
    border-radius: 8px;
    background: var(--fro-surface-2, rgba(255,255,255,0.03));
    cursor: pointer;
    transition: var(--fro-transition, all 0.15s ease);
}
.frd-texcard:hover {
    border-color: var(--fro-accent);
}
.frd-texcard--sel {
    border-color: var(--fro-error, #ff4d4d);
    box-shadow: 0 0 0 1px var(--fro-error, #ff4d4d) inset;
}
.frd-texcard--locked {
    cursor: not-allowed;
    opacity: 0.7;
}
.frd-texthumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    overflow: hidden;
    /* checkerboard so transparent decals read clearly */
    background-color: #2a2f3a;
    background-image:
        linear-gradient(45deg, rgba(255,255,255,0.06) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255,255,255,0.06) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.06) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.06) 75%);
    background-size: 12px 12px;
    background-position: 0 0, 0 6px, 6px -6px, -6px 0;
    color: var(--fro-text-muted);
}
.frd-texthumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.frd-texmeta {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
.frd-texname {
    font-size: 0.66rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.frd-texdim {
    font-size: 0.6rem;
    color: var(--fro-text-muted);
}
.frd-texwarn {
    font-size: 0.58rem;
    color: var(--fro-warning, #f0ad4e);
    line-height: 1.2;
}
.frd-texcb {
    position: absolute;
    top: 0.45rem;
    right: 0.45rem;
    width: 18px;
    height: 18px;
    accent-color: var(--fro-error, #ff4d4d);
}
.frd-texreview {
    margin-top: 0.6rem;
}
.frd-texreview > summary {
    font-size: 0.72rem;
    color: var(--fro-text-muted);
    cursor: pointer;
    padding: 0.3rem 0;
}
.frd-texreview[open] > summary {
    margin-bottom: 0.5rem;
}

/* "No 3D preview" overlay (Blender/Sollumz unavailable; texture debadge still works) */
.frd-viewer-notice {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.5rem;
    z-index: 4;
}
.frd-viewer-notice-inner {
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    color: var(--fro-text-muted);
}
.frd-viewer-notice-inner strong {
    color: var(--fro-text, #fff);
    font-size: 1.05rem;
}
.frd-vn-detail {
    font-size: 0.8rem;
    opacity: 0.8;
    word-break: break-word;
}
.frd-viewer-notice-inner em {
    font-size: 0.85rem;
    color: var(--fro-accent);
    font-style: normal;
}

/* Fragment-integrity validation report (done step) */
.frd-validation {
    text-align: left;
    margin: 1rem auto;
    max-width: 460px;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--fro-border, rgba(255,255,255,0.1));
    background: var(--fro-surface-2, rgba(255,255,255,0.03));
}
.frd-val--ok { border-color: rgba(60,200,120,0.35); }
.frd-val--warn { border-color: rgba(240,173,78,0.4); }
.frd-val-title {
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--fro-text-muted);
    margin-bottom: 0.5rem;
}
.frd-val-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.frd-val-row { display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.85rem; }
.frd-val-ico {
    flex: 0 0 18px;
    width: 18px; height: 18px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.7rem; font-weight: 700; line-height: 1;
}
.frd-val-ok .frd-val-ico { background: rgba(60,200,120,0.18); color: #4ade80; }
.frd-val-warn .frd-val-ico { background: rgba(240,173,78,0.18); color: #f0ad4e; }
.frd-val-details { margin-top: 0.6rem; }
.frd-val-details > summary { cursor: pointer; font-size: 0.8rem; color: var(--fro-text-muted); }
.frd-val-details ul { margin: 0.4rem 0 0; padding-left: 1.1rem; font-size: 0.76rem; color: var(--fro-text-muted); }
.frd-val-details li { margin-bottom: 0.15rem; }
.frd-val-tip { font-size: 0.78rem; color: var(--fro-accent); margin-top: 0.5rem; }

/* Texture action toggle (erase / replace) + logo upload */
.frd-texaction { margin: 0.5rem 0 0.75rem; }
.frd-texaction-toggle {
    display: flex;
    gap: 0.5rem;
    background: var(--fro-surface-2, rgba(255,255,255,0.03));
    border: 1px solid var(--fro-border, rgba(255,255,255,0.1));
    border-radius: 8px;
    padding: 0.3rem;
}
.frd-texact-opt {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    padding: 0.35rem 0.4rem;
    border-radius: 6px;
    cursor: pointer;
    color: var(--fro-text-muted);
}
.frd-texact-opt:has(input:checked) {
    background: var(--fro-accent-glow, rgba(0,200,255,0.12));
    color: var(--fro-text, #fff);
}
.frd-texact-opt input { accent-color: var(--fro-accent); }
.frd-logo-upload {
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.frd-logo-preview {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.7rem;
    color: var(--fro-text-muted);
}
.frd-logo-preview img {
    height: 34px;
    max-width: 90px;
    object-fit: contain;
    border-radius: 4px;
    background:
        linear-gradient(45deg, rgba(255,255,255,0.08) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255,255,255,0.08) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.08) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.08) 75%);
    background-size: 10px 10px;
    background-color: #2a2f3a;
}

/* --------- Edit Mode (Blender-style manual selection) -------------------- */
.frd-kbd {
    display: inline-block;
    padding: 0 0.3em;
    margin-left: 0.25em;
    font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace;
    font-size: 0.68em;
    line-height: 1.5;
    color: var(--fro-text-muted);
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--fro-border-light);
    border-bottom-width: 2px;
    border-radius: 4px;
    vertical-align: middle;
}

.frd-edit-bar {
    position: absolute;
    left: 50%;
    bottom: 4.2rem;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.55rem;
    background: rgba(10, 14, 20, 0.9);
    border: 1px solid #ff9e27;
    color: #f6efe6;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    z-index: 7;
    box-shadow: 0 4px 18px rgba(0,0,0,0.45);
    max-width: min(92%, 720px);
}

.frd-edit-pills {
    display: flex;
    gap: 0;
    border: 1px solid var(--fro-border-light);
    border-radius: 999px;
    overflow: hidden;
}
.frd-edit-pill {
    background: transparent;
    border: none;
    color: var(--fro-text-muted);
    padding: 0.25rem 0.7rem;
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: var(--fro-transition);
}
.frd-edit-pill:hover { color: #ffb85c; }
.frd-edit-pill--on {
    background: rgba(255, 158, 39, 0.18);
    color: #ffb85c;
}
.frd-edit-pill--on .frd-kbd { color: #ffb85c; }

.frd-edit-selinfo {
    color: #ffb85c;
    min-width: 5.5em;
    text-align: center;
}

.frd-edit-del {
    border-color: rgba(255, 80, 80, 0.6);
    color: #ff8a8a;
}
.frd-edit-del:hover {
    border-color: #ff5050;
    color: #ff5050;
    background: rgba(255, 80, 80, 0.12);
}

.frd-edit-hints {
    font-weight: 400;
    font-size: 0.68rem;
    color: var(--fro-text-muted);
}

#frd-edit-undo:disabled {
    opacity: 0.4;
    cursor: default;
}

#frd-edit-toggle.frd-btn-on {
    background: #ff9e27;
    color: #241503;
    border-color: #ff9e27;
}
#frd-edit-toggle.frd-btn-on .frd-kbd { color: #241503; }

.frd-edit-boxrect {
    position: absolute;
    display: none;
    border: 1px dashed #ffb85c;
    background: rgba(255, 158, 39, 0.08);
    pointer-events: none;
    z-index: 8;
}

@media (max-width: 720px) {
    .frd-edit-hints { display: none; }
}

/* --------- Simple mode: hover -> click -> gone ------------------------ */
.frd-island-progress {
    position: absolute;
    left: 0.75rem;
    bottom: 3.6rem;
    z-index: 5;
    background: rgba(10, 14, 20, 0.85);
    border: 1px solid var(--fro-border-light);
    color: var(--fro-text-muted);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    pointer-events: none;
}

.frd-removed-chip {
    display: inline-flex;
    align-items: center;
    align-self: center;
    background: rgba(255, 80, 80, 0.14);
    border: 1px solid rgba(255, 80, 80, 0.6);
    color: #ff8a8a;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    white-space: nowrap;
}

#frd-undo-main:disabled {
    opacity: 0.45;
    cursor: default;
}

.frd-removed-section {
    border: 1px solid rgba(255, 80, 80, 0.35);
    border-radius: var(--fro-radius-sm);
    padding: 0.6rem 0.75rem;
    background: rgba(255, 80, 80, 0.05);
}
.frd-removed-count {
    display: inline-block;
    min-width: 1.4em;
    text-align: center;
    margin-left: 0.35rem;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    background: rgba(255, 80, 80, 0.2);
    color: #ff8a8a;
    font-size: 0.72rem;
}
.frd-removed-list {
    list-style: none;
    margin: 0.45rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: 200px;
    overflow-y: auto;
}
.frd-removed-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "label btn" "meta btn";
    align-items: center;
    column-gap: 0.5rem;
    font-size: 0.78rem;
}
.frd-removed-label {
    grid-area: label;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.frd-removed-meta {
    grid-area: meta;
    font-size: 0.68rem;
    color: var(--fro-text-muted);
}
.frd-removed-restore {
    grid-area: btn;
    background: transparent;
    border: 1px solid var(--fro-border-light);
    color: var(--fro-text-muted);
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: var(--fro-transition);
}
.frd-removed-restore:hover {
    border-color: var(--fro-accent);
    color: var(--fro-accent);
}

/* --------- Interior view preset ---------------------------------------- */
/* Controls have their own layout space. Only scene overlays live in .frd-stage. */
#frd-step-picker { scroll-margin-top: 145px; }
.frd-side { height: clamp(640px, calc(64vh + 130px), 870px); max-height: none; overflow: hidden; }
.frd-side-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; padding-right: 0.3rem; scrollbar-gutter: stable; }
.frd-side-footer { flex: 0 0 auto; padding-top: 0.75rem; border-top: 1px solid var(--fro-border); }
.frd-side-footer #frd-submit { position: static; box-shadow: none; }
.frd-side-footer .frd-cost-note:empty { display: none; }
.frd-picker-grid { grid-template-columns: minmax(0, 1fr) 340px; }
.frd-viewer-wrap { min-width: 0; min-height: 0; }
.frd-viewer-hud {
    position: relative; top: auto; right: auto; order: 0;
    padding: 0.7rem; align-items: center; justify-content: flex-start;
}
.fro-debadger .frd-viewer-hud .fro-btn {
    min-height: 38px; padding: 0.45rem 0.65rem; font-size: 0.76rem;
    flex: 0 1 auto; white-space: normal;
}
.fro-debadger button:focus-visible { outline: 2px solid var(--fro-accent); outline-offset: 2px; }
.frd-view-presets {
    position: relative; top: auto; left: auto; order: 1;
    flex-direction: row; flex-wrap: wrap; padding: 0 0.7rem 0.7rem;
    border-bottom: 1px solid var(--fro-border);
}
.frd-view-presets .frd-vp-btn { margin-top: 0; min-height: 32px; }
.frd-edit-bar {
    position: relative; left: auto; bottom: auto; transform: none; order: 2;
    margin: 0.5rem 0.7rem; max-width: 100%; border-radius: 8px;
}
.frd-stage { position: relative; order: 3; height: clamp(420px, 64vh, 740px); overflow: hidden; }
.frd-stage .frd-canvas { width: 100%; height: 100%; min-height: 0; }
.frd-viewer-hint { order: 4; }
.frd-island-progress { top: 0.75rem; bottom: auto; }
.frd-callout, .frd-callout:hover { transform: none; }
.frd-callout::before, .frd-callout::after { display: none; }
.frd-callout:not(.frd-callout--selected):not(.frd-callout--hidden) { animation: none; }
@media (max-width: 960px) {
    .frd-picker-grid { grid-template-columns: minmax(0, 1fr); }
    .frd-side { max-height: 600px; }
}
@media (max-width: 540px) {
    .frd-stage { height: 440px; }
    .frd-viewer-hud .frd-kbd { display: none; }
    .frd-viewer-hud { gap: 0.35rem; }
    .frd-viewer-hint { font-size: 0.7rem; }
}

.frd-vp-btn--interior { margin-top: 0.35rem; border-color: rgba(63, 208, 201, 0.55); }
/* Build Studio — a separate, spacious finishing step; never over the 3D controls. */
.frds { --studio-mint: #64ead0; color: #eaf0f6; font-family: Inter, sans-serif; text-align: left; }
#frd-step-studio, #frd-step-done { scroll-margin-top: 145px; }
.fro-debadger .frds h2 { color: #f3f7fa; }
.frds [hidden] { display: none !important; }
.frds-heading, .frds-dashboard-head, .frds-option-top, .frds-checkout, .frds-quote-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.frds-heading { margin: 20px 0 28px; align-items: flex-start; }
.frds-eyebrow, .frds-index { font-size: 11px; letter-spacing: .13em; font-weight: 700; color: var(--studio-mint); }
.frds h2 { font-size: clamp(26px, 3vw, 42px); line-height: 1.15; margin: 12px 0; letter-spacing: -.04em; }
.frds h3 { color: #f3f7fa; font-size: 21px; letter-spacing: -.025em; margin: 16px 0 10px; }
.frds p { color: #a6b3c2; line-height: 1.65; font-size: 14px; margin: 10px 0; }
.frds-pill { border: 1px solid #36594f; color: var(--studio-mint); border-radius: 99px; padding: 7px 12px; font-size: 10px; letter-spacing: .07em; flex-shrink: 0; }
.frds-dashboard { background: radial-gradient(ellipse at top right, #15302f 0, transparent 55%), #111923; border: 1px solid #30404c; border-radius: 18px; padding: 24px; }
.frds-dashboard-head h3 { margin: 0; }
.frds-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 22px 0 16px; }
.frds-metric { min-width: 0; padding: 22px 18px; border: 1px solid #2b3946; background: #0c141bc9; border-radius: 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.frds-metric-label { color: #bac7d5; font-size: 12px; margin-bottom: 10px; }
.frds-metric-before, .frds-metric-after { font-size: clamp(21px, 2.3vw, 33px); line-height: 1.15; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; letter-spacing: -.035em; }
.frds-metric-after { color: var(--studio-mint); }
.frds-metric-caption { font-size: 9px; color: #9ba9b7; letter-spacing: .12em; }
.frds-arrow { color: #718796; font-size: 20px; margin: 3px 0; }
.frds-delta { background: #173d34; color: #a2f2dd; border-radius: 5px; padding: 4px 8px; margin-top: 10px; font-size: 12px; }
.frds .frds-note { color: #a8b7c6; font-size: 12px; line-height: 1.65; }
.frds-details { border-top: 1px solid #30404c; margin-top: 16px; padding-top: 14px; }
.frds-details summary { cursor: pointer; font-size: 12px; color: #bdcad6; }
.frds-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 22px 0; }
.frds-option { min-width: 0; border: 1px solid #303b48; border-radius: 14px; background: #111820; padding: 22px; }
.frds-option-base { background: linear-gradient(145deg, #252034, #111820 70%); }
.frds-option-top { align-items: flex-start; flex-direction: column; gap: 13px; }
.frds-index { color: #a7b1c3; font-size: 10px; }
.frds-price { font-size: 29px; font-weight: 700; color: #fff; }
.frds-price small { font-size: 11px; font-weight: 400; color: #a7b1c3; }
.frds-selected { border-color: #64ead0; box-shadow: inset 0 3px 0 #64ead0; }
.frds-included { display: inline-block; font-size: 12px; padding: 10px 0; color: var(--studio-mint); }
.frds label { display: block; font-size: 12px; color: #d3dce8; margin: 18px 0 8px; }
.frds select { width: 100%; min-width: 0; min-height: 46px; border: 1px solid #465263; border-radius: 7px; background: #0a1119; color: #e6edf6; padding: 10px; font-size: 12px; text-overflow: ellipsis; }
.frds audio { width: 100%; height: 38px; margin-top: 12px; }
.frds-checkout { background: #151d28; border: 1px solid #3b4758; padding: 20px; border-radius: 12px; flex-wrap: wrap; }
.frds-checkout > div { margin-left: auto; text-align: right; }
.frds-checkout strong { display: block; font-size: 23px; }
.frds-checkout span { display: block; margin-top: 5px; font-size: 11px; color: #a7b1c3; }
.frds-dialog { width: min(520px, calc(100% - 32px)); max-height: calc(100dvh - 40px); overflow: auto; border: 1px solid #5b6b7c; border-radius: 18px; background: #121b26; padding: 28px; }
.frds-dialog::backdrop { background: #030812c9; backdrop-filter: blur(6px); }
.frds-dialog h2 { font-size: 29px; }
.frds-quote-row { padding: 14px 0; border-bottom: 1px solid #344151; font-size: 14px; }
.frds-quote-total { color: var(--studio-mint); font-size: 19px; }
.frds-dialog-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; flex-wrap: wrap; }
.frds-result { width: min(960px, 100%); margin: 25px auto; }
.frds-result table { width: 100%; font-size: 12px; border-collapse: collapse; table-layout: fixed; margin-top: 12px; }
.frds-result th, .frds-result td { border-bottom: 1px solid #354352; padding: 10px 7px; overflow-wrap: anywhere; }
.frds select:focus-visible, .frds summary:focus-visible { outline: 2px solid var(--studio-mint); outline-offset: 3px; }
@media (max-width: 1000px) { .frds-options { grid-template-columns: 1fr 1fr; } .frds-option-base { grid-column: 1 / -1; } }
@media (max-width: 600px) {
    .frds-options, .frds-metrics { grid-template-columns: 1fr; }
    .frds-heading, .frds-dashboard-head { flex-wrap: wrap; }
    .frds-dashboard, .frds-option { padding: 18px; }
    .frds-checkout { align-items: stretch; flex-direction: column; }
    .frds-checkout > div { margin: 0; text-align: left; }
    .frds-dialog { padding: 20px; }
}
.frd-vp-btn--on,
.frd-vp-btn--interior.frd-vp-btn--on {
    background: var(--fro-accent, #3fd0c9);
    color: #06201f;
    border-color: var(--fro-accent, #3fd0c9);
}
