:root {
    --bg-color: #D9D9D9;
    --panel-bg: rgba(255, 255, 255, 0.9);
    --text-primary: #000000;
    --text-secondary: rgba(0, 0, 0, 0.6);
    --accent-color: #000000;
    /* Use black as accent for active tabs? Or keep blue? Figma uses black for active tab. */
    --accent-glow: rgba(0, 0, 0, 0.1);
    --border-color: rgba(0, 0, 0, 0.1);
    --controls-backdrop-offset: 350px;
    /* Increased to cover taller controls */
}

/* ... existing styles ... */

#profileBarContainer {
    position: absolute;
    top: auto;
    bottom: var(--profile-bar-bottom, 360px);
    /* Raised above the controls area; JS updates var */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: flex-end;
    gap: 20px;
    z-index: 1000;
    pointer-events: none;
    /* Allow clicks to pass through container */
    transition: transform 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.content-wrapper {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.layer-panel {
    width: 360px;
    background: var(--panel-bg);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    overflow-y: auto;
    flex-shrink: 0;
}

.layer-list {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 100;
}

.layer-button {
    background: transparent;
    border: none;
    border-bottom: 1px solid transparent;
    color: rgba(0, 0, 0, 0.4);
    padding: 2px 10px;
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 0;
    text-align: center;
}

.layer-button:hover,
.layer-button-wrapper:hover .layer-button {
    color: #000000;
    /* Keep text black when hovering wrapper (which includes popup) */
}

.layer-button.active {
    color: #000000;
    border-color: #000000;
    background: transparent;
}

.layer-control-groups {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.home-link {
    position: absolute;
    top: 0;
    left: 0;
    padding: 8px 14px;
    background: #EDEDED;
    color: #555;
    font-size: 14px;
    font-weight: 300;
    text-decoration: none;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0;
    opacity: 0.65;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1200;
    pointer-events: auto;
}

.home-link:hover {
    opacity: 1;
    background: #f7f7f7;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.15);
}

.layer-controls {
    display: none;
    flex-direction: column;
    gap: 1.5rem;
}

.layer-controls.active {
    display: flex;
}

.control-section {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.control-section:last-child {
    border-bottom: none;
}

.control-section h3 {
    font-size: 14px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.canvas-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    background-color: #D9D9D9;
    overflow: hidden;
}

.canvas-area {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.canvas-area.is-zoomed {
    cursor: grab;
}

.canvas-area.is-zoomed.is-panning {
    cursor: grabbing;
}

.canvas-area svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.canvas-content {
    position: absolute;
    inset: 0;
    transform-origin: 0 0;
    will-change: transform;
    z-index: 2;
    pointer-events: none;
}

.canvas-area.editing-image .canvas-content {
    pointer-events: none;
}

.image-toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.image-actions {
    display: none;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.image-toolbar.actions-visible .image-actions {
    display: flex;
}

.image-actions button {
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(15, 23, 42, 0.8);
    color: var(--text-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.75rem;
}

.rotation-control {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.65rem;
    color: var(--text-secondary);
}

.rotation-control input {
    width: 110px;
}

.image-toolbar button {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, border 0.2s ease;
}

.image-toolbar button.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #0f172a;
}

.image-controls {
    display: none;
    gap: 0.35rem;
    align-items: flex-end;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.4);
}

.image-controls.visible {
    display: flex;
}

.image-upload {
    font-size: 0.85rem;
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.image-upload input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.image-controls button {
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    color: var(--text-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
}

.opacity-control {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.opacity-control input {
    width: 120px;
}

svg {
    width: 100%;
    height: 100%;
    max-width: 100%;
    /* Allow full width */
    max-height: 100%;
    position: relative;
    z-index: 1;
    pointer-events: none;
}

/* Allow interaction with SVG shapes */
.canvas-area svg * {
    pointer-events: auto;
}

.canvas-area.editing-image .image-overlay-wrapper {
    pointer-events: auto;
}

.canvas-area.editing-image svg * {
    pointer-events: none;
}

.image-overlay-wrapper {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.image-frame {
    position: absolute;
    top: 0;
    left: 0;
    transform: none;
    border: 1px dashed rgba(255, 255, 255, 0.4);
    border-radius: 0.75rem;
    overflow: visible;
    display: none;
    min-width: 120px;
    min-height: 80px;
    pointer-events: none;
    background: transparent;
}

.image-frame.has-image {
    display: block;
}

.image-frame.editing {
    pointer-events: auto;
    cursor: grab;
}

.image-frame img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    border-radius: inherit;
    cursor: inherit;
}

/* Remove resize handle visuals; resizing now occurs via edges */
.resize-handle {
    display: none;
}

.canvas-area.drag-over {
    box-shadow: inset 0 0 0 2px rgba(56, 189, 248, 0.5);
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.control-group label {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.value-display {
    color: var(--accent-color);
    font-family: 'Roboto Mono', monospace;
}

/* Custom Range Slider Styling */
input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    background: transparent;
}

input[type=range]:focus {
    outline: none;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

input[type=range]::-webkit-slider-thumb {
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: -7px;
    box-shadow: 0 0 10px var(--accent-glow);
    transition: transform 0.1s ease;
}

input[type=range]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

input[type=range]::-moz-range-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

input[type=range]::-moz-range-thumb {
    height: 20px;
    width: 20px;
    border: none;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    box-shadow: 0 0 10px var(--accent-glow);
}

/* SVG Elements Styling */
.wheel {
    fill: none;
    stroke: #000000;
    stroke-width: 2;
    transition: all 0.3s ease;
}

.snapshot-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: white;
    opacity: 0;
    pointer-events: none;
    z-index: 9999;
    transition: opacity 0.5s ease-out;
}

.wheel-center {
    fill: var(--accent-color);
}

.chassis-line {
    stroke: rgba(0, 0, 0, 0.6);
    stroke-width: 2;
    stroke-dasharray: 5, 5;
}

/* Human Figure Canvas Layer */
.bodyandhead-parent,
.passenger-parent {
    width: 1920px;
    height: 1080px;
    position: absolute;
    top: 0;
    left: 0;
    background-color: transparent;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.bodyandhead-icon {
    position: absolute;
    top: 109.97px;
    left: 937.23px;
    width: 351.2px;
    height: 609.8px;
    display: block;
}

.big-leg-icon {
    position: absolute;
    top: 579.94px;
    left: 657.59px;
    border-radius: 100px;
    width: 406px;
    height: 134.7px;
    opacity: 0.5;
    display: block;
}

.bigarm-icon {
    position: absolute;
    top: 299.54px;
    left: 939.81px;
    border-radius: 100px;
    width: 264px;
    height: 167.5px;
    opacity: 0.5;
    display: block;
}

.small-leg-icon {
    position: absolute;
    top: 587.22px;
    left: 325px;
    width: 407.2px;
    height: 359.2px;
    opacity: 0.5;
    display: block;
}

.small-arm-icon {
    position: absolute;
    top: 383.76px;
    left: 631.92px;
    width: 358.9px;
    height: 88.8px;
    display: block;
}

.bodyandhead-icon svg,
.big-leg-icon svg,
.bigarm-icon svg,
.small-leg-icon svg,
.small-arm-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.bodyandhead-icon svg path,
.big-leg-icon svg path,
.bigarm-icon svg path,
.small-leg-icon svg path,
.small-arm-icon svg path {
    fill: #000000 !important;
}

/* Joint Markers */
.hip-joint-parent {
    position: absolute;
    top: 99px;
    left: 397px;
    width: 839.8px;
    height: 814.8px;
}

.hip-joint {
    position: absolute;
    top: 542.85px;
    left: 591.97px;
    border-radius: 50%;
    background-color: #ef4444;
    /* Red */
    width: 21.8px;
    height: 21.8px;
}

.elbow {
    position: absolute;
    top: 331.64px;
    left: 557.38px;
    border-radius: 50%;
    background-color: #04ff00;
    width: 21.8px;
    height: 21.8px;
    display: none;
}

.shoulder-joint {
    position: absolute;
    top: 224.21px;
    left: 759.49px;
    border-radius: 50%;
    background-color: #04ff00;
    width: 21.8px;
    height: 21.8px;
    display: none;
}

.knee {
    position: absolute;
    top: 515.53px;
    left: 284.26px;
    border-radius: 50%;
    background-color: #04ff00;
    width: 21.8px;
    height: 21.8px;
    display: none;
}

.hip-joint,
.hand-anchor,
.top-head,
.heel {
    display: none !important;
}

.hand-anchor {
    position: absolute;
    top: 307px;
    left: 256px;
    border-radius: 50%;
    background-color: #ffff00;
    /* Yellow */
    width: 21.8px;
    height: 21.8px;
    display: none;
}

.bottom-foot {
    position: absolute;
    top: 793px;
    left: 0px;
    border-radius: 50%;
    background-color: #04ff00;
    width: 21.8px;
    height: 21.8px;
    display: none;
}

/* Smart Hover & Selection */
.bodyandhead-parent .bodyandhead-icon,
.bodyandhead-parent .big-leg-icon,
.bodyandhead-parent .bigarm-icon,
.bodyandhead-parent .small-leg-icon,
.bodyandhead-parent .small-arm-icon,
.passenger-parent-mid .bodyandhead-icon,
.passenger-parent-mid .big-leg-icon,
.passenger-parent-mid .small-leg-icon,
.passenger-parent-last .bodyandhead-icon,
.passenger-parent-last .big-leg-icon,
.passenger-parent-last .small-leg-icon {
    pointer-events: auto;
}

.bodyandhead-parent.is-hovered,
.passenger-parent-mid.is-hovered,
.passenger-parent-last.is-hovered {
    opacity: 0.8 !important;
    /* Non-selected hover state */
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.bodyandhead-parent.is-active,
.passenger-parent-mid.is-active,
.passenger-parent-last.is-active {
    opacity: 1.0 !important;
    /* Selected state */
}

.bodyandhead-parent.is-inactive,
.passenger-parent-mid.is-inactive,
.passenger-parent-last.is-inactive {
    opacity: 0.6;
    /* Non-selected state */
    transition: opacity 0.3s ease;
}

.driver-anchor-layer,
.passenger-anchor-layer {
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
}

.driver-anchor,
.passenger-anchor {
    position: absolute;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
    cursor: pointer;
    box-shadow: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    display: none;
    pointer-events: auto;
}

.driver-anchor.is-visible,
.passenger-anchor.is-visible {
    display: block;
}

.driver-anchor.is-active,
.driver-anchor:hover,
.passenger-anchor.is-active,
.passenger-anchor:hover {
    transform: translate(-50%, -50%) scale(1.35);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.9);
}

.bodyandhead-parent.show-driver-anchors .top-head,
.bodyandhead-parent.show-driver-anchors .heel,
.passenger-parent.show-passenger-anchors .top-head,
.passenger-parent.show-passenger-anchors .heel {
    display: block;
}

.point-tooltip {
    position: absolute;
    background: #ffffff;
    color: #000000;
    padding: 0.25rem 0.5rem;
    border-radius: 0.35rem;
    font-size: 0.75rem;
    font-family: 'Roboto Mono', monospace;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    pointer-events: none;
    transform: translate(-50%, -100%);
    margin-bottom: 8px;
    white-space: nowrap;
    z-index: 5;
    display: none;
}

.spline-menu {
    position: absolute;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0.35rem;
    padding: 0.25rem;
    gap: 0.25rem;
    box-shadow: 0 10px 20px rgba(2, 6, 23, 0.5);
    z-index: 6;
}

.spline-menu button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.35rem;
    text-align: left;
    cursor: pointer;
}

.spline-menu button:hover,
.spline-menu button.active {
    background: rgba(56, 189, 248, 0.15);
    color: var(--text-primary);
}

.menu-button-danger:hover {
    background: rgba(248, 113, 113, 0.15);
    color: #fee2e2;
}

/* Hide old sidebar */
.layer-panel {
    display: none !important;
}

#profileBarContainer {
    position: absolute;
    top: auto;
    bottom: var(--profile-bar-bottom, 360px);
    /* Raised above the controls area; JS updates var */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: flex-end;
    gap: 20px;
    z-index: 1000;
    pointer-events: none;
    /* Allow clicks to pass through container */
    transition: transform 0.3s ease;
}

.profile-bar {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    justify-content: flex-start;
    /* Ensure content starts at top */
    padding: 10px 21px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 30px;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    pointer-events: auto;
    transition: all 0.3s ease;
    height: 44px;
    width: fit-content;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
    box-sizing: border-box;
    /* Ensure padding is included in height */
}

.profile-bar.active {
    cursor: default;
}

.profile-bar:not(.active) {
    opacity: 0.7;
    transform: scale(0.95);
    height: 35px;
    /* Shorter height for inactive */
    padding: 0 21px;
    /* Remove vertical padding to center text */
    justify-content: center;
    /* Center text vertically */
}

.profile-bar:not(.active):hover {
    opacity: 1;
    transform: scale(1);
}

.profile-bar.active:hover {
    height: 77px;
    box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.25);
    padding-top: 10px;
    /* Ensure top padding stays consistent */
}

.chassis-controls-overlay,
.driver-controls-overlay,
.passenger-controls-overlay,
.profile-controls-overlay {
    position: absolute;
    bottom: 110px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 0;
    z-index: 100;
    align-items: center;
    pointer-events: none;
    /* Let clicks pass through to canvas */
    transition: opacity 0.3s ease, visibility 0.3s;
}

.passenger-subset-controls {
    position: static;
    transform: none;
    bottom: auto;
    left: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.chassis-controls-overlay .control-row,
.driver-controls-overlay .control-row,
.passenger-controls-overlay .control-row,
.profile-controls-overlay .control-row,
.passenger-options-popup,
/* Ensure popup works if inside */
.smart-adjuster,
.smart-toggle,
.smart-button {
    pointer-events: auto;
    /* Re-enable for controls */
}

.profile-controls-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none !important;
}

.profile-controls-overlay .control-row {
    gap: 10px;
}

.profile-controls-overlay .smart-button,
.profile-controls-overlay .smart-toggle,
.profile-controls-overlay .smart-adjuster {
    pointer-events: auto;
}

#profileControls {
    position: absolute;
    top: 27px;
    right: 40px;
    height: 35px;
    /* Match height of blind zone display */
    display: flex;
    gap: 20px;
    z-index: 1000;
    align-items: center;
}

#profileLimitMessage {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #f87171;
}

#createNewProfileBtn,
#uploadProfileBtn {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 300;
    text-decoration: underline;
    color: #000000;
    opacity: 0.7;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

#createNewProfileBtn:hover,
#uploadProfileBtn:hover {
    opacity: 1;
}

.dimension-top-row {
    display: flex;
    align-items: center;
    gap: 26px;
    width: 100%;
    justify-content: center;
    height: 24px;
}

.profile-name {
    font-size: 12px;
    font-weight: 400;
    color: #000000;
    white-space: nowrap;
}

.profile-bar.active .profile-name {
    cursor: pointer;
}

.profile-bar.active .profile-name:hover {
    text-decoration: underline;
}

.profile-options {
    display: flex;
    width: 100%;
    justify-content: center;
    gap: 27px;
    padding-left: 0;
    margin-bottom: 14px;
    opacity: 0;
    transition: opacity 0.2s ease 0.1s;
}

.profile-bar.active:hover .profile-options {
    opacity: 1;
}

.profile-option {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 300;
    text-decoration: underline;
    color: #000000;
    opacity: 0.7;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.2s ease;
}

.profile-option:hover {
    opacity: 1;
}

.profile-option.danger {
    color: #850000;
}

.dimension-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 300;
    letter-spacing: -0.352px;
    color: #000000;
    opacity: 0.5;
    white-space: nowrap;
}

.dim-label {
    font-weight: inherit;
    color: inherit;
}

.dim-value {
    font-weight: inherit;
    color: inherit;
}

.align-top-bar {
    position: absolute;
    top: 27px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 21px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 30px;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    z-index: 1100;
}

.align-label {
    font-size: 14px;
    font-weight: 300;
    color: #4a4a4a;
}

.align-input-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.align-input {
    width: 140px;
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
    background: transparent;
    font-size: 16px;
    font-weight: 300;
    color: #000;
    text-align: center;
    padding: 4px 0;
}

.align-helper-text {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 4px;
    font-size: 12px;
    color: #888;
    font-weight: 300;
    white-space: nowrap;
    pointer-events: none;
}

.align-input:focus {
    outline: none;
    border-bottom-color: #000;
}

.align-confirm-btn {
    border: none;
    background: #000;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 300;
    letter-spacing: 0.01em;
    padding: 6px 20px;
    border-radius: 999px;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.align-confirm-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.controls-infill {
    position: absolute;
    left: 0;
    right: 0;
    top: max(0px, calc(100% - var(--controls-backdrop-offset, 320px)));
    bottom: 0px;
    background: rgba(217, 217, 217, 0.65);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 50;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 100px);
    mask-image: linear-gradient(to bottom, transparent, black 100px);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.controls-infill.visible {
    opacity: 1;
}

.align-cancel {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    border: none;
    padding: 10px 32px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    z-index: 1200;
    color: #000;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.align-dots-layer {
    position: absolute;
    inset: 0;
    z-index: 5;
}

.align-dots-layer {
    pointer-events: none;
}

.align-dots-layer .align-dot {
    pointer-events: auto;
}

.align-dot {
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #2563eb;
    border: 2px solid #fff;
    transform: translate(-50%, -50%);
    pointer-events: auto;
    cursor: grab;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.align-dot:active {
    cursor: grabbing;
}

body.align-mode #carCanvas,
body.align-mode .canvas-content,
body.align-mode #dimensionDisplay,
body.align-mode .controls-infill,
body.align-mode .layer-list,
body.align-mode .chassis-controls-overlay,
body.align-mode .driver-controls-overlay,
body.align-mode .passenger-controls-overlay,
body.align-mode .image-controls-overlay,
body.align-mode .blind-zone-display {
    opacity: 0;
    visibility: hidden;
    pointer-events: none !important;
}

body.align-mode .align-cancel {
    display: block;
}

body.align-mode #alignTopBar:not(.hidden) {
    display: flex;
}

body.align-mode #carCanvas {
    transition: opacity 0.2s ease;
}

.blind-zone-display {
    position: absolute;
    top: 27px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 21px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 30px;
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
    border: none;
    box-shadow: none;
    z-index: 1000;

    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 300;
    color: rgba(0, 0, 0, 0.4);

    white-space: nowrap;
    pointer-events: none;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease, visibility 0.3s;

    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-sizing: border-box;

    /* Inactive state */
    opacity: 0.7;
}

.blind-zone-display.hidden {
    opacity: 0;
    visibility: hidden;
}

.blind-zone-display:hover {
    opacity: 0.7;
    background: rgba(255, 255, 255, 0.65);
}

.blind-zone-display.active {
    color: rgba(0, 0, 0, 0.6);
    background: rgba(255, 255, 255, 0.5);
    opacity: 1;
    box-shadow: none;
}

.blind-zone-display.active:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    color: #000000;
}

.blind-zone-display.hidden {
    opacity: 0;
    visibility: hidden;
}

.assist-lines-group {
    transition: opacity 0.3s ease;
    opacity: 1;
}

.assist-lines-group.assist-hidden {
    opacity: 0;
}

/* Passenger Adjuster Styles */
.passenger-adjuster-wrapper {
    display: flex;
    align-items: flex-end;
    /* Ensure it aligns with other buttons */
}

/* Override .layer-list alignment if needed, but wrapper handles it */
.layer-list {
    align-items: flex-end;
}

.passenger-adjuster {
    /* Override smart-adjuster default dimensions for the button state */
    width: auto;
    min-width: unset;
    min-height: unset;
    padding: 0;
    margin: 0;
    background: transparent !important;
    opacity: 1 !important;
    box-shadow: none !important;
    border-radius: 0;
    flex-direction: column-reverse;
    /* Expand upwards */
    height: auto;
}

.passenger-adjuster .adjuster-label {
    /* Match .layer-button styles */
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: 20px;
    color: rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid transparent;
    padding: 2px 10px;
    margin: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: capitalize;
    pointer-events: auto;
    /* Enable click for layer switch */
    white-space: nowrap;
}

.passenger-adjuster.active .adjuster-label {
    color: #000000;
    border-color: #000000;
}

/* Hover State - Expand */
.passenger-adjuster:hover {
    background: rgba(255, 255, 255, 0.9) !important;
    box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.1) !important;
    backdrop-filter: blur(4px);
    border-radius: 20px;
    padding: 10px;
    min-width: 140px;
    /* Restore standard width on hover */
    z-index: 10;
    /* Bring to front */
    transform: translateY(0px);
    /* Adjust if needed */
    margin-bottom: 0px;
}

