:root {
    --lp-bg: #f3f4f6;
    --lp-surface: #ffffff;
    --lp-text: #111827;
    --lp-muted: #6b7280;
    --lp-border: #e5e7eb;
    --lp-primary: #1f18c0;
    --lp-primary-dark: #161189;
    --lp-primary-soft: #e8e7ff;
    --lp-primary-rgb: 31, 24, 192;
    --lp-accent: #1f18c0;
    --lp-danger: #b91c1c;
    --lp-warning: #92400e;
    --lp-success: #166534;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--lp-bg);
    color: var(--lp-text);
    line-height: 1.5;
}

h1, h2, h3, p {
    margin: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

.lp-shell {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.lp-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--lp-primary);
    color: #f9fafb;
    box-shadow: 0 2px 4px rgba(var(--lp-primary-rgb), 0.35);
}

.lp-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.lp-header-left {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.lp-app-title {
    font-weight: 600;
    font-size: 1.1rem;
}

.lp-project-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    font-size: 0.85rem;
}

.lp-header-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
}

.lp-header-nav a {
    color: #e5e7eb;
    text-decoration: none;
    padding: 6px 0;
}

.lp-header-nav a:hover {
    text-decoration: underline;
}

.lp-nav-divider {
    color: #9ca3af;
}

.lp-user-email {
    color: #e5e7eb;
    font-weight: 600;
}

.lp-main {
    max-width: 1200px;
    margin: 24px auto 40px;
    padding: 0 24px;
}

.lp-project-intro {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.lp-room-switcher--top {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    margin: 0 0 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.lp-project-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.lp-project-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    font-size: 0.9rem;
    color: var(--lp-muted);
}

.lp-meta-label {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
}

.lp-meta-value {
    font-weight: 600;
    color: var(--lp-text);
}

.lp-layout {
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    gap: 20px;
    align-items: flex-start;
}

.lp-column-left,
.lp-column-center,
.lp-column-right {
    width: 100%;
}

@media (max-width: 1024px) {
    .lp-header-inner {
        flex-direction: column;
        align-items: flex-start;
    }
    .lp-room-switcher--top {
        flex-direction: column;
        align-items: stretch;
    }
    .lp-layout {
        grid-template-columns: 1fr;
    }
    .lp-project-intro {
        flex-direction: column;
    }
    .lp-project-meta {
        align-items: flex-start;
    }
}

@media (max-width: 640px) {
    .lp-room-editor form,
    .lp-room-form-grid {
        grid-template-columns: 1fr;
    }
    .lp-button-row,
    .lp-room-switcher {
        flex-direction: column;
        align-items: stretch;
    }
    .lp-button-row .lp-btn,
    .lp-room-switcher .lp-btn,
    .lp-export {
        width: 100%;
    }
}

.lp-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
    padding: 16px 18px 20px;
    border: 1px solid #e5e7eb;
}

.lp-card-title {
    margin: 0 0 4px;
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
}

.lp-card-subtitle {
    margin: 0 0 12px;
    font-size: 0.85rem;
    color: #6b7280;
}

.lp-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.lp-room-view__header {
    align-items: center;
    margin-bottom: 8px;
}

.lp-overline {
    margin: 0;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b7280;
    font-weight: 700;
}

.lp-muted {
    color: #6b7280;
}

.lp-meta {
    color: #6b7280;
    font-size: 0.9rem;
}

.lp-btn-primary {
    background: var(--lp-primary);
    color: #ffffff;
}

.lp-room-editor form,
.lp-room-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    width: 100%;
}

.lp-field {
    min-width: 0;
}

.lp-field label {
    font-size: 0.85rem;
    color: #4b5563;
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}
.lp-field-hint {
    margin-top: 4px;
    font-size: 0.8rem;
    color: #6b7280;
}

input[type="text"],
input[type="password"],
input[type="number"],
select {
    width: 100%;
    padding: 10px 12px;
    font-size: 0.95rem;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    box-sizing: border-box;
    background: #fff;
    min-height: 40px;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: var(--lp-primary);
    box-shadow: 0 0 0 1px rgba(var(--lp-primary-rgb), 0.2);
}

.lp-button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.lp-room-switcher {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
    margin-top: 12px;
}

