
    body { margin: 0; overflow: hidden; background-color: #f0f2f5; font-family: 'Segoe UI', Tahoma, sans-serif; }
    #canvas-container { width: 100vw; height: 100vh; display: block; }

    /* --- DOCK DO CONNECTION LAB --- */
    #lab-toolbar {
        position: absolute; 
        bottom: 30px; 
        left: 50%; 
        transform: translateX(-50%);
        background: rgba(255, 255, 255, 0.95); 
        border: 1px solid #bdc3c7;
        border-radius: 30px; 
        box-shadow: 0 10px 25px rgba(0,0,0,0.15); 
        z-index: 2000; 
        display: none; /* Escondido por padrão */
        padding: 8px 15px;
        align-items: center; 
        gap: 5px;
        backdrop-filter: blur(5px);
    }
    .btn-lab {
        background: transparent; border: none; cursor: pointer; padding: 10px;
        border-radius: 50%; color: #34495e; display: flex; align-items: center; justify-content: center;
        transition: all 0.2s; position: relative;
    }
    .btn-lab:hover { background: #e8f4fd; color: #2980b9; transform: translateY(-2px); }
    .btn-lab.active { background: #3498db; color: white; box-shadow: 0 4px 10px rgba(52, 152, 219, 0.4); }
    .lab-separator { width: 1px; height: 24px; background: #ccc; margin: 0 10px; }
    
    /* --- NOVA TOOLBAR --- */
    #toolbar {
        position: absolute; top: 0; left: 0; width: 100%; height: 50px;
        background: #fff; border-bottom: 1px solid #ccc;
        display: flex; align-items: center; padding: 0 15px; 
        box-shadow: 0 2px 5px rgba(0,0,0,0.1); z-index: 100; box-sizing: border-box;
    }
    .brand { font-weight: bold; font-size: 16px; color: #2c3e50; margin-right: 20px; }
    .tool-separator { width: 1px; height: 30px; background: #eee; margin: 0 10px; }
    .btn-tool {
        background: transparent; border: none; cursor: pointer; padding: 8px;
        border-radius: 4px; color: #555; display: flex; align-items: center; justify-content: center;
        transition: all 0.2s;
    }
    .btn-tool:hover { background: #f0f0f0; color: #2c3e50; }
    .btn-tool.active { background: #e8f4fd; color: #3498db; }
    .btn-tool.danger { color: #e74c3c; }
    .btn-tool.danger:hover { background: #fdebd0; }

    /* --- ESTILOS GLOBAIS DE MODAIS DE FERRAMENTAS --- */
    .tool-modal-overlay {
        position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
        background: rgba(0,0,0,0.6); z-index: 5000;
        display: flex; align-items: center; justify-content: center;
        backdrop-filter: blur(3px);
    }
    .tool-modal-window {
        background: #fff; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.5);
        display: flex; flex-direction: column; overflow: hidden;
    }
    .tool-modal-header {
        color: white; padding: 15px 20px; font-weight: bold; font-size: 16px;
        display: flex; justify-content: space-between; align-items: center;
    }

    /* Caixa de Medidas estilo SketchUp */
    #vcb-panel {
        position: absolute; bottom: 20px; right: 20px;
        background: white; padding: 8px 15px;
        border-radius: 4px; box-shadow: 0 2px 10px rgba(0,0,0,0.2);
        font-family: monospace; font-size: 14px;
        display: flex; align-items: center; gap: 10px;
        border: 1px solid #ccc; z-index: 100;
    }
    #vcb-label { color: #666; font-size: 12px; font-family: 'Segoe UI', sans-serif;}
    #vcb-value { font-weight: bold; color: #2c3e50; min-width: 60px; text-align: right;}
    /* --- CAIXA DE SELEÇÃO --- */
        #selection-box {
            position: absolute;
            pointer-events: none;
            z-index: 1000;
            display: none;
        }
        .sel-window { background: rgba(52, 152, 219, 0.2); border: 1px solid #3498db; }
        .sel-crossing { background: rgba(46, 204, 113, 0.2); border: 1px dashed #27ae60; }

    /* --- NAV-DIAL (BÚSSOLA DE VISTAS) --- */
   
    #nav-dial {
        position: absolute; top: 70px; right: 20px;
        width: 120px; height: 120px; /* Aumentado para dar respiro */
        background: rgba(255, 255, 255, 0.85);
        border-radius: 50%;
        box-shadow: 0 4px 15px rgba(0,0,0,0.15);
        border: 2px solid rgba(255,255,255,0.5);
        backdrop-filter: blur(5px);
        z-index: 100;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(3, 1fr);
        overflow: hidden;
        transition: transform 0.2s, box-shadow 0.2s;
    }
    
    #nav-dial:hover {
        box-shadow: 0 6px 20px rgba(0,0,0,0.25);
        transform: scale(1.05);
    }

    .nav-btn {
        background: transparent;
        border: 1px solid rgba(200,200,200,0.15); /* Borda mais suave */
        cursor: pointer;
        display: flex; justify-content: center; align-items: center;
        color: #555;
        font-weight: bold; font-size: 10px; text-transform: uppercase;
        padding: 0; /* REMOVIDO: O padding estava empurrando o texto para fora */
        transition: all 0.15s;
    }

    .nav-btn:hover { background: rgba(52, 152, 219, 0.2); color: #2980b9; }
    .nav-btn.active { background: #3498db; color: white; }

    /* O botão do meio (Topo) fica redondo e ligeiramente menor */
    #nav-top { 
        border-radius: 50%; 
        background: #fff; 
        box-shadow: inset 0 0 5px rgba(0,0,0,0.1); 
        border: 2px solid #eee;
        transform: scale(0.9); /* Afasta um pouco das linhas do grid */
    }
    #nav-top:hover { background: #e8f4fd; border-color: #3498db;}
    #nav-top.active { background: #3498db; color: white; border-color: #2980b9; }

    /* Ícones das vistas Isométricas nos cantos */
    .nav-iso { font-size: 16px; color: #aaa; }
    .nav-iso:hover { color: #3498db; }

    /* --- EIXOS GLOBAIS 3D (HUD) --- */
    #axes-helper-container {
        position: absolute;
        top: 70px; /* Fica logo abaixo da barra de ferramentas superior */
        left: 20px;
        width: 100px;
        height: 100px;
        z-index: 100;
        pointer-events: none; /* Deixa os cliques do mouse passarem direto para a tela principal */
    }

    /* --- ETIQUETA DE DISTÂNCIA (TRACKING) --- */
    #tracking-badge {
        position: absolute;
        color: white;
        padding: 4px 8px;
        border-radius: 4px;
        font-family: 'Segoe UI', Tahoma, sans-serif;
        font-size: 11px;
        font-weight: bold;
        pointer-events: none; /* Para o mouse não esbarrar nela */
        display: none;
        z-index: 1000;
        box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    }

    /* --- PAINEL LATERAL DE PROPRIEDADES --- */
    #properties-panel {
        position: absolute; top: 50px; right: 0; bottom: 28px; width: 320px;
        background: #ffffff; border-left: 1px solid #ccc;
        box-shadow: -2px 0 10px rgba(0,0,0,0.05); z-index: 105;
        display: flex; flex-direction: column;
    }
    .panel-header {
        background: #f8f9fa; padding: 12px 15px; border-bottom: 1px solid #eee;
        font-weight: bold; color: #2c3e50; display: flex;
        justify-content: space-between; align-items: center;
    }
    .panel-content { flex: 1; padding: 15px; overflow-y: auto; }
    .prop-group { margin-bottom: 15px; }
    .prop-label {
        display: block; font-size: 11px; color: #7f8c8d;
        text-transform: uppercase; font-weight: bold; margin-bottom: 5px;
    }
    .prop-input, .prop-select {
        width: 100%; padding: 8px; border: 1px solid #ddd;
        border-radius: 4px; font-size: 13px; color: #333; box-sizing: border-box;
    }
    .prop-input:focus, .prop-select:focus { border-color: #3498db; outline: none; }

    /* --- MODAL DO VISUALIZADOR DE PERFIS --- */
    #profile-modal {
        display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
        background: rgba(0,0,0,0.6); z-index: 2500; align-items: center; justify-content: center;
        backdrop-filter: blur(2px);
    }
    .modal-content {
        background: #ffffff; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.5);
        display: flex; flex-direction: column; overflow: hidden; border: none;
    }
    #profile-modal .modal-content {
        width: 900px;
    }
    .modal-header {
        color: white; padding: 15px 20px; font-weight: bold; font-size: 16px;
        display: flex; justify-content: space-between; align-items: center;
    }
    #profile-modal .modal-header {
        background: #3498db;
    }
    .modal-header span { display: flex; align-items: center; gap: 10px; }
    .btn-close-x { 
        background: transparent; border: none; color: white; cursor: pointer; 
        font-size: 24px; line-height: 1; padding: 0; transition: color 0.2s; 
    }
    .btn-close-x:hover { color: #e74c3c; }
    #profile-modal .modal-toolbar {
        background: #f8f9fa; padding: 15px 20px; border-bottom: 1px solid #e1e4e8; display: flex; gap: 15px; flex-wrap: wrap; align-items: flex-end;
    }
    #profile-modal .modal-toolbar label { font-size: 10px; color: #7f8c8d; text-transform: uppercase; font-weight: 700; display: block; margin-bottom: 5px; }
    #profile-modal .modal-toolbar select, #profile-modal .modal-toolbar input {
        padding: 8px 10px; border: 1px solid #ccc; border-radius: 4px; font-size: 13px; font-weight: 600; color: #333; background: #fff; outline: none; transition: border 0.2s;
    }
    #profile-modal .modal-toolbar select:focus, #profile-modal .modal-toolbar input:focus { border-color: #3498db; box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2); }

    #profile-modal .modal-body { display: flex; padding: 20px; gap: 20px; background: #fff; height: 420px; }
    #profile-modal .modal-canvas-container {
        flex: 1.2; background: #fff; border: 1px solid #e1e4e8; border-radius: 6px; position: relative;
        display: flex; align-items: center; justify-content: center; box-shadow: inset 0 0 10px rgba(0,0,0,0.02);
    }
    #profile-modal .modal-props-container {
        flex: 1; background: #fff; border: 1px solid #e1e4e8; padding: 0; 
        border-radius: 6px; overflow-y: auto;
    }
    #profile-modal .prop-row {
        display: flex; justify-content: space-between; align-items: center; 
        padding: 10px 15px; font-size: 12px; border-bottom: 1px solid #f0f2f5; transition: background 0.2s;
    }
    #profile-modal .prop-row:hover { background: #f8f9fa; }
    #profile-modal .prop-row .prop-label { color: #7f8c8d; font-weight: 600; text-transform: uppercase; font-size: 10px; }
    #profile-modal .prop-row .prop-value { font-weight: 800; color: #2c3e50; font-size: 13px; }
    
    #profile-modal .modal-footer {
        padding: 15px 20px; background: #f8f9fa; border-top: 1px solid #e1e4e8; display: flex; justify-content: flex-end; gap: 10px;
    }
    #profile-modal .btn-modal-action {
        background: #27ae60; color: white; padding: 10px 25px; font-size: 14px; display: flex; align-items: center; gap: 8px;
        border-radius: 6px; cursor: pointer; font-weight: bold; border: none; transition: background 0.2s; box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }
    #profile-modal .btn-modal-action:hover { background: #219653; }
    #profile-modal .btn-modal-cancel {
        background: #fff; color: #555; padding: 10px 20px; font-size: 14px; border: 1px solid #ccc;
        border-radius: 6px; cursor: pointer; font-weight: bold; transition: background 0.2s;
    }
    #profile-modal .btn-modal-cancel:hover { background: #f0f0f0; }

    /* --- MODAIS DE CARGA --- */
    .load-cards-container {
        display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px;
    }
    .load-card {
        width: 60px; height: 60px; border: 2px solid #ddd; border-radius: 6px;
        background: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
        transition: all 0.2s; position: relative;
    }
    .load-card:hover { border-color: #3498db; background: #f0f8ff; }
    .load-card.active { border-color: #e67e22; background: #fdf2e9; box-shadow: 0 0 0 2px rgba(230,126,34,0.3); }
    .load-card svg { width: 40px; height: 40px; }
    .load-card-label {
        position: absolute; bottom: -18px; font-size: 10px; font-weight: bold; color: #555; text-align: center; width: 100%;
    }
    .load-section-title {
        font-size: 12px; color: #34495e; font-weight: bold; border-bottom: 1px solid #eee; padding-bottom: 5px; margin-bottom: 10px; margin-top: 15px;
    }

    /* --- OPÇÕES DE CARGA EM BARRAS --- */
    .load-type-container { display: flex; gap: 8px; margin-bottom: 15px; }
    .load-type-btn {
        flex: 1; padding: 8px; border: 1px solid #ddd; background: #f8f9fa; border-radius: 4px;
        cursor: pointer; text-align: center; font-size: 11px; font-weight: bold; color: #555; transition: all 0.2s;
    }
    .load-type-btn:hover { background: #e8f4fd; border-color: #3498db; }
    .load-type-btn.active { background: #3498db; color: white; border-color: #2980b9; }

    .axis-toggle-container {
        display: flex; background: #eee; border-radius: 6px; padding: 3px; width: 100%; margin-bottom: 15px;
    }
    .axis-toggle-btn {
        flex: 1; padding: 6px; text-align: center; font-size: 11px; font-weight: bold; color: #7f8c8d;
        cursor: pointer; border-radius: 4px; transition: all 0.2s;
    }
    .axis-toggle-btn.active { background: #fff; color: #2c3e50; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

    /* --- MENU DE DIAGRAMAS --- */
    #diagram-menu {
        position: absolute; bottom: 80px; left: 20px; background: #fff;
        border-radius: 6px; box-shadow: 0 4px 15px rgba(0,0,0,0.15);
        border: 1px solid #ddd; padding: 12px; z-index: 150;
        font-family: 'Segoe UI', Tahoma, sans-serif; display: none; width: 220px;
    }
    .diag-item {
        display: flex; align-items: center; gap: 8px; cursor: pointer;
        margin-bottom: 5px; padding: 6px; border-radius: 4px; transition: 0.2s;
    }
    .diag-item:hover { background: #f0f2f5; }
    .diag-item.active { background: #e8f4fd; font-weight: bold; border-left: 3px solid #3498db; }
    .diag-color { width: 14px; height: 14px; border-radius: 3px; }
    .diag-color.mom { background: #e74c3c; } /* Vermelho */
    .diag-color.cor { background: #2ecc71; } /* Verde */
    .diag-color.nor { background: #f1c40f; } /* Amarelo */
    .diag-select {
        width: 100%; padding: 6px; border: 1px solid #ccc; border-radius: 4px;
        font-size: 12px; color: #333; cursor: pointer; outline: none;
    }
    .diag-select:focus { border-color: #3498db; }

    /* --- LEGENDA DO MAPA DE CALOR (DEFORMADA) --- */
    #heatmap-legend {
        display: none;
        position: absolute;
        top: 210px; /* Fica posicionado logo abaixo da Bússola (Nav-Dial) */
        right: 340px; /* Fica ao lado do painel de propriedades */
        background: #1a1e24; /* Fundo escuro como na referência */
        border: 1px solid #2c3e50;
        border-radius: 6px;
        padding: 12px 15px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.4);
        z-index: 150;
        font-family: 'Segoe UI', Tahoma, sans-serif;
        color: white;
        width: 120px;
        box-sizing: border-box;
    }
    .hm-title {
        font-size: 10px;
        font-weight: 800;
        text-align: center;
        margin-bottom: 12px;
        letter-spacing: 0.5px;
        line-height: 1.3;
    }
    .hm-body {
        display: flex;
        justify-content: center;
        gap: 12px;
        height: 160px;
    }
    .hm-bar {
        width: 18px;
        border-radius: 3px;
        /* Gradiente contínuo igual ao do Three.js (HSL 0.66 a 0.0) */
        background: linear-gradient(to top, #0000ff, #00ffff, #00ff00, #ffff00, #ff0000);
        border: 1px solid rgba(255,255,255,0.2);
    }
    .hm-labels {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        font-size: 12px;
        font-weight: bold;
    }

    /* --- GERENCIADOR DE LAYERS (FUNÇÃO ESTRUTURAL) --- */
    #layer-manager {
        position: absolute; top: 210px; right: 335px; background: #fff;
        border-radius: 6px; box-shadow: 0 4px 20px rgba(0,0,0,0.15);
        border: 1px solid #ddd; z-index: 160; display: none;
        width: 320px; font-family: 'Segoe UI', Tahoma, sans-serif;
        flex-direction: column; overflow: hidden;
    }
    .layer-header {
        background: #2c3e50; color: white; padding: 10px 15px;
        font-weight: bold; font-size: 13px; display: flex;
        justify-content: space-between; align-items: center;
    }
    .layer-list { max-height: 300px; overflow-y: auto; padding: 10px; }
    .layer-item {
        display: flex; align-items: center; justify-content: space-between;
        padding: 6px 8px; border-bottom: 1px solid #eee; transition: background 0.2s;
    }
    .layer-item:hover { background: #f8f9fa; }
   .layer-color-box { 
        width: 18px; height: 18px; cursor: pointer; 
        border: 1px solid #ccc; border-radius: 4px;
        padding: 0; background: transparent; outline: none;
        -webkit-appearance: none;
    }
    .layer-color-box::-webkit-color-swatch-wrapper { padding: 0; }
    .layer-color-box::-webkit-color-swatch { border: none; border-radius: 3px; }
    .layer-name { flex: 1; margin-left: 10px; font-size: 12px; color: #333; font-weight: 500; }
    .layer-count { font-size: 10px; color: #95a5a6; margin-right: 10px; background: #eee; padding: 2px 6px; border-radius: 10px; }
    .layer-actions { display: flex; gap: 5px; }
    .layer-btn {
        background: transparent; border: none; cursor: pointer; color: #7f8c8d;
        padding: 2px; border-radius: 3px; display: flex; align-items: center;
    }
    .layer-btn:hover { color: #3498db; background: #e8f4fd; }
    .layer-btn.locked { color: #e74c3c; }
    .layer-btn.hidden { color: #ccc; }
    .layer-footer { padding: 10px; background: #f9f9f9; border-top: 1px solid #eee; display: flex; gap: 8px; }
    .layer-input { flex: 1; padding: 6px; border: 1px solid #ccc; border-radius: 4px; font-size: 11px; }
    .layer-add-btn { background: #3498db; color: white; border: none; border-radius: 4px; padding: 0 10px; cursor: pointer; font-weight: bold; }
    .global-color-toggle { padding: 8px 15px; background: #e8f4fd; border-bottom: 1px solid #b8daff; font-size: 11px; font-weight: bold; color: #2980b9; cursor: pointer; text-align: center; }
    .global-color-toggle:hover { background: #d0e8fc; }

   /* --- MODAL DO DOSSIÊ DE VERIFICAÇÃO --- */
    #dossier-modal {
        display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
        background: rgba(0,0,0,0.6); z-index: 3000; align-items: center; justify-content: center;
        backdrop-filter: blur(4px); font-family: 'Segoe UI', Tahoma, sans-serif;
    }
    #dossier-modal .modal-content {
        background: #fff; width: 95vw; max-width: 1400px; height: 92vh;
        border-radius: 8px; display: flex; flex-direction: column; overflow: hidden;
        box-shadow: 0 10px 40px rgba(0,0,0,0.4);
    }
    #dossier-modal .modal-header {
        background: #2c3e50; color: white; padding: 15px 25px; font-weight: bold; font-size: 16px;
        display: flex; justify-content: space-between; align-items: center;
        width: 100%; box-sizing: border-box; /* Garante que o header ocupe 100% da tela */
    }
    #dossier-modal .btn-close-x {
        background: transparent; border: none; color: white; cursor: pointer; font-size: 26px; line-height: 1; padding: 0; transition: color 0.2s;
    }
    #dossier-modal .btn-close-x:hover { color: #e74c3c; }
    
    .dossier-header-info {
        display: flex; flex-direction: column; padding: 12px 25px; background: #fff;
        border-bottom: 1px solid #eaeded; box-shadow: 0 2px 10px rgba(0,0,0,0.02); z-index: 10;
    }
    .dossier-title-bar { margin: 0 0 4px 0; color: #2c3e50; font-size: 18px; font-weight: 800; letter-spacing: -0.5px; }
    .dossier-subtitle { font-size: 13px; color: #7f8c8d; display: flex; gap: 25px; flex-wrap: wrap; }
    .dossier-subtitle strong { color: #34495e; }
    
    .btn-export-pdf {
        position: absolute; bottom: 30px; right: 40px; z-index: 100;
        background: #2980b9; color: white; border: none; padding: 12px 24px;
        border-radius: 30px; font-weight: bold; font-size: 14px; cursor: pointer;
        display: flex; align-items: center; gap: 8px; box-shadow: 0 4px 15px rgba(41, 128, 185, 0.4);
        transition: all 0.2s;
    }
    .btn-export-pdf:hover { background: #2471a3; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(41, 128, 185, 0.6); }
    
    .dossier-body { display: flex; flex: 1; overflow: hidden; background: #fdfdfd; }
    .dossier-sidebar {
        width: 340px; background: #f8f9fa; border-right: 1px solid #eaeded;
        overflow-y: auto; padding: 0; flex-shrink: 0;
    }
    .dossier-menu-item {
        padding: 16px 20px; border-bottom: 1px solid #eee; cursor: pointer;
        display: flex; justify-content: space-between; align-items: center;
        transition: all 0.2s; font-size: 13px; font-weight: 600; color: #555;
    }
    .dossier-menu-item:hover { background: #e8f4fd; color: #2980b9; }
    .dossier-menu-item.active { background: #3498db; color: white; border-color: #2980b9; }
    .dossier-menu-item.status-FALHA { border-left: 6px solid #e74c3c; }
    .dossier-menu-item.status-Passa { border-left: 6px solid #27ae60; }
    .dossier-menu-item.status-N\.A\. { border-left: 6px solid #bdc3c7; opacity: 0.7; }
    
    .dossier-main { flex: 1; padding: 40px 50px 85px 50px; overflow-y: auto; scroll-behavior: smooth; position: relative; }
    .dossier-section { margin-bottom: 60px; }
    .dossier-section:last-child { margin-bottom: 0; }
    .dossier-section-title {
        font-size: 18px; font-weight: 800; color: #2c3e50;
        border-bottom: 2px solid #3498db; padding-bottom: 8px; margin-bottom: 20px;
    }
    .dossier-step { margin-bottom: 12px; font-size: 15px; color: #444; line-height: 1.6; }
    .dossier-formula {
        text-align: center; margin: 25px 0; overflow-x: auto; padding: 20px;
        background: #fff; border-radius: 8px; border: 1px solid #e1e4e8; 
        box-shadow: 0 4px 10px rgba(0,0,0,0.03); font-size: 1.15em; color: #2c3e50;
    }

    /* Regras rigorosas para a exportação nativa do PDF */
    @media print {
        /* Adiciona margens físicas na folha A4 (20 milímetros) */
        @page {
            margin: 20mm; 
        }

        /* Esconde toda a interface gráfica do aplicativo */
        body { background: #fff !important; overflow: visible !important; height: auto !important; margin: 0 !important; padding: 0 !important; }
        #toolbar, #vcb-panel, #tracking-badge, #properties-panel, #canvas-container,
        #visibility-menu, #layer-manager, #diagram-menu, #heatmap-legend,
        #nav-dial, #btn-camera-toggle, #profile-modal, #load-modal { display: none !important; }

        /* Transforma o Modal em uma página A4 fluida contínua */
        #dossier-modal {
            position: relative !important;
            display: block !important;
            width: 100% !important;
            height: auto !important;
            background: white !important;
            backdrop-filter: none !important;
        }

        /* Destrava as alturas e rolagens para permitir múltiplas páginas */
        #dossier-modal .modal-content {
            box-shadow: none !important;
            border: none !important;
            width: 100% !important;
            max-width: none !important;
            height: auto !important;
            overflow: visible !important;
            border-radius: 0 !important;
        }

        /* Oculta os itens de navegação e botões interativos */
        .dossier-sidebar, .modal-header, .btn-export-pdf, .btn-close-x { display: none !important; }

        /* Ajusta o cabeçalho e o corpo para não cortarem */
        .dossier-header-info { padding: 0 0 20px 0 !important; box-shadow: none !important; border-bottom: 2px solid #2c3e50 !important; margin-bottom: 20px !important; }
        .dossier-body { display: block !important; overflow: visible !important; height: auto !important; }
        .dossier-main { padding: 0 !important; overflow: visible !important; height: auto !important; display: block !important; }
        
        /* Protege as tabelas e fórmulas para não quebrarem na transição de uma página para outra */
        .dossier-section { page-break-inside: avoid !important; margin-bottom: 30px !important; }
        .cype-table { page-break-inside: avoid !important; }
        .dossier-formula { page-break-inside: avoid !important; box-shadow: none !important; border: 1px solid #ccc !important; padding: 15px 0 !important; }
    }
    /* --- TABELA DOSSIÊ --- */
    .cype-table { width: 100%; border-collapse: collapse; margin-bottom: 40px; font-size: 13px; border: 2px solid #2c3e50; }
    .cype-table th, .cype-table td { border: 1px solid #7f8c8d; padding: 8px 10px; text-align: center; vertical-align: middle; color: #333; }
    .cype-table th { background-color: #ecf0f1; font-weight: 700; color: #2c3e50; }
    .cype-table .left-canvas-cell { width: 35%; background: #fff; padding: 15px; border-right: 2px solid #2c3e50; }
    .cype-table .header-row { background-color: #d5d8dc; text-align: left; font-size: 15px; border-bottom: 2px solid #2c3e50; padding: 12px 15px; }
    .cype-table .notes-row { text-align: left; font-size: 11px; font-style: italic; background: #fdfdfd; color: #555; padding: 6px 10px; line-height: 1.4; }

    /* --- MENU DE VISIBILIDADE --- */
    #visibility-menu {
        position: absolute; top: 210px; right: 335px; background: #fff;
        border-radius: 6px; box-shadow: 0 4px 15px rgba(0,0,0,0.15);
        border: 1px solid #ddd; padding: 15px; z-index: 150;
        font-family: 'Segoe UI', Tahoma, sans-serif; display: none; width: 220px;
    }
    .vis-item {
        display: flex; justify-content: space-between; align-items: center;
        margin-bottom: 10px; font-size: 13px; color: #333;
    }
    .vis-item:last-child { margin-bottom: 0; }
    /* Switch estilo iOS */
    .switch { position: relative; display: inline-block; width: 34px; height: 18px; }
    .switch input { opacity: 0; width: 0; height: 0; }
    .slider {
        position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
        background-color: #ccc; transition: .2s; border-radius: 18px;
    }
    .slider:before {
        position: absolute; content: ""; height: 14px; width: 14px; left: 2px; bottom: 2px;
        background-color: white; transition: .2s; border-radius: 50%;
    }
    input:checked + .slider { background-color: #3498db; }
    input:checked + .slider:before { transform: translateX(16px); }

    #btn-camera-toggle {
        position: absolute; 
        top: 50px; 
        right: 330px; /* Posiciona no ombro direito da bússola, fora do painel lateral */
        width: 32px; 
        height: 32px;
        background: rgba(255, 255, 255, 0.9);
        border: 2px solid rgba(255,255,255,0.5);
        border-radius: 50%; /* Torna o botão redondo */
        color: #555;
        cursor: pointer;
        z-index: 101;
        box-shadow: 0 4px 15px rgba(0,0,0,0.15);
        backdrop-filter: blur(5px);
        display: flex;
        justify-content: center;
        align-items: center;
        transition: all 0.2s;
    }
    #btn-camera-toggle .material-icons {
        font-size: 18px; /* Tamanho do ícone */
    }
    #btn-camera-toggle:hover { background: #e8f4fd; color: #3498db; }
    #btn-camera-toggle.active { background: #3498db; color: white; border-color: #2980b9; }

    /* --- MODAL FLUTUANTE DE LIGAÇÕES --- */
    #conn-floating-modal {
        position: absolute; 
        top: 100px; 
        left: 100px; 
        width: 360px;
        background: #ffffff; 
        border-radius: 6px; 
        box-shadow: 0 10px 30px rgba(0,0,0,0.3);
        display: none; 
        flex-direction: column; 
        z-index: 2100;
        border: 1px solid #b2bec3; 
        font-family: 'Segoe UI', Tahoma, sans-serif;
    }
    
    .conn-header {
        background: #8e44ad; /* Roxo para manter a identidade da ferramenta */
        color: white; 
        padding: 12px 15px; 
        border-radius: 5px 5px 0 0;
        cursor: grab; 
        display: flex; 
        justify-content: space-between; 
        align-items: center;
        font-weight: bold;
        font-size: 14px;
        user-select: none;
    }
    .conn-header:active { cursor: grabbing; }
    
    .conn-body { 
        padding: 15px; 
        max-height: 60vh; 
        overflow-y: auto; 
    }
    
    .conn-section-title {
        font-size: 11px; color: #7f8c8d; font-weight: bold; text-transform: uppercase;
        border-bottom: 1px solid #eee; padding-bottom: 5px; margin: 15px 0 10px 0;
    }
    .conn-section-title:first-child { margin-top: 0; }
    
    .conn-grid {
        display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
    }
    
    .conn-footer { 
        padding: 12px 15px; 
        background: #f8f9fa; 
        border-top: 1px solid #eee; 
        display: flex; 
        justify-content: flex-end; 
        gap: 10px; 
        border-radius: 0 0 5px 5px; 
    }

    /* --- MENU DE CONTEXTO E MODAL PARAMÉTRICO --- */
    #context-menu {
        position: absolute; display: none; background: white; border: 1px solid #bdc3c7;
        box-shadow: 0 4px 10px rgba(0,0,0,0.2); z-index: 5000; border-radius: 4px; padding: 5px 0;
        font-family: 'Segoe UI', sans-serif;
    }
    .ctx-item { padding: 10px 15px; font-size: 13px; cursor: pointer; color: #2c3e50; font-weight: 500; display: flex; align-items: center; gap: 8px;}
    .ctx-item:hover { background: #e8f4fd; color: #2980b9; }

    #parametric-modal {
        display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
        background: rgba(0,0,0,0.6); z-index: 4000; align-items: center; justify-content: center;
        backdrop-filter: blur(2px); font-family: 'Segoe UI', sans-serif;
    }
    #parametric-modal .modal-content {
        background: #fff; width: 850px; height: 500px; border-radius: 8px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    }

    /* =========================================
       WIZARD METÁLICAS - ESTILOS
       ========================================= */
    .wizard-container { width: 1080px; max-width: 95vw; height: 680px; max-height: 92vh; background: #fff; border: 1px solid #dde1e7; border-radius: 16px; box-shadow: 0 20px 48px rgba(0,0,0,0.12); display: flex; overflow: hidden; animation: slideUp 0.24s cubic-bezier(0.34, 1.1, 0.64, 1); }
    @keyframes slideUp { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
    .wizard-sidebar { width: 260px; background: #f7f8fa; border-right: 1px solid #dde1e7; padding: 28px 16px; display: flex; flex-direction: column; flex-shrink: 0; }
    .wizard-brand { font-size: 14px; font-weight: 700; color: #111827; margin-bottom: 32px; display: flex; align-items: center; gap: 10px; letter-spacing: -0.01em; }
    .step-list { list-style: none; padding: 0; margin: 0; counter-reset: wizard-step; }
    .step-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; margin-bottom: 3px; color: #6b7280; border-radius: 8px; transition: all 0.18s ease; font-size: 12.5px; font-weight: 500; cursor: pointer; }
    .step-item:hover { background: rgba(91, 53, 213, 0.05); color: #5b35d5; }
    .step-item.active { background: rgba(91, 53, 213, 0.10); color: #5b35d5; font-weight: 600; }
    .step-num { width: 24px; height: 24px; border: 1.5px solid #c8cdd6; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 11px; font-weight: 600; transition: all 0.18s ease; flex-shrink: 0; color: #6b7280; }
    .step-num::after { counter-increment: wizard-step; content: counter(wizard-step); }
    .step-item.active .step-num { border-color: #5b35d5; background: #5b35d5; color: white; }
    .step-item.completed .step-num { border-color: #16a34a; background: #16a34a; color: white; }
    .step-item.completed .step-num::after { content: '✓'; font-size: 14px; }
    
    .wizard-content { flex: 1; padding: 36px 40px; display: flex; flex-direction: column; background: #fff; position: relative; overflow-y: auto; }
    .wizard-step { display: none; flex: 1; animation: fadeIn 0.20s ease; }
    .wizard-step.active { display: block; }
    @keyframes fadeIn { from { opacity: 0; transform: translateX(6px); } to { opacity: 1; transform: translateX(0); } }
    .step-title { font-size: 20px; font-weight: 700; color: #111827; margin-bottom: 24px; border-bottom: 1px solid #dde1e7; padding-bottom: 12px; letter-spacing: -0.02em; }
    .subsection-title { font-size: 11px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: #6b7280; margin-top: 22px; margin-bottom: 14px; }
    .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; width: 100%; }
    .form-grid.three-col { grid-template-columns: 1fr 1fr 1fr; }
    .form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
    .form-group.span-2 { grid-column: span 2; }
    .form-group label { font-size: 11px; font-weight: 600; color: #374151; }
    .form-group input, .form-group select { padding: 9px 11px; border: 1px solid #c8cdd6; border-radius: 8px; font-size: 13px; background: #f7f8fa; color: #111827; outline: none; transition: border-color 0.15s, box-shadow 0.15s; }
    .form-group input:focus, .form-group select:focus { border-color: #5b35d5; background: #fff; box-shadow: 0 0 0 3px rgba(91,53,213,0.15); }
    .wizard-footer { margin-top: auto; padding-top: 18px; border-top: 1px solid #dde1e7; display: flex; gap: 10px; flex-shrink: 0; }
    .btn-wizard { padding: 9px 22px; border-radius: 8px; font-weight: 600; font-size: 13px; cursor: pointer; border: 1px solid transparent; transition: all 0.18s ease; }
    .btn-wizard.primary { background: #5b35d5; color: white; }
    .btn-wizard.primary:hover { background: #7c5ce8; }
    .btn-wizard.secondary { background: #f7f8fa; border-color: #c8cdd6; color: #374151; }
    .btn-wizard.secondary:hover { background: #eef0f3; color: #111827; }
    .btn-wizard.secondary:disabled { opacity: 0.45; cursor: not-allowed; }
    .btn-wizard.success { background: #16a34a; color: white; }
    .btn-wizard.success:hover { background: #15803d; }
    .dxf-card-option { flex: 1; background: #fff; border: 1px solid #c8cdd6; border-radius: 8px; padding: 20px; text-align: center; cursor: pointer; transition: all 0.2s; }
    .dxf-card-option:hover { border-color: #5b35d5; box-shadow: 0 4px 12px rgba(91,53,213,0.1); transform: translateY(-2px); }
    .dxf-card-option.active { border-color: #5b35d5; background: rgba(91,53,213,0.05); box-shadow: 0 0 0 2px #5b35d5; }
    .info-box { background: rgba(37,99,235,0.09); border: 1px solid rgba(37,99,235,0.18); color: #2563eb; padding: 11px 13px; border-radius: 8px; font-size: 12px; display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }

    .grid-input {
            width: 100%; padding: 4px; border: 1px solid transparent; 
            border-radius: 3px; font-size: 12px; text-align: center; color: #333;
            background: transparent; outline: none; transition: all 0.2s;
        }
        .grid-input:hover { border-color: #bdc3c7; background: #f9f9f9; }
        .grid-input:focus { border-color: #3498db; background: #fff; box-shadow: 0 0 3px rgba(52, 152, 219, 0.3); }

        /* =========================================
   MODAL DE PROJETOS EM NUVEM (ESTILO FORECAST)
   ========================================= */
#cloud-projects-modal {
    z-index: 100000 !important;
}

.cloud-modal-card {
    width: 860px;
    max-width: 95vw;
    max-height: 88vh;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.22);
    display: flex;
    flex-direction: column;
    position: relative;
    padding: 30px 32px 26px 32px;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    animation: modalIn 0.2s cubic-bezier(0.34, 1.15, 0.64, 1);
}

.cloud-modal-close {
    position: absolute;
    top: 18px;
    right: 22px;
    background: transparent;
    border: none;
    font-size: 24px;
    color: #9ca3af;
    cursor: pointer;
    line-height: 1;
    transition: color 0.15s;
}
.cloud-modal-close:hover {
    color: #111827;
}

.cloud-modal-header-center {
    text-align: center;
    margin-bottom: 22px;
}

.cloud-modal-title {
    font-size: 19px;
    font-weight: 700;
    color: #5b35d5;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.cloud-modal-title .material-icons {
    font-size: 24px;
    color: #5b35d5;
}

.cloud-modal-subtitle {
    font-size: 12px;
    color: #6b7280;
    margin-top: 5px;
}

.cloud-projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 16px;
    max-height: 58vh;
    overflow-y: auto;
    padding: 4px 6px 12px 2px;
    align-content: start;
}

.cloud-projects-grid::-webkit-scrollbar {
    width: 6px;
}
.cloud-projects-grid::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

/* Estado de Download / Loading do Projeto (Estilo Forecast Concreto) */
.cloud-loading-container {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 60px 20px;
    width: 100%;
    box-sizing: border-box;
}

.cloud-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3.5px solid #e2e8f0;
    border-top: 3.5px solid #16a34a;
    border-radius: 50%;
    animation: cloudSpin 0.9s linear infinite;
}

.cloud-loading-text {
    font-size: 13.5px;
    font-weight: 700;
    color: #16a34a;
    letter-spacing: -0.01em;
}

@keyframes cloudSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.cloud-project-card {
    background-color: #ffffff;
    border: 1px solid #dde1e7;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    display: flex;
    flex-direction: column;
    min-height: 140px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.cloud-project-card:hover {
    border-color: #5b35d5;
    box-shadow: 0 4px 14px rgba(91, 53, 213, 0.12);
    transform: translateY(-2px);
}

.cloud-card-header {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fafbfc;
}
.cloud-card-header h3 {
    margin: 0;
    font-size: 14px;
    color: #5b35d5;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 230px;
}

.cloud-card-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
}

.btn-card-action {
    background: transparent;
    border: 1px solid #c8cdd6;
    border-radius: 6px;
    color: #475569;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    padding: 0;
}
.btn-card-action:hover {
    background: rgba(91, 53, 213, 0.08);
    color: #5b35d5;
    border-color: #5b35d5;
}
.btn-card-action.danger {
    color: #dc2626;
    border-color: rgba(220, 38, 38, 0.35);
}
.btn-card-action.danger:hover {
    background: rgba(220, 38, 38, 0.08);
    border-color: #dc2626;
}
.btn-card-action .material-icons {
    font-size: 16px;
}

.cloud-card-body {
    padding: 12px 14px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
}

.cloud-meta-item {
    font-size: 11.5px;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cloud-meta-item .material-icons {
    font-size: 14px;
    color: #94a3b8;
    flex-shrink: 0;
}

.cloud-card-footer {
    padding: 9px 14px;
    border-top: 1px solid #f1f5f9;
    font-size: 11px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 5px;
    background-color: #ffffff;
}
.cloud-card-footer .material-icons {
    font-size: 13px;
    color: #94a3b8;
}