        :root {
            --primary: #2c3e50;
            --success: #27ae60;
            --accent: #3498db;
            --bg: #f0f2f5;
            --sidebar-bg: #ffffff;
        }
        body { font-family: 'Segoe UI', sans-serif; background: var(--bg); margin: 0; padding: 20px; color: #333; }

        /* Two-Column Layout */
        .main-wrapper {
            display: flex;
            gap: 20px;
            max-width: 1100px;
            margin: 0 auto;
            align-items: flex-start;
        }

        .content-main { flex: 3; }

        .sidebar {
            flex: 1;
            background: var(--sidebar-bg);
            padding: 20px;
            border-radius: 12px;
            box-shadow: 0 4px 15px rgba(0,0,0,0.05);
            border-top: 4px solid var(--accent);
        }

        .container { background: white; padding: 30px; border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,0.1); }

        h1 { color: var(--primary); margin: 0 0 20px 0; font-size: 24px; }
        h3 { margin-top: 0; color: var(--accent); font-size: 18px; }

        textarea {
            width: 100%; height: 350px; font-family: 'Consolas', monospace;
            background: #1e1e1e; color: #d4d4d4; padding: 15px; border-radius: 8px; border: none; box-sizing: border-box;
            font-size: 13px; line-height: 1.5;
        }

        .button-group { margin-top: 20px; display: flex; justify-content: space-between; align-items: center; }

        #btnRun {
            background: var(--success); color: white; border: none; padding: 12px 25px;
            font-size: 16px; border-radius: 6px; cursor: pointer; font-weight: bold; transition: 0.3s;
        }
        #btnRun:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(39, 174, 96, 0.3); }

        /* Results Card */
        #resultsCard {
            margin-top: 20px; background: #e8f5e9; border: 1px solid var(--success);
            border-radius: 10px; padding: 20px; display: none;
        }

        /* Sidebar Style */
        .example-box p { font-size: 14px; color: #666; line-height: 1.4; }
        .btn-exemplo {
            display: block; text-align: center; background: var(--bg); color: var(--primary);
            text-decoration: none; padding: 10px; border-radius: 6px; border: 1px dashed #ccc;
            margin-top: 15px; font-weight: bold; transition: 0.2s;
        }
        .btn-exemplo:hover { background: #e0e0e0; border-color: var(--accent); }

        #status { color: var(--accent); font-weight: bold; display: none; }

        @media (max-width: 850px) { .main-wrapper { flex-direction: column; } .sidebar { width: 100%; box-sizing: border-box; } }

	#container-3d {
       height: 400px;
       width: 100%;
       background: #fff;
       border-radius: 8px;
       border: 1px solid #ddd;
       position: relative;
       margin-bottom: 20px;
      }

/* Pagina inicial: escolha da ferramenta */
.home { max-width: 760px; margin: 60px auto; text-align: center; }
.home .container { text-align: left; }
.home-sub { margin: -10px 0 35px 0; color: #7f8c8d; font-size: 15px; }
.home-buttons { display: flex; gap: 25px; justify-content: center; flex-wrap: wrap; }
.home-btn {
    flex: 1 1 280px; max-width: 340px; display: flex; flex-direction: column; gap: 10px;
    padding: 40px 25px; border-radius: 12px; color: white; text-decoration: none;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1); transition: 0.2s;
}
.home-btn:hover { transform: translateY(-3px); box-shadow: 0 12px 35px rgba(0,0,0,0.18); }
.home-btn-mscd { background: var(--accent); }
.home-btn-iv { background: #e67e22; }
.home-btn-title { font-size: 24px; font-weight: bold; letter-spacing: 1px; }
.home-btn-desc { font-size: 14px; opacity: 0.9; }
.back-link {
    display: inline-block; margin-bottom: 12px; color: var(--primary);
    text-decoration: none; font-weight: bold; font-size: 14px;
}
.back-link:hover { color: var(--accent); }

/* IV Curve */
.iv-page { max-width: 1400px; margin: 0 auto; }
.iv-sub { margin: -10px 0 20px 0; font-size: 14px; color: #7f8c8d; }
.iv-folders { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.iv-drop {
    display: flex; flex-direction: column; gap: 6px; padding: 18px; cursor: pointer;
    background: #e8f0fe; border: 2px dashed var(--accent); border-radius: 10px; transition: 0.2s;
}
.iv-drop:hover { background: #dce8fd; }
.iv-drop input { font-size: 13px; }
.iv-drop-title { font-weight: bold; color: var(--primary); font-size: 15px; }
.iv-drop-hint { font-size: 12px; color: #666; }
.iv-drop-count { font-size: 13px; font-weight: bold; color: var(--primary); }
.iv-load-row { display: flex; align-items: center; gap: 15px; margin-top: 18px; flex-wrap: wrap; }
.iv-progress { width: 220px; height: 8px; background: #e0e0e0; border-radius: 4px; overflow: hidden; }
#iv-progresso-barra { height: 100%; width: 0; background: var(--accent); transition: width 0.2s; }
.iv-status { font-size: 13px; color: #555; }
.iv-status.iv-erro { color: #c62828; font-weight: bold; }

.iv-btn {
    background: #ecf0f1; color: var(--primary); border: 1px solid #ccd1d4; padding: 9px 16px;
    border-radius: 6px; cursor: pointer; font-weight: bold; font-size: 13px;
}
.iv-btn:hover { background: #e0e6e8; }
.iv-btn:disabled { opacity: 0.5; cursor: default; }
.iv-btn-primary { background: var(--accent); color: white; border-color: var(--accent); padding: 10px 28px; }
.iv-btn-primary:hover { background: #2d86c4; }
.iv-btn-save { background: #b8e0b8; border-color: #8fd18f; }
.iv-btn-save:hover { background: #8fd18f; }

.iv-tool {
    display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; margin-top: 20px;
    background: white; padding: 20px; border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}
.iv-tool[hidden] { display: none; }
.iv-col-img, .iv-col-side { min-width: 0; }
.iv-img-title { text-align: center; font-size: 16px; font-weight: bold; color: var(--primary); margin-bottom: 6px; }
.iv-canvas-img { display: block; width: 100%; background: #000; cursor: crosshair; border-radius: 4px; }
.iv-slider-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 13px; }
.iv-slider-row input { flex: 1; }
.iv-mono { font-family: 'Consolas', monospace; min-width: 4ch; }
.iv-checks { display: flex; gap: 25px; margin-top: 10px; font-size: 13px; flex-wrap: wrap; }
.iv-help { font-size: 11px; color: #888; margin: 10px 0 0 0; line-height: 1.5; }

.iv-top-row { display: flex; gap: 15px; }
.iv-zoom-box { flex: 0 0 41%; }
.iv-zoom-title { text-align: center; font-size: 12px; color: #555; margin-bottom: 4px; }
.iv-canvas-zoom { display: block; width: 100%; aspect-ratio: 1; background: #111; border-radius: 4px; }
.iv-info {
    flex: 1; margin: 0; font-family: 'Consolas', monospace; font-size: 12px; line-height: 1.45;
    white-space: pre-wrap; color: #222; background: #fafafa; border: 1px solid #eee; border-radius: 6px;
    padding: 10px; overflow: auto; max-height: 300px;
}
.iv-curve-box { position: relative; margin-top: 15px; }
.iv-canvas-curva { display: block; width: 100%; height: 300px; cursor: pointer; }
.iv-tooltip {
    position: absolute; pointer-events: none; background: white; border: 1px solid #ddd; border-radius: 6px;
    padding: 6px 9px; font-size: 12px; color: #222; box-shadow: 0 2px 8px rgba(0,0,0,0.12); white-space: nowrap;
}
.iv-controls { display: flex; gap: 15px; margin-top: 12px; flex-wrap: wrap; align-items: stretch; }
.iv-controls fieldset { border: 1px solid #ddd; border-radius: 6px; padding: 6px 12px 8px; font-size: 13px; }
.iv-controls legend { font-size: 12px; color: #555; padding: 0 4px; }
.iv-controls fieldset label { display: block; margin: 3px 0; cursor: pointer; }
.iv-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; flex: 1; min-width: 200px; align-content: center; }
.iv-buttons .iv-btn-save { grid-column: 1 / 3; }

@media (max-width: 1000px) {
    .iv-tool, .iv-folders { grid-template-columns: 1fr; }
}