.lp-room-switcher .lp-field {
    flex: 1;
}

.lp-btn,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    font-size: 0.9rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    background: var(--lp-primary);
    color: #ffffff;
    transition: background 0.15s ease, box-shadow 0.15s ease;
    min-height: 40px;
}

.lp-btn:hover,
button:hover {
    box-shadow: 0 8px 20px rgba(var(--lp-primary-rgb), 0.25);
}

.lp-btn:disabled,
button:disabled {
    opacity: 0.5;
    cursor: default;
    box-shadow: none;
}

.lp-btn-secondary {
    background: #e5e7eb;
    color: #111827;
}

.lp-btn-danger {
    background: #fee2e2;
    color: var(--lp-danger);
}

.lp-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #4b5563;
    cursor: pointer;
    user-select: none;
}

.lp-toggle input {
    display: none;
}

.lp-toggle__slider {
    position: relative;
    width: 40px;
    height: 22px;
    border-radius: 999px;
    background: #e5e7eb;
    transition: background 0.2s ease;
}

.lp-toggle__slider::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease;
}

.lp-toggle input:checked + .lp-toggle__slider {
    background: rgba(var(--lp-primary-rgb), 0.25);
}

.lp-toggle input:checked + .lp-toggle__slider::after {
    transform: translateX(18px);
}

.lp-toggle__label {
    color: #111827;
    font-weight: 600;
}

.lp-btn-ghost {
    background: transparent;
    color: #111827;
    border: 1px solid #d1d5db;
}

.lp-btn-ghost.lp-btn-danger {
    background: #fff5f5;
    border-color: #fca5a5;
    color: var(--lp-danger);
}

.lp-export {
    width: 100%;
    margin-top: 12px;
}

.lp-room-view {
    min-height: 420px;
}

.lp-room-canvas {
    position: relative;
    margin-top: 8px;
    min-height: 360px;
    border-radius: 10px;
    border: 2px solid #e5e7eb;
    background: repeating-linear-gradient(
        45deg,
        #f9fafb,
        #f9fafb 10px,
        #f3f4f6 10px,
        #f3f4f6 20px
    );
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}
.lp-room-surface {
    position: absolute;
    inset: 0;
    z-index: 2;
    overflow: hidden;
    pointer-events: none;
    isolation: isolate;
    background: #ffffff;
}
.lp-room-surface::before {
    content: "";
    position: absolute;
    inset: 0;
    background: transparent;
    z-index: 0;
}
.lp-room-surface,
.lp-lighting-overlay {
    -webkit-clip-path: var(--lp-room-clip, var(--lp-room-clip-fallback, none));
    clip-path: var(--lp-room-clip, var(--lp-room-clip-fallback, none));
}
.lp-room-surface .lamp-instance {
    pointer-events: auto;
}
.lp-room-shape {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 4;
    pointer-events: none;
}
.lp-room-shape polygon {
    fill: transparent;
    stroke: var(--lp-primary);
    stroke-width: 1.8;
}
.lp-room-shape__handle {
    fill: #fff;
    stroke: var(--lp-primary);
    stroke-width: 0.6;
}
.lp-room-edge-labels {
    pointer-events: none;
}
.lp-room-rect {
    position: absolute;
    inset: 10%;
    border: 2px solid var(--lp-primary);
    background: rgba(var(--lp-primary-rgb), 0.12);
    border-radius: 12px;
}

.lp-room-edge-label {
    font-size: 5px;
    font-weight: 700;
    fill: #111827;
    stroke: #ffffff;
    stroke-width: 0.6;
    paint-order: stroke;
}

.lp-room-canvas--empty:empty::before {
    content: "Create a room to start planning.";
    color: #9ca3af;
    font-size: 0.9rem;
}

