body, html, #root {
    margin: 0;
    padding: 0;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    background: #ffffff;
    color: #111111;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    display: flex;
    flex-direction: column;
}

/* Hide all scrollbars globally across all elements */
*::-webkit-scrollbar,
::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

* {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

button, textarea, input, select {
    font-family: inherit;
    box-sizing: border-box;
}

/* ==========================================================
   Global Link Reset (Monochrome)
   ========================================================== */

a, a:visited, a:active {
    color: #111111;
    text-decoration: none;
}

a:hover {
    color: #555555;
}

/* ==========================================================
   mini.css Button: Clean small Monochrome Style
   ========================================================== */

button, [type="button"], [type="submit"], [type="reset"], .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    border: 1px solid #111111;
    background: #ffffff;
    color: #111111;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
    user-select: none;
    margin: 0;
}

button:active, .button:active {
    background: #e5e5e5;
}

button:disabled, .button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    border-color: #cccccc;
    color: #888888;
}

/* ==========================================================
   Unified Top-Level Container (Fills exact remaining viewport)
   ========================================================== */

.container {
    flex: 1 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: calc(100vh - 40px) !important;
    max-height: calc(100vh - 40px) !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
}


/* Modal Styles */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 20px 24px;
    position: relative;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    min-width: 300px;
}

.modal-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    font-size: 14px;
    color: #888888;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

.modal-close-btn:hover {
    color: #111111;
}

.modal-card-loading {
    min-width: auto;
    padding: 16px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.modal-loading-box {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.modal-loading-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: #111111;
    border-radius: 50%;
    animation: modal-spin 0.6s linear infinite;
}

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

.modal-auth-box {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-auth-desc {
    font-size: 12px;
    color: #666666;
    line-height: 1.5;
}

.modal-google-btn-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 0;
    min-height: 44px;
}

.modal-setting-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Feedback Modal Box */
.modal-feedback-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 360px;
    max-width: 90vw;
}

.modal-feedback-box h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #111111;
}

.feedback-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.feedback-field label {
    font-size: 11px;
    font-weight: 600;
    color: #555555;
}

.feedback-field input,
.feedback-field select,
.feedback-field textarea {
    width: 100%;
    padding: 6px 8px;
    font-size: 12px;
    border: 1px solid #dddddd;
    border-radius: 4px;
    box-sizing: border-box;
    background: #ffffff;
    color: #111111;
    font-family: inherit;
}

.feedback-field textarea {
    resize: vertical;
    min-height: 80px;
}

.feedback-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}

.feedback-submit-btn {
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 600;
    background: #111111;
    color: #ffffff;
    border: 1px solid #111111;
    border-radius: 4px;
    cursor: pointer;
}

.feedback-submit-btn:hover {
    background: #333333;
}

.feedback-status-msg {
    font-size: 12px;
    color: #e11d48;
    background: #ffe4e6;
    padding: 6px 10px;
    border-radius: 4px;
}

/* Lightweight Pure Minimalist Toast */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: 380px;
}

.toast-item {
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.4;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: toast-slide-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    transition: opacity 0.2s, transform 0.2s;
    user-select: none;
}

.toast-info {
    background: #111111;
    color: #ffffff;
    border: 1px solid #333333;
}

.toast-error {
    background: #ffffff;
    color: #111111;
    border: 2px solid #111111;
    font-weight: 500;
}

.toast-text {
    flex: 1;
    margin-right: 12px;
    word-break: break-word;
}

.toast-close-btn {
    background: transparent !important;
    border: none !important;
    color: inherit !important;
    font-size: 18px !important;
    padding: 0 !important;
    margin: 0 !important;
    cursor: pointer;
    line-height: 1;
    opacity: 0.7;
}

.toast-close-btn:hover {
    opacity: 1;
}

