/* Palette from Warhammer Community: charcoal #181a1c, yellow #fbca1b,
   grey #4f4f4f / #c2c2c2 / #e2e2e2, and white. */
:root{--ink:#181a1c;--muted:#4f4f4f;--paper:#fff;--line:#e2e2e2;--green:#181a1c;--gold:#fbca1b;--accent:#181a1c}
body{background:#fff;color:#181a1c}
header{background:#181a1c;border-color:#4f4f4f;color:#fff}
.brand .seal{color:#fbca1b}
.brand small,.official{color:#fff}
header .official #header-count{background:#fbca1b;color:#181a1c}
header .menu{color:#fff}
.sidebar{background:#f5f5f5;border-color:#e2e2e2}
.roster-panel{background:#f5f5f5;border-color:#e2e2e2}
#army-nav a.active{background:#181a1c;border-left-color:#181a1c;color:#fff}
#army-nav a:hover,.side-link:hover{background:#e2e2e2;color:#181a1c}
#army-nav a.active:hover{background:#181a1c;color:#fff}
#army-nav a.active small{color:#c2c2c2}
.side-filters{border-color:#c2c2c2;background:#fff}
.side-filters button[aria-pressed=true]{background:#181a1c;color:#fff}
.filters{background:#e2e2e2}
.filters button[aria-pressed=true]{background:#181a1c;color:#fff;box-shadow:none}
.search{background:#fff;border-color:#c2c2c2}
.search input,#roster-name,#points-limit{color:#181a1c}
input[type=checkbox]{accent-color:#181a1c}
.profile-card{background:#fff;border-color:#e2e2e2}
.profile-footer{background:#f5f5f5;border-color:#e2e2e2}
.stats-grid{background:#e2e2e2;border-color:#e2e2e2}
.stats-grid strong,.profile-price strong,.profile-name h3{color:#181a1c}
.stats-grid abbr{color:#4f4f4f}
.add-button{background:#fbca1b;color:#181a1c;border-color:#fbca1b;font-weight:600}
.add-button:hover{background:#181a1c;color:#fff;border-color:#181a1c}
.add-button:disabled{background:#e2e2e2;color:#4f4f4f;border-color:#e2e2e2}
.count-badge{background:#e2e2e2;color:#181a1c}
.warband-group{background:#fff;border-color:#c2c2c2}
.warband-group summary{background:#e2e2e2;color:#181a1c}
.warband-name{color:#181a1c}
.warband-hero,.warband-empty,.roster-entry{border-color:#e2e2e2}
.quantity-controls button{background:#fff;border-color:#c2c2c2;color:#181a1c}
.quantity-controls button:hover:not(:disabled){background:#fbca1b;border-color:#fbca1b}
.clear-button{border-color:#181a1c;color:#181a1c}
.clear-button:hover:not(:disabled){background:#181a1c;color:#fff}
.points-track{background:#e2e2e2}
.points-track>div{background:#fbca1b}
.points-track .over{background:#a13f36}
#toast{background:#181a1c;color:#fff;border-left:4px solid #fbca1b}
dialog{background:#fff;color:#181a1c;border-color:#c2c2c2}
dialog::backdrop{background:#0009}
.dialog-actions button{background:#fff;color:#181a1c;border-color:#c2c2c2}
.dialog-actions button:last-child{background:#fbca1b;color:#181a1c;border-color:#fbca1b}
.warband-choice{background:#f5f5f5;color:#181a1c;border-color:#c2c2c2}
.warband-choice:hover{background:#fbca1b;color:#181a1c;border-color:#fbca1b}
.warband-choice small{color:#4f4f4f}
#warband-dialog select,#warband-dialog input{background:#fff;color:#181a1c;border-color:#c2c2c2}
.library-label,.nav-label,.edition,.sidebar-foot p,.legacy-toggle,.army-meta,.breadcrumb,.profile-role,.profile-tags,.profile-price small,.profile-footer>span,.profile-details summary,.details-content,.details-content h4,.data-source,.data-source h3,.roster-title .eyebrow,.roster-name-label,.roster-total>span,.roster-total label,.roster-summary,#roster-army,.roster-entry p,.roster-entry-top small,.draft-note,.roster-empty,.roster-empty span,.warband-label,.warband-capacity,.warband-hero p,.warband-hero button,.warband-empty,.miniature-photo figcaption,.miniature-photo .image-credit,footer p{color:#4f4f4f}
.eyebrow{color:#181a1c}
#roster-warnings,.unassigned-group{color:#715500}
.unassigned-group{border-color:#fbca1b;background:#fff9df}
.unassigned-group>p{color:#715500}
.over,#add-warband-error,#warband-dialog-error{color:#a13f36!important}
a:focus-visible,button:focus-visible,summary:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #181a1c;outline-offset:3px}
header a:focus-visible,header button:focus-visible{outline-color:#fbca1b}

/* Khazad-dûm wordmark: crop the concept canvas margins within the header. */
header .brand{display:flex;align-items:center;min-width:0;flex:none}
header .brand img{display:block;width:auto;height:58px;max-width:100%}
@media(max-width:650px){header .brand img{height:38px}}
@media(max-width:480px){header .brand{flex:1;min-width:0}header .brand img{width:min(190px,100%);height:auto;aspect-ratio:512/116}}

/* Preserve full miniature portraits and explicitly selected source regions. */
.profile-card .unit-thumbnail{object-fit:contain;flex-shrink:0;border-radius:0}
.profile-portrait{border-radius:0}
.miniature-photo-crop{display:block;position:relative;overflow:hidden;width:100%;aspect-ratio:1}
.miniature-photo-crop img{position:absolute;display:block;max-width:none}
/* Header: menu button (mobile), logo on the left, caption, roster link on the right. */
header{display:grid;grid-template-columns:auto auto minmax(0,1fr) auto;column-gap:0}
header .menu{grid-column:1;grid-row:1;justify-self:start;margin-right:12px}
header .brand{grid-column:2;grid-row:1;justify-self:start}
header .top-caption{grid-column:3;grid-row:1;justify-self:start;margin-left:24px}
header .official{grid-column:4;grid-row:1;justify-self:end;margin-left:16px}
@media(max-width:800px){header .top-caption{display:none}}
@media(max-width:480px){
  header .brand img{width:auto;height:auto;max-width:min(190px,52vw)}
  header .official{max-width:64px}
}
/* Thumbnails fill the card header edge to edge (top, left and bottom). */
.profile-header{align-items:center}
.profile-card .unit-thumbnail,.profile-header>.profile-portrait{align-self:stretch;width:116px;height:auto;min-height:116px;margin:-20px 4px -20px -20px;border-radius:0;background:#e2e2e2}
.profile-card .unit-thumbnail{object-fit:cover;object-position:center 40%}
@media(max-width:480px){.profile-card .unit-thumbnail,.profile-header>.profile-portrait{width:88px;min-height:88px;margin:-16px 2px -16px -16px}}
/* Profile matches in the sidebar search: profile name, then one link per army. */
.profile-match{margin:6px 0 12px}
.profile-match-name{font-size:14px;font-weight:650;color:#181a1c;padding:4px 10px 2px}
#army-nav .profile-match a{font-size:13px;padding:5px 10px 5px 18px;margin:1px 0;gap:8px;color:#4f4f4f}
#army-nav .profile-match a>small{white-space:nowrap;text-align:right}
#army-nav .profile-match a:hover{color:#181a1c}
.sidebar-foot .fan-note{font-size:11px;line-height:1.6;margin-top:6px}
/* Independent Heroes cannot take followers, so their warband is not a destination. */
.warband-choice:disabled,.warband-choice:disabled:hover{opacity:.55;cursor:not-allowed;background:#f5f5f5;border-color:#e2e2e2}
/* Army page notice for heroes the army list requires. */
.required-notice{margin:18px 0 4px;padding:14px 16px;border:1px solid #e2e2e2;border-left:3px solid #181a1c;border-radius:4px;background:#f5f5f5;font-size:14px;color:#181a1c}
.required-notice p{margin:3px 0 8px;color:#4f4f4f;font-size:13px}
.required-notice ul{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}
.required-notice li{display:flex;align-items:center;justify-content:space-between;gap:12px}
.required-notice a{font-weight:600;text-decoration:underline;text-underline-offset:3px}
.required-notice button{border:1px solid #181a1c;background:#fff;color:#181a1c;border-radius:4px;padding:4px 10px;font-size:12px;cursor:pointer;white-space:nowrap}
.required-notice button:hover{background:#181a1c;color:#fff}
.required-ok{font-size:12px;color:#4f4f4f;white-space:nowrap}
/* Equipment changes: modified characteristics are underlined; a chosen mount shows its own line. */
.stats-grid .stat-changed strong{color:#181a1c;text-decoration:underline;text-decoration-color:#fbca1b;text-decoration-thickness:3px;text-underline-offset:4px}
.mount-line{display:grid;grid-template-columns:minmax(90px,1.6fr) repeat(9,minmax(0,1fr)) minmax(0,3fr);align-items:center;background:#f5f5f5;border-bottom:1px solid #e2e2e2;padding:6px 12px}
.mount-line>div{text-align:center;min-width:0}
.mount-line abbr{display:block;font-size:9px;color:#4f4f4f;text-decoration:none}
.mount-line strong{display:block;font:14px/1.5 Georgia;color:#181a1c}
.mount-name{font-size:11px;font-weight:650;letter-spacing:.5px;color:#4f4f4f;text-transform:uppercase}
@media(max-width:480px){.mount-line{grid-template-columns:repeat(9,minmax(0,1fr));row-gap:2px}.mount-name{grid-column:1/-1}}
/* Printable roster: an on-screen preview, and the only thing printed while it is open. */
.print-button{display:block;width:100%;margin:0 0 8px;padding:10px;border:1px solid #181a1c;border-radius:4px;background:#181a1c;color:#fff;font:inherit;font-size:14px;cursor:pointer}
.print-button:disabled{opacity:.4;cursor:default}
body.printing>*:not(#print-view):not(#toast){display:none!important}
#print-view{background:#fff;color:#181a1c;min-height:100vh}
.print-toolbar{position:sticky;top:0;z-index:5;display:flex;flex-wrap:wrap;align-items:center;gap:10px 22px;padding:12px 24px;background:#181a1c;color:#fff;font-size:14px}
.print-toolbar strong{margin-right:auto;font:18px Georgia,serif}
.print-toolbar label{display:flex;align-items:center;gap:6px;cursor:pointer}
.print-toolbar button{border:1px solid #fff;background:none;color:#fff;border-radius:4px;padding:7px 16px;font:inherit;cursor:pointer}
.print-toolbar #print-now{background:#fbca1b;border-color:#fbca1b;color:#181a1c;font-weight:650}
#print-sheet{max-width:960px;margin:0 auto;padding:24px 16px 48px;font:13px/1.45 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
.print-head{display:flex;justify-content:space-between;align-items:flex-end;gap:16px;border-bottom:2px solid #181a1c;padding-bottom:8px;margin-bottom:16px}
#print-sheet .print-head h1{font:26px/1.15 Georgia,serif;letter-spacing:0;margin:0;color:#181a1c}
.print-head p{margin:4px 0 0;color:#4f4f4f}
.print-head strong{font:26px Georgia,serif;white-space:nowrap}
.print-head strong small{font-size:13px;color:#4f4f4f}
.print-warband{margin-bottom:14px}
#print-sheet .print-warband h2{display:flex;align-items:baseline;justify-content:space-between;gap:12px;font:600 13px/1.3 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;letter-spacing:.6px;text-transform:uppercase;border-bottom:1px solid #181a1c;padding:4px 0;margin:0 0 8px}
#print-sheet .print-warband h2 span{white-space:nowrap;font-weight:400;text-transform:none;letter-spacing:0;color:#4f4f4f}
.print-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.print-card{border:1.5px solid #181a1c;border-radius:4px;padding:8px 10px;break-inside:avoid;page-break-inside:avoid}
.print-card-head{display:flex;align-items:center;gap:8px}
.print-card-head img{width:44px;height:44px;object-fit:cover;border:1px solid #181a1c;border-radius:50%}
.print-card-head div{flex:1;min-width:0}
.print-card small{color:#4f4f4f;font-size:10px;text-transform:uppercase;letter-spacing:.5px}
#print-sheet .print-card h3{font:600 15px/1.2 Georgia,serif;margin:1px 0 0;color:#181a1c}
.print-card .pts{font:20px Georgia,serif;text-align:right;line-height:1}
.print-card .pts small{display:block;font-size:9px}
.print-stats{width:100%;border-collapse:collapse;margin:6px 0;table-layout:fixed}
.print-stats td{border:1px solid #181a1c;text-align:center;font:600 13px/1.2 Georgia,serif;padding:2px 0}
.print-stats td b{display:block;font:400 8px/1.2 -apple-system,sans-serif;color:#4f4f4f}
.print-stats td.changed{background:#fff3c4}
.print-stats tr.mount th{text-align:left;font:600 9px/1.6 -apple-system,sans-serif;text-transform:uppercase;letter-spacing:.5px;padding-top:3px}
.print-card dl{display:grid;grid-template-columns:auto 1fr;gap:1px 8px;margin:0;font-size:11px}
.print-card dt{font-weight:650}
.print-card dd{margin:0}
.print-rules{margin-top:16px;break-before:auto}
#print-sheet .print-rules h2{font:20px Georgia,serif;letter-spacing:0;border-bottom:2px solid #181a1c;margin:0 0 6px;padding-bottom:4px}
.print-rules table{width:100%;border-collapse:collapse}
.print-rules td{border-bottom:1px solid #c2c2c2;padding:6px 2px;font-size:11.5px;break-inside:avoid;page-break-inside:avoid}
.print-rules .who{margin-top:3px}
.print-rules .who span{display:inline-block;border:1px solid #181a1c;padding:0 5px;margin:2px 4px 0 0;font-size:9px;text-transform:uppercase;letter-spacing:.4px}
.print-foot{margin-top:18px;border-top:1px solid #c2c2c2;padding-top:6px;font-size:9px;color:#4f4f4f}
.print-empty{padding:40px 0;text-align:center;color:#4f4f4f}
@media(max-width:640px){.print-cards{grid-template-columns:1fr}}
@media print{
  @page{size:A4;margin:12mm}
  body.printing{background:#fff}
  .print-toolbar,#toast{display:none!important}
  #print-view{min-height:0}
  #print-sheet{max-width:none;padding:0;font-size:11px}
  .print-cards{grid-template-columns:repeat(2,minmax(0,1fr))}
  .print-card,.print-stats td.changed{-webkit-print-color-adjust:exact;print-color-adjust:exact}
}
/* The roster is named after its army. */
#roster-army.roster-army-name{font:22px/1.25 Georgia,serif;color:#181a1c;margin:14px 0 18px}
#roster-army.roster-army-name.empty{font-size:15px;color:#4f4f4f;font-style:italic}
/* Mobile: 16px inputs stop iOS zooming in; while searching, the sidebar fills the visible area above the keyboard. */
.search-done{display:none}
@media(max-width:800px){
  .search input,#profile-search,#points-limit{font-size:16px}
  .sidebar{width:min(360px,100vw);height:calc(var(--vvh,100dvh) - 72px);bottom:auto;overscroll-behavior:contain}
  .sidebar.searching{top:var(--vvtop,0px);height:var(--vvh,100dvh);width:100vw;z-index:40;padding:12px 14px 0;overflow:hidden}
  .sidebar.searching .library-label,.sidebar.searching .side-filters,.sidebar.searching .sidebar-foot{display:none}
  .sidebar.searching .search{flex:none}
  .sidebar.searching .search-done{display:block;flex:none;border:0;background:none;color:#181a1c;font:600 15px/1 inherit;padding:6px 2px 6px 8px;cursor:pointer}
  .sidebar.searching #army-nav{flex:1;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch;margin:8px -14px 0;padding:0 14px 16px}
  #army-nav a{padding-top:11px;padding-bottom:11px}
}