.lp-fullscreen-shell {
    position: fixed;
    inset: 0;
    background: #0b1f3f;
    padding: 22px;
    display: none;
    z-index: 999;
}
.lp-fullscreen-shell.is-open {
    display: flex;
}
.lp-fullscreen-shell__inner {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 18px;
    align-items: stretch;
}
.lp-fullscreen-canvas {
    position: relative;
    background: #050a14;
    border: 3px solid #e11d48;
    border-radius: 16px;
    padding: 12px;
    display: flex;
}
.lp-fullscreen-canvas .lp-room-view {
    width: 100%;
    margin: 0;
    border: none;
    box-shadow: none;
}
.lp-fullscreen-canvas .lp-room-canvas {
    min-height: 70vh;
    height: calc(100vh - 180px);
    background: #0b1022;
    border: 2px solid #e11d48;
}
.lp-fullscreen-sidebar {
    background: #0c142a;
    border: 3px solid #f5c518;
    border-radius: 14px;
    padding: 12px;
    overflow: auto;
}
.lp-fullscreen-close {
    position: absolute;
    top: 12px;
    right: 16px;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 2px solid #22c55e;
    background: transparent;
    color: #22c55e;
    font-weight: 700;
    cursor: pointer;
}
.lp-fullscreen-close:hover {
    background: rgba(34, 197, 94, 0.12);
}
body.lp-fullscreen-open {
    overflow: hidden;
}

.lp-lighting-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    opacity: var(--lp-wash-opacity, 0.2);
    background: radial-gradient(circle at 50% 50%, rgba(var(--lp-wash-color, 255, 225, 180), 0.35) 0%, rgba(var(--lp-wash-color, 255, 225, 180), 0.08) 40%, rgba(var(--lp-wash-color, 255, 225, 180), 0) 70%);
    transition: opacity 0.3s ease, filter 0.3s ease;
    mix-blend-mode: screen;
    z-index: 1;
}

.lp-lighting-glow {
    position: absolute;
    width: var(--lp-glow-size, 320px);
    height: var(--lp-glow-size, 320px);
    margin-left: calc(var(--lp-glow-size, 320px) / -2);
    margin-top: calc(var(--lp-glow-size, 320px) / -2);
    background: radial-gradient(circle, rgba(255, 238, 200, 0.75) 0%, rgba(255, 214, 170, 0.35) 40%, rgba(255, 214, 170, 0) 75%);
    filter: blur(10px);
    mix-blend-mode: screen;
    opacity: 0.9;
    border-radius: 50%;
    pointer-events: none;
    animation: lp-glow-pulse 2s ease-in-out infinite;
    transform-origin: center center;
    left: 50%;
    top: 50%;
}

.lp-lighting-under {
    filter: saturate(1.05) hue-rotate(-8deg);
}

.lp-lighting-over {
    filter: saturate(1.1) hue-rotate(8deg);
}

@keyframes lp-glow-pulse {
    0%, 100% { transform: scale(0.98); opacity: 0.9; }
    50% { transform: scale(1.03); opacity: 1; }
}

.lp-canvas-placeholder {
    color: #9ca3af;
    font-size: 0.9rem;
}

.room-size-label {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(var(--lp-primary-rgb), 0.12);
    color: var(--lp-primary);
    font-weight: 600;
    font-size: 0.85rem;
}

.lamp-instance {
    position: absolute;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: url('../../assets/img/lamp.png') center/cover no-repeat;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    animation: lp-lamp-pulse 1.5s ease-in-out infinite;
    cursor: grab;
    border: 2px solid #fff;
    z-index: 3;
}

.lamp-instance::after {
    content: "";
    position: absolute;
    width: var(--lp-lamp-glow, 200px);
    height: var(--lp-lamp-glow, 200px);
    margin-left: calc(var(--lp-lamp-glow, 200px) / -2);
    margin-top: calc(var(--lp-lamp-glow, 200px) / -2);
    left: 50%;
    top: 50%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 238, 200, 0.7) 0%, rgba(255, 214, 170, 0.35) 45%, rgba(255, 214, 170, 0) 70%);
    pointer-events: none;
    filter: blur(2px);
    opacity: 0.9;
    animation: lp-torch-flicker 2.4s ease-in-out infinite;
    mix-blend-mode: screen;
}

.lamp-instance:hover::after {
    opacity: 1;
}

.lp-lamp-glow-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

@keyframes lp-torch-flicker {
    0%, 100% { transform: scale(0.98); opacity: 0.9; }
    20% { transform: scale(1.03); opacity: 1; }
    45% { transform: scale(0.97); opacity: 0.82; }
    65% { transform: scale(1.05); opacity: 1; }
    80% { transform: scale(1); opacity: 0.9; }
}

