body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 16px 20px;
    background-color: #f4f6f8;
    color: #333;
}

/* New unified header is styled via shared.css */

/* Main layout container - wider + charts get priority */
section.tool-page {
    max-width: 1480px;
    margin: 16px auto;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    gap: 20px;
}
/* Old global link styles removed — new header uses shared.css */

/* Freeze checkbox styling (Feature 2) */
#freeze-checkbox {
    width: 15px;
    height: 15px;
    accent-color: #1a73e8;
    cursor: pointer;
}
.calculator {
    background-color: #f9f9f9;
    padding: 18px 20px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    width: 36%;
    flex-shrink: 0;
}

.charts {
    width: 64%;
    padding-left: 12px;
    min-width: 0; /* allow canvas to shrink properly */
}
.calculator label {
    display: block;
    margin: 8px 0 3px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #374151;
}
.calculator .param-group {
    margin-bottom: 12px;
}
.calculator input[type="number"] {
    width: 100%;
    max-width: 180px;
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.95rem;
}
.calculator input[type="number"]:focus {
    border-color: #1a73e8;
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}
.calculator input[type="range"] {
    width: 100%;
    max-width: 180px;
    margin: 3px 0 6px;
    -webkit-appearance: none;
    height: 6px;
    background: #e5e7eb;
    border-radius: 999px;
    outline: none;
}
.calculator input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    background: #1a73e8;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.calculator input[type="range"]::-webkit-slider-thumb:hover {
    background: #1557b0;
}
.calculator .equation {
    font-size: 0.82rem;
    color: #555;
    margin-top: 4px;
    line-height: 1.3;
}

.charts .transfer,
.charts .phase-boost,
.charts .poles-zeros {
    margin-top: 16px;
    font-size: 1rem;
    color: #1a73e8;
}

.transfer {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.transfer .mathjax-eq {
    margin-left: 8px;
    display: inline-block;
    padding: 6px 10px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    transform: scale(1.08);
}

.schematic {
    display: block;
    max-width: 260px;
    margin: 12px auto 18px;
    border: 1px solid #e5e7eb;
    border-radius: 5px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.calculator button {
    background-color: #1a73e8;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 8px;
    margin-right: 8px;
    font-size: 0.9rem;
}
.calculator button:hover {
    background-color: #1557b0;
}

canvas {
    max-width: 100%;
    margin-top: 12px;
}

/* These coordinate readouts are one of the best parts of this tool */
.chart-coordinates {
    font-size: 13px;
    color: #374151;
    margin-top: 4px;
    margin-bottom: 10px;
    text-align: left;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    background: #f8fafc;
    padding: 2px 6px;
    border-radius: 3px;
    display: inline-block;
}