* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: #f5f7fa;
    padding: 12px;
    color: #333;
}

.container {
    display: flex;
    gap: 16px;
    height: calc(100vh - 24px);
}

.input-panel {
    width: 420px;
    background: white;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 0.93em;
}

.input-panel h2 {
    font-size: 1.3em;
    margin-bottom: 6px;
    color: #2c3e50;
}

/* Выбор калькулятора */
.wide-select {
    width: 100%;
    min-width: 400px;
    padding: 6px 8px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
}

/* Два подблока в строку */
.params-split {
    display: flex;
    gap: 14px;
}

.params-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.params-col label {
    font-weight: 600;
    margin: 0;
    font-size: 0.93em;
    color: #2d3748;
}

.params-col input[type="number"],
.params-col select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 0.93em;
}

/* Плоский инпут для R2 */
.plain-input {
    -webkit-appearance: none;
    -moz-appearance: textfield;
    appearance: none;
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 0.93em;
}

.plain-input::-webkit-outer-spin-button,
.plain-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.params-col input:focus {
    outline: none;
    border-color: #4299e1;
}

/* Чекбоксы */
.toggle-label {
    font-weight: normal;
    font-size: 0.9em;
    color: #4a5568;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

/* Обороты */
.cycles-container {
    display: none;
    margin-top: 4px;
}

/* Режим отрисовки */
.draw-mode-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 6px 0;
}

.draw-mode-group label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: normal;
    font-size: 0.92em;
    color: #4a5568;
    margin: 0;
}

/* Кнопка */
#calculateBtn {
    background: #3182ce;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
}

#calculateBtn:hover {
    background: #2c5aa0;
}

/* Вывод CAD — оставить как есть */
.output-section {
    margin-top: 8px;
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.output-header h3 {
    font-size: 1.05em;
    margin: 0;
}

#outputText {
    width: 100%;
    height: 120px;
    padding: 8px;
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 11px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    background: #f8fafc;
    white-space: pre;
    resize: vertical;
}

#copyBtn {
    background: #48bb78;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin-top: 6px;
}

#copyBtn:hover {
    background: #38a169;
}

/* Контакты — чуть крупнее */
.contact-footer {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #edf2f7;
    font-size: 0.92em; /* ← увеличено */
    color: #718096;
    text-align: center;
}

.contact-footer a {
    color: #3182ce;
    text-decoration: none;
}

.contact-footer a:hover {
    text-decoration: underline;
}

/* Canvas */
.canvas-panel {
    position: relative;
    flex: 1;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

.canvas-panel canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Адаптив */
@media (max-width: 1024px) {
    .container {
        flex-direction: column;
        height: auto;
    }
    .input-panel {
        width: 100%;
        max-height: 600px;
    }
}

.canvas-panel canvas {
    cursor: grab;
}

.calculator-params {
    display: block;
}