/* Builder-only semantic theme. Hub routes retain their existing tokens. */
body:has(#native-builder) {
  color-scheme: dark;
  --bg-app: #101015; --bg-sidebar: #0d0e13; --bg-header: #121218;
  --bg-panel: #18181f; --bg-surface: #202029; --bg-elevated: #252530;
  --bg-hover: #292934; --bg-selected: #302b37; --bg-overlay: #09090e;
  --border-subtle: #252530; --border-default: #30303a; --border-control: #807d8c; --border-selected: #a98c58;
  --text-primary: #f0edf4; --text-secondary: #b5b1c0; --text-muted: #aaa6b7; --text-inverse: #151219;
  --accent-primary: #d8b477; --accent-hover: #e8c68e; --accent-active: #c19b60; --accent-subtle: #382e24; --accent-muted: #8a704c;
  --magic-primary: #b6a1dc; --magic-hover: #c1afe5; --magic-subtle: #30283f; --magic-glow: rgba(168,147,206,.12);
  --ornament-gold: #967c50; --ornament-muted: rgba(216,180,119,.18); --ornament-subtle: rgba(216,180,119,.08);
  --success: #83c9a9; --success-bg: #1d3028; --warning: #e9be79; --warning-bg: #342b20;
  --danger: #ef8f9d; --danger-bg: #38232c; --info: #a7b9e8; --info-bg: #242d43;
  --focus-ring: #d8b477; --scrollbar-track: #18181f; --scrollbar-thumb: #666473;
  --shadow-panel: 0 2px 12px #00000024; --shadow-popover: 0 12px 32px #0006;
  background: var(--bg-app); color: var(--text-primary);
}
body[data-theme="hub-classic"]:has(#native-builder) {
  --bg-app:#10141b; --bg-sidebar:#0a1018; --bg-header:#121820; --bg-panel:#151c26;
  --bg-surface:#1c2532; --bg-elevated:#222c39; --bg-hover:#293747; --bg-selected:#303540;
  --border-default:#343e4b; --text-primary:#e8edf3; --text-secondary:#acb7c5;
  --accent-primary:#efc182; --accent-subtle:#3b3024; --ornament-gold:transparent;
}
#native-builder {
  --builder-space-1:4px; --builder-space-2:8px; --builder-space-3:12px; --builder-space-4:16px;
  --builder-space-5:20px; --builder-space-6:24px; --builder-space-8:32px;
  --builder-radius-sm:4px; --builder-radius-md:6px; --builder-radius-lg:10px; --builder-radius-panel:12px;
  --builder-control-height:36px; --builder-toolbar-height:60px; --builder-catalog-row-height:64px;
  --builder-transition-fast:120ms; --builder-transition-normal:180ms;
  --nb-base:var(--bg-app); --nb-panel:var(--bg-panel); --nb-deep:var(--bg-surface); --nb-raised:var(--bg-elevated);
  --nb-line:var(--border-default); --nb-ink:var(--text-primary); --nb-muted:var(--text-secondary);
  --nb-amber:var(--accent-primary); --nb-bronze:var(--border-selected); --nb-error:var(--danger);
  display:flex; flex-direction:column; padding:16px; gap:12px;
  font-family:Onest,Inter,system-ui,sans-serif; font-size:13px; line-height:1.45;
}
body:has(#native-builder) .ec-header { background:var(--bg-header); border-bottom:1px solid var(--border-subtle); box-shadow:none; }
body:has(#native-builder) .ec-header__in { max-width:none; min-height:64px; padding:10px 24px; gap:32px; }
body:has(#native-builder) .ec-logo__name { font-family:Onest,system-ui,sans-serif; font-size:19px; font-weight:700; color:var(--accent-primary); }
body:has(#native-builder) .ec-logo__sub { color:var(--text-secondary); }
body:has(#native-builder) .ec-header__actions { margin-left:auto; }
body:has(#native-builder) .ec-header__actions :is(a,button) { color:var(--text-primary); border-color:var(--border-control); }
.nb-shell-title { font-size:18px; color:var(--text-primary); white-space:nowrap; }
body:has(#native-builder) .hub-side { background:var(--bg-sidebar); border-color:var(--border-subtle); }
body:has(#native-builder) .hub-menu a { color:var(--text-secondary); border:0; border-radius:6px; }
body:has(#native-builder) .hub-menu a:hover { background:var(--bg-hover); color:var(--text-primary); }
body:has(#native-builder) .hub-menu a.on { color:var(--accent-primary); background:var(--accent-subtle); }
body:has(#native-builder) .hub-menu a .ico { width:21px; height:21px; }
#native-builder :is(h1,h2,h3,summary) { font-family:inherit; }
#native-builder h2 { font-size:17px; font-weight:600; line-height:1.35; }
#native-builder h3 { color:var(--text-primary); font-size:14px; }
#native-builder :is(button,a,input,select,textarea,summary):focus-visible { outline:2px solid var(--focus-ring); outline-offset:2px; }
#native-builder :is(button,a,summary) { touch-action:manipulation; }
#native-builder [hidden] { display:none !important; }
.nb-sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
#native-builder input:not([type=checkbox]),#native-builder select,#native-builder textarea { border-color:var(--border-control); background:var(--bg-surface); border-radius:6px; color:var(--text-primary); font-size:13px; }
#native-builder .btn { font-size:13px; min-height:36px; font-weight:600; border-radius:6px; }
#native-builder .btn.ghost { background:var(--bg-surface); border-color:var(--border-default); }
#native-builder :is(.nb-save,.nb-profile-add) { color:var(--text-inverse); background:var(--accent-primary); border:1px solid transparent; font-weight:650; }
#native-builder :is(.nb-save,.nb-profile-add):hover:not(:disabled) { background:var(--accent-hover); }
#native-builder :is(.nb-save,.nb-profile-add):active:not(:disabled) { background:var(--accent-active); }
#native-builder .nb-icon-button { display:inline-grid; place-items:center; width:36px; min-width:36px; height:36px; padding:7px; background:transparent; color:var(--text-secondary); border:1px solid transparent; border-radius:6px; }
#native-builder .nb-icon-button:hover { background:var(--bg-hover); color:var(--text-primary); }
.nb-icon { display:block; width:20px; height:20px; flex:none; }
#native-builder .nb-toolbar { display:grid; grid-template-columns:minmax(150px,1fr) minmax(180px,auto) auto auto; align-items:center; gap:20px; min-height:76px; padding:10px 18px; background:var(--bg-panel); border:0; border-radius:12px; position:relative; flex:none; }
#native-builder .nb-title { font-size:19px; font-weight:650; padding:0; line-height:1.4; }
#native-builder .nb-title span:last-child { color:var(--text-muted); font-size:13px; }
.nb-title-row { min-width:0; }
.nb-identity-meta { display:flex; align-items:center; gap:4px; min-height:24px; }
#native-builder .nb-identity-meta .nb-icon-button { width:24px; min-width:24px; height:24px; padding:3px; }
.nb-identity-meta .nb-icon { width:16px; height:16px; }
.nb-mode-caption { color:var(--text-muted); font-size:10px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#native-builder #nb-save-status { min-height:24px; line-height:1; }
#native-builder #nb-save-status[data-error=true] { color:var(--danger); }
#native-builder .nb-save-error { flex:none; padding:8px 12px; background:var(--danger-bg); color:var(--danger); border-radius:6px; }
#native-builder .nb-settings { display:block; min-width:0; }
#native-builder .nb-faction-icons { display:flex; gap:6px; flex-wrap:nowrap; overflow-x:auto; max-width:394px; padding:3px; scrollbar-width:thin; }
#native-builder .nb-faction-icon { flex:0 0 40px; width:40px; height:42px; background:var(--bg-elevated); border:1px solid transparent; padding:5px; border-radius:7px; position:relative; }
#native-builder .nb-faction-icon img { width:28px; height:28px; object-fit:contain; }
#native-builder .nb-faction-icon:hover { background:var(--bg-hover); border-color:var(--border-control); }
#native-builder .nb-faction-icon[aria-pressed=true] { border-color:var(--accent-primary); background:var(--accent-subtle); box-shadow:none; }
#native-builder .nb-faction-icon[aria-pressed=true]::after { content:''; position:absolute; bottom:2px; left:12px; right:12px; height:2px; background:var(--accent-primary); }
.nb-faction-monogram { font-size:17px; font-weight:650; color:var(--text-secondary); }
.nb-faction-icon img[src*="faction-thenion"] { filter:invert(1) hue-rotate(180deg) saturate(1.4); mix-blend-mode:screen; }
#native-builder .nb-budget { display:flex; align-items:center; gap:14px; color:var(--accent-primary); }
.nb-budget-trigger { display:grid; gap:4px; padding:0; text-align:left; background:transparent; border:0; color:inherit; font:inherit; }
#native-builder .nb-budget strong { font-size:26px; line-height:1.1; font-weight:650; font-variant-numeric:tabular-nums; }
#native-builder .nb-budget progress { width:100%; height:5px; background:var(--border-default); }
#native-builder .nb-budget progress::-webkit-progress-bar { background:var(--border-default); }
#native-builder .nb-budget progress::-webkit-progress-value { background:var(--accent-primary); }
#native-builder .nb-budget[data-budget=over] { color:var(--danger); }
#native-builder .nb-budget[data-budget=over] progress::-webkit-progress-value { background:var(--danger); }
#native-builder .nb-budget-caption { font-size:10px; color:var(--text-secondary); }
#native-builder .nb-validation { text-decoration:none; }
#native-builder .nb-validation[data-issues=no] { color:var(--success); }
#native-builder .nb-validation[data-issues=yes] { color:var(--danger); }
#native-builder .nb-validation[data-issues=draft] { color:var(--text-muted); }
.nb-toolbar-actions { gap:4px; }
#native-builder .nb-save { padding:9px 18px; min-height:40px; }
#native-builder .nb-layout { flex:1; grid-template-columns:minmax(250px,.98fr) minmax(320px,1.4fr) minmax(280px,1.12fr); min-height:0; gap:12px; padding:0; }
#native-builder .nb-pane { background:var(--bg-panel); border:1px solid var(--border-default); border-radius:12px; box-shadow:var(--shadow-panel); position:relative; }
.nb-pane::before,.nb-pane::after { content:''; position:absolute; top:11px; width:20px; height:12px; pointer-events:none; z-index:1; opacity:.7; border-top:1px solid var(--ornament-gold); }
.nb-pane::before { left:11px; border-left:1px solid var(--ornament-gold); }
.nb-pane::after { right:11px; border-right:1px solid var(--ornament-gold); }
#native-builder .nb-scroll { scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track); scroll-padding-block:12px; }
#native-builder .nb-tabs { padding:14px 14px 0; gap:16px; }
#native-builder .nb-tabs button { padding:4px 0 10px; border:0; border-radius:0; border-bottom:2px solid transparent; background:transparent; color:var(--text-secondary); font-size:14px; font-weight:500; }
#native-builder .nb-tabs button[aria-selected=true] { color:var(--accent-primary); border-bottom-color:var(--accent-primary); font-weight:650; }
#native-builder .nb-browse>.nb-tabs,#native-builder .nb-party-head { background:transparent; border-bottom:0; }
#native-builder .nb-catalog-controls { padding:12px 14px 8px; gap:8px; border:0; }
.nb-search { position:relative; display:block; }
#native-builder .nb-search input { padding-right:36px; height:38px; }
#native-builder .nb-search button { position:absolute; right:3px; top:3px; width:30px; min-height:30px; padding:0; background:transparent; border:0; }
.nb-search kbd { position:absolute; right:13px; top:10px; color:var(--text-muted); font:11px inherit; pointer-events:none; }
.nb-search:has(button:not([hidden])) kbd { display:none; }
#native-builder .nb-catalog-filters { display:grid; grid-template-columns:minmax(0,1fr) auto minmax(65px,.7fr) 28px; gap:4px; }
#native-builder .nb-catalog-filters :is(select,button) { min-height:30px; height:30px; padding:3px; font-size:11px; background:transparent; border:0; }
#native-builder .nb-catalog-filters .nb-icon-button { width:28px; min-width:28px; }
#native-builder .nb-count { font-size:11px; color:var(--text-muted); }
#native-builder #nb-catalog { gap:4px; padding:2px 12px 16px; }
#native-builder .nb-catalog-row { border:1px solid transparent; background:var(--bg-surface); border-radius:7px; }
#native-builder .nb-catalog-row:hover { background:var(--bg-hover); }
#native-builder .nb-catalog-row:has([aria-pressed=true]) { background:var(--bg-selected); border-left:3px solid var(--accent-primary); }
#native-builder :is(.nb-catalog-unit,.nb-roster-tile) { grid-template-columns:46px minmax(0,1fr) auto; gap:9px; padding:7px; min-height:64px; border:0; background:transparent; }
#native-builder :is(.nb-catalog-unit,.nb-roster-tile) img { width:46px; height:48px; }
#native-builder .nb-catalog-copy strong { font-size:14px; font-weight:550; line-height:1.3; }
#native-builder .nb-catalog-copy small { font-size:11px; color:var(--text-secondary); line-height:1.3; }
#native-builder .nb-catalog-copy .nb-unavailable { color:var(--danger); }
#native-builder .nb-row-cost { color:var(--text-primary); font-size:13px; font-variant-numeric:tabular-nums; }
#native-builder .nb-row-cost strong { font-weight:500; }
#native-builder .nb-plus { width:32px; height:34px; margin-right:7px; border:0; background:var(--accent-subtle); color:var(--accent-primary); }
#native-builder .nb-plus:hover:not(:disabled) { background:var(--bg-hover); }
#native-builder .nb-catalog-upgrade { background:var(--bg-surface); border:1px solid transparent; }
#native-builder .nb-catalog-upgrade[aria-pressed=true] { background:var(--bg-selected); border-left:3px solid var(--magic-primary); }
#native-builder #nb-catalog.nb-catalog-grid .nb-catalog-unit { grid-template-columns:1fr; }
#native-builder .nb-catalog-grid .nb-catalog-unit img { width:100%; height:110px; object-fit:contain; }
#native-builder #nb-party-content { padding:16px; }
#native-builder .nb-roster-list { gap:10px; }
#native-builder .nb-roster-row { background:var(--bg-surface); border:1px solid var(--border-default); border-radius:10px; padding:6px 8px 10px; }
#native-builder .nb-roster-row:has([aria-pressed=true]) { background:var(--bg-selected); border-color:var(--border-selected); border-left:3px solid var(--accent-primary); }
#native-builder .nb-roster-row.is-leader:not(:has([aria-pressed=true])) { border-left:1px solid var(--border-default); }
#native-builder .nb-roster-tile .nb-catalog-copy strong { font-size:15px; font-weight:600; }
#native-builder .nb-leader { color:var(--accent-primary); border:0; padding:0; font-size:11px; }
#native-builder .nb-model-slots { padding-left:62px; gap:3px; }
#native-builder .nb-model-slots:has(.nb-assigned:empty) { display:none; }
#native-builder .nb-slot-count { color:var(--text-muted); font-size:10px; }
#native-builder .nb-open-upgrades { padding:0; min-height:26px; color:var(--magic-primary); border:0; background:transparent; font-weight:500; }
#native-builder .nb-assigned-row { padding:3px 0; border:0; }
#native-builder .nb-assigned-name { font-size:12px; }
#native-builder .nb-add-model { width:100%; min-height:44px; margin-top:14px; border:1px dashed var(--border-control); background:transparent; color:var(--text-secondary); }
#native-builder .nb-party .nb-empty { border:0; margin:0; padding:12px 12px 28px; justify-items:center; text-align:center; gap:14px; background:transparent; }
.nb-empty-art { width:min(100%,340px); height:auto; max-height:260px; pointer-events:none; }
#native-builder .nb-empty h2 { font-size:18px; }
#native-builder .nb-empty p { max-width:290px; color:var(--text-secondary); line-height:1.6; }
#native-builder .nb-empty .nb-profile-add { margin-top:4px; }
#native-builder .nb-inspector { padding:14px 16px; background:var(--bg-panel); }
#native-builder .nb-inspector-bar { font-size:11px; font-weight:500; border:0; padding:0 0 8px; min-height:24px; }
#native-builder .nb-profile-sticky { position:sticky; top:-14px; z-index:2; background:var(--bg-panel); padding-top:10px; padding-bottom:10px; margin-top:0; }
#native-builder .nb-profile-head { gap:12px; }
#native-builder .nb-profile-head :is(img,.nb-image-fallback) { flex:0 0 72px; width:72px; height:80px; border-radius:7px; object-fit:cover; }
#native-builder .nb-profile-head h2 { font-size:17px; font-weight:650; }
#native-builder .nb-profile-head p { font-size:11px; }
#native-builder .nb-profile-head strong { display:block; margin-top:3px; font-size:21px; font-weight:500; color:var(--text-primary); }
.nb-profile-context { color:var(--text-muted); font-size:10px !important; }
#native-builder .nb-profile-stats { grid-template-columns:repeat(5,minmax(0,1fr)); gap:5px; margin:14px 0 0; }
#native-builder .nb-profile-stats:has(>div:nth-child(11)) { grid-template-columns:repeat(6,minmax(0,1fr)); }
#native-builder .nb-profile-stats>div { display:grid; align-content:center; min-height:48px; padding:5px 2px; background:var(--bg-surface); border:0; border-radius:6px; }
#native-builder .nb-profile-stats>div:last-child:nth-child(11) { grid-column:span 2; }
#native-builder .nb-profile-stats dt { font-size:10px; color:var(--text-secondary); }
#native-builder .nb-profile-stats dd { font-size:17px; font-weight:550; color:var(--text-primary); }
#native-builder .nb-load { font-size:12px; gap:5px; }
#native-builder .nb-load meter { width:100%; max-width:none; height:8px; border:0; background:var(--border-default); border-radius:6px; }
#native-builder .nb-load meter::-webkit-meter-bar { background:var(--border-default); border:0; height:6px; }
#native-builder .nb-load meter::-webkit-meter-optimum-value { background:var(--accent-primary); }
#native-builder .nb-load.warn meter::-webkit-meter-optimum-value { background:var(--danger); }
.nb-magic-schools { display:flex; gap:6px; flex-wrap:wrap; }
#native-builder .nb-magic-tag { padding:5px 8px; border-radius:6px; border:0; background:var(--magic-subtle); color:var(--magic-primary); font:inherit; font-size:12px; }
#native-builder .nb-rule-group { background:var(--bg-surface); border-radius:6px; margin-top:6px; }
#native-builder .nb-rule-group>summary { display:flex; align-items:center; gap:8px; padding:8px 10px; min-height:36px; color:var(--text-primary); font-size:13px; cursor:pointer; list-style:none; }
#native-builder .nb-rule-group>summary::before { content:'›'; color:var(--text-secondary); font-size:18px; line-height:1; transition:transform 120ms; }
#native-builder .nb-rule-group[open]>summary::before { transform:rotate(90deg); }
.nb-rule-count { margin-left:auto; color:var(--text-muted); font-size:11px; font-variant-numeric:tabular-nums; }
#native-builder .nb-rule-group>summary::-webkit-details-marker { display:none; }
#native-builder .nb-rule-group>.nb-rule { margin:0 10px; padding:3px 0; border-color:var(--border-default); }
#native-builder .nb-rule-group>.nb-rule:last-child { border:0; }
#native-builder .nb-rule summary { font-size:12px; font-weight:500; }
#native-builder .nb-rule[open]>summary { color:var(--accent-primary); }
#native-builder .nb-rule-description { font-size:13px; line-height:1.55; padding-bottom:8px; }
#native-builder .nb-inspector-primary { bottom:-14px; padding:12px 0 4px; z-index:3; background:var(--bg-panel); }
#native-builder .nb-inspector-primary:empty { display:none; }
#native-builder .nb-inspector-primary .btn { min-height:42px; width:100%; }
#native-builder .nb-unit-actions { border-top:1px solid var(--border-default); padding-top:8px; }
#native-builder .nb-unit-actions>summary { min-height:32px; color:var(--text-secondary); }
#native-builder .nb-unit-settings { border:0; }
.nb-inspector-empty { display:grid; align-content:center; justify-items:center; text-align:center; gap:16px; min-height:75%; padding:24px; }
.nb-empty-sigil { font-size:58px; font-weight:300; color:var(--ornament-gold); line-height:1; }
.nb-inspector-empty p { max-width:260px; line-height:1.65; }
#native-builder .nb-picker-detail { background:var(--magic-subtle); border:0; padding:12px; }
#native-builder .nb-picker-detail p { line-height:1.5; font-size:13px; }
#native-builder .nb-picker-item { border:1px solid transparent; background:var(--bg-surface); }
#native-builder .nb-picker-item[aria-pressed=true] { border-color:var(--magic-primary); }
#native-builder .nb-popover { position:fixed; inset:auto; margin:0; width:min(340px,calc(100vw - 24px)); max-height:calc(100dvh - 24px); overflow-y:auto; background:var(--bg-elevated); color:var(--text-primary); border:1px solid var(--border-control); border-radius:10px; padding:16px; box-shadow:var(--shadow-popover); }
#native-builder .nb-popover:popover-open { display:grid; gap:12px; }
#native-builder .nb-popover .nb-dialog-head { margin:0; }
#native-builder .nb-popover h2 { font-size:15px; }
#native-builder .nb-popover > .btn { text-align:left; justify-content:flex-start; background:transparent; border:0; }
#native-builder .nb-popover>.btn:hover { background:var(--bg-hover); }
.nb-budget-breakdown { display:grid; gap:10px; margin:0; }
.nb-budget-breakdown>div { display:flex; justify-content:space-between; gap:16px; }
.nb-budget-breakdown dd { margin:0; font-variant-numeric:tabular-nums; }
#native-builder .nb-dialog { background:var(--bg-elevated); border-color:var(--border-control); }
#native-builder .nb-dialog::backdrop { background:#09090ecc; }
#native-builder :is(button,a,summary) { transition:background-color var(--builder-transition-fast),border-color var(--builder-transition-fast),color var(--builder-transition-fast); }
@media (min-width:1100px) {
  #native-builder[data-collapsed=true] .nb-layout { grid-template-columns:minmax(280px,1fr) minmax(360px,1.45fr); }
}
@media (max-width:1439px) and (min-width:1100px) {
  #native-builder { padding:12px; gap:10px; }
  #native-builder .nb-toolbar { gap:12px; padding:10px 12px; grid-template-columns:minmax(135px,1fr) minmax(160px,1.6fr) auto auto; }
  #native-builder .nb-layout { grid-template-columns:minmax(245px,1fr) minmax(300px,1.35fr) minmax(275px,1.1fr); gap:10px; }
  #native-builder .nb-budget { gap:6px; }
  #native-builder .nb-budget strong { font-size:24px; }
  #native-builder .nb-toolbar-actions { gap:0; }
  #native-builder .nb-save { padding:8px 12px; }
  #native-builder .nb-catalog-filters { grid-template-columns:minmax(0,1fr) auto 62px 26px; }
}
@media (min-width:768px) and (max-width:1099px) {
  #native-builder .nb-toolbar { grid-template-columns:minmax(130px,1fr) auto auto; gap:10px; }
  #native-builder .nb-settings { grid-column:1/-1; grid-row:2; }
  #native-builder .nb-faction-icons { max-width:none; }
  #native-builder .nb-layout { grid-template-columns:minmax(260px,1fr) minmax(300px,1.35fr); }
  #native-builder[data-drawer=true] .nb-inspector { display:block; width:min(440px,60%); position:absolute; inset:0 0 0 auto; z-index:5; border-radius:12px; box-shadow:var(--shadow-popover); }
  #native-builder[data-drawer=true] .nb-drawer-scrim { display:block; position:absolute; inset:0; z-index:4; background:#09090eaa; }
  #native-builder .nb-profile-sticky { z-index:2; }
}
@media (max-width:767px) {
  body:has(#native-builder) .ec-header__in { padding:8px 12px; min-height:56px; gap:12px; }
  body:has(#native-builder) .ec-logo__mark { width:28px; height:28px; }
  body:has(#native-builder) .ec-logo__name { font-size:16px; }
  body:has(#native-builder) .ec-logo__sub { display:none; }
  .nb-shell-title { font-size:13px; }
  #native-builder { padding:8px 8px 0; gap:8px; }
  #native-builder .nb-toolbar { grid-template-columns:minmax(0,1fr) auto; gap:6px 10px; padding:10px; }
  #native-builder .nb-title { font-size:17px; }
  #native-builder .nb-settings { grid-row:3; grid-column:1/-1; }
  #native-builder .nb-budget { grid-row:1; grid-column:2; gap:3px; }
  #native-builder .nb-budget strong { font-size:22px; }
  #native-builder .nb-budget-caption { font-size:9px; }
  #native-builder .nb-toolbar-actions { grid-row:2; grid-column:2; justify-content:flex-end; }
  #native-builder .nb-identity { grid-column:1; grid-row:1/3; }
  #native-builder .nb-identity-meta { flex-wrap:wrap; }
  #native-builder .nb-mode-caption { width:100%; font-size:9px; }
  #native-builder .nb-toolbar-actions .nb-icon-button { min-width:32px; width:32px; height:32px; padding:6px; }
  #native-builder .nb-save { min-height:34px; padding:6px 8px; font-size:11px; }
  #native-builder .nb-faction-icons { max-width:none; gap:6px; }
  #native-builder .nb-faction-icon { flex-basis:40px; height:42px; }
  #native-builder .nb-layout { order:2; grid-template-columns:minmax(0,1fr); gap:0; padding:0; }
  #native-builder .nb-mobile-nav { order:3; flex:none; grid-template-columns:repeat(3,minmax(0,1fr)); margin:0 -8px; padding:4px 8px max(4px,env(safe-area-inset-bottom)); background:var(--bg-header); border-color:var(--border-default); }
  #native-builder .nb-mobile-nav .btn { min-height:44px; border:0; border-top:2px solid transparent; border-radius:0; background:transparent; }
  #native-builder .nb-mobile-nav button[aria-pressed=true] { border-top-color:var(--accent-primary); color:var(--accent-primary); }
  #native-builder .nb-inspector { border-radius:10px; }
  #native-builder .nb-catalog-filters { grid-template-columns:minmax(0,1fr) auto 70px 28px; }
  #native-builder .nb-tabs button { min-height:40px; }
  #native-builder .nb-plus { min-width:40px; }
  #native-builder .nb-empty-art { max-height:170px; }
  #native-builder .nb-profile-sticky { position:static; }
  #native-builder .nb-entry-actions { max-width:calc(100vw - 64px); }
}
@media (prefers-reduced-motion:reduce) {
  #native-builder *,#native-builder *::before,#native-builder *::after { transition:none !important; animation:none !important; scroll-behavior:auto !important; }
}
@media print {
  #native-builder { display:block; height:auto; padding:0; }
  #native-builder .nb-print { display:block; }
  .nb-pane::before,.nb-pane::after { display:none; }
}

/* Neutralize the global Hub's cut corners, heading diamonds and heavy tab buttons. */
body:has(#native-builder) .ec-header .ec-logo { margin-right:0; }
body:has(#native-builder) .ec-header { backdrop-filter:none; }
body:has(#native-builder) .hub-menu a.on .ico { color:var(--accent-primary); }
body:has(#native-builder) .hub-menu a:not(.on) .ico { color:var(--text-secondary); }
#native-builder h2::before { content:none; }
#native-builder .btn { clip-path:none; }
#native-builder .nb-tabs .btn.ghost { background:transparent; border:0; border-bottom:2px solid transparent; border-radius:0; }
#native-builder .nb-tabs .btn.ghost[aria-selected=true] { border-bottom-color:var(--accent-primary); }
#native-builder .nb-catalog-filters .btn.ghost { background:transparent; border:0; }
#native-builder .nb-model-slots .btn.ghost.nb-open-upgrades { background:transparent; border:0; color:var(--magic-primary); }
#native-builder .nb-popover>.btn.ghost { background:transparent; border:0; }
#native-builder .nb-popover>.btn.ghost:hover { background:var(--bg-hover); }
#native-builder .nb-profile-stats { align-items:stretch; }

/* A fixed profile and primary action frame one scrolling rule surface. */
#native-builder .nb-inspector { display:flex; flex-direction:column; overflow:hidden; }
#native-builder .nb-inspector>* { flex:none; }
#native-builder .nb-inspector .nb-inspector-body { flex:1; min-height:0; overflow-y:auto; margin-top:8px; padding:0 1px 12px; }
#native-builder .nb-inspector-body>*+* { margin-top:10px; }
#native-builder .nb-profile-sticky { position:static; padding-top:0; padding-bottom:4px; margin:0; }
#native-builder .nb-inspector-primary { position:static; margin-top:0; padding:10px 0 0; }
#native-builder .nb-inspector-empty { min-height:100%; }
#native-builder .nb-inspector-body .nb-rule-group { margin-top:6px; }
@media (min-width:768px) and (max-width:1099px) {
  #native-builder .nb-inspector { display:none; }
  #native-builder[data-drawer=true] .nb-inspector { display:flex; }
}
@media (min-width:1100px) { #native-builder[data-collapsed=true] .nb-inspector { display:none; } }
@media (max-width:767px) { #native-builder:not([data-panel=inspector]) .nb-inspector { display:none; } }

@media (min-width:1440px) {
  #native-builder .nb-toolbar { grid-template-columns:minmax(180px,.75fr) minmax(300px,1.1fr) minmax(180px,.55fr) auto; }
}
#native-builder .nb-mobile-nav .btn.ghost { border:0; border-top:2px solid transparent; background:transparent; }
#native-builder .nb-mobile-nav .btn.ghost[aria-pressed=true] { border-top-color:var(--accent-primary); color:var(--accent-primary); }

/* Library artwork and warm selection matched to the supplied roster reference. */
body:has(#native-builder) {
  --bg-selected:#2f2b2a;
  --border-selected:#d6a74e;
}
body:has(#native-builder) .ec-header {
  background:linear-gradient(90deg,#121218 0%,#121218a6 28%,#12121840 58%,#121218db 100%),url('/builder-library-header-v1.jpg') center 44% / cover no-repeat;
}
#native-builder .nb-party {
  background:linear-gradient(#18181fe8,#18181ff5),url('/builder-library-header-v1.jpg') center / cover no-repeat;
}
#native-builder .nb-party:has(.nb-empty-art) {
  background:radial-gradient(ellipse at 50% 43%,#302a3640,transparent 72%),#18181f;
}
#native-builder .nb-empty-art {
  content:url('/builder-library-scene-v1.jpg');
  width:calc(100% + 56px); max-width:none; height:auto; max-height:none;
  aspect-ratio:3/2; object-fit:cover;
  margin:-12px -28px -24px;
  mask-image:linear-gradient(to bottom,transparent,#000 10%,#000 74%,transparent),linear-gradient(to right,transparent,#000 9%,#000 91%,transparent);
  mask-composite:intersect;
}
#native-builder .nb-party .nb-empty { overflow:hidden; }
#native-builder .nb-empty h2 { position:relative; font-size:26px; }
#native-builder .nb-empty p { max-width:350px; }
#native-builder .nb-catalog-row:has([aria-pressed=true]),
#native-builder .nb-roster-row:has([aria-pressed=true]) {
  background:linear-gradient(110deg,#3c342d,#2f2b2a 55%,#383127);
  border:1px solid var(--border-selected);
  box-shadow:inset 0 0 0 1px #f6cf7833,0 0 9px #e8b64c14;
}
#native-builder .nb-catalog-unit[aria-pressed=true],
#native-builder .nb-roster-tile[aria-pressed=true] { background:transparent; box-shadow:none; }
#native-builder .nb-catalog-row:has([aria-pressed=true]):hover,
#native-builder .nb-roster-row:has([aria-pressed=true]):hover { background:linear-gradient(110deg,#443a30,#35302b 55%,#40372b); }
#native-builder .nb-row-cost { color:#f0c56e; }
#native-builder :is(.nb-save,.nb-profile-add) {
  background:linear-gradient(180deg,#f3d18d,#ddb166 65%,#c29652);
  border:1px solid #d4a351;
  box-shadow:inset 0 1px 2px #fff0c8aa,inset 0 -2px 2px #76502255;
}
#native-builder :is(.nb-save,.nb-profile-add):hover:not(:disabled) { background:linear-gradient(#ffe0a1,#e6bc75); }
@media (max-width:767px) {
  #native-builder .nb-empty-art { width:min(calc(100% + 56px),480px); max-height:240px; }
  #native-builder .nb-empty h2 { font-size:22px; }
}

#native-builder[data-start=true] { display:block; overflow:auto; background-color:var(--bg-app); background-image:radial-gradient(ellipse at 22% 0%,#322821 0,transparent 42%),linear-gradient(100deg,rgba(16,16,21,.78),rgba(16,16,21,.58)),var(--nb-faction-art,none); background-repeat:no-repeat; background-position:center,center,72% center; background-size:cover,cover,min(58vw,720px) auto; }
#native-builder:not([data-start=true]) { background-color:var(--bg-app); background-image:linear-gradient(100deg,rgba(16,16,21,.8),rgba(16,16,21,.64)),var(--nb-faction-art,none); background-repeat:no-repeat; background-position:center,72% center; background-size:cover,min(58vw,720px) auto; }
#native-builder .nb-layout { background:transparent; }
.nb-start-screen { width:min(1500px,100%); min-height:100%; margin:0 auto; padding:clamp(22px,4vh,48px) clamp(18px,3vw,52px); display:grid; align-content:start; gap:24px; }
.nb-start-heading { text-align:center; display:grid; justify-items:center; gap:10px; }
.nb-start-kicker { color:var(--accent-primary); font-size:11px; font-weight:750; letter-spacing:.22em; }
.nb-start-heading h1 { color:var(--text-primary); font-size:clamp(30px,4vw,48px); line-height:1.1; }
.nb-start-heading > p:last-child { color:var(--text-secondary); font-size:clamp(14px,1.5vw,18px); }
.nb-start-layout { display:grid; grid-template-columns:minmax(0,1fr); gap:20px; align-items:stretch; }
.nb-start-factions { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; align-content:center; }
#native-builder .nb-start-faction { min-width:0; aspect-ratio:1.08; display:grid; position:relative; place-items:center; align-content:center; gap:10px; padding:18px; border:1px solid var(--border-control); border-radius:14px; color:var(--text-primary); background:linear-gradient(145deg,#19191f,#111116); transition:border-color .16s,background .16s,transform .16s; }
#native-builder .nb-start-faction:hover { transform:translateY(-2px); border-color:var(--accent-primary); background:linear-gradient(145deg,#29231f,#17171d); }
#native-builder .nb-start-faction[aria-pressed=true] { border:2px solid var(--accent-primary); background:linear-gradient(145deg,#382d23,#1b1a1d); box-shadow:0 0 20px #d5a34b22,inset 0 0 0 1px #d5a34b44; }
.nb-start-faction img { width:min(66%,116px); height:min(66%,116px); object-fit:contain; }
.nb-start-faction strong { font-size:clamp(14px,1.25vw,19px); text-align:center; line-height:1.25; }
.nb-start-check { position:absolute; top:10px; right:10px; width:28px; height:28px; display:grid; place-items:center; border-radius:50%; color:#24180c; background:var(--accent-primary); font-weight:900; }


.nb-start-library { display:grid; gap:12px; padding:18px; border:1px solid var(--border-default); border-radius:12px; background:var(--bg-panel); }
.nb-start-library > header { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.nb-start-library h2 { margin:0!important; font-size:18px!important; color:var(--text-primary)!important; }
.nb-start-rosters { display:grid; gap:8px; max-height:330px; overflow:auto; }
.nb-start-roster { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:10px; padding:11px 12px; border:1px solid var(--border-subtle); border-radius:8px; background:var(--bg-deep); }
.nb-start-roster-info { display:grid; gap:4px; min-width:160px; }
.nb-start-roster-info strong { color:var(--text-primary); }
.nb-start-roster-info span { font-size:12px; }
.nb-start-roster-actions { display:flex; flex-wrap:wrap; gap:6px; }
#native-builder .nb-start-signin { color:var(--text-secondary); }
@media (max-width:1050px) { .nb-start-layout { grid-template-columns:minmax(0,1fr) 285px; gap:12px; } .nb-start-factions { gap:9px; } }
@media (max-width:760px) { .nb-start-screen { padding:22px 14px; gap:18px; } .nb-start-layout { grid-template-columns:1fr; } .nb-start-factions { grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; } #native-builder .nb-start-faction { aspect-ratio:1.05; padding:12px 8px; border-radius:10px; } .nb-start-faction img { width:62%; height:62%; } .nb-start-roster { align-items:flex-start; } }

/* Mobile unit profile styled after the Eldfall model sheet reference. */
#native-builder .nb-inspector { padding:12px; }
#native-builder .nb-inspector-body { overscroll-behavior:contain; }
#native-builder .nb-model-hero { display:grid; grid-template-columns:96px minmax(0,1fr) 34px; align-items:center; gap:12px; min-height:126px; padding:12px; border:1px solid var(--border-default); border-radius:14px; background:radial-gradient(ellipse at 85% 20%,rgba(119,73,145,.28),transparent 46%),linear-gradient(110deg,#1d1c25,#15151b); }
#native-builder .nb-model-portrait { display:block; width:96px; height:106px; object-fit:cover; object-position:center 22%; border-radius:10px; background:var(--bg-surface); }
#native-builder .nb-model-hero-copy { min-width:0; }
#native-builder .nb-model-hero-copy h2 { margin:0; font:700 clamp(20px,5vw,28px)/1.05 var(--ec-display,Georgia,serif); color:var(--text-primary); }
#native-builder .nb-model-class { margin:6px 0; color:var(--text-secondary); font-size:12px; letter-spacing:.04em; text-transform:uppercase; }
#native-builder .nb-model-rp { display:inline-flex; padding:5px 10px; border:1px solid var(--accent-primary); border-radius:9px; color:var(--accent-primary); font-weight:700; }
#native-builder .nb-model-more { min-width:34px; min-height:42px; padding:0; font-size:22px; }
#native-builder .nb-profile-tabs { display:flex; gap:3px; margin:8px 0 10px; overflow-x:auto; scrollbar-width:none; border:1px solid var(--border-default); border-radius:12px; background:var(--bg-surface); }
#native-builder .nb-profile-tabs::-webkit-scrollbar { display:none; }
#native-builder .nb-profile-tab { flex:1 0 auto; min-height:44px; padding-inline:12px; border:0; border-radius:10px; color:var(--text-secondary); background:transparent; white-space:nowrap; }
#native-builder .nb-profile-tab[aria-selected=true] { color:var(--text-primary); background:linear-gradient(135deg,#563f20,#30261c); box-shadow:inset 0 -2px 0 var(--accent-primary); }
#native-builder .nb-profile-tabpanel { display:grid; gap:10px; }
#native-builder .nb-profile-card { padding:12px; border:1px solid var(--border-default); border-radius:14px; background:linear-gradient(130deg,#202027,#17171e); }
#native-builder .nb-model-stats-card { display:grid; grid-template-columns:68px minmax(0,1fr); align-items:center; gap:10px; }
#native-builder .nb-stat-crest { display:grid; place-items:center; width:64px; height:64px; border:1px solid var(--accent-muted); border-radius:50%; color:var(--accent-primary); background:radial-gradient(circle,#302c32 46%,#16161d 48%,#40321e 75%,#17171d 78%); font-size:29px; }
#native-builder .nb-model-stats-card .nb-profile-stats { grid-template-columns:repeat(6,minmax(0,1fr)); gap:4px; margin:0; }
#native-builder .nb-model-stats-card .nb-profile-stats div { min-width:0; min-height:48px; display:grid; align-content:center; gap:2px; padding:3px 1px; border-radius:9px; background:rgba(12,12,17,.55); }
#native-builder .nb-model-stats-card .nb-profile-stats dt { font-size:10px; }
#native-builder .nb-model-stats-card .nb-profile-stats dd { font:600 17px/1.1 var(--ec-display,Georgia,serif); }
#native-builder .nb-profile-link-card { display:grid; grid-template-columns:48px minmax(0,1fr) 20px; align-items:center; gap:10px; width:100%; min-height:66px; padding:9px 12px; text-align:left; border:1px solid var(--border-default); border-radius:13px; color:var(--text-primary); background:radial-gradient(ellipse at 85% 40%,rgba(120,92,75,.18),transparent 52%),linear-gradient(110deg,#202027,#17171d); }
#native-builder .nb-profile-link-card strong,#native-builder .nb-profile-link-card small { display:block; }
#native-builder .nb-profile-link-card strong { font:650 17px/1.2 var(--ec-display,Georgia,serif); }
#native-builder .nb-profile-link-card small { margin-top:3px; color:var(--text-secondary); }
#native-builder .nb-profile-link-icon { display:grid; place-items:center; width:42px; height:42px; border-radius:11px; color:var(--accent-primary); background:var(--bg-selected); font-size:20px; }
#native-builder .nb-profile-chevron { color:var(--text-secondary); font-size:27px; }
#native-builder .nb-profile-notes h3,#native-builder .nb-profile-section-title { margin:0 0 8px; font:650 19px/1.2 var(--ec-display,Georgia,serif); }
#native-builder .nb-note-tabs { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:8px; }
#native-builder .nb-note-tab { min-height:30px; padding:4px 10px; border:1px solid transparent; border-radius:18px; color:var(--accent-primary); background:var(--accent-subtle); }
#native-builder .nb-note-tab[aria-selected=true] { border-color:var(--accent-primary); }
#native-builder .nb-note-content { display:flex; flex-wrap:wrap; gap:6px; min-height:30px; }
#native-builder .nb-rule-chip { min-height:30px; max-width:100%; padding:4px 11px; border:1px solid var(--border-control); border-radius:18px; background:rgba(8,8,12,.35); color:var(--text-primary); text-align:left; white-space:normal; }
#native-builder .nb-rule-chip.nb-magic-chip { border-color:#74628f; color:#d7c7f6; }
#native-builder .nb-spell-open { min-height:32px; border-color:var(--accent-primary); }
#native-builder .nb-spell-tab-head { display:flex; justify-content:space-between; align-items:center; gap:8px; }
#native-builder .nb-spell-row { padding:10px 0; border-bottom:1px solid var(--border-default); }
#native-builder .nb-spell-row-head { display:flex; justify-content:space-between; gap:8px; }
#native-builder .nb-spell-row-head span { color:var(--text-secondary); font-size:11px; text-align:right; }
#native-builder .nb-spell-table-popover { width:min(980px,calc(100vw - 24px)); }
#native-builder .nb-spell-table-scroll { max-width:100%; overflow:auto; }
#native-builder .nb-spell-table { width:100%; min-width:760px; border-collapse:collapse; font-size:12px; }
#native-builder .nb-spell-table :is(th,td) { padding:8px; border-bottom:1px solid var(--border-default); text-align:left; vertical-align:top; }
#native-builder .nb-spell-table thead { position:sticky; top:0; background:var(--bg-elevated); z-index:1; }
#native-builder .nb-spell-table th[scope=row] { min-width:130px; }
#native-builder .nb-spell-table th small { display:block; margin-top:4px; color:var(--text-muted); font-weight:400; }
#native-builder .nb-spell-table td:last-child { min-width:300px; white-space:normal; }
#native-builder .nb-spell-count { margin:0; color:var(--text-secondary); }
@media(max-width:480px) {
  #native-builder .nb-inspector { padding:8px; }
  #native-builder .nb-model-hero { grid-template-columns:76px minmax(0,1fr) 30px; gap:9px; min-height:104px; padding:9px; }
  #native-builder .nb-model-portrait { width:76px; height:88px; }
  #native-builder .nb-model-stats-card { grid-template-columns:50px minmax(0,1fr); gap:6px; padding:8px; }
  #native-builder .nb-stat-crest { width:48px; height:48px; font-size:22px; }
  #native-builder .nb-model-stats-card .nb-profile-stats { grid-template-columns:repeat(6,minmax(34px,1fr)); }
  #native-builder .nb-model-stats-card .nb-profile-stats dt { font-size:9px; }
  #native-builder .nb-model-stats-card .nb-profile-stats dd { font-size:14px; }
}

#native-builder .nb-model-more { border:1px solid var(--border-control); border-radius:10px; background:transparent; color:var(--text-primary); }

#native-builder .nb-profile-note-section { padding:0; border:0; background:transparent; }
#native-builder .nb-profile-note-section h3 { margin:2px 0 5px; color:var(--text-secondary); font-size:11px; letter-spacing:.08em; }
#native-builder .nb-equipment-list { display:grid; gap:7px; }
#native-builder .nb-equipment-row { padding:10px 12px; border:1px solid var(--border-default); border-radius:10px; background:var(--bg-surface); }
#native-builder .nb-equipment-row-head { display:flex; justify-content:space-between; align-items:baseline; gap:8px; }
#native-builder .nb-equipment-row-head strong { font-weight:650; }
#native-builder .nb-equipment-row-head span { color:var(--accent-primary); font-size:11px; text-align:right; }
#native-builder .nb-equipment-row .nb-rule-description { margin-top:6px; color:var(--text-secondary); font-size:12px; }
#native-builder .nb-model-size { margin:3px 0 5px; color:var(--text-secondary); font-size:12px; }
#native-builder .nb-spell-stat-columns { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:5px; margin:7px 0; }
#native-builder .nb-spell-stat-columns div { display:grid; gap:2px; padding:5px 7px; border:1px solid var(--border-default); border-radius:7px; background:var(--bg-surface); }
#native-builder .nb-spell-stat-columns span { color:var(--text-muted); font-size:10px; }
#native-builder .nb-spell-stat-columns strong { color:var(--accent-primary); }
#native-builder .nb-spell-table { min-width:900px; }
#native-builder .nb-spell-table .nb-spell-stat-cell { min-width:64px; text-align:center; }
#native-builder .nb-spell-stat-cell strong,#native-builder .nb-spell-stat-cell span { display:block; }
#native-builder .nb-spell-stat-cell strong { color:var(--text-muted); font-size:10px; }
#native-builder .nb-spell-stat-cell span { margin-top:4px; color:var(--accent-primary); }

#native-builder .nb-equipment-table-scroll { max-width:100%; overflow:auto; border:1px solid var(--border-default); border-radius:10px; }
#native-builder .nb-equipment-table { width:100%; min-width:760px; border-collapse:collapse; font-size:12px; }
#native-builder .nb-equipment-table :is(th,td) { padding:9px 10px; border-bottom:1px solid var(--border-default); text-align:left; vertical-align:top; }
#native-builder .nb-equipment-table thead { position:sticky; top:0; z-index:1; background:var(--bg-elevated); }
#native-builder .nb-equipment-table tbody th { min-width:135px; color:var(--text-primary); font-weight:600; }
#native-builder .nb-equipment-table tbody td:nth-child(n+2):nth-child(-n+5) { min-width:58px; text-align:center; color:var(--accent-primary); font-variant-numeric:tabular-nums; }
#native-builder .nb-equipment-table tbody td:last-child { min-width:260px; color:var(--text-secondary); }
#native-builder .nb-spell-table { min-width:900px; }
#native-builder .nb-spell-table .nb-spell-stat-cell { min-width:64px; text-align:center; color:var(--accent-primary); font-weight:650; }


/* Compact illuminated cards are limited to the left catalog column. */
#native-builder .nb-catalog-row,#native-builder .nb-catalog-upgrade{
  margin:2px 0!important;
  padding:0!important;
  border:1px solid transparent!important;
  border-radius:12px;
  background:radial-gradient(ellipse at 92% 78%,rgba(73,57,96,.23),transparent 38%),linear-gradient(145deg,#191721 0%,#17151e 58%,#211b2b 100%) padding-box,linear-gradient(135deg,rgba(241,199,120,.9),rgba(152,113,62,.72) 24%,rgba(65,53,75,.82) 52%,rgba(240,193,109,.9)) border-box!important;
  box-shadow:0 3px 12px rgba(0,0,0,.18)
}
#native-builder .nb-catalog-row:has([aria-pressed=true]),#native-builder .nb-catalog-upgrade[aria-pressed=true]{
  background:radial-gradient(ellipse at 92% 78%,rgba(103,77,43,.32),transparent 42%),linear-gradient(145deg,#29221b,#201a18 58%,#30251b) padding-box,linear-gradient(135deg,#ffe09a,#d8a94e 45%,#f1c778) border-box!important;
  box-shadow:0 0 12px rgba(216,180,119,.12)
}

/* Catalog model and upgrade artwork runs flush to the card edges. */
#native-builder .nb-catalog-row{overflow:hidden;padding:0!important}
#native-builder .nb-catalog-row>.nb-catalog-unit{align-self:stretch;grid-template-columns:64px minmax(0,1fr) auto;gap:8px;min-height:64px;padding:0!important}
#native-builder .nb-catalog-row>.nb-catalog-unit img{align-self:stretch;width:58px;height:100%;min-height:64px;max-height:none;object-fit:cover;object-position:center 25%;border-radius:0}
#native-builder .nb-catalog-row>.nb-catalog-unit.nb-catalog-upgrade img{object-fit:cover}
#native-builder .nb-catalog-row>.nb-catalog-unit .nb-catalog-copy{padding:5px 0}
#native-builder .nb-catalog-grid .nb-catalog-row>.nb-catalog-unit{display:grid;grid-template-columns:minmax(0,1fr);gap:0;padding:0!important}
#native-builder .nb-catalog-grid .nb-catalog-row>.nb-catalog-unit img{width:100%;height:110px;min-height:0;object-fit:cover;border-radius:0}
#native-builder .nb-catalog-grid .nb-catalog-row>.nb-catalog-unit .nb-catalog-copy{padding:7px 7px 9px}


/* Exact catalog thumbnail framing: flush square artwork, edge-to-edge. */
#native-builder .nb-catalog-row>.nb-catalog-unit img{width:64px;height:64px;min-height:64px;max-height:64px;object-fit:cover;object-position:center 25%;background:transparent}
#native-builder .nb-catalog-row>.nb-catalog-unit.nb-catalog-upgrade img{object-fit:cover}
#native-builder .nb-catalog-grid .nb-catalog-row>.nb-catalog-unit img{width:100%;height:auto;min-height:0;max-height:none;aspect-ratio:1/1;object-fit:cover;background:transparent}

/* Keep list rows at thumbnail height so artwork is never clipped by the row. */
#native-builder #nb-catalog:not(.nb-catalog-grid) .nb-catalog-row{height:66px!important;min-height:66px!important}
#native-builder #nb-catalog:not(.nb-catalog-grid) .nb-catalog-row>.nb-catalog-unit{height:64px!important;min-height:64px!important;align-self:center}
#native-builder #nb-catalog:not(.nb-catalog-grid) .nb-catalog-row>.nb-catalog-unit img{width:64px!important;height:64px!important;min-height:64px!important;max-height:64px!important;align-self:center;object-fit:cover}

#native-builder .nb-rule-group[data-category="Combat Arts"]>.nb-rule-combat-art{display:block;margin:0 10px;padding:8px 0;border-bottom:1px solid rgba(216,180,119,.35)}
#native-builder .nb-rule-group[data-category="Combat Arts"]>.nb-rule-combat-art:last-child{border-bottom:0}
#native-builder .nb-rule-combat-art .nb-rule-name{margin:0 0 4px;color:var(--accent-primary);font-size:13px;font-weight:650}
#native-builder .nb-rule-group[data-category="Combat Arts"]>.nb-rule-combat-art .nb-rule-description{padding:0 0 3px}

#native-builder .nb-rule-group[data-category="Стратагемы"]>.nb-rule-stratagem{display:block;margin:0 10px;padding:10px 0;border-bottom:1px solid transparent;border-image:linear-gradient(90deg,transparent,rgba(216,180,119,.72) 18%,rgba(216,180,119,.28) 82%,transparent) 1}
#native-builder .nb-rule-group[data-category="Стратагемы"]>.nb-rule-stratagem:last-child{border-bottom:0}
#native-builder .nb-rule-stratagem .nb-rule-name{margin:0 0 5px;color:var(--accent-primary);font-size:14px;font-weight:650}
#native-builder .nb-rule-group[data-category="Стратагемы"]>.nb-rule-stratagem .nb-rule-description{padding:0 0 4px}

#native-builder .nb-roster-error{display:block;margin-top:3px;color:var(--danger,#e98d9b);font-size:12px;line-height:1.35;white-space:normal}
#native-builder .nb-validation-inline{margin:0 0 10px;padding:8px 12px 8px 28px;border:1px solid rgba(220,120,132,.48);border-radius:8px;background:rgba(95,40,49,.16);color:var(--danger,#e98d9b);font-size:12px;line-height:1.45}
#native-builder .nb-validation-inline li+li{margin-top:4px}

#native-builder .nb-picker-row{display:grid;grid-template-columns:minmax(0,1fr) 42px;gap:6px;align-items:stretch;margin:4px 0}
#native-builder .nb-picker-row .nb-picker-item{width:100%;min-width:0;text-align:left;display:grid;grid-template-columns:42px minmax(0,1fr) auto;align-items:center;gap:8px;padding:5px 8px}
#native-builder .nb-picker-row .nb-picker-item .nb-assigned-art{width:40px;height:40px;object-fit:cover;border-radius:6px}
#native-builder .nb-picker-add{min-height:44px;width:42px;padding:0!important;display:grid;place-items:center;border:1px solid rgba(216,180,119,.35)!important;border-radius:8px!important;background:rgba(216,180,119,.14)!important;color:var(--accent-primary)!important;font-size:22px!important;font-weight:600!important}
#native-builder .nb-picker-add:hover:not(:disabled){background:rgba(216,180,119,.3)!important}
#native-builder .nb-picker-add:disabled{opacity:.35}
@media(max-width:520px){#native-builder .nb-picker-row{grid-template-columns:minmax(0,1fr) 38px}#native-builder .nb-picker-row .nb-picker-item{grid-template-columns:36px minmax(0,1fr) auto;gap:6px;padding:4px}#native-builder .nb-picker-row .nb-picker-item .nb-assigned-art{width:34px;height:34px}#native-builder .nb-picker-add{width:38px}}
