:root {
    color-scheme: dark;
    font-family: system-ui, sans-serif;
    background: #111216;
    color: #f4f1e8;
    --mechanic-ap-color: #80c7ff;
    --mechanic-hp-color: #7ee2a8;
    --mechanic-armor-color: #f2c66d;
    --mechanic-die-color: #d7a8ff;
    --mechanic-glow-color: #f5a6ff;
    --mechanic-backlash-color: #ff8a80;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

[hidden] { display: none !important; }

.shell { flex: 1; padding: 2rem 1.5rem 4rem; box-sizing: border-box; }
.site-header { min-height: 4rem; padding: 0 1.5rem; border-bottom: 1px solid #393b43; display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: #17181d; }
.site-header .desktop-navigation { display: flex; flex-wrap: wrap; gap: 1rem; }
.site-header a { color: #e5d1b1; text-decoration: none; }
.brand { font-size: 1.15rem; font-weight: 800; letter-spacing: .04em; }
.mobile-navigation { display: none; position: relative; }
.mobile-navigation > summary { display: grid; width: 2.75rem; height: 2.75rem; place-items: center; border: 1px solid #51545f; border-radius: .4rem; color: #e5d1b1; cursor: pointer; font-size: 1.55rem; line-height: 1; list-style: none; }
.mobile-navigation > summary::-webkit-details-marker { display: none; }
.mobile-navigation > summary::marker { content: ""; }
.mobile-navigation[open] > summary { border-color: #c7a36b; background: #20232b; }
.mobile-navigation nav { position: absolute; z-index: 20; top: calc(100% + .55rem); right: 0; display: grid; width: min(17rem, calc(100vw - 2rem)); padding: .5rem; border: 1px solid #51545f; border-radius: .5rem; background: #1b1d23; box-shadow: 0 .75rem 2rem rgb(0 0 0 / 45%); }
.mobile-navigation nav a { padding: .75rem .85rem; border-radius: .35rem; }
.mobile-navigation nav a:hover, .mobile-navigation nav a:focus-visible { background: #2a2d35; }
.page { width: min(100%, 76rem); margin: 0 auto; }
.page.narrow { width: min(100%, 44rem); }
.shell > .card { margin: 8vh auto; }

.card {
    width: min(100%, 28rem);
    padding: 2rem;
    border: 1px solid #393b43;
    border-radius: 0.75rem;
    background: #1b1d23;
    box-shadow: 0 1rem 3rem rgb(0 0 0 / 30%);
}
.panel { padding: 1.25rem; border: 1px solid #393b43; border-radius: .65rem; background: #1b1d23; color: inherit; text-decoration: none; }
.panel h2 { margin-top: 0; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; margin: 1.5rem 0 2rem; }
.card-grid .panel:hover, .list-row:hover { border-color: #c7a36b; }

.eyebrow {
    margin: 0;
    color: #c7a36b;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

h1 {
    margin: 0.35rem 0 0.75rem;
}
h2 { margin-top: 1.75rem; }
a { color: #e7bd7d; }

.muted { color: #b6b8c0; }
.error { color: #ffaaa4; }
.mechanic { font-weight: 700; }
.mechanic-ap { color: var(--mechanic-ap-color); }
.mechanic-hp { color: var(--mechanic-hp-color); }
.mechanic-armor { color: var(--mechanic-armor-color); }
.mechanic-die { color: var(--mechanic-die-color); }
.mechanic-glow { color: var(--mechanic-glow-color); }
.mechanic-backlash { color: var(--mechanic-backlash-color); }

label {
    display: block;
    margin: 1rem 0 0.35rem;
    font-weight: 600;
}

input, select, textarea {
    width: 100%;
    padding: 0.7rem;
    box-sizing: border-box;
    border: 1px solid #51545f;
    border-radius: 0.35rem;
    background: #101116;
    color: inherit;
}
select[multiple] { min-height: 12rem; }
input[type="checkbox"], input[type="radio"] { width: auto; }
form ul { list-style: none; padding: 0; }
form li label { margin: .25rem 0; font-weight: 400; }

button {
    width: 100%;
    margin-top: 1.25rem;
    padding: 0.75rem 1rem;
    border: 0;
    border-radius: 0.35rem;
    background: #c7a36b;
    color: #17130d;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

button.secondary {
    background: #343741;
    color: #f4f1e8;
}
button.inline, .button-link.inline { display: inline-block; width: auto; margin-top: 0; }
button.danger { background: #8b3535; color: white; }

.button-link {
    display: block;
    margin-top: 1.25rem;
    padding: 0.75rem 1rem;
    border-radius: 0.35rem;
    background: #c7a36b;
    color: #17130d;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.button-link.secondary {
    background: #343741;
    color: #f4f1e8;
}
.toolbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.toolbar h1 { margin-top: .25rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin: 1rem 0; }
.actions form { margin: 0; }
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 1rem; padding: 1rem; background: #17181d; border-radius: .5rem; margin: 1rem 0; }
.filters label { margin: 0; }
.filters select { margin-top: .35rem; }
.list-stack { display: grid; gap: .6rem; }
.list-row { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem; border: 1px solid #393b43; border-radius: .5rem; color: inherit; text-decoration: none; background: #1b1d23; }
.badge { display: inline-block; padding: .16rem .45rem; border-radius: 999px; background: #3b3e48; color: #e5e6eb; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
.badge.official, .badge.approved { background: #285b45; }.badge.experimental { background: #6d4f20; }.badge.draft { background: #3b496b; }.badge.archived { background: #5c3940; }.badge.review { background: #7d3535; }
.notice { width: min(100%, 76rem); box-sizing: border-box; padding: .9rem 1rem; border: 1px solid #4b5365; border-radius: .5rem; background: #202633; }
.notice.warning { border-color: #936a2b; background: #332819; }.notice.success { border-color: #316b50; background: #172c24; }
.maintenance-bypass-banner { padding: .65rem 1rem; border-bottom: 1px solid #936a2b; background: #332819; color: #ffe3a3; text-align: center; font-weight: 800; }
.messages { width: min(100%, 76rem); margin: 0 auto 1rem; }
.stats-grid, .field-grid, .summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .75rem; }
.stat, .summary-grid .panel { display: flex; flex-direction: column; gap: .3rem; padding: 1rem; border: 1px solid #393b43; border-radius: .5rem; background: #1b1d23; }
.stat strong, .summary-grid strong { font-size: 1.65rem; }
.form-section { margin: 1.25rem 0; padding: 1.25rem; border: 1px solid #393b43; border-radius: .65rem; background: #1b1d23; }
.form-section h2 { margin-top: 0; }
.two-column, .comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.result { margin-top: 1.5rem; }
.site-footer { display: flex; justify-content: center; gap: .5rem; padding: 1rem 1.5rem; border-top: 1px solid #393b43; background: #17181d; color: #b6b8c0; font-size: .9rem; }
.site-footer a { color: #e5d1b1; }
.changelog-entry { margin-top: 2rem; padding-top: .25rem; scroll-margin-top: 1.5rem; border-top: 1px solid #393b43; }
.changelog-entry h2 { display: flex; align-items: baseline; gap: .5rem; }
.changelog-entry h3 { margin-bottom: .5rem; color: #e5d1b1; }
.changelog-entry li { margin: .5rem 0; line-height: 1.5; }
.anchor-link { color: #b6b8c0; font-size: .9em; text-decoration: none; }
.anchor-link:hover, .anchor-link:focus { color: #e7bd7d; }
.form-section > summary, .subsection > summary { cursor: pointer; }
.form-section > summary h2, .subsection > summary h3 { display: inline; margin: 0; }
.section-body { margin-top: 1rem; }
.budget-indicator { position: sticky; top: .5rem; z-index: 2; padding: .7rem .9rem; border: 1px solid #4b5365; border-radius: .4rem; background: #202633; font-weight: 800; }
.over-budget { color: #ffaaa4; border-color: #b84b45; box-shadow: 0 0 .5rem rgb(184 75 69 / 45%); }
.invalid-field { border-color: #d8625b; box-shadow: 0 0 0 2px rgb(216 98 91 / 25%); }
.field-error, .warning-text { color: #ffaaa4; font-weight: 700; }
.skill-reference { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.skill-reference span { padding: .45rem .65rem; border: 1px solid #393b43; border-radius: .35rem; background: #101116; }
.show-all { display: inline-flex; align-items: center; gap: .45rem; margin: .75rem 0 1rem; }
.talent-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.choice-group h3 { margin: .25rem 0 .65rem; }
.talent-role { min-width: 0; padding: .7rem; border: 1px solid #393b43; border-radius: .45rem; background: #17181d; }
.talent-role > summary { cursor: pointer; }
.talent-role > summary h3 { display: inline; }
.talent-role > .compact-choice-list { margin-top: .65rem; }
.compact-choice-list, .equipment-list { display: grid; gap: .35rem; }
.choice-card, .package-card { display: block; padding: .55rem .65rem; border: 1px solid #393b43; border-radius: .35rem; background: #101116; }
.package-card { margin: .5rem 0; cursor: pointer; }
.choice-line { display: flex; align-items: center; gap: .5rem; }
.choice-line > label { flex: 1; margin: 0; font-weight: 500; }
.description-toggle { width: 2rem; min-width: 2rem; margin: 0; padding: .25rem; background: #343741; color: #f4f1e8; }
.choice-description { margin-top: .5rem; padding: .55rem; border-left: 2px solid #c7a36b; color: #d6d7dc; line-height: 1.45; }
.choice-card.unavailable { opacity: .55; }
.subsection { margin-top: 1rem; padding: .8rem; border: 1px solid #393b43; border-radius: .45rem; }
.equipment-budget { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; padding: .8rem; border-radius: .45rem; background: #202633; }
.equipment-item .source-badges { display: flex; flex-wrap: wrap; gap: .3rem; }
.starting-badge { background: #285b45; }.package-badge { background: #594679; }.equipped-badge { background: #6d4f20; }
.equip-control { display: inline-flex; align-items: center; gap: .35rem; margin: .5rem 0 0 1.5rem; font-weight: 500; }
.equipment-quantity-control { display: flex; align-items: center; gap: .5rem; margin: .5rem 0 0 1.5rem; font-weight: 700; }
.equipment-quantity-control input { width: 6rem; }
.equipment-item:not(:has(.equipment-select:checked)) .equip-control { display: none; }
.dependent-field.is-disabled { opacity: .55; }
.dependent-field.is-disabled label { color: #b6b8c0; }
.dependent-field select:disabled { cursor: not-allowed; }
.dependent-help { margin: .4rem 0 0; font-size: .9rem; }
.equipment-description dl { display: grid; grid-template-columns: max-content 1fr; gap: .25rem .8rem; margin: 0; }
.equipment-description dt { font-weight: 700; }.equipment-description dd { margin: 0; }
.casting-flow { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; padding-left: 1.5rem; }
.casting-flow li { padding-right: .5rem; }
.magnitude-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.magnitude-card h4, .power-magnitudes h4 { margin-top: 0; }
.glow-domain-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.glow-domain-card h3, .glow-example h3 { margin-top: 0; }
.glow-domain-group { margin-top: 1.5rem; }
.glow-domain-group:first-child { margin-top: 0; }
.glow-example p { line-height: 1.55; }
.glow-reference-page .subsection { padding: 0; overflow: hidden; }
.glow-reference-page .subsection > summary { padding: .8rem; }
.glow-reference-page .subsection[open] {
    padding-bottom: .8rem;
    border-color: #51545f;
}
.glow-reference-page .subsection[open] > summary {
    margin-bottom: .8rem;
    border-bottom: 1px solid #393b43;
    background: #20232b;
}
.glow-reference-page .subsection > :not(summary) {
    margin-right: .8rem;
    margin-left: .8rem;
}
.glow-reference-page .lead,
.glow-rule-copy > p,
.glow-check-flow > p,
.glow-check-outcomes p {
    max-width: 72ch;
    line-height: 1.6;
}
.glow-rule-copy { margin: .75rem 0 1rem; }
.glow-rule-copy > h4 {
    margin: 1.35rem 0 .55rem;
    color: #e5d1b1;
}
.glow-rule-formula {
    padding: .7rem .9rem;
    border-left: 3px solid var(--mechanic-glow-color);
    background: #201b24;
    font-weight: 800;
}
.glow-rule-copy-backlash .glow-rule-formula {
    border-left-color: var(--mechanic-backlash-color);
}
.glow-rule-labeled {
    padding: .6rem .75rem;
    border-left: 3px solid #745078;
    background: #17181d;
}
.glow-rule-table {
    width: min(100%, 52rem);
    margin: .75rem 0 1.25rem;
}
.glow-check-flow {
    max-width: 62rem;
    margin: .75rem 0 1.25rem;
}
.glow-check-outcomes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
}
.glow-check-outcomes > section {
    min-width: 0;
    padding: .75rem .9rem;
    border: 1px solid #393b43;
    border-left-width: 4px;
    border-radius: .35rem;
    background: #17181d;
}
.glow-check-outcomes > .contained { border-left-color: var(--mechanic-hp-color); }
.glow-check-outcomes > .breach { border-left-color: var(--mechanic-backlash-color); }
.glow-check-outcomes h5 { margin: 0 0 .35rem; font-size: 1rem; }
.glow-check-outcomes p { margin: 0; }
.backlash-procedure { margin-bottom: 1rem; }
.backlash-procedure > h3 { margin-top: 0; }
@media (max-width: 700px) {
    .glow-check-outcomes { grid-template-columns: 1fr; }
    .glow-reference-page .subsection > :not(summary) {
        margin-right: .65rem;
        margin-left: .65rem;
    }
}
.power-list { display: grid; gap: .5rem; margin-top: 1rem; }
.power-entry { border: 1px solid #393b43; border-radius: .35rem; background: #101116; }
.power-entry > summary { display: flex; justify-content: space-between; gap: .75rem; padding: .65rem; cursor: pointer; }
.glow-build-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .65rem; }
.glow-build-summary p { margin: 0; }
.dependent-fields.unavailable, #advanced-manipulation-field.unavailable, #glow-resonance-field.unavailable, .glow-capstone.unavailable { opacity: .55; }
.affinity-badge { margin-left: .4rem; }
.library-card { display: block; }
.library-card:focus-visible, .status-tab:focus-visible, summary:focus-visible, button:focus-visible, .button-link:focus-visible { outline: 3px solid #f2c66d; outline-offset: 3px; }
.status-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 1.5rem; border-bottom: 1px solid #393b43; }
.status-tab { padding: .7rem 1rem; border: 1px solid transparent; border-bottom: 0; border-radius: .4rem .4rem 0 0; color: #d6d7dc; text-decoration: none; }
.status-tab:hover { background: #20232b; }
.status-tab.selected { border-color: #51545f; background: #1b1d23; color: #f4f1e8; font-weight: 800; }
.status-tab .tab-count { margin-left: .35rem; min-width: 1.45rem; text-align: center; }
.reference-controls { display: flex; flex-wrap: wrap; gap: .5rem; margin: .75rem 0; }
.reference-controls button { margin: 0; padding: .5rem .75rem; }
.reference-entry-list { display: grid; gap: .55rem; }
.reference-entry, .reference-section { scroll-margin-top: 1.25rem; border: 1px solid #393b43; border-radius: .5rem; background: #17181d; }
.reference-entry > summary, .reference-section > summary { cursor: pointer; }
.reference-entry > summary, .reference-section > summary { list-style: none; }
.reference-entry > summary::-webkit-details-marker, .reference-section > summary::-webkit-details-marker { display: none; }
.reference-entry > summary { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .85rem 1rem .85rem 2.4rem; }
.reference-entry > summary::before, .reference-section > summary::before { position: absolute; left: .9rem; color: #e7bd7d; font-weight: 900; content: "+"; }
.reference-entry[open] > summary::before, .reference-section[open] > summary::before { content: "−"; }
.reference-entry-name { font-weight: 800; }
.reference-entry-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .35rem; }
.reference-entry-body { padding: 0 1rem 1rem; border-top: 1px solid #393b43; overflow-wrap: anywhere; }
.entry-context { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; margin: .8rem 0; }
.entry-actions { margin-bottom: 0; }
.reference-section { margin-top: 1rem; background: #1b1d23; }
.reference-section > summary { position: relative; display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: 1rem 1.1rem 1rem 2.5rem; }
.reference-section > summary h2 { display: inline; margin: 0; }
.reference-section-body { padding: 0 1rem 1rem; }
.bestiary-filters { margin: 1rem 0; }
.bestiary-filters .button-row { margin-bottom: 0; }
.creature-facts { grid-template-columns: repeat(4, max-content minmax(3rem, 1fr)); }
.creature-rules-section { margin-top: .75rem; border-top: 1px solid #393b43; }
.creature-rules-section > summary { padding: .8rem 0 .35rem; cursor: pointer; }
.creature-rules-section > summary h3 { display: inline; margin: 0; }
.creature-rules-body { display: grid; gap: .65rem; padding: .35rem 0; }
.creature-rules-body p { margin: 0; }
.creature-action { padding: .7rem; border-radius: .4rem; background: #101116; }
.creature-action h4 { margin: 0 0 .35rem; }
.encounter-add-form, .encounter-quantity-actions, .encounter-quantity-actions form { display: flex; flex-wrap: wrap; align-items: end; gap: .65rem; }
.encounter-add-form { margin: 1rem 0; padding: .75rem; border-radius: .4rem; background: #20232b; }
.encounter-add-form label, .encounter-quantity-actions label { margin: 0; }
.encounter-add-form input[type="number"], .encounter-quantity-actions input[type="number"] { width: 6rem; }
.encounter-add-form button, .encounter-quantity-actions button { width: auto; margin: 0; }
.encounter-setup-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 1rem 0; }
.encounter-setup-grid .panel { margin: 0; }
.encounter-setup-grid h2 { margin-top: 0; }
.encounter-selection-form { display: flex; align-items: end; gap: .65rem; }
.encounter-selection-form .field { flex: 1 1 auto; }
.encounter-selection-form button { width: auto; margin: 0; }
.encounter-search-results, .encounter-roster-list { display: grid; gap: .55rem; }
.encounter-search-row, .encounter-roster-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .8rem 1rem; border: 1px solid #393b43; border-radius: .5rem; background: #1b1d23; }
.encounter-search-row strong, .encounter-roster-row strong { font-size: 1.05rem; }
.encounter-roster-row p { margin: .25rem 0 0; }
.encounter-row-badges { justify-content: flex-start; margin-top: .4rem; }
.encounter-row-form { display: flex; align-items: end; gap: .5rem; }
.encounter-row-form input[type="number"] { width: 4.5rem; }
.encounter-row-form button { width: auto; margin: 0; }
.encounter-summary { margin: 1rem 0; }
.encounter-roster-toolbar { align-items: center; margin-top: 1.25rem; }
.encounter-roster-toolbar h2 { margin: 0; }
.encounter-roster-toolbar button { width: auto; margin: 0; }
.encounter-quantity-actions { justify-content: flex-end; margin: 0; padding: 0; border: 0; }
.empty-encounter { margin-top: 1rem; }
.encounter-guidance { margin-top: 1rem; }
.encounter-guidance > summary { cursor: pointer; }
.encounter-guidance > summary h2 { display: inline; margin: 0; }
.compact-actions { align-items: center; margin: 0; }
.compact-actions form, .compact-actions button, .compact-actions .button-link { width: auto; margin: 0; }
.tracker-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.tracker-toolbar h2, .tracker-add-character h2 { margin-top: 0; }
.tracker-add-character { margin-bottom: 1rem; }
.tracker-turn-order { display: grid; grid-template-columns: minmax(12rem, .4fr) minmax(0, 1fr); gap: 1rem; align-items: start; margin-bottom: 1rem; }
.tracker-turn-order h2 { margin-top: 0; }
.tracker-turn-order ol { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0; padding: 0; list-style: none; }
.tracker-turn-order li { display: flex; align-items: center; gap: .45rem; padding: .35rem .55rem; border: 1px solid #51545f; border-radius: .4rem; background: #17181d; }
.tracker-turn-order li.active { border-color: #e7bd7d; background: #332819; }
.tracker-turn-order li span { min-width: 1.5rem; color: #e7bd7d; font-weight: 800; text-align: center; }
.inline-form { display: flex; flex-wrap: wrap; align-items: end; gap: .75rem; }
.inline-form .field { flex: 1 1 18rem; }
.inline-form button { width: auto; margin: 0; }
.tracker-combatant-list { display: grid; gap: 1rem; }
.tracker-combatant { border-left: 4px solid #51545f; }
.tracker-combatant.current-turn { border-left-color: #e7bd7d; box-shadow: 0 0 0 1px rgb(231 189 125 / 35%); }
.tracker-combatant.combatant-out { opacity: .72; }
.tracker-combatant-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.tracker-combatant-heading h2 { margin: 0; }
.tracker-combatant-heading p { margin-bottom: 0; }
.tracker-weapon { margin-top: 1rem; padding: .8rem; border: 1px solid #393b43; border-radius: .4rem; background: #17181d; }
.tracker-weapon h3 { margin-top: 0; }
.tracker-weapon-form label { flex-basis: 100%; }
.tracker-weapon-form select { flex: 1 1 20rem; }
.tracker-weapon-facts { display: flex; flex-wrap: wrap; gap: .6rem 1.25rem; margin: .85rem 0 0; }
.tracker-weapon-facts div { display: flex; gap: .4rem; }
.tracker-weapon-facts dt { font-weight: 800; }
.tracker-weapon-facts dd { margin: 0; }
.tracker-weapon-properties { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: 0; }
.tracker-rolls { margin-top: 1rem; }
.tracker-rolls h3 { margin: 0 0 .6rem; }
.tracker-roll-form { display: grid; grid-template-columns: minmax(12rem, 1fr) minmax(9rem, .45fr) auto; gap: .65rem; align-items: end; }
.tracker-roll-form .field { margin: 0; }
.tracker-roll-form button { width: auto; margin: 0; }
.tracker-attack { margin-top: 1rem; padding-top: .75rem; border-top: 1px solid #393b43; }
.tracker-attack > summary { cursor: pointer; }
.tracker-attack > summary h3 { display: inline; }
.tracker-attack-form { display: grid; grid-template-columns: repeat(2, minmax(12rem, 1fr)); gap: .65rem; margin-top: .8rem; }
.tracker-attack-form .field { margin: 0; }
.tracker-spend-ap { display: inline-flex; align-items: center; gap: .4rem; margin: 0; }
.tracker-attack-form button { width: auto; margin: 0; justify-self: end; }
.tracker-number-fields { display: grid; grid-template-columns: repeat(6, minmax(5.5rem, 1fr)); gap: .65rem; margin: 1rem 0; }
.tracker-number-fields input { min-width: 0; }
.tracker-stepper { display: grid; grid-template-columns: 2.25rem minmax(3.25rem, 1fr) 2.25rem; }
.tracker-stepper input { border-radius: 0; text-align: center; }
.tracker-number-fields input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
.tracker-number-fields input[type="number"]::-webkit-inner-spin-button,
.tracker-number-fields input[type="number"]::-webkit-outer-spin-button { appearance: none; -webkit-appearance: none; margin: 0; }
.tracker-stepper button { width: 2.25rem; margin: 0; padding-inline: 0; border-radius: 0; }
.tracker-stepper button:first-child { border-radius: .35rem 0 0 .35rem; }
.tracker-stepper button:last-child { border-radius: 0 .35rem .35rem 0; }
.tracker-checks { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; margin: 0 0 1rem; }
.tracker-checks label { display: inline-flex; align-items: center; gap: .4rem; margin: 0; }
.tracker-state-form > button { width: auto; margin: 0; }
.tracker-turn-actions { margin-top: .75rem; }
.tracker-conditions { margin-top: 1rem; padding-top: .75rem; border-top: 1px solid #393b43; }
.tracker-conditions h3 { margin-top: 0; }
.condition-list { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: .75rem; }
.condition-chip { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .35rem .2rem .65rem; border: 1px solid #754141; border-radius: 999px; background: #3a2020; }
.condition-chip button { width: auto; margin: 0; padding: .1rem .35rem; border: 0; background: transparent; color: inherit; }
.derived-condition { padding-right: .65rem; }
.compact-condition-form { align-items: center; }
.compact-condition-form select { width: auto; min-width: 12rem; }
.encounter-log { margin-top: 1rem; }
.encounter-log > summary { cursor: pointer; }
.encounter-log > summary h2 { display: inline; }
.encounter-log-body { margin-top: 1rem; }
.encounter-log-actions { display: flex; justify-content: flex-end; }
.encounter-log-actions button { width: auto; margin: 0; }
.encounter-log-list { display: grid; gap: .55rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.encounter-log-list li { display: grid; gap: .2rem; padding: .65rem .75rem; border: 1px solid #393b43; border-radius: .4rem; background: #17181d; }
.encounter-log-list span { color: #e7bd7d; }
.encounter-notes { margin-top: 1rem; }
.encounter-notes > summary { cursor: pointer; }
.encounter-notes > summary h2 { display: inline; }
.rule-facts { display: grid; grid-template-columns: minmax(9rem, max-content) minmax(0, 1fr); gap: .45rem 1rem; margin: 1rem 0; }
.rule-facts dt { font-weight: 800; }.rule-facts dd { margin: 0; }
.rule-facts .badge + .badge { margin-left: .3rem; }
.release-hash { overflow-wrap: anywhere; }
.compact-list { margin: 0; padding-left: 1.2rem; }
.reference-table-wrap { max-width: 100%; overflow-x: auto; }
.reference-table-wrap table { width: 100%; border-collapse: collapse; }
.reference-table-wrap th, .reference-table-wrap td { padding: .55rem .7rem; border-bottom: 1px solid #393b43; text-align: left; }
.bell-calendar { margin: 1.25rem 0; }
.bell-calendar h2, .bell-calendar h3, .bell-grand-year h2 { margin-top: 0; }
.bell-date-converters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; }
.bell-date-converters > section { min-width: 0; padding: 1rem; border: 1px solid #393b43; border-radius: .5rem; background: #17181d; }
.bell-date-converters > section > p { margin-bottom: 0; }
.bell-calendar-form { margin: 1rem 0; padding-top: 1rem; border-top: 1px solid #393b43; }
.bell-date-converters .bell-calendar-form { margin-bottom: 0; }
.bell-calendar-form .field label { margin-top: 0; }
.button-link.disabled { opacity: .45; pointer-events: none; }
.bell-month-heading { display: grid; grid-template-columns: auto minmax(12rem, 1fr) auto; align-items: center; gap: 1rem; margin: 1.5rem 0 .75rem; text-align: center; }
.bell-month-heading h3, .bell-month-heading p { margin-bottom: .15rem; }
.bell-month-scroll-hint { display: none; }
.bell-month-calendar { min-width: 56rem; table-layout: fixed; }
.bell-month-calendar th { text-align: center; }
.bell-month-calendar th:first-child { width: 7rem; }
.reference-table-wrap .bell-month-calendar td { height: 7rem; padding: 0; vertical-align: top; }
.bell-calendar-day > a { display: flex; min-height: 7rem; height: 100%; flex-direction: column; gap: .3rem; padding: .55rem; color: inherit; text-decoration: none; }
.bell-calendar-day > a:hover { background: #282b34; }
.bell-calendar-day.selected { outline: 3px solid #e7bd7d; outline-offset: -3px; background: #282619; }
.bell-calendar-day.has-event { background: #202a25; }
.bell-calendar-day.empty { background: #14151a; }
.bell-day-number { font-size: 1.2rem; font-weight: 850; }
.bell-day-name { color: #b6b8c0; font-size: .78rem; }
.bell-season-marker { margin-top: auto; padding: .25rem .35rem; border: 1px solid #56806a; border-radius: .3rem; background: #1b3528; color: #d6f1df; font-size: .72rem; font-weight: 800; line-height: 1.25; }
.bell-calendar-selected { margin: 1rem 0; padding: 1rem; border-left: 4px solid #c89b51; background: #17181d; }
.bell-calendar-selected h3 { margin-bottom: .35rem; font-size: clamp(1.4rem, 4vw, 2rem); }
.bell-old-earth-date { display: block; margin-top: .2rem; color: #b6b8c0; line-height: 1.35; }
.bell-calendar-summary strong { overflow-wrap: anywhere; font-size: 1.25rem; }
.bell-calendar-summary small { color: #b6b8c0; line-height: 1.4; }
.bell-calendar-correction { margin-top: 1rem; }
.bell-season-heading { margin-top: 1.5rem; }
.bell-grand-year { margin: 1rem 0; }
.bell-grand-year-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.bell-grand-year-heading p { margin-bottom: .75rem; }
.rules-comparison { min-width: 44rem; }
.rules-comparison th:first-child { width: 12rem; }
.rules-comparison td { width: 50%; vertical-align: top; }
.rules-comparison pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; color: inherit; font: inherit; }
.template-card > summary > span:first-child { min-width: 0; }
.template-card .muted { display: inline-block; margin-top: .25rem; line-height: 1.4; }
.template-progression table { min-width: 58rem; }
.template-progression th:first-child { width: 3.5rem; text-align: center; }
.template-progression td { min-width: 12rem; vertical-align: top; line-height: 1.45; }
.template-choice, .template-review { margin-top: .65rem; padding: .55rem; border-left: 3px solid #936a2b; background: #332819; }
.template-choice ul, .template-review ul { margin: .35rem 0 0; padding-left: 1.2rem; }
.path-choice-list { display: grid; gap: 1rem; margin: 1.25rem 0; }
.path-choice { width: auto; }
.path-choice-label { display: flex; align-items: flex-start; gap: .65rem; margin: 0; cursor: pointer; }
.path-choice-label input { margin-top: .3rem; }
.path-choice-label strong { font-size: 1.15rem; }
.path-level-field { max-width: 18rem; }
.skill-rank-reference { width: auto; margin: 1rem 0; }
.skill-rank-reference h2 { margin-top: 0; }
input[list]::-webkit-inner-spin-button, input[list]::-webkit-outer-spin-button { appearance: none; margin: 0; }
@media (max-width: 950px) { .talent-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 950px) { .tracker-number-fields { grid-template-columns: repeat(3, minmax(5.5rem, 1fr)); } }
@media (max-width: 900px) { .bell-date-converters { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .site-header { padding-block: .6rem; }.site-header .desktop-navigation { display: none; }.mobile-navigation { display: block; }.two-column, .comparison, .talent-grid, .magnitude-grid, .encounter-setup-grid, .tracker-turn-order { grid-template-columns: 1fr; }.list-row, .tracker-toolbar, .tracker-combatant-heading, .encounter-search-row, .encounter-roster-row { align-items: stretch; flex-direction: column; }.equipment-description dl, .rule-facts, .creature-facts { grid-template-columns: 1fr; }.equipment-description dd, .rule-facts dd { margin-bottom: .4rem; }.reference-entry > summary, .reference-section > summary { align-items: flex-start; flex-direction: column; }.reference-entry-badges { justify-content: flex-start; }.tracker-number-fields { grid-template-columns: repeat(2, minmax(7rem, 1fr)); } }
@media (max-width: 700px) { .tracker-roll-form, .tracker-attack-form { grid-template-columns: 1fr; }.tracker-roll-form button, .tracker-attack-form button { width: 100%; justify-self: stretch; } }
@media (max-width: 700px) { .bell-grand-year-heading { align-items: stretch; flex-direction: column; }.bell-month-heading { grid-template-columns: 1fr 1fr; }.bell-month-heading > div { grid-column: 1 / -1; grid-row: 1; }.bell-month-heading .button-link { width: 100%; text-align: center; } }
@media (max-width: 700px) { .bell-month-scroll-hint { display: block; margin-bottom: .5rem; font-size: .85rem; } }

/* Character Sheet */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.character-sheet { width: min(100%, 88rem); }
.sheet-header { display: grid; grid-template-columns: minmax(18rem, 1fr) minmax(24rem, .9fr); gap: 1.5rem 2.5rem; padding: 1.5rem; border: 1px solid #51545f; border-radius: .75rem; background: linear-gradient(135deg, #20232b, #17181d); }
.sheet-profile { display: flex; align-items: flex-start; gap: 1.25rem; min-width: 0; }
.sheet-portrait { width: 9rem; height: 9rem; flex: 0 0 9rem; margin: 0; overflow: hidden; border: 1px solid #51545f; border-radius: .65rem; background: #101116; }
.sheet-portrait img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sheet-portrait-placeholder { display: grid; width: 100%; height: 100%; place-items: center; color: #e7bd7d; font-size: 3.25rem; font-weight: 850; }
.sheet-identity { min-width: 0; }
.sheet-identity h1 { margin-bottom: 1.1rem; font-size: clamp(2rem, 4vw, 3.25rem); overflow-wrap: anywhere; }
.sheet-identity-facts, .sheet-facts { display: grid; align-items: start; gap: .4rem .85rem; margin: 0; }
.sheet-identity-facts { grid-template-columns: 4.75rem minmax(0, 1fr); gap: .65rem 1rem; }
.sheet-facts { grid-template-columns: 9rem minmax(0, 1fr); }
.sheet-identity-facts dt, .sheet-facts dt { color: #b6b8c0; font-size: .8rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.sheet-identity-facts dt { font-size: .9rem; }
.sheet-identity-facts dd, .sheet-facts dd { margin: 0; }
.sheet-identity-facts dd { font-size: 1.15rem; font-weight: 650; line-height: 1.35; }
.sheet-core-values { display: grid; grid-template-columns: repeat(3, minmax(6rem, 1fr)); gap: .65rem; margin: 0; align-content: start; }
.sheet-core-values > div { padding: .8rem; border: 1px solid #4b5365; border-radius: .5rem; background: rgb(16 17 22 / 72%); }
.sheet-core-values dt { color: #b6b8c0; font-size: .8rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.sheet-core-values dd { margin: .2rem 0 0; font-size: 1.55rem; font-weight: 850; }
.sheet-core-values .sheet-core-wide { grid-column: span 3; }
.sheet-description { grid-column: 1 / -1; padding-top: 1rem; border-top: 1px solid #393b43; }
.sheet-description p { margin-bottom: 0; line-height: 1.55; }
.sheet-label { color: #c7a36b; font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.sheet-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: 1rem 0; }
.sheet-alert { margin: .75rem 0; }
.sheet-alert ul { margin-bottom: 0; }

.sheet-section { min-width: 0; padding: 1rem; border: 1px solid #393b43; border-radius: .65rem; background: #1b1d23; }
.sheet-roleplay, .sheet-companion { margin-top: 1rem; }
.sheet-companion > .sheet-label { margin-top: 0; }
.sheet-companion > p:last-child { margin-bottom: 0; }
.sheet-section > h2, .sheet-section-heading h2 { margin: 0 0 1rem; font-size: 1.35rem; }
.sheet-collapsible > summary { cursor: pointer; }
.sheet-collapsible > summary h2 { display: inline; margin: 0; font-size: 1.35rem; }
.sheet-collapsible[open] > summary { margin-bottom: 1rem; }
.sheet-rules-grid { display: grid; grid-template-columns: 12rem minmax(0, 1fr); gap: 1rem; margin-top: 1rem; }
.sheet-source-list { display: grid; gap: .55rem; }
.sheet-source { display: grid; gap: .25rem; padding: .65rem; border: 1px solid #393b43; border-radius: .4rem; background: #101116; text-align: center; }
.sheet-source span { color: #d6d7dc; font-size: .78rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.sheet-source strong { font-size: 1.6rem; }
.sheet-skill-table { overflow: hidden; border: 1px solid #393b43; border-radius: .45rem; }
.sheet-skill-head, .sheet-skill-row { display: grid; grid-template-columns: minmax(8rem, 1.2fr) minmax(10rem, 1fr) 7.5rem 4.5rem; gap: .65rem; align-items: center; padding: .55rem .7rem; }
.sheet-skill-head { background: #292c35; color: #b6b8c0; font-size: .72rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.sheet-skill-row { border-top: 1px solid #30323a; background: #15161b; }
.sheet-skill-row:nth-child(odd) { background: #181a20; }
.sheet-skill-stats { color: #bfc1c8; font-size: .86rem; }
.sheet-rank-pips { display: inline-flex; gap: .32rem; }
.sheet-rank-pip { width: .75rem; height: .75rem; box-sizing: border-box; border: 2px solid #858995; border-radius: 50%; background: transparent; }
.sheet-rank-pip.filled { border-color: #e7bd7d; background: #e7bd7d; }

.sheet-reference-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; align-items: start; }
.sheet-reference-main, .sheet-reference-side { display: grid; gap: 1rem; min-width: 0; }
.sheet-talent-group { margin-top: .8rem; padding-left: .8rem; border-left: 4px solid #737783; }
.sheet-talent-group > h3 { margin: 0 0 .6rem; }
.sheet-talent-group.role-striker { border-color: #d86969; }
.sheet-talent-group.role-controller { border-color: #8b9de8; }
.sheet-talent-group.role-support { border-color: #68bd98; }
.sheet-talent-group.role-leader { border-color: #d6aa64; }
.sheet-talent-group.role-skirmisher { border-color: #a68add; }
.sheet-talent-group.role-defender { border-color: #7cb8cb; }
.sheet-talent-group.role-glow { border-color: var(--mechanic-glow-color); }
.sheet-entry-list, .sheet-discipline-list, .sheet-power-list { display: grid; gap: .6rem; }
.sheet-reference-entry, .sheet-equipment-entry, .sheet-discipline, .sheet-power { min-width: 0; padding: .75rem; border: 1px solid #393b43; border-radius: .45rem; background: #101116; overflow-wrap: anywhere; }
.sheet-reference-entry h3, .sheet-reference-entry h4 { margin: 0 0 .45rem; }
.sheet-reference-entry p:last-child, .sheet-equipment-body p:last-child { margin-bottom: 0; }
.sheet-entry-meta { display: flex; flex-wrap: wrap; gap: .35rem .75rem; margin: -.15rem 0 .5rem; color: #b6b8c0; font-size: .82rem; }
.sheet-reference-entry.role-striker { border-left: 4px solid #d86969; }
.sheet-reference-entry.role-controller { border-left: 4px solid #8b9de8; }
.sheet-reference-entry.role-support { border-left: 4px solid #68bd98; }
.sheet-reference-entry.role-leader { border-left: 4px solid #d6aa64; }
.sheet-reference-entry.role-skirmisher { border-left: 4px solid #a68add; }
.sheet-reference-entry.role-defender { border-left: 4px solid #7cb8cb; }
.sheet-reference-entry.role-wildcard { border-left: 4px solid #e7bd7d; }
.calling-entry { border-left: 4px solid #c7a36b; }
.calling-entry .sheet-facts { margin-bottom: .75rem; }
.calling-benefit + .calling-benefit { margin-top: .8rem; }
.calling-benefit h4 { margin-bottom: .35rem; }
.sheet-section-stat { margin: 0 0 .75rem; }
.sheet-inventory-group + .sheet-inventory-group { margin-top: 1rem; }
.sheet-inventory-group > h3 { margin: 0 0 .55rem; }

.sheet-equipment-entry { padding: 0; }
.sheet-equipment-entry > summary { cursor: pointer; }
.sheet-equipment-entry > summary, .sheet-equipment-entry > .sheet-equipment-title { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .7rem; }
.sheet-equipment-entry > .sheet-equipment-title { border-bottom: 1px solid #393b43; }
.sheet-equipment-title { min-width: 0; }
.sheet-equipment-title strong { overflow-wrap: anywhere; }
.sheet-equipment-body { padding: .7rem; }
.sheet-equipment-body .sheet-facts { margin-bottom: .65rem; }
.sheet-facts dt, .sheet-facts dd { overflow-wrap: anywhere; }
.sheet-section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.sheet-section-heading > .eyebrow { margin: .35rem 0 0; }
.sheet-section-heading h2 { margin-top: .3rem; }
.sheet-glow-section { margin-top: 1rem; border-color: #745078; background: linear-gradient(150deg, #251d2a, #1b1d23 45%); }
.sheet-glow-summary { display: flex; gap: .75rem; margin: 0; }
.sheet-glow-summary > div { min-width: 6rem; padding: .5rem .65rem; border: 1px solid #745078; border-radius: .4rem; background: #101116; }
.sheet-glow-summary dt { font-size: .72rem; text-transform: uppercase; }
.sheet-glow-summary dd { margin: .15rem 0 0; font-size: 1.25rem; font-weight: 800; }
.sheet-discipline > summary, .sheet-power > summary { display: flex; justify-content: space-between; align-items: center; gap: .75rem; cursor: pointer; }
.sheet-discipline > summary { font-size: 1.1rem; }
.sheet-discipline-body, .sheet-power-body { margin-top: .75rem; padding-top: .75rem; border-top: 1px solid #393b43; }
.sheet-power-list { margin-top: .75rem; }
.sheet-magnitude-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.sheet-magnitude-grid article { padding: .65rem; border: 1px solid #393b43; border-radius: .4rem; background: #17181d; }
.sheet-magnitude-grid h4 { margin: 0 0 .45rem; }
.sheet-magnitude-grid p { margin-bottom: 0; }
.sheet-notes { margin-top: 1rem; }
.sheet-management { margin-top: 1rem; border: 1px solid #393b43; border-radius: .5rem; background: #17181d; }
.sheet-management > summary { padding: .8rem 1rem; cursor: pointer; font-weight: 800; }
.sheet-management-body { padding: 0 1rem 1rem; }
.sheet-management-body .sheet-facts { margin-bottom: 1rem; }
.portrait-management, .companion-management { margin: 1rem 0; padding: 1rem; border: 1px solid #393b43; border-radius: .5rem; background: #101116; }
.portrait-management h3, .companion-management h3 { margin-top: 0; }
.companion-management .actions { margin-bottom: 0; }
.portrait-management form { margin: 0; }
.portrait-management form + form { margin-top: .75rem; }
.portrait-management label { display: block; margin-bottom: .45rem; font-weight: 750; }
.portrait-management input[type="file"] { display: block; max-width: 100%; }
.portrait-management .muted { margin: .45rem 0 .75rem; }

/* World Characters */
.field-help { margin: .35rem 0 0; font-size: .9rem; }
.world-character-filters { margin: 1.25rem 0; }
.world-character-filters label { margin-top: 0; }
.world-character-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.world-character-card { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 1rem; min-width: 0; }
.world-character-card:hover { border-color: #c7a36b; }
.world-character-thumbnail, .world-character-portrait { display: grid; margin: 0; overflow: hidden; place-items: center; border: 1px solid #51545f; border-radius: .55rem; background: #101116; color: #e7bd7d; font-weight: 850; }
.world-character-thumbnail { width: 5.5rem; height: 5.5rem; font-size: 2rem; }
.world-character-thumbnail img, .world-character-portrait img { display: block; width: 100%; height: 100%; object-fit: cover; }
.world-character-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.world-character-card h2 { margin: 0; overflow-wrap: anywhere; }
.world-character-occupation { margin: .35rem 0; color: #e5d1b1; }
.world-character-meta { margin: .35rem 0 0; line-height: 1.45; }
.world-character-empty { grid-column: 1 / -1; }
.world-character-header { position: relative; display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 1.5rem; }
.world-character-portrait { width: 11rem; height: 11rem; font-size: 4rem; }
.world-character-identity h1 { margin-bottom: 1rem; font-size: clamp(2rem, 5vw, 3.25rem); overflow-wrap: anywhere; }
.world-character-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .5rem 1rem; margin: 0; }
.world-character-facts dt { color: #b6b8c0; font-size: .8rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.world-character-facts dd { margin: 0; overflow-wrap: anywhere; }
.world-character-status { position: absolute; top: 1rem; right: 1rem; }
.world-character-roleplay h3 { margin: 1.1rem 0 .35rem; color: #e5d1b1; }
.world-character-roleplay p, .world-character-notes p:last-child { line-height: 1.6; }
.world-character-notes { border-color: #745078; background: linear-gradient(150deg, #251d2a, #1b1d23 45%); }
.world-character-notes h2 { margin-top: .35rem; }
.world-character-management > summary { cursor: pointer; }
.world-character-management > summary h2 { display: inline; }
.record-facts { margin-top: 1rem; }

@media (max-width: 1000px) {
    .sheet-rules-grid, .sheet-reference-grid { grid-template-columns: 1fr; }
    .sheet-source-list { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .sheet-reference-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .character-sheet { width: 100%; }
    .sheet-header { grid-template-columns: 1fr; }
    .sheet-profile { align-items: center; }
    .sheet-core-values { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .sheet-source-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .sheet-reference-side { grid-template-columns: 1fr; }
    .sheet-skill-head, .sheet-skill-row { grid-template-columns: minmax(6.5rem, 1.15fr) minmax(6rem, .9fr) 6.5rem 3.5rem; gap: .4rem; padding-inline: .5rem; }
    .sheet-magnitude-grid { grid-template-columns: 1fr; }
    .world-character-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
    .shell { padding-inline: .65rem; }
    .sheet-header, .sheet-section { padding: .8rem; }
    .sheet-profile { align-items: flex-start; gap: .8rem; }
    .sheet-portrait { width: 7rem; height: 7rem; flex-basis: 7rem; }
    .sheet-core-values { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem; }
    .sheet-core-values > div { min-width: 0; padding: .65rem .55rem; }
    .sheet-core-values dt { font-size: .7rem; }
    .sheet-core-values .sheet-core-wide { grid-column: span 3; }
    .sheet-skill-head { display: none; }
    .sheet-skill-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "skill bonus" "stats rank"; font-size: .85rem; }
    .sheet-skill-row > :nth-child(1) { grid-area: skill; }
    .sheet-skill-row > :nth-child(2) { grid-area: stats; }
    .sheet-skill-row > :nth-child(3) { grid-area: rank; justify-self: end; }
    .sheet-skill-row > :nth-child(4) { grid-area: bonus; justify-self: end; }
    .sheet-rank-pips { gap: .18rem; }
    .sheet-rank-pip { width: .55rem; height: .55rem; border-width: 1px; }
    .sheet-section-heading { display: block; }
    .sheet-glow-summary { margin-bottom: .75rem; }
    .world-character-header { grid-template-columns: 7rem minmax(0, 1fr); gap: .85rem; padding: .8rem; }
    .world-character-portrait { width: 7rem; height: 7rem; font-size: 2.75rem; }
    .world-character-status { position: static; align-self: start; justify-self: start; grid-column: 2; }
    .world-character-facts { grid-template-columns: 1fr; gap: .2rem; }
    .world-character-facts dd { margin-bottom: .45rem; }
}

@media print {
    :root { color-scheme: light; background: white; color: #111; }
    body, .shell { display: block; min-height: auto; margin: 0; padding: 0; background: white; color: #111; }
    .site-header, .site-footer, .messages, .no-print { display: none !important; }
    .character-sheet { width: 100%; max-width: none; font-size: 9pt; }
    .sheet-header, .sheet-section, .sheet-reference-entry, .sheet-equipment-entry, .sheet-discipline, .sheet-power, .sheet-source, .sheet-skill-row, .sheet-magnitude-grid article { background: white !important; color: #111; box-shadow: none; border-color: #777; }
    .sheet-header { padding: .8rem; }
    .sheet-portrait { width: 7rem; height: 7rem; flex-basis: 7rem; }
    .sheet-portrait-placeholder { color: #333; }
    .sheet-identity h1 { font-size: 22pt; }
    .sheet-section { padding: .6rem; }
    .sheet-rules-grid { grid-template-columns: 8rem minmax(0, 1fr); }
    .sheet-reference-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sheet-source-list { grid-template-columns: 1fr; }
    .sheet-skill-head, .sheet-skill-row { grid-template-columns: minmax(7rem, 1.2fr) minmax(8rem, 1fr) 6rem 3.5rem; padding: .3rem .4rem; }
    .muted, .sheet-skill-stats, .sheet-identity-facts dt, .sheet-facts dt, .sheet-core-values dt { color: #444; }
    .mechanic-ap { color: #075b93; }
    .mechanic-hp { color: #146b3a; }
    .mechanic-armor { color: #795300; }
    .mechanic-die { color: #63358c; }
    .mechanic-glow { color: #7a237e; }
    .mechanic-backlash { color: #8f2923; }
    .character-sheet details:not([open]) > :not(summary) { display: block !important; }
    .character-sheet details > summary { list-style: none; }
    .character-sheet details > summary::-webkit-details-marker { display: none; }
    .sheet-reference-entry, .sheet-equipment-entry, .sheet-discipline, .sheet-power, .sheet-skill-row, .sheet-source, .sheet-magnitude-grid article { break-inside: avoid; page-break-inside: avoid; }
    .sheet-section { break-inside: auto; }
    a { color: #111; text-decoration: none; }
}
.encounter-read-only form {
    display: none;
}
