body {
    font-family: tahoma, verdana, arial, sans-serif;
    font-size: 11pt;
    max-width: 52em;
    margin-left: 1em;
    margin-right: 1em;
    background-color: #f9f9f9;
}

h1 {
    color: #35A;
    border-bottom: 1px solid silver;
    padding-bottom: 4px;
}

.section {
    margin: 1em 0;
    padding: 1em;
    border-radius: 4px;
    border: 1px solid #ccc;
}

.playername { background-color: #e8f5d0; }
.stats { background-color: #e6f2ff; }
.hpetc { background-color: #e6e6e6; }
.proficiencies { background-color: #fffae6; }
.attacks { background-color: #ffe6cc; }
.magic { background-color: #ffe6e6; }
.features { background-color: #f0e6f7; }
.equipment { background-color: #e8f5d0; }

.section h2 {
    color: #631;
    margin-top: 0;
    margin-bottom: 0.5em;
}

.field-group {
    margin-bottom: 0.5em;
}

.field-row {
    display: flex;
    gap: 1em;
    margin-bottom: 0.5em;
    flex-wrap: wrap;
}

.field {
    display: flex;
    flex-direction: column;
}

.field.wide {
    flex: 1;
}

label {
    font-weight: bold;
    margin-bottom: 0.2em;
    color: #333;
}

input, textarea, select {
    padding: 0.3em;
    border: 1px solid #999;
    border-radius: 2px;
    font-family: inherit;
    font-size: inherit;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #35A;
    box-shadow: 0 0 3px rgba(53, 170, 170, 0.3);
}

.ability-scores {
    display: flex;
    gap: 0.5em;
    flex-wrap: wrap;
}

.ability-scores .field {
    align-items: center;
}

.ability-scores input {
    width: 3em;
    max-width: 4em;
}

.centered {
    text-align: center;
}

.list-container {
    border: 1px solid #ccc;
    padding: 0.5em;
    background-color: rgba(255,255,255,0.5);
    border-radius: 2px;
}

.list-item {
    display: flex;
    gap: 0.5em;
    margin-bottom: 0.3em;
    align-items: center;
}

.list-item input {
    flex: 1;
}

.list-item button {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.2em 0.5em;
    border-radius: 2px;
    cursor: pointer;
}

.add-button {
    background: #28a745;
    color: white;
    border: none;
    padding: 0.4em 0.8em;
    border-radius: 2px;
    cursor: pointer;
    margin-top: 0.3em;
}

.attack-item {
    border: 1px solid #ddd;
    padding: 0.5em;
    margin-bottom: 0.5em;
    border-radius: 2px;
    background-color: rgba(255,255,255,0.5);
}

.attack-fields {
    display: flex;
    flex-wrap: wrap;
    justify-content: start;
    gap: 0.5em;
    margin-bottom: 0.3em;
}

.attack-fields > * {
    flex: 1;
    min-width: 8em;
}

.attack-fields > *:first-child {
    flex: 2;
    min-width: 12em;
}

.attack-fields .range-field {
    flex: 0 0 10em;
    max-width: 10em;
}

.attack-fields .ammo-field {
    flex: 0 0 4ch;
    max-width: 4ch;
    width: 4ch;
}

.attack-fields::after {
    content: ' ';
    flex: auto;
}

.spell-level {
    margin-bottom: 1.5em;
    padding: 0.8em;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: rgba(255,255,255,0.3);
}

.spell-level h3 {
    margin: 0 0 0.5em 0;
    color: #631;
    font-size: 1.1em;
}

.spell-item {
    border: 1px solid #ddd;
    padding: 0.5em;
    margin-bottom: 0.5em;
    border-radius: 2px;
    background-color: rgba(255,255,255,0.8);
}

.spells-container {
    margin-bottom: 0.5em;
}

.feature-item {
    border: 1px solid #ddd;
    padding: 0.5em;
    margin-bottom: 0.5em;
    border-radius: 2px;
    background-color: rgba(255,255,255,0.5);
}

.feature-item textarea,
.spell-item textarea {
    resize: vertical;
    width: 100%;
    box-sizing: border-box;
}

.output-section {
    margin-top: 2em;
    padding: 1em;
    background-color: #f4f4f4;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.output-section h2 {
    margin-top: 0;
    color: #631;
}

#yaml-output {
    width: 100%;
    height: 300px;
    font-family: monospace;
    font-size: 10pt;
    background-color: white;
    border: 1px solid #999;
    padding: 0.5em;
}

.generate-button {
    background: #35A;
    color: white;
    border: none;
    padding: 0.6em 1.2em;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12pt;
    margin: 1em 0;
}

.generate-button:hover {
    background: #2a8;
}

.currency-fields {
    display: flex;
    gap: 1em;
}

.currency-fields .field {
    min-width: 80px;
}

kbd {
    background-color: #f5f5f5;
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 0.2em 0.4em;
    font-family: monospace;
    font-size: 0.9em;
}

/* Render options radio button groups */
.render-options {
    text-align: left;
}

.render-options label {
    display: block;
    margin-bottom: 0.3em;
    font-weight: normal;
}

/* All sections and their contents are left-aligned */
.sheet-section,
.sheet-section * {
    text-align: left !important;
}

/* Exception: ability score labels are centered */
.ability-scores label {
    text-align: center !important;
}

/* Style disabled buttons properly */
button:disabled,
.add-button:disabled {
    background-color: #ccc !important;
    color: #666 !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
}