@keyframes toast-slide-in {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
/* minicss reset */
nav a, nav a:visited {
    color: black;
}


.nav {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 0;
    border-bottom: 1px solid #eeeeee;
    margin: 0;
    padding: 0 16px;
    flex-shrink: 0;
    background: #ffffff;
    user-select: none;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-brand {
    text-decoration: none;
    color: #111111;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: -0.3px;
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
}

.nav-brand-beta {
    font-size: 10px;
    font-weight: 500;
    color: #888888;
    text-transform: lowercase;
}

.nav-divider {
    color: #dddddd;
    font-size: 12px;
}

.nav-slash {
    color: #cbd5e1;
    font-size: 13px;
    margin: 0 -4px;
}

.nav-project-name-input {
    background: transparent;
    border: none;
    border-bottom: 1px solid #eeeeee;
    border-radius: 0;
    padding: 1px 4px;
    font-size: 13px;
    font-weight: 500;
    color: #0f172a;
    outline: none;
    font-family: inherit;
    width: 150px;
    transition: all 0.15s ease;
}

.nav-project-name-input:hover {
    border-bottom-color: #cbd5e1;
    background: transparent;
}

.nav-project-name-input:focus {
    background: transparent;
    border-bottom-color: #0f172a;
    box-shadow: none;
    width: 220px;
}

.nav-project-actions {
    display: inline-flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    padding: 2px 4px;
    margin-left: 4px;
    gap: 2px;
}

.nav-action-btn {
    background: transparent;
    border: none;
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    line-height: 1.2;
    transition: all 0.15s ease;
    outline: none;
}

.nav-action-btn:hover:not(:disabled) {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.nav-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nav-action-divider {
    width: 1px;
    height: 12px;
    background: #e2e8f0;
    margin: 0 2px;
}

.nav-link {
    text-decoration: none;
    color: #666666;
    font-size: 13px;
    transition: color 0.15s;
}

.nav-link:hover {
    color: #000000;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-lang-select {
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    outline: none;
    font-family: inherit;
    transition: all 0.15s ease;
}

.nav-lang-select:hover {
    border-color: #0f172a;
    color: #0f172a;
}

.nav-lang-select option {
    background: #ffffff;
    color: #0f172a;
}

.nav-btn-link {
    background: transparent;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.15s;
}

.nav-btn-link:hover {
    opacity: 0.8;
}

.nav-user-status {
    font-family: monospace;
    font-size: 12px;
    color: #111111;
}

.nav-login-link {
    font-size: 12px;
    color: #555555;
    text-decoration: underline;
}
/* Minimalist Monochrome Compass Overlay */
.compass-container {
    position: relative;
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 50;
    transition: transform 0.15s ease;
    user-select: none;
    margin: 0;
}

.compass-container:hover {
    transform: scale(1.1);
}

.compass-container:active {
    transform: scale(0.92);
}

.compass-svg {
    width: 26px;
    height: 26px;
    pointer-events: none;
    transition: transform 0.05s linear;
}

.compass-text-n {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 11px;
    font-weight: 800;
    fill: #0f172a;
    user-select: none;
}

.compass-text-s {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 9px;
    font-weight: 600;
    fill: #94a3b8;
    user-select: none;
}

/* Projects Page Cards */
.projects-page {
    flex: 1;
    width: 100%;
    height: 100%;
    padding: 16px;
    box-sizing: border-box;
    overflow-y: auto;
}

.project-new-card {
    min-height: 190px;
    border: 1px dashed #cccccc;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-align: center;
    box-sizing: border-box;
    padding: 0;
    margin-bottom: 12px;
}

.project-new-card:hover {
    border-color: #888888;
}

.project-new-icon {
    font-size: 32px;
    line-height: 1;
    margin-bottom: 8px;
    color: #666666;
}

.project-new-label {
    font-size: 13px;
    color: #333333;
}

/* Project Card */
.project-card {
    min-height: 190px;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    box-sizing: border-box;
    margin-bottom: 12px;
}

/* Thumbnail Box */
.project-thumb-box {
    width: 100%;
    height: 120px;
    background-position: center;
}

/* Delete Button on Card */
.project-card-del-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid #dddddd;
    color: #888888;
    border-radius: 3px;
    padding: 2px 6px;
    font-size: 11px;
    cursor: pointer;
    line-height: 1;
    z-index: 2;
}

.project-card-del-btn:hover {
    background: #ff4d4f;
    color: #ffffff;
    border-color: #ff4d4f;
}

/* Card Body */
.project-card-body {
    padding: 8px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #ffffff;
}

.project-card-name {
    font-size: 13px;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-card-meta {
    font-size: 11px;
    color: #888888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Welcome Page Styles */

.welcome-page {
    flex: 1;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    box-sizing: border-box;
    background: #ffffff;
}

.welcome-hero {
    max-width: 680px;
    text-align: center;
    margin-bottom: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.welcome-title {
    font-size: 28px;
    font-weight: 800;
    color: #09090b;
    letter-spacing: -0.6px;
    line-height: 1.25;
    margin: 0 0 14px 0;
}

.welcome-desc {
    font-size: 14px;
    line-height: 1.6;
    color: #71717a;
    margin: 0 0 24px 0;
    max-width: 540px;
}

.welcome-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.welcome-btn-primary,
.welcome-btn-primary:visited,
.welcome-btn-primary:link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 4px;
    text-decoration: none;
    background: #ffffff !important;
    color: #111111 !important;
    border: 1px solid #111111 !important;
    transition: all 0.15s ease;
}

.welcome-btn-primary:hover {
    background: #f4f4f4 !important;
    color: #111111 !important;
    border-color: #111111 !important;
}

.welcome-btn-arrow {
    margin-left: 4px;
    transition: transform 0.15s ease;
}

.welcome-btn-primary:hover .welcome-btn-arrow {
    transform: translateX(2px);
}

/* Feature Cards Grid */
.welcome-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 860px;
    width: 100%;
}

@media (max-width: 768px) {
    .welcome-grid {
        grid-template-columns: 1fr;
    }
}

.welcome-card {
    background: #fafafa;
    border: 1px solid #eeeeee;
    border-radius: 8px;
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    transition: border-color 0.15s ease;
}

.welcome-card:hover {
    border-color: #cccccc;
}

.welcome-card-title {
    font-size: 14px;
    font-weight: 700;
    color: #18181b;
    margin-bottom: 6px;
}

.welcome-card-desc {
    font-size: 12px;
    line-height: 1.5;
    color: #71717a;
}
/* ── Right Panel (Chat / Dsl Tabs) ─────────────────────── */

.right-panel {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    background: #ffffff;
    border-left: 1px solid #eeeeee;
    box-sizing: border-box;
    overflow: hidden;
}

.right-panel .button-group {
    display: flex;
    flex-shrink: 0;
    height: 38px;
    border: 0;
    margin: 0;
}

.right-panel .button-group button.active {
    color: #111111;
    font-weight: 600;
    background: #ffffff;
}

.right-panel .tab-content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    overflow: hidden;
}
.dimensions-card {
    position: absolute;
    top: 56px;
    right: 16px;
    width: 220px;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(226, 232, 240, 0.6);
    border-radius: 6px;
    padding: 8px 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    z-index: 100;
    user-select: text;
}

.dimensions-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 12px;
    color: #1e293b;
    margin-bottom: 6px;
    border-bottom: 1px solid rgba(241, 245, 249, 0.8);
    padding-bottom: 4px;
}

.dimensions-card-title {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 11px;
    color: #0f172a;
}

.dimensions-card-close {
    cursor: pointer;
    color: #94a3b8;
    font-size: 12px;
    padding: 1px 4px;
    border-radius: 3px;
    transition: all 0.1s;
}

.dimensions-card-close:hover {
    color: #ef4444;
    background: rgba(254, 226, 226, 0.6);
}

.dimensions-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #475569;
    margin-bottom: 2px;
    padding: 1px 0;
}