.lamp-instance .delete {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--lp-danger);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

@keyframes lp-lamp-pulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(251, 191, 36, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 22px rgba(251, 191, 36, 0.9);
        transform: scale(1.08);
    }
}

.lp-lamp-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lp-lamp-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 999px;
    background: #f3f4f6;
    border: 1px dashed #d1d5db;
    cursor: grab;
    user-select: none;
}

.lp-lamp-name {
    font-size: 0.9rem;
    font-weight: 500;
}

.lp-lamp-lumens {
    font-size: 0.8rem;
    color: #6b7280;
}

.lp-lamp-icon {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: url('../../assets/img/lamp.png') center/cover no-repeat;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
}
.lp-lamp-toolbar {
    align-items: center;
    gap: 12px;
}
.lp-lamp-toggle-row {
    display: flex;
    justify-content: flex-start;
    margin: 4px 0 8px;
}
.lp-lamp-palette.is-custom #lampListDefault {
    display: none !important;
}
.lp-lamp-palette.is-default #lampListCustom,
.lp-lamp-palette.is-default #customLampControls {
    display: none !important;
}
.lp-custom-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
    margin: 8px 0 4px;
}
.lp-field-inline {
    min-width: 200px;
}
.lp-modern-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #f3f4f6;
    cursor: pointer;
    user-select: none;
    font-weight: 600;
}
.lp-modern-switch input {
    display: none;
}
.lp-modern-switch__track {
    position: relative;
    width: 46px;
    height: 26px;
    border-radius: 999px;
    background: #e5e7eb;
    padding: 4px;
    transition: background 0.2s ease;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
}
.lp-modern-switch__thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(145deg, #ffffff, #e5e7eb);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    transition: transform 0.22s ease;
}
.lp-modern-switch__label {
    color: #374151;
    font-size: 0.9rem;
}
.lp-modern-switch input:checked + .lp-modern-switch__track {
    background: rgba(var(--lp-primary-rgb), 0.25);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
}
.lp-modern-switch input:checked + .lp-modern-switch__track .lp-modern-switch__thumb {
    transform: translateX(20px);
    background: linear-gradient(145deg, var(--lp-primary), #4338ca);
}
.lp-lamp-item.is-custom {
    background: #eef2ff;
    border-color: #c7d2fe;
}
.lp-empty-custom {
    padding: 12px;
    border-radius: 12px;
    border: 1px dashed #cbd5e1;
    background: #f8fafc;
}

.lp-info-section {
    margin-top: 10px;
}

.lp-info-row,
.info-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 4px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}
.lp-info-row strong,
.info-row strong {
    margin-left: auto;
    text-align: right;
    display: block;
}

.lp-info-label {
    color: #6b7280;
}

.lp-info-value {
    font-weight: 500;
}

.lp-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 6px;
}

.lp-badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.lp-badge-optimal {
    background: #dcfce7;
    color: #166534;
}

.lp-badge-error {
    background: #fee2e2;
    color: #b91c1c;
}

.status.ok { color: var(--lp-success); }
.status.warn { color: var(--lp-warning); }
.status.error { color: var(--lp-danger); }

.lp-projects-page {
    display: grid;
    gap: 20px;
}

.lp-projects-hero {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    align-items: start;
}

.lp-hero-copy {
    display: grid;
    gap: 8px;
}

.lp-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.lp-project-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.lp-project-name {
    font-weight: 600;
    font-size: 1rem;
}

.lp-inline-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.lp-inline-form input {
    flex: 1;
    min-width: 160px;
}
.lp-inline-form .lp-choice-row {
    width: 100%;
}
.lp-quick-create .lp-inline-form {
    flex-direction: column;
    align-items: stretch;
}
.lp-quick-create .lp-inline-form input[type="text"],
.lp-quick-create .lp-inline-form .lp-choice-row {
    width: 100%;
}
.lp-quick-create .lp-inline-form button {
    align-self: flex-start;
}

.lp-delete-form {
    margin-top: 10px;
}

.lp-alert {
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(var(--lp-primary-rgb), 0.08);
    border: 1px solid rgba(var(--lp-primary-rgb), 0.18);
    color: var(--lp-primary);
    margin-bottom: 10px;
}

