.foundation-section {
    padding: 60px 0;
    background: #fff;
}

.foundation-grid {
    display: flex;
    grid-template-columns: 300px 1fr;
    justify-content: center;
    gap: 50px;
}

.foundation-controls {
    background: var(--light-gray);
    padding: 25px;
    border-radius: 8px;
    max-width: 380px;
}

.f-results {
    margin: 20px 0;
    padding: 15px;
    background: var(--dark-bg);
    color: #fff;
    border-radius: 4px;
}

.f-result-item {
    margin-bottom: 10px;
}

.f-result-item strong {
    color: var(--primary-color);
    font-size: 20px;
}

.canvas-container {
    background: #eee;
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    width: fit-content;
}

#foundationCanvas {
    display: block;
    background-color: #fff;
    max-width: 100%;
}

@media (max-width: 768px) {
    .foundation-section {
        display: none;
    }
}

.type-selector {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.radio-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: bold;
}

.checkmark {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    margin-right: 8px;
    border: 2px solid #ddd;
    display: inline-block;
}

input[type="radio"]:checked + .type-p { background: #333; border-color: #333; }
input[type="radio"]:checked + .type-s { background: #007bff; border-color: #007bff; }

.control-group h4 {
    margin: 15px 0 10px;
    font-size: 14px;
    text-transform: uppercase;
    color: #666;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.input-row div input {
    max-width: 100%;
}

.btn-clear {
    width: 100%;
    padding: 10px;
    background: #ff4d4d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
}

.instruction {
    font-size: 12px;
    color: #888;
    margin-top: 15px;
    line-height: 1.4;
}

.canvas-container {
    background: #f8f9fa;
    border: 2px solid #ced4da;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

#foundationCanvas {
    background-color: #ffffff;
}

.tool-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.tool-btn {
    padding: 12px;
    border: 2px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tool-btn.active {
    border-color: #007bff;
    background: #eef4ff;
    color: #007bff;
}

.tool-btn:hover:not(.active) {
    background: #f8f9fa;
    border-color: #bbb;
}