.passenger-adjuster:hover .adjuster-label {
    font-size: 14px;
    /* Shrink to standard label size? */
    color: #000000;
    border-bottom: none;
    margin-bottom: 0px;
    margin-top: 4px;
    /* Since reversed */
}

.passenger-adjuster .adjuster-value {
    display: none;
}

.passenger-adjuster:hover .adjuster-value {
    display: block;
    font-size: 16px;
    margin-bottom: 4px;
    /* Top since reversed */
}

/* Knob Container */
.passenger-adjuster .adjuster-knob-container {
    height: 0;
    opacity: 0;
    margin: 0;
}

.passenger-adjuster:hover .adjuster-knob-container {
    height: 24px;
    opacity: 1;
    margin: 4px 0;
}


/* Dropdown for passenger button */
.layer-button-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.passenger-options-popup {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);

    /* Match blind-zone-display style */
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 30px;
    padding: 0 21px;
    /* Horizontal padding, height handles vertical */
    height: 44px;
    box-shadow: none;
    border: none;

    display: flex;
    flex-direction: row;
    /* Keep text and numbers in same row */
    align-items: center;
    gap: 20px;

    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease, visibility 0.2s ease 0.5s;
    /* Add delay */
    transition-delay: 0.3s;
    /* Ensure delay works */
    white-space: nowrap;
}

