/* Opt-in sibling themes. Motifs are original geometric marks, not official insignia. */
body[data-army-theme]{--ink:#25282a;--muted:#5e6265;--gold:#843d42;--green:#843d42;--paper:#faf7ef;--line:#c9c5bc;--theme-bg:#eae7df;--theme-head:#25282a;--theme-accent:#843d42;--theme-heading:'Arial Narrow','Helvetica Neue',system-ui,sans-serif;background:var(--theme-bg);color:var(--ink)}
body[data-army-theme=aos]{--ink:#232d33;--muted:#59636a;--gold:#846728;--green:#73591f;--paper:#fffdf6;--line:#d5cbb5;--theme-bg:#f3eee2;--theme-head:#232d33;--theme-accent:#846728;--theme-heading:Georgia,'Times New Roman',serif}
body[data-army-theme] .masthead{background:var(--theme-head);border-bottom:2px solid var(--theme-accent)}
body[data-army-theme] .mode-app-name{display:flex;flex-direction:column;gap:3px;font-family:var(--theme-heading);font-weight:800;letter-spacing:.035em;line-height:1.1;font-size:20px;color:#faf7ef}
body[data-army-theme] .mode-app-name small{font:400 11px system-ui,sans-serif;letter-spacing:.08em}
body[data-army-theme=aos] .mode-app-name{font-size:19px;font-weight:600;letter-spacing:.05em}
body[data-army-theme] .masthead .army-current{border-radius:0;min-height:44px;text-align:left;color:#faf7ef}
body[data-army-theme] .masthead .army-current::before{content:'';display:inline-block;width:12px;height:12px;border:1px solid #e1cdc0;margin-right:8px;vertical-align:middle;box-shadow:inset 0 0 0 3px var(--theme-head)}
body[data-army-theme=aos] .masthead .army-current::before{transform:rotate(45deg);border-color:#d7bd75;border-radius:2px}
body[data-army-theme] #mode-nav{background:var(--paper);border-color:var(--line)}
body[data-army-theme] #mode-nav a,body[data-army-theme] #view-nav a,body[data-army-theme] .build-links a{color:var(--muted)}
body[data-army-theme] a[aria-current=page]{color:var(--ink)!important;border-bottom-color:var(--theme-accent)!important}
body[data-army-theme] h1,body[data-army-theme] h2,body[data-army-theme] h3,body[data-army-theme] .tile h2{font-family:var(--theme-heading);color:inherit}
body[data-army-theme=40k] .tile h2{font-weight:800;letter-spacing:.015em;font-size:17px}
body[data-army-theme=aos] .tile h2{font-size:19px;line-height:1.2;font-weight:600}
body[data-army-theme] .tile,body[data-army-theme] .force-row,body[data-army-theme] .force-list article,body[data-army-theme] .quick-unit-tile,body[data-army-theme] .unitcard{border:1px solid var(--line);border-radius:0;background:var(--paper);box-shadow:none;color:var(--ink)}
body[data-army-theme=aos] .tile{border-radius:3px}
body[data-army-theme] .tile:hover,body[data-army-theme] .quick-unit-tile:hover{border-color:var(--theme-accent);background:var(--paper);transform:none;box-shadow:0 0 0 1px var(--theme-accent)}
body[data-army-theme] .photo{position:relative;display:flex;align-items:center;justify-content:center;background:#e7e3db;overflow:hidden;border-bottom:1px solid var(--line)}
body[data-army-theme=aos] .photo{background:#ece6d8}
body[data-army-theme] .photo img{width:100%;height:100%;object-fit:contain;padding:8px;min-height:0}
body[data-army-theme] .photo:has(.default-photo-note){flex-direction:column;height:150px;min-height:0}
body[data-army-theme] .photo:has(.default-photo-note) img{flex:1;min-height:0}
body[data-army-theme] .default-photo-note{position:static;flex:none;background:var(--paper);color:var(--ink);padding:3px 6px;font-size:10px}
.photo img[data-src],.photo .image-pending,.photo .image-failed{visibility:hidden}
.photo .image-status{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:14px;text-align:center;font:12px system-ui,sans-serif;color:#555b5d;background:#e7e3db}
body[data-army-theme] .placeholder{color:var(--muted);background:transparent;min-height:100%;font:12px system-ui,sans-serif}
body[data-army-theme] .placeholder .bolt{font-size:25px;color:var(--theme-accent)}
body[data-army-theme] .tileinfo{padding:12px}
body[data-army-theme] .tile .tag,body[data-army-theme] .eyebrow,body[data-army-theme] .statslabel{color:var(--theme-accent);font:700 10px system-ui,sans-serif;letter-spacing:.07em;text-transform:uppercase}
body[data-army-theme] .tilebottom{border-top:1px solid var(--line);padding-top:8px;color:var(--muted)}
body[data-army-theme] .tilebottom strong{color:var(--ink);font-variant-numeric:tabular-nums}
body[data-army-theme] .sidebar{background:#e8e5dc;color:var(--ink);border-right:1px solid var(--line)}
body[data-army-theme] .sidebar .photo{height:240px}
body[data-army-theme] .sidebar a{color:var(--theme-accent)}
body[data-army-theme] .stats{background:var(--line);gap:1px;border:1px solid var(--line)}
body[data-army-theme] .stat{background:var(--paper);color:var(--ink);padding:10px 4px}
body[data-army-theme] .stat strong{font:800 24px system-ui,sans-serif;font-variant-numeric:tabular-nums}
body[data-army-theme] .stat span{color:var(--muted);font:700 11px system-ui,sans-serif}
body[data-army-theme] .sectiontitle,body[data-army-theme] table th{background:var(--theme-head);color:#faf7ef;border-color:var(--theme-head)}
body[data-army-theme=40k] .sectiontitle{text-transform:uppercase;font:700 13px system-ui,sans-serif;letter-spacing:.07em}
body[data-army-theme] .cardheading{border-bottom:1px solid var(--theme-accent)}
body[data-army-theme] .cardheading h2{font-size:30px;line-height:1.1}
body[data-army-theme] .rule-chip{color:var(--ink);border-color:var(--line);background:var(--paper)}
body[data-army-theme] #force-surface button{border-radius:2px;border-color:var(--line);background:var(--paper);color:var(--ink)}
body[data-army-theme] #force-surface [data-force-action=play],body[data-army-theme] #force-surface [data-force-action=create],body[data-army-theme] #force-surface [data-force-action=add]{background:var(--theme-accent);border-color:var(--theme-accent);color:white}
body[data-army-theme] .mode-army-bar,body[data-army-theme] #mode-roster{border-color:var(--line)}
body[data-army-theme] .army-menu>div,body[data-army-theme] #mode-sources .mode-source-content{background:var(--paper);color:var(--ink);border-color:var(--line)}
body[data-army-theme] #mode-sources .download{color:var(--theme-accent)}
body[data-army-theme] :focus-visible{outline:3px solid #377da4;outline-offset:3px}
body[data-army-theme].force-play .play-strip-group h2{color:var(--ink);font:700 12px system-ui,sans-serif}
body[data-army-theme].force-play .quick-unit-grid .photo{height:150px}
body[data-army-theme].force-play .play-rule-strip{border-color:var(--line)}
@media(max-width:700px){body[data-army-theme] .mode-app-name{font-size:15px;max-width:170px;white-space:normal}body[data-army-theme=aos] .mode-app-name{font-size:16px}body[data-army-theme] .masthead .army-current{max-width:155px;font-size:12px}body[data-army-theme] #mode-sources{color:var(--ink)}body[data-army-theme] .tile .photo,body[data-army-theme] .photo:has(.default-photo-note){height:135px}body[data-army-theme] .tile h2{font-size:16px}body[data-army-theme=aos] .tile h2{font-size:18px}body[data-army-theme] .tileinfo{padding:10px}body[data-army-theme] .sidebar .photo{height:230px}body[data-army-theme] .cardheading h2{font-size:26px}}
@media(prefers-reduced-motion:reduce){body[data-army-theme] *,body[data-army-theme] *::before{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

body[data-army-theme] .photo:has(img[data-src])::after{content:"Miniature photograph";position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font:12px system-ui,sans-serif;color:var(--muted)}
body[data-army-theme] .mobile-build-views [aria-pressed=true]{background:var(--theme-accent)!important;border-color:var(--theme-accent)!important;color:white!important}
/* New immutable refinement snapshots retain their own opt-in. */
body.army-refinement #mode-sources,body.army-refinement .photo-source,body.army-refinement .sourcenote,body.army-refinement .default-photo-note{display:none!important}
body.army-refinement #mode-nav{padding-right:12px}
body.army-refinement .inline-keyword,body.army-refinement #force-surface .inline-keyword,body.army-refinement .rule-dialog .inline-keyword{display:inline;border:0!important;border-radius:0!important;background:transparent!important;color:inherit!important;padding:2px 0!important;margin:0!important;min-height:0!important;font:inherit!important;text-decoration:underline dotted;text-underline-offset:4px;cursor:pointer;box-shadow:none!important}
body.army-refinement .inline-keyword:focus-visible{outline:2px solid var(--army-accent,#93713b);outline-offset:3px}
.faction-gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:16px}.faction-card{display:flex;flex-direction:column;gap:7px;text-align:left;min-width:0;padding:0 0 12px;overflow:hidden;color:inherit;background:transparent;border:1px solid #9f9274;font:inherit}.faction-card .photo{width:100%;height:180px}.faction-card>strong,.faction-card>small,.faction-card>span:not(.photo){margin:0 12px}.faction-card>span:not(.photo){font-size:12px}.faction-card small{font-size:12px}
.tile-stats{display:flex;gap:8px;flex-wrap:wrap;font-size:12px;line-height:1.8;margin-top:5px}.tile-stats span{white-space:nowrap}
body.army-refinement .mode-army-bar{position:sticky;top:0;z-index:12;background:var(--army-paper,#fffdf7);padding:8px 0;gap:8px}body.army-refinement[data-army-theme="40k"] .mode-army-bar{background:#222728}body.army-refinement[data-army-theme="aos"] .mode-army-bar{background:#f7f1e4}
body.army-refinement .mode-army-bar h1{max-width:400px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}
.build-setup{display:flex;align-items:center;gap:12px;padding:8px 0;margin:0 0 12px;border-bottom:1px solid #9f927477;font-size:13px}.build-setup>div{flex:1}.build-setup p{margin:4px 0;max-width:800px}.build-setup>a{display:inline-flex;min-height:44px;align-items:center}
body.army-refinement .compact-roster .roster-essential{display:flex;gap:8px;align-items:center;min-width:0}.roster-essential>div{flex:1;min-width:0}.roster-essential .photo{width:48px;height:56px;flex-shrink:0}.roster-essential h3{overflow-wrap:anywhere}.compact-roster>details>summary{cursor:pointer;padding:8px 0;min-height:28px;font-size:12px}.army-refinement .compact-roster .force-row-fields{grid-template-columns:65px minmax(0,1fr)}
.army-refinement .force-list article>.photo{display:block;height:140px;width:100%}.army-refinement .force-list article time{display:inline}.army-refinement .force-list article>small{display:block;margin-bottom:8px}
.army-add-toast{position:fixed;bottom:16px;left:50%;transform:translateX(-50%);z-index:30;display:flex;align-items:center;gap:12px;background:#fffdf7;color:#203440;border:1px solid #93713b;box-shadow:0 3px 15px #0004;padding:8px 12px;max-width:calc(100vw - 32px);box-sizing:border-box}.army-add-toast button{min-height:44px}
.play-sheet{width:min(1100px,calc(100vw - 24px));max-height:90dvh;box-sizing:border-box;padding:16px;background:#fffdf7;color:#203440;border:1px solid #93713b;overflow:auto}.play-sheet::backdrop{background:#000a}.play-sheet .sheet-close{position:sticky;top:0;z-index:4;min-height:44px}.play-sheet #detail{display:block}.play-sheet .customphoto{display:none}.play-sheet .cardtools{display:none}
body.army-refinement .quick-overview-rules .play-rule-strip{max-height:190px;overflow:auto}body.army-refinement .play-strip-group[aria-label="Favourites"]{position:sticky;left:0;z-index:2}
@media(max-width:700px){.faction-gallery{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.faction-card .photo{height:145px}.faction-card>strong{font-size:15px}body.army-refinement .mode-army-bar{display:grid;grid-template-columns:1fr auto;gap:2px 8px}body.army-refinement .mode-army-bar>div:first-child{grid-column:1/-1;width:auto}body.army-refinement .mode-army-bar .army-save-status{max-width:none}body.army-refinement .mode-army-bar .force-actions{justify-content:flex-end}body.army-refinement .mode-army-bar h1{max-width:calc(100vw - 30px)}body.army-refinement .mobile-build-views{position:sticky;top:var(--army-bar-height,112px);z-index:11;background:#f7f1e4;padding:6px 0;margin:0 0 10px}body.army-refinement[data-army-theme="40k"] .mobile-build-views{background:#222728}.tile-stats{gap:4px 8px;font-size:11px}.play-sheet{padding:10px;max-height:94dvh}.build-setup{font-size:12px}}
body.army-refinement[data-army-theme="40k"] .faction-card{background:#252b2d;color:#e7e1d3;border-color:#6d6253}body.army-refinement[data-army-theme="40k"] .faction-card small{color:#cec4b0}body.army-refinement[data-army-theme="40k"] #force-surface>h1{color:#e7e1d3}
body.army-refinement .army-picker-tiles .photo{height:130px;width:100%;display:block}
body.army-refinement[data-army-theme="40k"] #force-surface .mode-army-bar,body.army-refinement[data-army-theme="40k"] #force-surface .mode-army-bar h1,body.army-refinement[data-army-theme="40k"] #force-surface .mode-army-bar p,body.army-refinement[data-army-theme="40k"] #force-surface .mode-army-bar .force-total,body.army-refinement[data-army-theme="40k"] #force-surface .mode-army-bar .army-save-status{color:#e7e1d3!important}
body.army-refinement #force-surface .roster-essential .photo{width:48px!important;min-width:48px!important;max-width:48px!important;height:56px!important;display:block}.roster-essential .photo img{width:100%;height:100%;object-fit:contain}.roster-essential .photo .image-status{font-size:9px;padding:2px}
body.army-refinement .army-picker-tiles button{overflow:hidden}body.army-refinement .army-picker-tiles button .photo{width:100%;max-width:100%}
body.army-refinement #mode-nav{position:sticky;top:0;z-index:14;min-height:44px;background:#f7f1e4}body.army-refinement[data-army-theme="40k"] #mode-nav{background:#e7e1d3}body.army-refinement .mode-army-bar{top:44px}body.army-refinement .mobile-build-views{top:calc(var(--army-bar-height,112px) + 44px)}body.army-refinement #mode-roster{top:calc(var(--army-bar-height,112px) + 56px);max-height:calc(100dvh - var(--army-bar-height,112px) - 68px)}body.army-refinement :where(input,select,button,a,summary){scroll-margin-top:calc(var(--army-bar-height,0px) + 100px)}
@media(max-width:700px){body.army-refinement #mode-roster{max-height:none}}
body.army-refinement #mode-nav a{scroll-margin:0}
body.army-refinement #force-status{position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip-path:inset(50%);margin:0!important;padding:0!important}
body.army-refinement #faction-breadcrumb[hidden]{display:none!important}
body.army-refinement[data-army-theme="40k"] #force-surface>h1{color:#24343d!important}body.army-refinement[data-army-theme="40k"] #force-surface .faction-card{background:#252b2d!important;color:#e7e1d3!important;border-color:#6d6253!important;padding:0 0 12px!important}body.army-refinement #force-surface .faction-card{padding:0 0 12px!important}
body.army-refinement[data-army-theme="40k"] #force-surface .faction-card small{color:#d6ccb8!important}
body.army-refinement .force-row-fields [data-field-error]{display:block;color:#8b3040;background:#fff4e8;padding:4px;font-size:12px;line-height:1.4}
body.army-refinement .force-row-fields>[data-field-error],body.army-refinement .force-row-fields label:has([data-field="manualPoints"]){grid-column:1/-1}