.param-label {
    font-size: 10px;
    color: #64748b;
}

.param-value {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 10px;
    font-weight: 600;
    color: #0f172a;
}

.dimensions-card-divider {
    height: 1px;
    background: rgba(241, 245, 249, 0.8);
    margin: 6px 0;
}

.param-inputs-row {
    display: flex;
    gap: 4px;
    margin-top: 2px;
    margin-bottom: 6px;
}

.param-input-group {
    display: flex;
    flex: 1;
    align-items: center;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(203, 213, 225, 0.8);
    border-radius: 4px;
    padding: 2px 4px;
}

.param-input-tag {
    font-size: 9px;
    font-weight: 700;
    color: #64748b;
    margin-right: 2px;
}

.param-input-field {
    width: 100%;
    border: none;
    background: transparent;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 10px;
    color: #0f172a;
    outline: none;
}

.param-input-field:focus {
    color: #2563eb;
    font-weight: 600;
}

.delete-part-btn {
    width: 100%;
    margin-top: 4px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    background: transparent;
    border: 1px solid rgba(203, 213, 225, 0.6);
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.12s ease;
}

.delete-part-btn:hover {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
}

/* ── 2D SVG Vector Overlay & Live Dimension Ticks (Pascal-inspired) ── */

.viewport-2d-svg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 20;
    overflow: visible;
}

.dim-svg-line {
    stroke: #64748b;
    stroke-width: 1.0;
    vector-effect: non-scaling-stroke;
}

