:root {
    --primary: #2563eb;
    --group-bg: #eff6ff;
    --border: #cbd5e1;
    --bg: #f8fafc;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg);
    color: #1f2937;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

.no-print {
    display: block;
}

@media print {
    .no-print {
        display: none !important;
    }

    body {
        background: white;
        padding: 0;
    }
}

.btn-home {
    background-color: #475569;
    color: white;
    padding: 8px 14px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    display: inline-block;
}

h1 {
    text-align: center;
    color: var(--primary);
    margin: 18px 0;
}

.form-container {
    background: white;
    border: 2px solid var(--primary);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.form-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--group-bg);
    border-radius: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

label {
    font-weight: 700;
}

input[type="number"],
select,
input[type="text"] {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    width: 220px;
    box-sizing: border-box;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.button-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 10px;
    flex-wrap: wrap;
}

button {
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

#generate-btn {
    background-color: #16a34a;
}

#answer-key-btn {
    background-color: #f59e0b;
}

#print-btn {
    background-color: #3b82f6;
}

#problem-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.problem-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    min-height: 120px;
}

.problem-card.wide-card {
    min-height: 150px;
}

.problem-number {
    font-weight: 700;
    margin-bottom: 8px;
}

.problem-text {
    line-height: 1.7;
}

.problem-note {
    margin-top: 10px;
    color: #475569;
    font-size: 0.95rem;
}

.inline-choice {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.number-line-wrap {
    margin-top: 12px;
}

.number-line-svg {
    width: 100%;
    height: 84px;
}

.answer-item {
    margin-bottom: 18px;
}

.answer-step {
    margin-left: 12px;
    color: #334155;
}

@media (max-width: 800px) {
    #problem-grid {
        grid-template-columns: 1fr;
    }

    input[type="number"],
    select,
    input[type="text"] {
        width: 100%;
    }
}
