body {
    align-items: flex-start;
}

.wizard-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 640px;
    margin: 24px auto;
    box-shadow: var(--shadow-card);
}

.wizard-card h1 {
    margin: 0 0 4px;
    font-size: 22px;
}

.wizard-card p.subtitle {
    margin: 0 0 28px;
    color: var(--text-secondary);
    font-size: 14px;
}

fieldset {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 18px 20px;
    margin: 0 0 20px;
    /* Browsers give <fieldset> a default min-width of its content's
       min-content size, which it won't shrink below no matter how
       narrow its container is - a long-standing fieldset-specific
       quirk, separate from the ordinary flex-child min-width issue.
       On Picks, that held the game grid at its full natural width on
       a narrow phone in portrait, pushing the home team's card off
       the right edge of the page. */
    min-width: 0;
}

legend {
    padding: 0 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-tertiary);
}

.field-row {
    display: flex;
    gap: 14px;
}

.field-row .field {
    flex: 1;
}

.checkbox-field {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-tertiary);
    margin-bottom: 12px;
    cursor: pointer;
    /* Same flex min-width quirk as elsewhere - without this, a long
       label (e.g. Picks' Draft toggle text) won't wrap and instead
       pushes past the page's edge on a narrow phone. */
    min-width: 0;
}

.checkbox-field input {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}

.override-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.override-row input {
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 14px;
    flex: 1 1 120px;
    min-width: 0;
}

.override-row .remove-row {
    background: none;
    border: none;
    color: var(--accent-red);
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
}

button.secondary {
    background: none;
    border: 1px dashed var(--border-muted);
    color: var(--text-secondary);
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
}

button.secondary:hover {
    border-color: var(--text-muted);
    color: var(--text-tertiary);
}

@media (max-width: 480px) {
    .wizard-card {
        padding: 24px 20px;
    }

    .field-row {
        flex-direction: column;
        gap: 0;
    }
}