.dim-svg-line.selected {
    stroke: #2563eb;
    stroke-width: 1.5;
}

.dim-extension-line {
    stroke: rgba(148, 163, 184, 0.6);
    stroke-width: 0.75;
    stroke-dasharray: 2, 2;
    vector-effect: non-scaling-stroke;
}

.dim-tick-mark {
    stroke: #475569;
    stroke-width: 1.25;
    stroke-linecap: square;
    vector-effect: non-scaling-stroke;
}

.dim-tick-mark.selected {
    stroke: #1d4ed8;
    stroke-width: 2.0;
}

.dim-label-container {
    pointer-events: none;
    user-select: none;
}

.dim-label-badge {
    fill: rgba(255, 255, 255, 0.95);
    stroke: rgba(148, 163, 184, 0.5);
    stroke-width: 0.75;
    rx: 2px;
    ry: 2px;
    filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.05));
}

.dim-label-badge.selected {
    stroke: #2563eb;
    fill: #ffffff;
    stroke-width: 1.2;
}

.dim-label-text {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 9.5px;
    font-weight: 500;
    fill: #334155;
    text-anchor: middle;
    dominant-baseline: central;
    user-select: none;
}

.dim-label-text.selected {
    font-weight: 700;
    fill: #1d4ed8;
}

.dim-contour-outline {
    fill: rgba(248, 250, 252, 0.08);
    stroke: #64748b;
    stroke-width: 1.0;
    vector-effect: non-scaling-stroke;
    pointer-events: none;
}

.dim-contour-outline.selected {
    fill: rgba(59, 130, 246, 0.08);
    stroke: #2563eb;
    stroke-width: 2.0;
}

/* ── Interactive 2D/3D Draft Tool Overlay (Pascal/Editor style) ── */

.draft-svg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 25;
    overflow: visible;
}

.draft-line-solid {
    stroke: #2563eb;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.draft-line-preview {
    stroke: #3b82f6;
    stroke-width: 2;
    stroke-dasharray: 4, 3;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
}

.draft-polygon-preview {
    fill: rgba(59, 130, 246, 0.12);
    stroke: #2563eb;
    stroke-width: 2;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.draft-closing-preview {
    stroke: #10b981;
    stroke-width: 2;
    stroke-dasharray: 3, 3;
    vector-effect: non-scaling-stroke;
}

.draft-node-circle {
    fill: #ffffff;
    stroke: #2563eb;
    stroke-width: 2.5;
    cursor: pointer;
    transition: transform 0.1s ease;
}

.draft-node-first {
    fill: #10b981;
    stroke: #ffffff;
    stroke-width: 2.5;
}

.draft-cursor-point {
    fill: #3b82f6;
    stroke: #ffffff;
    stroke-width: 2;
    filter: drop-shadow(0 0 4px rgba(59, 130, 246, 0.6));
}

.draft-status-badge {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(8px);
    color: #f8fafc;
    font-size: 11.5px;
    font-weight: 500;
    padding: 6px 16px;
    border-radius: 20px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 60;
    user-select: none;
    pointer-events: none;
    letter-spacing: 0.01em;
}

.draft-status-badge kbd {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    padding: 1px 6px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 600;
}

.draft-opening-ghost {
    pointer-events: none;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
}


.panel-editor-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #ffffff;
}

/* Floating Toolbars Stack */
.cad-tools-toolbar-stack {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    pointer-events: none;
}

.cad-tools-toolbar {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(8px);
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 3px 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    pointer-events: auto;
}

.cad-tools-divider {
    width: 1px;
    height: 14px;
    background: #e2e8f0;
    margin: 0 4px;
}

/* 3D Viewport wrapper */
.panel-editor-viewport {
    position: relative;
    width: 100%;
    height: 100%;
    flex: 1;
    overflow: hidden;
}

.viewport-3d-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.render-canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: grab;
}

.render-canvas:active {
    cursor: grabbing;
}

/* Floating 2D/3D Viewport Mode Switcher & Compass in Bottom-Right Corner */
.viewport-mode-switcher {
    position: absolute;
    bottom: 16px;
    right: 16px;
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 3px;
    gap: 3px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    user-select: none;
}

.mode-switch-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #475569;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.mode-switch-btn:hover:not(.active) {
    background: #f1f5f9;
    color: #0f172a;
}

.mode-switch-btn.active {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
}

