body {
    font-family: Arial, sans-serif;
    background-color: #f4f6f9;
    margin: 0;
    padding: 10px 20px;
    color: #333;
    height: 100vh;
    box-sizing: border-box;
    overflow: hidden;
}
.nav-bar {
    background-color: #f4f6f9;
    padding: 2px 0 8px 0;
    max-width: 1400px;
    margin: 0 auto 5px auto;
    display: flex;
    gap: 10px;
}
.nav-btn {
    background-color: #0056b3;
    color: white;
    border: none;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    width: auto;
    margin-top: 0;
}
.nav-btn:hover {
    background-color: #003d82;
}
.container {
    display: flex;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
    height: calc(100vh - 65px);
    align-items: stretch;
}
.panel {
    background: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    flex: 1;
    height: 100%;
    box-sizing: border-box;
    overflow-y: auto;
}
.sticky-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.full-panel {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    max-width: 1400px;
    margin: 0 auto;
    height: calc(100vh - 80px);
    overflow-y: auto;
    box-sizing: border-box;
}
h2 {
    font-size: 18px;
    color: #0056b3;
    border-bottom: 2px solid #0056b3;
    padding-bottom: 5px;
    margin-top: 0;
}
.section-title {
    font-size: 14px;
    font-weight: bold;
    color: #0056b3;
    border-bottom: 1px dashed #bce8f1;
    padding-bottom: 3px;
    margin-top: 10px;
    margin-bottom: 8px;
}
.form-group {
    margin-bottom: 8px;
}
label {
    display: block;
    font-weight: bold;
    margin-bottom: 2px;
    font-size: 12px;
}
select, input {
    width: 100%;
    padding: 5px 8px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
}
.preview-container {
    background: #ffffff;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 8px;
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}
.preview-title {
    color: #0056b3;
    font-weight: bold;
    margin-bottom: 4px;
    font-size: 14px;
}
.svg-box {
    width: 100%;
    height: 150px;
    background: #ffffff;
    border: 1px solid #ccc;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    margin-bottom: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
}
.svg-overlay {
    width: 100%;
    height: 100%;
    overflow: visible;
}
.ruler-bar {
    height: 22px;
    background: #f8f9fa;
    position: relative;
    border: 1px solid #ccc;
    border-radius: 3px;
    box-sizing: border-box;
    overflow: hidden;
    margin: 2px 0;
    width: 100%;
}
.ruler-tick {
    position: absolute;
    bottom: 0;
    width: 1px;
    background: #0056b3;
}
.ruler-tick-major {
    background: #333;
}
.ruler-label {
    position: absolute;
    bottom: 8px;
    font-size: 9px;
    color: #0056b3;
    font-family: monospace;
    transform: translateX(-50%);
    font-weight: bold;
}
.direction-badge {
    background: #e9ecef;
    color: #0056b3;
    padding: 4px 12px;
    font-size: 11px;
    font-family: monospace;
    border-radius: 3px;
    border: 1px solid #ccc;
    margin: 2px 0;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    font-weight: bold;
}
textarea {
    width: 100%;
    flex: 1;
    background: #e9ecef;
    color: #212529;
    font-family: 'Consolas', 'Courier New', monospace;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    resize: none;
    margin-top: 8px;
    font-size: 12px;
    line-height: 18px; 
    white-space: pre;
    overflow-wrap: normal;
    overflow-x: auto;
}
button.action-btn {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 15px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    margin-top: 10px;
    flex-shrink: 0;
}
button.action-btn:hover {
    background-color: #218838;
}
button.download-btn {
    background-color: #17a2b8;
    color: white;
    border: none;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    margin-top: 8px;
    flex-shrink: 0;
}
button.download-btn:hover {
    background-color: #138496;
}

.tool-sticky-header {
    position: sticky;
    top: 0;
    background-color: #fff;
    z-index: 50;
    padding-bottom: 10px;
}
.table-container {
    max-height: 450px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-top: 5px;
}
table.tool-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0;
}
table.tool-table th {
    position: sticky;
    top: 0;
    background-color: #0056b3;
    color: white;
    z-index: 40;
}
table.tool-table th, table.tool-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
    font-size: 13px;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}
.modal-box {
    background: #fff;
    padding: 25px 30px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    text-align: center;
    max-width: 400px;
    width: 100%;
}
.modal-box h3 {
    margin-top: 0;
    color: #0056b3;
    font-size: 18px;
}
.modal-box p {
    font-size: 14px;
    color: #333;
    margin-bottom: 20px;
}
.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}
.modal-btn-yes {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
}
.modal-btn-yes:hover {
    background-color: #c82333;
}
.modal-btn-no {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
}
.modal-btn-no:hover {
    background-color: #5a6268;
}

/* --- STABILE ANIMATIONEN OHNE CSS-CALC() --- */
@keyframes virtualDrillAnim {
    0%   { transform: translateY(-70px); opacity: 0; }
    10%  { transform: translateY(var(--pos-start)); opacity: 1; }
    20%  { transform: translateY(var(--pos-1)); opacity: 1; } 
    25%  { transform: translateY(var(--pos-1-up)); opacity: 1; } 
    35%  { transform: translateY(var(--pos-2));  opacity: 1; } 
    40%  { transform: translateY(var(--pos-2-up)); opacity: 1; } 
    50%  { transform: translateY(var(--pos-end));  opacity: 1; } 
    60%  { transform: translateY(var(--pos-end));  opacity: 1; } 
    70%  { transform: translateY(-50px); opacity: 1; } 
    100% { transform: translateY(-70px); opacity: 0; }
}

@keyframes virtualReamAnim {
    0%   { transform: translateY(-70px); opacity: 0; }
    15%  { transform: translateY(var(--pos-start)); opacity: 1; }
    40%  { transform: translateY(var(--pos-end));  opacity: 1; } 
    60%  { transform: translateY(var(--pos-end));  opacity: 1; } 
    70%  { transform: translateY(-50px); opacity: 1; } 
    100% { transform: translateY(-70px); opacity: 0; }
}

@keyframes virtualMillAnim {
    0%   { transform: translate(0, -70px); opacity: 0; }
    10%  { transform: translate(0, var(--pos-start)); opacity: 1; }
    20%  { transform: translate(var(--hx), var(--pos-1)); opacity: 1; }
    30%  { transform: translate(var(--neg-hx), var(--pos-2)); opacity: 1; }
    40%  { transform: translate(var(--hx), var(--pos-end)); opacity: 1; }
    50%  { transform: translate(var(--neg-hx), var(--pos-end)); opacity: 1; } 
    60%  { transform: translate(var(--hx), var(--pos-end)); opacity: 1; } 
    65%  { transform: translate(0, var(--pos-end)); opacity: 1; } 
    75%  { transform: translate(0, var(--pos-end)); opacity: 1; } 
    85%  { transform: translate(0, -50px); opacity: 1; } 
    100% { transform: translate(0, -70px); opacity: 0; }
}

.virtual-drill {
    animation: virtualDrillAnim 3s ease-in-out infinite;
    pointer-events: none;
}
.virtual-ream {
    animation: virtualReamAnim 3s ease-in-out infinite;
    pointer-events: none;
}
.virtual-mill {
    animation: virtualMillAnim 3s linear infinite;
    pointer-events: none;
}

.highlight-svg {
    filter: drop-shadow(0 0 1px red) sepia(1) hue-rotate(-50deg) saturate(30);
}
