body {
    display: flex;
    justify-content: center;
}

h1 {
    margin-bottom: 0;
}

.wrap {
    display: flex;
    justify-content: center;
    flex-direction: row;
    max-width: 1000px;
}

.article {
    flex-direction: column;
    justify-content: start;
}

#stat_sheet {
    display: flex;
    justify-content: center;
    flex-direction: column;
}

#spells {
    display: flex;
    flex-direction: column;
}
.spells_guide_link {
    text-align: right;
    width: 100%;
}

#stat_sheet input[type="number"] {
    width: 50px;
}

body[spell_entry="manual"] .select_spell {
    display: none;
}
body[spell_entry="manual"] .manual_spell {
    display: inline-block;
}
body[spell_entry="entry"] .select_spell {
    display: inline-block;
}
body[spell_entry="entry"] .manual_spell {
    display: none !important;
}

#ability_table select, #ability_table input[type="text"] {
    width: 250px;
}
#ability_table select:disabled, #ability_table input:disabled {
    color: black;
}

#dice_roll_proof {
    margin: 0;
}
#dice_roll_result {
    margin: 10px 0 0 0;
    font-size: 1.5em;
}

@media screen and ( max-width: 676px ) {
    .wrap {
        display: flex;
        justify-content: center;
        flex-direction: column;
        align-items: center;
    }
    #spells {
        flex-direction: column-reverse;
        width: 480px;
    }
    #stat_sheet {
        flex-direction: row;
    }
    #stat_sheet fieldset {
        width: 210px;
    }
}

@media screen and ( max-width: 472px ) {
    #stat_sheet {
        flex-direction: column;
        max-width: calc( 100% - 0.70em ) !important;
        width: calc( 100% - 0.70em ) !important;
    }
    #stat_sheet fieldset {
        max-width: calc( 100% - ( 0.70em * 2 ) ) !important;
        width: calc( 100% - ( 0.70em * 2 ) ) !important;
        margin-left: -0.175em;
    }
    #spells {
        width: 100%;
    }
    #ability_table select, #ability_table input[type="text"] {
        width: 100%;
    }
    #ability_table {
        border-spacing: 0 22px;
    }
    #ability_table tr > td:nth-child(1) {
        width: 120px; 
        position: absolute;
        display: block;
        transform: translate( 0, -100% );
    }
    #ability_table tr > td:nth-child(2) {
        width: 100%;
    }
}