.passenger-options-popup::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 6px;
    /* Bridge the gap without blocking button */
    /* Bridge the gap */
    background: transparent;
}

.layer-button-wrapper:hover .passenger-options-popup {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(-5px);
    /* Raised 5px higher than 0 (which was prev hover state) - wait previously it was translateY(0) on hover and -10px initial. 
    User said "hove the bar 5 px higher".
    Initial was -10px. Hover was 0.
    If I want it higher on hover, maybe -5px? 
    Or does user mean initial position? "hove the bar 5 px higher" -> maybe lift it up more?
    Let's assumes hover state should be 5px higher. So translateY(-5px).
    */
    transition-delay: 0s;
    /* No delay on appear */
}

.passenger-options-label {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 300;
    color: rgba(0, 0, 0, 0.7);
}

.passenger-row-options {
    display: flex;
    gap: 30px;
    align-items: center;
}

.passenger-row-tabs-btn {
    background: transparent;
    border: none;
    padding: 0;
    width: auto;
    height: auto;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    /* User requested 14 font */
    font-weight: 300;
    cursor: pointer;
    transition: color 0.2s ease, opacity 0.2s ease;

    /* Default state: slightly dimmed */
    color: #000000;
    opacity: 0.4;
}

.passenger-row-tabs-btn:hover {
    background: transparent;
    opacity: 0.7;
}

.passenger-row-tabs-btn.active {
    background: transparent;
    border: none;
    color: #000000;
    opacity: 1;
    font-weight: 500;
}