/* Полный CSS-код из предыдущего ответа */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #e0e0e0;
    user-select: none;
}
#app {
    width: 100vw;
    height: 100vh;
    position: relative;
    background: #f5f5f5;
}
#svg-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f0f0f0;
}
#svg-wrapper {
    transform-origin: center center;
    transition: transform 0.1s ease-out;
}
#svg-wrapper svg {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    background: white;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}
#zoom-controls {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    background: rgba(255,255,255,0.9);
    padding: 10px 16px;
    border-radius: 40px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
}
#zoom-controls button {
    background: #2c3e50;
    color: white;
    border: none;
    border-radius: 30px;
    width: 36px;
    height: 36px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
#zoom-controls button:hover {
    background: #1a252f;
}
#zoom-controls .zoom-level {
    min-width: 50px;
    text-align: center;
    font-weight: 600;
    color: #2c3e50;
    font-size: 16px;
}
#zoom-controls .reset-btn {
    background: #e67e22;
}
#zoom-controls .reset-btn:hover {
    background: #d35400;
}
#floating-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 380px;
    max-height: calc(100vh - 100px);
    background: rgba(255,255,255,0.97);
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.25);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    resize: both;
    min-width: 300px;
    min-height: 200px;
    transition: box-shadow 0.2s;
    cursor: default;
}
#floating-panel:hover {
    box-shadow: 0 12px 48px rgba(0,0,0,0.3);
}
.panel-header {
    padding: 14px 18px;
    background: #2c3e50;
    color: white;
    font-weight: 600;
    font-size: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    flex-shrink: 0;
    border-radius: 16px 16px 0 0;
}
.panel-header .close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.7;
    padding: 0 6px;
}
.panel-header .close-btn:hover {
    opacity: 1;
}
.panel-body {
    padding: 18px 20px 20px;
    overflow-y: auto;
    flex: 1;
}
.panel-body::-webkit-scrollbar {
    width: 5px;
}
.panel-body::-webkit-scrollbar-thumb {
    background: #bdc3c7;
    border-radius: 10px;
}
.form-row {
    margin-bottom: 14px;
}
.form-row label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    font-size: 13px;
    margin-bottom: 3px;
}
.form-row input, .form-row select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 14px;
    transition: border 0.2s;
}
.form-row input:focus, .form-row select:focus {
    outline: none;
    border-color: #2980b9;
    box-shadow: 0 0 0 2px rgba(41,128,185,0.2);
}
.form-row .hint {
    font-size: 11px;
    color: #7f8c8d;
    margin-top: 2px;
}
.radio-group {
    display: flex;
    gap: 20px;
    padding-top: 4px;
}
.radio-group label {
    font-weight: normal;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    cursor: pointer;
}
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 4px;
}
.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}
.checkbox-group label {
    font-weight: normal;
    font-size: 14px;
    cursor: pointer;
}
.openings-section {
    border-top: 2px solid #ecf0f1;
    margin-top: 10px;
    padding-top: 14px;
}
.openings-section h4 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 0 10px 0;
    color: #2c3e50;
}
.opening-item {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid #e74c3c;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: end;
}
.opening-item .form-row {
    flex: 1 1 80px;
    margin-bottom: 0;
}
.opening-item .form-row label {
    font-size: 11px;
    font-weight: normal;
}
.opening-item .form-row input, .opening-item .form-row select {
    padding: 5px 8px;
    font-size: 13px;
}
.opening-item .remove-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    height: 34px;
    align-self: center;
}
.opening-item .remove-btn:hover {
    background: #c0392b;
}
.add-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}
.add-btn:hover {
    background: #1e8449;
}
.calc-btn {
    width: 100%;
    padding: 12px;
    background: #2980b9;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 10px;
}
.calc-btn:hover {
    background: #1f6a8a;
}
.result-stats {
    margin-top: 16px;
    border-top: 2px solid #ecf0f1;
    padding-top: 14px;
}
.result-stats .stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.result-stats .stat-item {
    background: white;
    padding: 6px 10px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    font-size: 13px;
    border: 1px solid #eee;
}
.result-stats .stat-item span {
    font-weight: bold;
    color: #2980b9;
}
.result-stats .stat-item .highlight {
    color: #27ae60;
}
.result-stats .openings-list {
    margin-top: 8px;
    font-size: 13px;
    color: #555;
}
.result-stats .openings-list li {
    background: white;
    padding: 4px 10px;
    border-radius: 4px;
    display: inline-block;
    margin: 3px 6px 3px 0;
    border: 1px solid #ddd;
}
.result-stats .print-hint {
    text-align: center;
    font-size: 12px;
    color: #7f8c8d;
    margin-top: 8px;
}
.error-msg {
    color: #e74c3c;
    font-weight: bold;
    padding: 8px 0;
    font-size: 14px;
}
@media print {
    #floating-panel, #zoom-controls {
        display: none !important;
    }
    #app {
        background: white;
    }
    #svg-container {
        padding: 0;
        background: white;
    }
    #svg-wrapper svg {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    body {
        overflow: visible;
    }
}
.lang-switcher {
    display: flex;
    gap: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 12px;
    padding: 2px;
}
.lang-switcher a {
    color: white;
    text-decoration: none;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    transition: background 0.2s, color 0.2s;
}
.lang-switcher a.active {
    background: white;
    color: #2c3e50;
}
.lang-switcher a:hover:not(.active) {
    background: rgba(255,255,255,0.2);
}

.print-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 10px;
    width: 100%;
}
.print-btn:hover {
    background: #1e8449;
}
.print-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s;
}
.print-btn:hover {
    background: #1e8449;
}