.mode-switch-divider {
    width: 16px;
    height: 1px;
    background: #e2e8f0;
    margin: 2px 0;
}

.origin-reset-btn {
    width: 28px;
    height: 28px;
    color: #64748b;
}

.origin-reset-btn:hover {
    color: #0f172a;
    background: #f1f5f9;
}
.cad-actions-group {
    display: flex;
    align-items: center;
    gap: 3px;
}

.cad-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    transition: all 0.12s ease;
}

.cad-action-btn:hover:not(:disabled) {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.cad-action-btn:active:not(:disabled) {
    background: #e2e8f0;
    transform: translateY(1px);
}

.cad-action-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.cad-action-label {
    font-size: 11px;
    font-weight: 500;
    color: #334155;
    letter-spacing: 0.01em;
}

.cad-action-btn:hover:not(:disabled) .cad-action-label {
    color: #0f172a;
}

.cad-action-btn.mode-switch-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 3px 10px;
}

.cad-action-btn.mode-switch-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.cad-action-btn.mode-switch-btn.active {
    background: #0f172a;
    border-color: #0f172a;
}

.cad-action-btn.mode-switch-btn.active .cad-action-label {
    color: #ffffff;
}
/* ── Chat Widget Styles ─────────────────────────────────── */

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    background: #ffffff;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Unified Left-Aligned Message Box with Light Gray Border */
.chat-item {
    display: block;
    width: 100%;
    box-sizing: border-box;
    background: #fafafa;
    border: 1px solid #eeeeee;
    border-radius: 4px;
    padding: 8px 10px;
    font-size: 12px;
    line-height: 1.5;
    color: #111111;
    word-break: break-word;
    white-space: pre-wrap;
}

.chat-role {
    font-weight: 600;
    color: #333333;
    margin-right: 6px;
    user-select: none;
}

.chat-content {
    color: #222222;
}

.chat-input-box {
    border-top: 1px solid #eeeeee;
    padding: 12px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.chat-input-box textarea {
    width: 100%;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 8px 10px;
    font-size: 13px;
    resize: none;
    outline: none;
    background: #ffffff;
    color: #111111;
    transition: border-color 0.15s ease;
    box-sizing: border-box;
}

.chat-input-box textarea:focus {
    border-color: #888888;
}

.chat-input-box button {
    width: 100%;
}
.dsl-editor {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    background: #ffffff;
    overflow: hidden;
}

.dsl-editor-textarea {
    flex: 1;
    height: 100%;
    width: 100%;
    padding: 12px;
    margin: 0;
    border: none;
    outline: none;
    resize: none;
    font-family: monospace;
    font-size: 12px;
    line-height: 1.5;
    background: #ffffff;
    color: #111111;
    box-sizing: border-box;
}
.project {
    display: flex;
    flex-direction: row;
    height: 100%;
    width: 100%;
    overflow: hidden;
    position: relative;
    user-select: none;
}

/* Canvas Area */
.canvas-region {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #ffffff;
}

.viewport-3d-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.render-canvas {
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
}

/* Local Transparent Loading Spinner Overlay inside Viewer */
.viewer-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 40;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.viewer-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(0, 0, 0, 0.08);
    border-top-color: #111111;
    border-radius: 50%;
    animation: viewer-spin 0.6s linear infinite;
}

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

/* Splitter */
.splitter-handle {
    width: 1px;
    cursor: col-resize;
    background: #eeeeee;
    flex-shrink: 0;
    z-index: 10;
    user-select: none;
    transition: background 0.12s;
}

.splitter-handle:hover,
.splitter-handle.dragging {
    background: #111111;
}

/* Top-Right Viewport Actions Floating Button Group */
.viewport-actions-top-right {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 50;
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #cccccc;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.viewport-actions-top-right button {
    border: none;
    border-radius: 0;
}

.viewport-actions-top-right .viewport-btn-divider {
    width: 1px;
    height: 16px;
    background: #e0e0e0;
}

/* Top-Left Viewport Mode Toggle (2D / 3D) */
.viewport-mode-toggle {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 50;
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #cccccc;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.viewport-mode-toggle .mode-btn {
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #444444;
    background: #ffffff;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.viewport-mode-toggle .mode-btn:hover {
    background: #f3f3f5;
    color: #111111;
}

.viewport-mode-toggle .mode-btn.active {
    background: #111111;
    color: #ffffff;
}.cad-primitives-group {
    display: flex;
    align-items: center;
    gap: 3px;
}