.lp-alert-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.auth-container {
    max-width: 720px;
    margin: 0 auto;
    display: grid;
    gap: 18px;
    padding: 12px 0;
}

.auth-card {
    display: grid;
    gap: 12px;
}

.card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 8px;
    border: none;
    background: var(--lp-primary);
    color: #ffffff;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.btn.primary {
    background: var(--lp-primary);
    color: #fff;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #e5e7eb;
    color: #111827;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.muted {
    color: #6b7280;
}

.alert {
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(var(--lp-primary-rgb), 0.08);
    border: 1px solid rgba(var(--lp-primary-rgb), 0.18);
    color: var(--lp-primary);
}

.alert-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.form-group {
    display: grid;
    gap: 6px;
}

.lp-footer {
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    padding: 10px 24px 16px;
}

.lp-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    justify-items: center;
    text-align: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #6b7280;
}

.lp-footer-legend {
    font-style: italic;
}

.lp-choice-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    margin: 8px 0;
    align-items: stretch;
}

.lp-choice {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: flex-start;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #f9fafb;
    font-size: 0.9rem;
    text-align: left;
}
.lp-choice span {
    flex: 1;
    text-align: left;
}
.lp-choice input {
    margin: 0;
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
}
.lp-choice input[type="radio"],
.lp-choice input[type="checkbox"] {
    width: 14px;
    height: 14px;
    min-width: 14px;
}

.lp-project-mode-pill {
    margin-top: 6px;
}

.lp-floorplan-page {
    display: grid;
    gap: 16px;
}

.lp-floorplan-layout {
    display: grid;
    grid-template-columns: 2fr 320px;
    gap: 16px;
    align-items: flex-start;
}

.lp-floorplan-main {
    display: grid;
    gap: 12px;
}

.lp-floorplan-wrapper {
    position: relative;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: #f9fafb;
}

.lp-floorplan-wrapper img {
    display: block;
    width: 100%;
    height: auto;
    -webkit-user-drag: none;
    user-select: none;
    pointer-events: none;
}

#floorplan-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 2px dashed rgba(var(--lp-primary-rgb), 0.25);
    cursor: crosshair;
    touch-action: none;
    z-index: 1;
    background: transparent;
}

.lp-scale-mode {
    border-color: rgba(var(--lp-primary-rgb), 0.6) !important;
    box-shadow: 0 0 0 2px rgba(var(--lp-primary-rgb), 0.15);
}

.lp-scale-wrapper,
.lp-draw-wrapper {
    outline: 3px solid rgba(var(--lp-primary-rgb), 0.35);
    outline-offset: 2px;
    border-radius: 12px;
    transition: outline 0.15s ease;
}

.lp-floorplan-instructions {
    padding: 8px 4px;
    color: var(--lp-muted);
    font-size: 0.95rem;
}

.lp-floorplan-instructions ol {
    margin: 4px 0;
    padding-left: 18px;
}

.lp-floorplan-sidebar {
    display: grid;
    gap: 12px;
}

.lp-scale-display {
    margin-top: 8px;
    font-weight: 600;
}

.lp-floorplan-room-list {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
    display: grid;
    gap: 8px;
}

.lp-floorplan-room-list li {
    padding: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lp-room-list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.95rem;
}

.lp-room-list-actions {
    display: flex;
    gap: 8px;
}

.lp-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 120;
}
.lp-modal.is-open {
    display: flex;
}
.lp-modal__dialog {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.2);
    width: min(460px, 100%);
    padding: 16px;
}
.lp-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}
.lp-modal__close {
    border: none;
    background: #eef2ff;
    color: var(--lp-primary);
    border-radius: 10px;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 1.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.lp-modal__body {
    display: grid;
    gap: 10px;
    margin-top: 6px;
}
.lp-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 12px;
}

.lp-floorplan-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 12px;
}

.lp-floorplan-modal__card {
    max-width: 360px;
    width: 100%;
}

.lp-error {
    color: var(--lp-danger);
}

@media (max-width: 900px) {
    .lp-floorplan-layout {
        grid-template-columns: 1fr;
    }
}
