* { box-sizing: border-box; }
:root {
    color-scheme: light;
    --ink: #1a302d;
    --muted: #526761;
    --pine: #143d35;
    --gold: #debb80;
    --line: #cdd3c7;
    --surface: #fffefa;
}
body {
    margin: 0;
    background: #f4f4ec;
    color: var(--ink);
    font: 1rem/1.55 "Source Sans 3", "Segoe UI", sans-serif;
}
h1, h2, h3, p, ul { margin: 0; }
a { color: var(--pine); }
:focus-visible { outline: 3px solid #ae5e16; outline-offset: 4px; }
.wrap { width: min(1100px, calc(100% - 48px)); margin: auto; }
.mast { background: var(--pine); color: #fbf7ea; border-bottom: 3px solid var(--gold); }
.mast-inner { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 74px; }
.wordmark, h1, h2, .saved-army strong {
    font-family: "Baskervville", Georgia, serif;
    font-weight: 500;
}
.wordmark { color: inherit; display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-size: 1.6rem; }
.standard { width: 18px; height: 25px; background: repeating-linear-gradient(135deg, var(--gold) 0 4px, transparent 4px 6px); border-top: 3px solid var(--gold); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 76%, 0 100%); }
.edition { color: #e0e7d9; font-size: .84rem; }
.edition span { color: var(--gold); padding: 0 7px; }
main { padding-bottom: 4rem; }
.page-heading { padding: clamp(2rem, 5vw, 4.3rem) 0 2.2rem; }
h1 { font-size: clamp(2.55rem, 6vw, 4.7rem); line-height: 1.06; letter-spacing: -.043em; overflow-wrap: anywhere; }
.page-heading p { margin-top: .85rem; color: var(--muted); }
h2 { font-size: 1.8rem; line-height: 1.25; letter-spacing: -.025em; }
.library, .overview { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: clamp(1.5rem, 5vw, 4rem); align-items: start; }
.panel { padding: clamp(1.2rem, 3vw, 2.2rem); background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--pine); }
.input-choice { margin: 1.4rem 0 0; padding: 0; border: 0; min-width: 0; }
.mode, .sr-only { position: absolute; height: 1px; width: 1px; clip-path: inset(50%); overflow: hidden; }
.mode + label { display: inline-block; padding: 7px 14px; color: var(--muted); border: 1px solid var(--line); cursor: pointer; }
.mode:checked + label { color: #fff; background: var(--pine); border-color: var(--pine); }
.mode:focus-visible + label { outline: 3px solid #ae5e16; outline-offset: 2px; }
form { margin-top: 1.3rem; }
#paste:not(:checked) ~ .paste-form, #upload:not(:checked) ~ .upload-form { display: none; }
form label { display: block; font-weight: 600; margin-bottom: .45rem; }
textarea, input[type=file] { max-width: 100%; width: 100%; padding: .85rem; background: #f9faf5; border: 1px solid #9caea3; color: var(--ink); border-radius: 3px; }
textarea { display: block; min-height: 12rem; resize: vertical; font: .9rem/1.5 "Courier Prime", Consolas, monospace; }
input[type=file] { font: inherit; }
.help, .empty, small { color: var(--muted); }
.help { margin-top: .4rem; font-size: .85rem; }
button { display: inline-flex; align-items: center; gap: 1.8rem; margin-top: 1.15rem; padding: .7rem 1rem; border: 0; border-radius: 3px; background: var(--pine); color: #fffefa; font-family: inherit; font-size: .96rem; line-height: 1.5; font-weight: 600; cursor: pointer; }
button:hover { background: #245c4f; }
button span { color: var(--gold); font-size: 1.15rem; }
.saved { border-top: 1px solid var(--ink); padding-top: 1.2rem; }
.saved h2 { margin-bottom: 1rem; }
.saved-army { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 0; border-top: 1px solid var(--line); text-decoration: none; }
.saved-army strong { display: block; font-size: 1.28rem; overflow-wrap: anywhere; }
.saved-army:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.saved-army small { display: block; }
.arrow { font-size: 1.3rem; }
.pages { display: flex; gap: 1.5rem; padding-top: 1rem; }
.error { margin-top: 1rem; color: #7f3022; padding: .7rem .9rem; border-left: 3px solid #a14b37; background: #fbede6; }
.back { display: inline-block; margin-bottom: 1rem; font-size: .9rem; text-underline-offset: 3px; }
.section-line { display: flex; justify-content: space-between; align-items: baseline; gap: .8rem; margin-bottom: 1rem; }
.section-line span { font-size: .9rem; color: var(--muted); }
.regiment { margin-bottom: 1.65rem; }
.regiment > h3 { display: flex; align-items: center; gap: .65rem; margin-bottom: .55rem; font-size: .86rem; }
.regiment > h3::after { content: ""; flex: 1; border-top: 1px solid #a4b0a6; }
.units, .selections ul { list-style: none; padding: 0; }
.units > li + li { margin-top: .55rem; }
.unit-card { min-width: 0; overflow-wrap: anywhere; border: 1px solid #b8c5ba; background: var(--surface); }
.unit-card summary { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .7rem 1rem; border-left: 4px solid var(--pine); background: #e6ece3; cursor: pointer; }
.unit-card summary strong { font: 700 1.2rem/1.25 "Baskervville", Georgia, serif; }
.unit-card summary::-webkit-details-marker { display: none; }
.unit-card summary::after { content: ""; width: .5rem; height: .5rem; border: solid var(--muted); border-width: 0 1.5px 1.5px 0; transform: rotate(-45deg); flex: none; }
.unit-card[open] > summary::after { transform: rotate(45deg); }
.unit-card summary:hover { background: #dce6db; }
.unit-card[open] > summary { border-left-color: var(--gold); background: var(--pine); color: white; }
.unit-card[open] > summary .loadout { color: #e1e9de; }
.unit-card[open] > summary::after { border-color: currentColor; }
.loadout { display: block; margin-top: .18rem; font-size: .88rem; }
.card-body { padding: .65rem 1.1rem 1.15rem; }
.characteristics { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .55rem; }
.characteristics div { flex: 1 1 3rem; padding: .4rem; background: #edf0e7; border-radius: 2px; text-align: center; }
.characteristics dt { font-size: .75rem; font-weight: 600; color: var(--muted); }
.characteristics dd { margin: 0; font-size: 1.15rem; font-weight: 650; }
.keywords, .weapon-traits, .stat-note { font-size: .88rem; }
.keywords { margin: .5rem 0; color: var(--muted); }
.weapons { width: 100%; margin-top: .8rem; border: 1px solid var(--line); border-collapse: collapse; font-variant-numeric: tabular-nums; }
.weapons thead { background: #e9ede5; border-bottom: 1px solid var(--line); }
.weapons thead th { padding: .35rem .25rem; color: var(--muted); font-size: .75rem; }
.weapons thead th:first-child { text-align: left; padding-left: .65rem; color: var(--pine); font-size: .88rem; }
.weapon + .weapon { border-top: 1px solid var(--line); }
.weapon-values th, .weapon-values td { padding: .45rem .25rem; vertical-align: top; }
.weapon-values th { width: 36%; padding-left: .65rem; text-align: left; font-size: .94rem; }
.weapon-values td { white-space: nowrap; text-align: center; font-size: .9rem; }
.weapon-traits { display: block; margin-top: .15rem; color: var(--muted); font-size: .8rem; font-weight: 400; }
.weapon-notes { padding: 0 .65rem .5rem; font-size: .84rem; }
.weapon-notes p + p { margin-top: .2rem; }
.stat-note, .reference { margin-top: .35rem; }
.reference { font-size: .78rem; color: var(--muted); }
.rule-heading { margin: .85rem 0 .3rem; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.selected-rule + .selected-rule { margin-top: .65rem; }
.selected-rule h5 { margin: 0; font-size: 1rem; }
.selected-rule small { display: block; margin-bottom: .2rem; }
.unit-abilities > .rule-heading { padding: .35rem .65rem; border-left: 3px solid var(--pine); background: #e9ede5; color: var(--pine); }
.unit-abilities .selected-rule { padding: .35rem .65rem; }
.unit-abilities .selected-rule + .selected-rule { margin-top: .15rem; border-top: 1px solid var(--line); }
.unit-abilities .ability-target { margin-bottom: .2rem; font-size: .88em; }
.selections { padding: 1.4rem; background: #e9ece1; border-top: 3px solid var(--pine); overflow-wrap: anywhere; }
.selections section { margin-top: 1rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.selections h3 { font-size: .85rem; color: var(--muted); margin-bottom: .2rem; }
.source { margin-top: 1.4rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.source summary { cursor: pointer; }
.source pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .85rem; }
@media screen {
    .card-body { container: card / inline-size; }
}
@container card (max-width: 29rem) {
    .weapons, .weapons thead, .weapons thead tr, .weapon { display: block; }
    .weapons thead th:first-child { display: block; }
    .weapons thead th:not(:first-child) { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
    .weapon-values { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); padding: 0 .3rem .3rem; }
    .weapon-values th { grid-column: 1/-1; width: auto; padding: .45rem .3rem .15rem; }
    .weapon-values td { padding: .2rem 0; }
    .weapon-values td::before { display: block; content: attr(data-stat) / ""; font-size: .7rem; color: var(--muted); }
    .weapon-notes { display: block; }
    .weapon tr:has(.weapon-notes) { display: block; }
}
@media (max-width: 720px) {
    .wrap { width: calc(100% - 32px); }
    .library, .overview { grid-template-columns: minmax(0, 1fr); gap: 1.6rem; }
    .edition { font-size: .75rem; }
    .mast-inner { min-height: 60px; }
}
@media print {
    body, .regiment, .selections { color: black; background: white; }
    body { font-size: 9pt; line-height: 1.25; }
    .mast, .back, .source { display: none; }
    .wrap { width: 100%; }
    .page-heading { padding: 0 0 1rem; }
    h1 { font-size: 2rem; }
    .overview { display: block; }
    .regiment { break-inside: auto; }
    .regiment > h3, .unit-card summary, .rule-heading { break-after: avoid; }
    .units > li, .unit-card { break-inside: avoid; }
    .weapon, .selected-rule, .characteristics { break-inside: avoid; }
    .unit-card::details-content { display: block; content-visibility: visible; }
    .unit-card summary::after { display: none; }
    .unit-card summary, .unit-card[open] > summary { padding: .32rem .6rem; border-left: 4pt solid black; border-bottom: 1pt solid #63726a; background: #e6ece3; color: black; }
    .unit-card summary strong { font-size: 13pt; }
    .unit-card[open] > summary .loadout { color: var(--muted); }
    .card-body { padding: .35rem .6rem .4rem; }
    .characteristics { margin-bottom: .2rem; gap: .2rem; }
    .characteristics div { padding: .12rem; }
    .characteristics dd { font-size: 10pt; }
    .keywords, .reference, .stat-note, .weapon-traits, .selected-rule small { font-size: 8pt; }
    .weapons { margin-top: .35rem; }
    .weapons thead th, .weapon-values :is(th, td) { padding-block: .18rem; }
    .weapon-values th, .weapon-values td, .selected-rule h5 { font-size: 9pt; }
    .weapon-notes { font-size: 8pt; padding-bottom: .2rem; }
    .selected-rule + .selected-rule, .rule-heading { margin-top: .3rem; }
}

.phase-sheet { margin-bottom: 2.4rem; border-top: 3px solid var(--pine); }
.sheet-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .4rem 1.2rem; margin: 1rem 0; }
.sheet-heading a, .return-to-sheet { font-size: .9rem; text-underline-offset: 3px; }
.sheet-controls { margin: 0; padding: .85rem 1rem; background: #e7ebe1; display: flex; flex-wrap: wrap; align-items: end; gap: .75rem 1.5rem; }
.sheet-controls fieldset { border: 0; padding: 0; margin: 0; display: flex; }
.sheet-controls legend, .sheet-controls > label { color: var(--muted); font-size: .8rem; font-weight: 650; }
.sheet-controls label { margin: 0; }
.sheet-controls fieldset label { position: relative; }
.sheet-controls input[type=radio] { position: absolute; opacity: 0; }
.sheet-controls span, .sheet-controls select { display: block; background: var(--surface); border: 1px solid #87998e; color: var(--ink); padding: .48rem .75rem; font-family: inherit; line-height: 1.4; }
.sheet-controls span { cursor: pointer; font-size: .94rem; }
.sheet-controls fieldset label + label span { border-left: 0; }
.sheet-controls input:checked + span { color: white; background: var(--pine); }
.sheet-controls input:focus-visible + span { outline: 3px solid #ae5e16; outline-offset: 2px; }
.sheet-controls select { min-height: 2.5rem; font: inherit; font-size: .94rem; }
.sheet-controls input[type=number], .witness-choice select, .rules-lookup input { display: block; min-height: 2.5rem; max-width: 100%; padding: .4rem .65rem; border: 1px solid #87998e; border-radius: 2px; background: var(--surface); color: var(--ink); font: inherit; font-size: .94rem; }
.sheet-controls input[type=number] { width: 4.25rem; }
.battle-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .45rem; margin-bottom: .65rem; }
.battle-bar button, .ability-use button, .rules-lookup button { margin: 0; padding: .4rem .75rem; }
.text-button, .small-action { background: var(--surface); color: var(--pine); border: 1px solid #a9b8ab; }
.text-button:hover, .small-action:hover { background: #e6ece3; }
.battle-ui button:disabled { cursor: wait; opacity: .65; }
#battle-heading { color: var(--pine); }
#battle-status { margin: .35rem 0; font-size: .85rem; color: var(--muted); }
.great-plan { padding: .65rem 1rem; border: 1px solid var(--line); background: var(--surface); }
.great-plan + .great-plan { margin-top: .5rem; }
.ability-use[data-score-card]:has(button[hidden]):has(strong:empty) { display: none; }
.great-plan summary, .lookup-results summary { cursor: pointer; font-weight: 650; }
.great-plan summary small { display: inline-block; font-weight: 400; margin-left: .45rem; }
.plan-body { margin-top: .65rem; }
.plan-stage { margin-top: .6rem; padding-top: .6rem; border-top: 1px solid var(--line); }
.witness-choice, .ability-use { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; margin-block: .4rem; font-size: .86rem; }
.ability-use button { font-size: .85rem; }
.ability-use button[hidden] { display: none; }
.ability-use strong:empty { display: none; }
.witness-choice select { font-size: .86rem; }
button[data-show-rule] { margin: 0; padding: .15rem .2rem; background: transparent; color: var(--pine); font: inherit; text-decoration: underline; text-underline-offset: .16em; }
button[data-show-rule]:hover { background: #e6ece3; }
.selections button[hidden] { display: none; }
@media screen {
    .selections button:not([hidden]) + .selection-rule-name { display: none; }
}
@media print {
    .selections button[data-show-rule] { display: none; }
}
.battle-bar[hidden], html:not(.battle-active) .battle-only, .battle-active .start-battle { display: none; }
.lookup-open { display: block; position: fixed; z-index: 2; right: max(1rem, calc((100vw - 1100px) / 2)); bottom: max(1rem, env(safe-area-inset-bottom)); margin: 0; box-shadow: 0 2px 8px #143d3533; }
.lookup-open[hidden] { display: none; }
.rules-lookup { width: min(42rem, calc(100% - 1rem)); max-height: 85dvh; padding: 1rem; border: 1px solid var(--line); border-radius: .4rem; background: var(--surface); color: var(--ink); }
.rules-lookup::backdrop { background: rgb(13 28 25 / .8); }
.rules-lookup header { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .85rem; }
.rules-lookup form { margin: 0; }
.rules-lookup label { font-weight: 600; }
.rules-lookup input { width: 100%; margin: .4rem 0; }
.lookup-count { color: var(--muted); font-size: .88rem; }
.lookup-results > details { margin-top: .4rem; border: 1px solid var(--line); padding: .55rem .7rem; }
.lookup-results summary small { display: block; font-weight: 400; }
.lookup-results .reference { display: block; }
.lookup-detail p { margin: .6rem 0; }
.lookup-results .card-body { padding: 0; }
.lookup-results > details[open] > summary { margin-bottom: .5rem; }
@media print {
    .battle-ui, .lookup-open, .rules-lookup[open], .rules-lookup::backdrop { display: none !important; }
}
.sheet-window { padding: 1.2rem 0 .6rem; }
.sheet-window > h3 { font: 600 1.45rem/1.3 "Baskervville", Georgia, serif; margin-bottom: .55rem; }
.group-jumps { display: flex; flex-wrap: wrap; gap: .4rem; margin: .65rem 0 1rem; }
.group-jumps a { padding: .28rem .65rem; border: 1px solid #aebbb0; background: var(--surface); text-decoration: none; font-size: .88rem; font-weight: 600; }
.group-jumps a:hover, .unit-links a:hover { background: #e6ece3; text-decoration: underline; }
.rule-group { margin: 0 0 1.15rem; }
.rule-group > h4 { margin: 0; padding: .38rem .85rem; background: var(--pine); color: var(--surface); border-left: 4px solid var(--gold); font: 600 1.2rem/1.4 "Baskervville", Georgia, serif; scroll-margin-top: .75rem; }
.group-rules { display: grid; grid-template-columns: minmax(0, 1fr); border: 1px solid var(--line); border-top: 0; }
.phase-rule { min-width: 0; padding: .85rem 1rem; border-top: 1px solid var(--line); background: var(--surface); scroll-margin-top: .75rem; }
.ability-name { margin: .1rem 0 .35rem; font: 650 1.15rem/1.3 "Source Sans 3", "Segoe UI", sans-serif; }
.rule-units { margin: .35rem 0 .55rem; padding: .4rem .65rem; background: #eff2ea; border-left: 2px solid #9eae9e; font-size: .92rem; }
.rule-units > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: .12rem .6rem; }
.rule-units > div + div { border-top: 1px solid var(--line); margin-top: .3rem; padding-top: .3rem; }
.rule-units dt { color: #39534a; font-weight: 650; }
.rule-units dd { flex: 1 1 11rem; min-width: 0; margin: 0; }
.eligible-units summary { cursor: pointer; text-decoration: underline; text-underline-offset: 2px; color: var(--pine); }
.no-eligible { display: block; }
.intervention-options h6 { margin: .55rem 0 .2rem; font-size: 1rem; }
.intervention-options li + li { margin-top: .35rem; }
.phase-rule p, .phase-rule > ul:not(.unit-links) { max-width: 80ch; }
.phase-rule ul:not(.unit-links) { padding-left: 1.25rem; }
.rule-meta { color: var(--muted); font-size: .8rem; }
.unit-links { display: flex; flex-wrap: wrap; gap: .15rem .75rem; margin: 0; padding: 0; list-style: none; font-size: .92rem; }
.unit-links a { text-underline-offset: 2px; }
.phase-rule .reference { display: block; }
.standing { border-block: 1px solid var(--line); }
.standing > summary, .intervention-options summary { cursor: pointer; padding: .55rem 0; font-weight: 650; }
.standing small { font-weight: 400; margin-left: .45rem; }
.sheet-gap { padding: .65rem 0; color: var(--muted); font-size: .88rem; }
.return-to-sheet { display: inline-block; margin-bottom: .55rem; }
.unit-card:target { outline: 2px solid var(--pine); }
.print-timing { display: none; }
.unit-image-links { display: inline-flex; align-items: stretch; gap: .3rem; vertical-align: middle; }
.unit-image-link { display: inline-flex; align-items: center; min-height: 2.5rem; padding: 0 .5rem; border: 1px solid #a9b8ab; border-radius: .25rem; background: var(--surface); color: var(--pine); font-size: .8rem; font-weight: 600; text-decoration: none; }
.unit-image-link[data-view="miniature"] { padding: 0; }
.unit-image-link:hover { background: #f4f7ed; text-decoration: underline; }
.unit-links li { max-width: 100%; }
.unit-card summary .unit-image-links { flex: none; margin-left: auto; }
.unit-image-link img { display: block; width: 2.5rem; height: 2.5rem; object-fit: contain; background: white; border-radius: 2px; }
.unit-image-viewer { width: min(64rem, calc(100% - 2rem)); height: min(56rem, calc(100% - 2rem)); max-width: none; max-height: none; padding: 0; border: 1px solid var(--line); border-radius: .4rem; color: var(--ink); background: var(--surface); }
.unit-image-viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.unit-image-viewer::backdrop { background: rgb(13 28 25 / .8); }
.unit-image-viewer header { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; padding: .7rem .9rem; border-bottom: 1px solid var(--line); }
.unit-image-viewer h2 { flex: 1 1 12rem; font-size: 1.4rem; overflow-wrap: anywhere; }
.unit-image-viewer form, .unit-image-viewer button { margin: 0; }
.unit-image-viewer button { justify-content: center; min-height: 2.6rem; padding: .4rem .75rem; }
.image-switch { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: .25rem; }
.image-switch button, .unit-image-viewer .image-zoom { background: var(--surface); color: var(--pine); }
.image-switch button:hover, .unit-image-viewer .image-zoom:hover { background: #e6ece3; }
.image-switch button[aria-pressed=true] { background: var(--pine); color: white; }
.image-viewport { min-width: 0; min-height: 0; overflow: auto; background: #e8ebe4; overscroll-behavior: contain; }
.image-viewport img { display: block; width: 100%; height: 100%; object-fit: contain; }
.image-viewport.is-zoomed img { width: max(160%, var(--image-native-width, 0px)); height: auto; }
.image-error { padding: 1.25rem; }
.unit-image-viewer [hidden] { display: none; }
@media (max-width: 640px) {
    .unit-image-viewer { width: calc(100% - .75rem); height: calc(100% - .75rem); }
    .unit-image-viewer header { display: grid; grid-template-columns: 1fr auto; gap: .5rem; }
    .unit-image-viewer form { grid-column: 2; grid-row: 1; }
    .image-switch { justify-self: start; }
    .unit-image-viewer .image-zoom { justify-self: end; }
    .unit-card summary { gap: .55rem; }
}
@media screen and (min-width: 850px) {
    .group-rules { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1px; background: var(--line); }
    .phase-rule:nth-child(odd of :not([hidden])):nth-last-child(1 of :not([hidden])) { grid-column: 1/-1; }
}
@media print {
    .unit-image-links, .unit-image-viewer[open], .unit-image-viewer::backdrop { display: none; }
    .sheet-controls, .sheet-heading a, .return-to-sheet, .window-empty, .intervention-options, .group-jumps, .eligible-units > summary { display: none; }
    .phase-sheet { margin: 0; }
    .print-checklist { columns: 2; column-gap: 7mm; column-rule: .5pt solid var(--line); }
    .print-timing { display: inline; }
    .sheet-window[hidden], .rule-group[hidden], .phase-rule[hidden] { display: block !important; }
    .standing::details-content, .eligible-units::details-content { display: block; content-visibility: visible; }
    .rule-group { margin: .25rem 0; }
    .rule-group > h4 { break-after: avoid; font-size: 10pt; padding: .12rem .3rem; color: black; background: white; border-left: 2pt solid black; border-bottom: 1pt solid #77857e; }
    .group-rules { display: block; border: 0; }
    .rule-units { margin: .1rem 0; padding: 0 .25rem; font-size: 8pt; }
    .rule-units > div + div { margin: 0; padding: 0; border: 0; }
    .standing > summary, .sheet-heading, .sheet-window h3 { break-after: avoid; }
    .sheet-window { padding: .4rem 0; }
    .sheet-window h3, .standing > summary { background: #e6ece3; border-bottom: 1pt solid black; padding: .2rem .4rem; }
    .phase-rule { padding: .25rem 0; break-inside: avoid; }
    .ability-name { font-size: 10pt; margin: 0; }
    .phase-rule p, .phase-rule > ul:not(.unit-links) { max-width: none; }
    .phase-rule .reference, .rule-meta, .unit-links { font-size: 8pt; }
    .unit-links { gap: .1rem .65rem; margin: .15rem 0; }
    .unit-links a { text-decoration: none; }
    .overview { break-before: page; }
}
