    :root {
      --gold:         #c9a227;
      --gold-dim:     #6a4f10;
      --gold-faint:   rgba(201, 162, 39, .06);
      --amber:        #c97a20;
      --red:          #c94040;
      --bg-base:      #0e0d0a;
      --bg-dark:      #1a1408;
      --bg-input:     #130f08;
      --bg-mid:       #3a2a10;
      --border:       #2a2010;
      --text-main:    #c4b49a;
      --text-brown:   #7a6a4a;
      --text-dim:     #7a6a4a;
      --font-heading: 'Cinzel', serif;
      --font-body:    Georgia, serif;
    }

    *,
    *::before,
    *::after {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    body {
      font-family: system-ui, -apple-system, sans-serif;
      font-size: 15px;
      background: #0d0d1a;
      color: var(--text-main);
    }

    /* ── Header ── */
    header {
      background: radial-gradient(ellipse 90% 100% at 50% 40%, #1c1408 0%, #0e0b05 55%, #0d0d1a 100%);
      border-bottom: 2px solid var(--gold-dim);
      text-align: center;
      padding: 18px 20px 14px;
      position: relative;
    }

    header::after {
      content: '';
      position: absolute;
      bottom: -1px;
      left: 5%;
      right: 5%;
      height: 1px;
      background: linear-gradient(to right, transparent, #c9a22766, var(--gold), #c9a22766, transparent);
      pointer-events: none;
    }

    .logo {
      display: block;
      height: 130px;
      margin: 0 auto 8px;
      -webkit-mask-image:
        linear-gradient(to right, transparent 0%, rgba(0, 0, 0, .5) 10%, black 22%, black 78%, rgba(0, 0, 0, .5) 90%, transparent 100%),
        linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, .5) 8%, black 18%, black 76%, rgba(0, 0, 0, .5) 88%, transparent 100%);
      -webkit-mask-composite: source-in;
      mask-image:
        linear-gradient(to right, transparent 0%, rgba(0, 0, 0, .5) 10%, black 22%, black 78%, rgba(0, 0, 0, .5) 90%, transparent 100%),
        linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, .5) 8%, black 18%, black 76%, rgba(0, 0, 0, .5) 88%, transparent 100%);
      mask-composite: intersect;
      filter: drop-shadow(0 0 18px rgba(201, 162, 39, 0.7)) drop-shadow(0 0 6px rgba(201, 162, 39, 0.4));
    }

    header p {
      font-family: var(--font-heading);
      font-size: .65rem;
      color: var(--text-dim);
      letter-spacing: .22em;
      text-transform: uppercase;
      margin-top: 2px;
    }

    .header-disclaimer {
      font-family: system-ui, -apple-system, sans-serif;
      font-size: .6rem;
      color: #3a2c0e;
      letter-spacing: .04em;
      text-transform: none;
      margin-top: 8px;
      max-width: 480px;
      margin-left: auto;
      margin-right: auto;
      line-height: 1.6;
    }

    /* ── Controls bar ── */
    #controls {
      position: sticky;
      top: 0;
      z-index: 10;
      background: var(--bg-base);
      border-bottom: 1px solid var(--border);
      padding: 8px 16px;
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      align-items: center;
    }

    #search {
      flex: 1 1 160px;
      min-width: 120px;
      padding: 5px 10px;
      border: 1px solid var(--border);
      border-radius: 4px;
      font-size: 13px;
      background: var(--bg-input);
      color: var(--text-main);
      outline: none;
    }

    #search::placeholder {
      color: var(--text-brown);
    }

    #search:focus {
      border-color: #8a6a1a;
      box-shadow: 0 0 0 2px rgba(201, 162, 39, .12);
    }

    select {
      padding: 5px 8px;
      border: 1px solid var(--border);
      border-radius: 4px;
      font-size: 13px;
      background: var(--bg-input);
      color: var(--text-main);
      cursor: pointer;
      outline: none;
    }

    select:focus {
      border-color: #8a6a1a;
    }

    #reset {
      padding: 5px 12px;
      border: 1px solid var(--border);
      border-radius: 4px;
      font-size: 13px;
      background: var(--bg-input);
      cursor: pointer;
      color: var(--text-dim);
      font-family: var(--font-heading);
      letter-spacing: .05em;
    }

    #reset:hover {
      border-color: #8a6a1a;
      color: var(--gold);
    }

    .inv-flagged-btn {
      padding: 4px 10px;
      border: 1px solid var(--border);
      border-radius: 4px;
      font-size: 11px;
      background: var(--bg-input);
      cursor: pointer;
      color: var(--text-dim);
      font-family: var(--font-heading);
      letter-spacing: .06em;
    }
    .inv-flagged-btn:hover { border-color: #8a6a1a; color: var(--gold); }
    .inv-flagged-btn.active { background: #2a1a04; border-color: var(--gold); color: var(--gold); }

    #count {
      font-size: 12px;
      color: var(--text-brown);
      margin-left: auto;
      white-space: nowrap;
      font-family: var(--font-heading);
    }

    /* ── Table ── */
    .table-wrap {
      overflow-x: auto;
      padding: 0 16px 40px;
    }

    table {
      width: 100%;
      border-collapse: collapse;
      background: var(--bg-base);
      margin-top: 12px;
      border-radius: 4px;
      overflow: hidden;
      box-shadow: 0 2px 16px rgba(0, 0, 0, .6), 0 0 0 1px var(--border);
    }

    thead tr {
      background: #130f06;
    }

    th {
      padding: 9px 12px;
      text-align: left;
      font-size: 11px;
      font-weight: 700;
      font-family: var(--font-heading);
      text-transform: uppercase;
      letter-spacing: .08em;
      color: var(--gold);
      cursor: pointer;
      user-select: none;
      white-space: nowrap;
      border-bottom: 2px solid var(--border);
    }

    th:hover {
      background: var(--bg-dark);
      color: #e8c84a;
    }

    th .sort-icon {
      font-size: 10px;
      margin-left: 3px;
      color: #4a3a10;
    }

    th.active .sort-icon {
      color: #e8c84a;
    }

    td {
      padding: 7px 12px;
      border-bottom: 1px solid var(--bg-dark);
      vertical-align: middle;
      color: var(--text-main);
    }

    tr:last-child td {
      border-bottom: none;
    }

    tr:hover td {
      background: rgba(255, 255, 255, .03) !important;
    }

    /* Brand row tinting */
    tr.brand-citadel td {
      background-color: #161208;
    }

    tr.brand-proacryl td {
      background-color: #0a1018;
    }

    tr.brand-vallejo td {
      background-color: #091410;
    }

    tr.brand-armypainter td {
      background-color: #140a10;
    }

    tr.brand-gamblinartistoils td {
      background-color: #130e06;
    }

    tr.brand-akinteractive td {
      background-color: #0b0d14;
    }

    tr.brand-scale75 td {
      background-color: #0e0f0a;
    }

    tr.brand-twothincoats td {
      background-color: #091314;
    }

    /* ── Swatches ── */
    .swatch {
      display: inline-block;
      width: 20px;
      height: 20px;
      border-radius: 4px;
      border: 1px solid rgba(255, 255, 255, .15);
      vertical-align: middle;
      flex-shrink: 0;
    }

    .swatch-White {
      background: #f0ede8;
    }

    .swatch-Grey {
      background: #9ca3af;
    }

    .swatch-Black {
      background: #3d3d3d;
      border-color: rgba(255, 255, 255, .25);
    }

    .swatch-Flesh {
      background: #e8b49a;
    }

    .swatch-Red {
      background: #b91c1c;
    }

    .swatch-Orange {
      background: #c2410c;
    }

    .swatch-Yellow {
      background: #ca8a04;
    }

    .swatch-Green {
      background: #15803d;
    }

    .swatch-Blue {
      background: #1d4ed8;
    }

    .swatch-Purple {
      background: #7e22ce;
    }

    .swatch-Pink {
      background: #be185d;
    }

    .swatch-Brown {
      background: #92400e;
    }

    .swatch-Metallic {
      background: linear-gradient(135deg, #c0c0c0 0%, #e8e0c8 50%, #c0c0c0 100%);
    }

    .swatch-Wash {
      background: repeating-linear-gradient(45deg, #475569, #475569 3px, #64748b 3px, #64748b 6px);
    }

    .swatch-Transparent {
      background: repeating-linear-gradient(-45deg, #0ea5e9, #0ea5e9 3px, #1e3a4a 3px, #1e3a4a 6px);
      border-style: dashed;
    }

    .swatch-Fluorescent {
      background: #84cc16;
      box-shadow: 0 0 6px #84cc1699;
    }

    .swatch-Special {
      background: linear-gradient(135deg, #f97316, #ec4899);
    }

    .swatch-Effect {
      background: repeating-linear-gradient(45deg, #78350f, #78350f 3px, #92400e 3px, #92400e 6px);
    }

    .swatch-Medium {
      background: #1e293b;
      border-style: dashed;
    }

    .swatch-Shade {
      background: repeating-linear-gradient(45deg, #1e293b, #1e293b 3px, #334155 3px, #334155 6px);
    }

    .swatch-Ink {
      background: linear-gradient(135deg, #312e81 0%, #1e1b4b 100%);
      border-style: dashed;
    }

    .swatch-Primer {
      background: #94a3b8;
    }

    .swatch-Utility {
      background: #374151;
      border-style: dashed;
    }

    .swatch-Pigment {
      background: repeating-linear-gradient(45deg, #78350f, #78350f 2px, #a16207 2px, #a16207 5px);
    }

    .swatch-Texture {
      background: repeating-linear-gradient(45deg, #44403c, #44403c 3px, #57534e 3px, #57534e 6px);
    }

    .swatch-Fluid {
      background: linear-gradient(135deg, #164e63 0%, #0f172a 100%);
      border-style: dashed;
    }

    .swatch-Contrast {
      background: linear-gradient(135deg, #7c3aed 0%, #4c1d95 100%);
    }

    /* ── Layer badges ── */
    .badge {
      display: inline-block;
      font-size: 11px;
      font-weight: 600;
      padding: 2px 8px;
      border-radius: 3px;
      white-space: nowrap;
      letter-spacing: .04em;
      border: 1px solid rgba(255, 255, 255, .06);
    }

    .badge-Base {
      background: #0e1e30;
      color: #4a6888;
    }

    .badge-Contrast {
      background: #180e2e;
      color: #6050a0;
    }

    .badge-Metallic {
      background: #1a1a1e;
      color: #787878;
    }

    .badge-Wash {
      background: #0a1018;
      color: #38505e;
    }

    .badge-Transparent {
      background: #081c2c;
      color: #30607a;
    }

    .badge-Fluorescent {
      background: #101a06;
      color: #446028;
    }

    .badge-Special {
      background: #240a06;
      color: #8a3828;
    }

    .badge-Speedpaint {
      background: #1e1006;
      color: #805020;
    }

    .badge-SpeedpaintMetallic {
      background: #161616;
      color: #585858;
    }

    .badge-AirbrushMetallic {
      background: #071620;
      color: #2a4860;
    }

    .badge-Medium {
      background: #081420;
      color: #2a4860;
    }

    .badge-Texture {
      background: #140a04;
      color: #684818;
    }

    .badge-Shade {
      background: #0c1622;
      color: #2a4860;
    }

    .badge-Air {
      background: #071420;
      color: #285070;
    }

    .badge-Technical {
      background: #071618;
      color: #285040;
    }

    .badge-ModelColor {
      background: #141416;
      color: #545454;
    }

    .badge-ModelAir {
      background: #081420;
      color: #304868;
    }

    .badge-Ink {
      background: #0e0c26;
      color: #484880;
    }

    .badge-Varnish {
      background: #1c0a04;
      color: #7a5828;
    }

    .badge-Effect {
      background: #081406;
      color: #2a4820;
    }

    .badge-Weathering {
      background: #160604;
      color: #6a3820;
    }

    .badge-Terrain {
      background: #100e0c;
      color: #504840;
    }

    .badge-Mud {
      background: #141008;
      color: #504038;
    }

    .badge-Tool {
      background: #141416;
      color: #444444;
    }

    .badge-Primer {
      background: #374151;
    }

    .badge-X-Opaque {
      background: #1e1b4b;
      color: #a5b4fc;
    }

    .badge-Oil {
      background: #1a1006;
      color: #8a6030;
    }

    /* ── Utilities ── */
    .hidden { display: none; }

    /* Sticky controls bars (wishlist/shame added after per-ID pattern was established) */
    #wishlist-controls, #shame-controls, #battles-controls, #rescues-controls {
      position: sticky;
      top: 0;
      z-index: 10;
      background: var(--bg-base);
      border-bottom: 1px solid var(--border);
      padding: 8px 16px;
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      align-items: center;
    }

    #wishlist-count {
      padding: 6px 16px;
      font-size: 11px;
      color: var(--text-brown);
      font-family: var(--font-heading);
      letter-spacing: .04em;
    }

    #shame-summary, #rescues-summary {
      font-size: 11px;
      color: var(--text-brown);
      font-family: var(--font-heading);
      letter-spacing: .04em;
      white-space: nowrap;
    }

    /* Empty-state message shown when a tab/list has no results */
    .tab-empty {
      padding: 40px 16px;
      text-align: center;
      font-family: var(--font-heading);
      font-size: 11px;
      color: var(--text-brown);
      letter-spacing: .06em;
    }

    /* Same pattern but rendered inside a CSS grid (spans full width) */
    .grid-empty {
      grid-column: 1 / -1;
      padding: 24px 16px;
      text-align: center;
      font-family: var(--font-heading);
      font-size: 11px;
      color: var(--text-brown);
      letter-spacing: .06em;
    }

    /* Select dropdowns inside controls bars */
    .mini-select {
      background: var(--bg-input);
      border: 1px solid var(--border);
      border-radius: 3px;
      color: #7a6840;
      font-size: 11px;
      padding: 3px 7px;
      font-family: inherit;
      outline: none;
      cursor: pointer;
    }

    /* Small action buttons (Copy / Print / Export) inside controls bars */
    .filter-btn-sm {
      font-size: 10px;
      font-family: var(--font-heading);
      letter-spacing: .06em;
      background: none;
      border: 1px solid var(--bg-mid);
      color: #7a6840;
      border-radius: 3px;
      padding: 4px 12px;
      cursor: pointer;
    }

    /* Horizontal flex row of filter/category pills */
    .pill-row { display: flex; gap: 6px; flex-wrap: wrap; }

    /* Gold Cinzel label (recipe category heads, WD section labels, etc.) */
    .label-cinzel-gold {
      color: var(--gold);
      font-family: var(--font-heading);
      font-size: .8em;
      letter-spacing: .06em;
      text-transform: uppercase;
    }

    /* Stock status dots (used by inventory and equivalency tabs) */
    .stock-dot {
      display: inline-block;
      width: 8px;
      height: 8px;
      border-radius: 50%;
      vertical-align: middle;
      margin-left: 5px;
    }
    .stock-dot-unknown { border: 1.5px solid #6a6a6a; }
    .stock-dot-low     { background: #f97316; box-shadow: 0 0 4px #f9731688; }
    .stock-dot-out     { background: #ef4444; box-shadow: 0 0 4px #ef444488; }
    .stock-dot-wanted  { background: #3b82f6; box-shadow: 0 0 4px #3b82f688; }
    .stock-dot-owned   { background: #22c55e; box-shadow: 0 0 4px #22c55e88; }

    /* ── Empty state ── */
    #empty {
      display: none;
      padding: 40px;
      text-align: center;
      color: var(--text-brown);
      font-family: var(--font-heading);
      font-size: 14px;
      letter-spacing: .05em;
    }

    /* ── Tab nav (hidden - replaced by sidebar) ── */
    .tab-nav {
      display: none;
      flex-wrap: nowrap;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      background: #0a0908;
      border-bottom: 1px solid var(--border);
      padding: 0 16px;
      gap: 4px;
      scrollbar-width: none;
    }
    .tab-nav::-webkit-scrollbar { display: none; }

    .tab-btn {
      font-family: var(--font-heading);
      font-size: 11px;
      font-weight: 700;
      letter-spacing: .12em;
      text-transform: uppercase;
      color: var(--text-brown);
      background: none;
      border: none;
      border-bottom: 2px solid transparent;
      padding: 10px 14px;
      cursor: pointer;
      margin-bottom: -1px;
      transition: color .15s;
    }

    .tab-short {
      display: none;
    }

    .tab-btn:hover {
      color: #8a6a2a;
    }
    .tab-panel { position: relative; }

    .tab-btn.active {
      color: var(--gold);
      border-bottom-color: var(--gold);
    }
    .tab-label {
      font-family: var(--font-heading);
      font-size: 12px;
      letter-spacing: .14em;
      text-transform: uppercase;
      color: #9a8040;
      white-space: nowrap;
      padding-right: 12px;
      border-right: 1px solid var(--border);
      margin-right: 2px;
      align-self: center;
      flex-shrink: 0;
      text-decoration: none;
      cursor: pointer;
    }
    .tab-label:hover { color: var(--gold); }

    .tab-search {
      flex: 1 1 160px;
      min-width: 120px;
      padding: 5px 10px;
      border: 1px solid var(--border);
      border-radius: 4px;
      font-size: 13px;
      background: var(--bg-input);
      color: var(--text-main);
      font-family: inherit;
      outline: none;
    }
    .tab-search::placeholder { color: var(--text-brown); }
    .tab-search:focus {
      border-color: #8a6a1a;
      box-shadow: 0 0 0 2px rgba(201, 162, 39, .12);
    }

    .tab-btn.tab-group-start {
      margin-left: 10px;
      padding-left: 16px;
      border-left: 1px solid var(--border);
    }

    .tab-btn.tab-equiv-rainbow {
      border-bottom: 2px solid transparent;
      border-image: linear-gradient(to right, #7a2a2a, #7a6a20, #2a6a3a, #1a3a6a, #5a2a6a) 1;
      color: #6a5a3a;
    }
    .tab-btn.tab-equiv-rainbow:hover {
      color: #a08040;
      border-image: linear-gradient(to right, #b04040, #b09030, #309050, #2050a0, #7a3a9a) 1;
    }
    .tab-btn.tab-equiv-rainbow.active {
      color: var(--gold);
      border-image: linear-gradient(to right, #c04848, #c0a838, #38a858, #2860c0, #9048b8) 1;
    }

    .tab-pipeline {
      border-bottom-color: #2a1f0a;
    }

    .tab-panel {
      display: none;
    }

    .tab-panel.active {
      display: block;
    }

    /* ── Gallery ── */
    .gallery-wrap {
      padding: 16px;
    }

    .gallery-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 16px;
      max-width: 960px;
      margin: 0 auto;
    }

    /* "Show all entries" CTA at end of truncated gallery */
    #gallery-more {
      max-width: 960px;
      margin: 0 auto;
      padding: 0 16px 28px;
      position: relative;
    }

    .gallery-more-fade {
      height: 80px;
      margin: -80px 0 0;
      background: linear-gradient(to bottom, transparent 0%, rgba(13, 13, 26, .55) 50%, #0d0d1a 100%);
      pointer-events: none;
      position: relative;
      z-index: 2;
    }

    .gallery-more-btn {
      display: flex;
      flex-direction: column;
      align-items: center;
      width: 100%;
      margin-top: 12px;
      padding: 18px 24px 16px;
      background:
        radial-gradient(ellipse 70% 100% at 50% 100%, rgba(201, 162, 39, .12) 0%, transparent 70%),
        linear-gradient(180deg, #14100a 0%, #0a0907 100%);
      border: 1px solid #5a4a18;
      border-top: 2px solid var(--gold);
      border-radius: 3px;
      cursor: pointer;
      color: var(--gold);
      box-shadow: 0 2px 18px rgba(201, 162, 39, .08);
      transition: background .2s, transform .15s, box-shadow .2s, border-color .2s;
    }

    .gallery-more-btn:hover {
      background:
        radial-gradient(ellipse 70% 100% at 50% 100%, rgba(201, 162, 39, .2) 0%, transparent 70%),
        linear-gradient(180deg, #1c1408 0%, #0e0c08 100%);
      border-color: #8a6a18;
      box-shadow: 0 4px 28px rgba(201, 162, 39, .22);
      transform: translateY(-1px);
    }

    .gallery-more-btn:active {
      transform: translateY(0);
    }

    .gallery-more-count {
      font-family: var(--font-body);
      font-style: italic;
      font-size: 12px;
      letter-spacing: .02em;
      color: #8a7a5a;
      margin-bottom: 6px;
    }

    .gallery-more-label {
      display: flex;
      align-items: center;
      gap: 10px;
      font-family: var(--font-heading);
      font-weight: 700;
      font-size: .9rem;
      letter-spacing: .18em;
      text-transform: uppercase;
      color: var(--gold);
    }

    .gallery-more-chevron {
      display: inline-block;
      font-size: 14px;
      line-height: 1;
      color: var(--gold);
      animation: galleryMoreBounce 1.8s ease-in-out infinite;
    }

    @keyframes galleryMoreBounce {
      0%, 100% { transform: translateY(0); opacity: .85; }
      50%      { transform: translateY(4px); opacity: 1; }
    }

    @media (max-width: 600px) {
      .gallery-more-label {
        font-size: .78rem;
        letter-spacing: .12em;
      }
      .gallery-more-fade {
        height: 50px;
        margin-top: -50px;
      }
    }

    .model-card {
      background: var(--bg-base);
      border: 1px solid var(--border);
      border-left: 3px solid var(--bg-mid);
      border-radius: 4px;
      overflow: hidden;
      display: flex;
      flex-direction: column;
    }

    .model-images {
      display: grid;
      grid-template-columns: 1fr 1fr;
      grid-template-rows: 1fr 1fr;
      height: 210px;
      gap: 2px;
      background: #080706;
      overflow: hidden;
      flex-shrink: 0;
    }

    .model-images.imgs-1 img {
      grid-column: 1 / -1;
      grid-row: 1 / -1;
    }

    .model-images.imgs-2 img:first-child {
      grid-row: 1 / -1;
    }

    .model-images.imgs-3 img:first-child {
      grid-row: 1 / -1;
    }

    .model-images img {
      width: 100%;
      height: 100%;
      min-height: 0;
      object-fit: cover;
      display: block;
    }

    .model-theme-stripe {
      height: 7px;
      border: none;
    }

    .model-no-image {
      grid-column: 1 / -1;
      grid-row: 1 / -1;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--border);
      font-family: var(--font-heading);
      font-size: 11px;
      letter-spacing: .1em;
    }

    .model-header {
      padding: 10px 14px 8px;
      background: #0a0906;
      border-bottom: 1px solid var(--bg-dark);
      position: relative;
    }

    .model-info {
      padding: 10px 14px 12px;
      flex: 1;
      display: flex;
      flex-direction: column;
    }

    .model-name {
      font-family: var(--font-heading);
      font-size: 13px;
      font-weight: 700;
      color: var(--gold);
      letter-spacing: .05em;
    }

    .model-count-badge {
      display: inline-block;
      margin-left: 6px;
      padding: 1px 6px;
      font-family: var(--font-heading);
      font-size: 10px;
      font-weight: 700;
      letter-spacing: .06em;
      background: var(--bg-dark);
      border: 1px solid #4a3a10;
      color: var(--gold);
      border-radius: 2px;
      vertical-align: 1px;
    }

    .model-meta {
      font-size: 11px;
      color: var(--text-brown);
      margin-top: 3px;
      letter-spacing: .03em;
    }

    .model-link-btn {
      position: absolute;
      top: 8px;
      right: 8px;
      background: none;
      border: none;
      color: var(--bg-mid);
      cursor: pointer;
      padding: 2px;
      line-height: 1;
      opacity: 0.6;
    }

    .model-link-btn:hover {
      color: var(--gold);
      opacity: 1;
    }

    .model-card.highlight {
      animation: highlightFade 3s forwards;
    }

    @keyframes highlightFade {
      0% {
        box-shadow: 0 0 0 2px var(--gold), 0 0 18px rgba(201, 162, 39, .45);
      }

      100% {
        box-shadow: none;
      }
    }

    .model-desc {
      font-size: 12px;
      color: #7a6a50;
      margin-top: 8px;
      margin-bottom: 10px;
      line-height: 1.55;
      flex: 1;
    }
    .desc-hd {
      font-family: var(--font-heading);
      font-size: 9px;
      letter-spacing: .16em;
      text-transform: uppercase;
      color: #9a7a30;
      margin-top: 14px;
      margin-bottom: 5px;
      padding-bottom: 3px;
      border-bottom: 1px solid #2a1e0a;
    }
    .model-desc .desc-hd:first-child { margin-top: 0; }
    .desc-step {
      display: flex;
      gap: 10px;
      line-height: 1.5;
      padding: 3px 0 3px 8px;
      border-left: 2px solid #2a1e0a;
      margin-bottom: 2px;
    }
    .desc-lbl {
      font-family: var(--font-heading);
      font-size: 10px;
      letter-spacing: .06em;
      text-transform: uppercase;
      color: #7a6040;
      min-width: 58px;
      flex-shrink: 0;
      padding-top: 3px;
    }
    .desc-val {
      font-size: 13px;
      color: var(--text-main);
      line-height: 1.4;
    }
    .desc-step.desc-sub {
      padding-left: 20px;
      border-left-color: var(--bg-dark);
      margin-bottom: 1px;
    }
    .desc-step.desc-sub .desc-val {
      font-size: 11px;
      color: #7a6a50;
    }

    .model-summary {
      display: grid;
      grid-template-columns: auto 1fr;
      gap: 2px 8px;
      margin-bottom: 10px;
      padding-bottom: 10px;
      border-bottom: 1px solid var(--bg-dark);
    }
    .model-summary-lbl {
      font-family: var(--font-heading);
      font-size: 10px;
      letter-spacing: .12em;
      text-transform: uppercase;
      color: #7a6a4a;
      white-space: nowrap;
      padding-top: 2px;
    }
    .model-summary-val {
      font-size: 11px;
      color: #9a8a6a;
      line-height: 1.45;
    }

    .model-colors {
      display: flex;
      flex-wrap: wrap;
      gap: 4px;
      margin-top: 10px;
      padding-top: 10px;
      border-top: 1px solid var(--bg-dark);
    }

    .color-pill {
      font-size: 10px;
      padding: 2px 7px;
      border-radius: 3px;
      background: #130f06;
      color: #7a6840;
      border: 1px solid var(--border);
      cursor: pointer;
      letter-spacing: .03em;
      transition: color .15s, border-color .15s;
    }

    .color-pill:hover {
      border-color: #8a6a1a;
      color: var(--gold);
    }

    .pill-brand-label {
      font-family: var(--font-heading);
      font-size: 9px;
      letter-spacing: .1em;
      text-transform: uppercase;
      color: var(--text-brown);
      width: 100%;
      margin-top: 6px;
    }

    .pill-brand-label:first-child {
      margin-top: 0;
    }

    .gallery-empty {
      text-align: center;
      padding: 80px 20px;
      color: var(--text-brown);
      font-family: var(--font-heading);
      font-size: 13px;
      letter-spacing: .08em;
    }

    .gallery-empty a {
      color: #8a6a2a;
      text-decoration: none;
    }

    .gallery-empty a:hover {
      color: var(--gold);
    }

    /* ── Faction tag ── */
    .faction-tag {
      display: inline-block;
      font-size: 10px;
      padding: 2px 8px;
      border-radius: 3px;
      background: #130f06;
      color: #7a6840;
      border: 1px solid var(--border);
      cursor: pointer;
      letter-spacing: .04em;
      font-family: var(--font-heading);
      transition: color .15s, border-color .15s;
      user-select: none;
    }

    .faction-tag:hover,
    .faction-tag.active {
      border-color: var(--gold);
      color: var(--gold);
      background: var(--bg-dark);
    }

    /* ── System game badge ── */
    .sys-game-badge {
      display: inline-block;
      font-size: 9px;
      padding: 2px 7px;
      border-radius: 3px;
      color: #9a8a6a;
      letter-spacing: .07em;
      font-family: var(--font-heading);
      text-transform: uppercase;
      vertical-align: middle;
    }

    .sys-40k    { background: #5a1a1a; }
    .sys-30k    { background: #4a3a0a; }
    .sys-aos    { background: #1a2a5a; }
    .sys-kt     { background: #0a3a3a; }
    .sys-bb     { background: #0a3a1a; }
    .sys-necro  { background: #3a0a5a; }
    .sys-opr    { background: #1a2a3a; }
    .sys-epic   { background: #1a3a1a; }
    .sys-other  { background: #2a2a2a; }

    /* ── Gallery controls ── */
    #gallery-controls {
      position: sticky;
      top: 0;
      z-index: 10;
      background: var(--bg-base);
      border-bottom: 1px solid var(--border);
      padding: 8px 16px;
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: center;
    }

    @media (max-width: 600px) {
      #gallery-controls .tab-label { display: none; }
      #gallery-search { flex-basis: 100%; }
    }

    .active-faction-pill {
      font-family: var(--font-heading);
      font-size: 9px;
      letter-spacing: .08em;
      text-transform: uppercase;
      color: var(--gold);
      border: 1px solid #4a3a10;
      background: var(--bg-input);
      padding: 4px 8px;
      border-radius: 3px;
      white-space: nowrap;
      cursor: pointer;
      flex-shrink: 0;
    }

    .active-faction-pill:hover {
      border-color: var(--gold);
    }

    .faction-pull-btn {
      font-family: var(--font-heading);
      font-size: 9px;
      letter-spacing: .08em;
      text-transform: uppercase;
      background: none;
      border: 1px solid var(--border);
      color: var(--text-brown);
      padding: 4px 10px;
      cursor: pointer;
      border-radius: 3px;
      white-space: nowrap;
      flex-shrink: 0;
    }

    .faction-pull-btn:hover {
      color: var(--gold);
      border-color: var(--text-brown);
    }

    /* ── Readiness ── */
    #ready-filter-btn {
      font-family: var(--font-heading);
      font-size: 9px;
      letter-spacing: .08em;
      text-transform: uppercase;
      background: none;
      border: 1px solid var(--border);
      color: var(--text-brown);
      padding: 4px 10px;
      cursor: pointer;
      border-radius: 3px;
      white-space: nowrap;
      flex-shrink: 0;
    }

    #ready-filter-btn:hover {
      color: var(--gold);
      border-color: var(--text-brown);
    }

    #ready-filter-btn.active {
      color: #4a9a4a;
      border-color: #2a5a2a;
    }

    .ready-dot {
      display: inline-block;
      width: 7px;
      height: 7px;
      border-radius: 50%;
      margin-left: 7px;
      vertical-align: middle;
      flex-shrink: 0;
    }

    .ready-dot.ready {
      background: #2d7a3a;
      box-shadow: 0 0 5px rgba(45, 122, 58, .6);
    }

    .ready-dot.low {
      background: var(--amber);
      box-shadow: 0 0 5px rgba(201, 122, 32, .6);
    }

    .ready-dot.blocked {
      background: var(--red);
      box-shadow: 0 0 5px rgba(201, 64, 64, .6);
    }

    /* ── Lightbox ── */
    .lightbox-overlay {
      display: none;
      position: fixed;
      inset: 0;
      z-index: 200;
      background: rgba(0, 0, 0, .92);
      align-items: center;
      justify-content: center;
    }

    /* ── Global Search ── */
    #gs-trigger {
      width: 100%;
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 8px 10px;
      background: rgba(201, 162, 39, .04);
      border: 1px solid #3a2a10;
      border-radius: 4px;
      color: var(--gold);
      cursor: pointer;
      transition: border-color .15s, background .15s;
      margin-bottom: 10px;
    }

    #gs-trigger:hover {
      border-color: #6a5020;
      background: rgba(201, 162, 39, .08);
    }

    .gs-label {
      font-family: var(--font-heading);
      font-size: .62rem;
      letter-spacing: .1em;
      text-transform: uppercase;
      color: #8a7040;
      flex: 1;
      text-align: left;
    }

    .gs-hint {
      font-family: monospace;
      font-size: .58rem;
      color: #3a2a10;
      white-space: nowrap;
    }

    .gs-overlay {
      display: none;
      position: fixed;
      inset: 0;
      z-index: 300;
      background: rgba(5, 3, 0, .82);
      backdrop-filter: blur(3px);
      padding: 80px 16px 40px;
      justify-content: center;
      align-items: flex-start;
    }

    .gs-overlay.open {
      display: flex;
    }

    .gs-modal {
      width: 100%;
      max-width: 720px;
      background: linear-gradient(180deg, #14100a 0%, #0a0907 100%);
      border: 1px solid #5a4a18;
      border-top: 2px solid var(--gold);
      border-radius: 4px;
      box-shadow: 0 12px 40px rgba(0, 0, 0, .8), 0 2px 24px rgba(201, 162, 39, .18);
      display: flex;
      flex-direction: column;
      max-height: calc(100vh - 120px);
      overflow: hidden;
    }

    .gs-input-wrap {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 14px 16px;
      border-bottom: 1px solid var(--border);
    }

    .gs-icon {
      color: var(--gold);
      flex-shrink: 0;
    }

    #gs-input {
      flex: 1;
      background: transparent;
      border: none;
      outline: none;
      color: var(--gold);
      font-family: var(--font-heading);
      font-size: 1.05rem;
      letter-spacing: .04em;
      padding: 2px 0;
    }

    #gs-input::placeholder {
      color: #7a6a4a;
      font-style: italic;
      font-family: var(--font-body);
      letter-spacing: 0;
    }

    .gs-esc, .gs-foot kbd {
      font-family: var(--font-heading);
      font-size: 9px;
      letter-spacing: .1em;
      text-transform: uppercase;
      padding: 3px 7px;
      background: #0a0806;
      border: 1px solid var(--border);
      border-radius: 2px;
      color: #7a6a4a;
    }

    .gs-results {
      flex: 1;
      overflow-y: auto;
      padding: 8px 0;
    }

    .gs-results::-webkit-scrollbar { width: 6px; }
    .gs-results::-webkit-scrollbar-track { background: #0a0806; }
    .gs-results::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
    .gs-results::-webkit-scrollbar-thumb:hover { background: #4a3a18; }

    .gs-group-title {
      font-family: var(--font-heading);
      font-size: 9px;
      letter-spacing: .22em;
      text-transform: uppercase;
      color: var(--text-dim);
      padding: 10px 16px 4px;
    }

    .gs-result {
      display: grid;
      grid-template-columns: 96px 1fr auto;
      gap: 12px;
      align-items: center;
      width: 100%;
      padding: 10px 16px;
      background: transparent;
      border: none;
      border-bottom: 1px solid var(--bg-dark);
      color: inherit;
      cursor: pointer;
      text-align: left;
      font-family: inherit;
    }

    .gs-result:hover,
    .gs-result.selected {
      background: rgba(201, 162, 39, .08);
    }

    .gs-result-type {
      font-family: var(--font-heading);
      font-size: 8px;
      letter-spacing: .14em;
      text-transform: uppercase;
      padding: 3px 7px;
      border-radius: 2px;
      text-align: center;
    }

    .gs-type-paint    { background: #2a1810; color: var(--gold); }
    .gs-type-scheme   { background: #10202a; color: #6abce0; }
    .gs-type-recipe   { background: #1a0f28; color: #a088c9; }
    .gs-type-planned  { background: #0d2a1a; color: #6dc990; }
    .gs-type-bench    { background: #2a1d0a; color: #e8b060; }
    .gs-type-force    { background: #1a2a1a; color: #70c090; }
    .gs-type-wish     { background: rgba(26,74,74,.3); color: #4a9a9a; }
    .gs-type-brush    { background: #1d1812; color: #a89078; }
    .gs-type-wd       { background: #2a0d12; color: #d06878; }
    .gs-type-book     { background: #14182a; color: #7890d0; }
    .gs-type-shame    { background: #2a1a08; color: #c87a30; }

    .gs-result-name {
      font-family: var(--font-heading);
      font-size: 13px;
      color: var(--gold);
      letter-spacing: .03em;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .gs-result-meta {
      font-family: var(--font-body);
      font-size: 11px;
      font-style: italic;
      color: var(--text-dim);
      white-space: nowrap;
    }

    .gs-empty {
      padding: 30px 16px;
      text-align: center;
      font-family: var(--font-body);
      font-style: italic;
      color: #4a3a10;
      font-size: 13px;
    }

    .gs-foot {
      padding: 8px 12px;
      border-top: 1px solid var(--border);
      display: flex;
      gap: 8px;
      align-items: center;
      font-family: var(--font-body);
      font-size: 11px;
      color: var(--text-dim);
      flex-wrap: wrap;
    }

    @media (max-width: 600px) {
      .gs-overlay { padding: 40px 8px 20px; }
      .gs-modal { max-height: calc(100vh - 60px); }
      .gs-result { grid-template-columns: 80px 1fr; }
      .gs-result-meta { grid-column: 1 / -1; padding-left: 92px; margin-top: 2px; white-space: normal; }
    }

    .lightbox-overlay.open {
      display: flex;
    }

    .lb-img {
      max-width: 90vw;
      max-height: 88vh;
      object-fit: contain;
      border: 1px solid var(--border);
      border-radius: 3px;
      box-shadow: 0 0 60px rgba(0, 0, 0, .9), 0 0 20px rgba(201, 162, 39, .12);
      display: block;
    }

    .lb-close {
      position: absolute;
      top: 6px;
      right: 10px;
      font-size: 34px;
      line-height: 1;
      color: var(--text-dim);
      cursor: pointer;
      transition: color .15s;
      font-family: system-ui, sans-serif;
      padding: 10px 12px;
      min-width: 44px;
      min-height: 44px;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .lb-close:hover {
      color: var(--gold);
    }

    .lb-arrow {
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      font-size: 42px;
      line-height: 1;
      font-family: system-ui, sans-serif;
      color: var(--text-brown);
      cursor: pointer;
      padding: 8px 16px;
      background: rgba(0, 0, 0, .5);
      border-radius: 3px;
      user-select: none;
      transition: color .15s, background .15s;
    }

    .lb-arrow:hover {
      color: var(--gold);
      background: rgba(0, 0, 0, .8);
    }

    .lb-prev {
      left: 12px;
    }

    .lb-next {
      right: 12px;
    }

    .lb-arrow[hidden] {
      display: none !important;
    }

    .lb-counter {
      position: absolute;
      bottom: 16px;
      left: 50%;
      transform: translateX(-50%);
      font-family: var(--font-heading);
      font-size: 10px;
      letter-spacing: .12em;
      color: var(--text-brown);
    }

    .model-images img {
      cursor: zoom-in;
    }

    /* ── Footer ── */
    footer {
      background: radial-gradient(ellipse 90% 100% at 50% 60%, #1c1408 0%, #0e0b05 55%, #0d0d1a 100%);
      border-top: 2px solid var(--gold-dim);
      text-align: center;
      padding: 32px 20px 28px;
      position: relative;
      margin-top: 40px;
    }

    footer::before {
      content: '';
      position: absolute;
      top: -1px;
      left: 5%;
      right: 5%;
      height: 1px;
      background: linear-gradient(to right, transparent, #c9a22766, var(--gold), #c9a22766, transparent);
      pointer-events: none;
    }

    .footer-sigil {
      font-size: 1.6rem;
      color: #5a3e0e;
      text-shadow: 0 0 18px rgba(201, 162, 39, .35);
      letter-spacing: .6em;
      margin-bottom: 14px;
    }

    .footer-domain {
      font-family: var(--font-heading);
      font-size: 1.1rem;
      font-weight: 900;
      color: var(--gold);
      letter-spacing: .45em;
      text-transform: uppercase;
      text-shadow:
        0 0 24px rgba(201, 162, 39, .4),
        0 0 6px rgba(201, 162, 39, .2);
      margin-bottom: 16px;
    }

    .footer-rule {
      display: flex;
      align-items: center;
      gap: 12px;
      justify-content: center;
      margin: 0 auto 14px;
      width: 320px;
      max-width: 80%;
    }

    .footer-rule::before,
    .footer-rule::after {
      content: '';
      flex: 1;
      height: 1px;
      background: linear-gradient(to var(--dir), var(--border), transparent);
    }

    .footer-rule::before {
      --dir: left;
    }

    .footer-rule::after {
      --dir: right;
    }

    .footer-rule-gem {
      width: 5px;
      height: 5px;
      background: var(--gold-dim);
      transform: rotate(45deg);
      box-shadow: 0 0 6px rgba(201, 162, 39, .3);
      flex-shrink: 0;
    }

    .footer-copy {
      font-family: var(--font-heading);
      font-size: .55rem;
      color: #3a2c0e;
      letter-spacing: .22em;
      text-transform: uppercase;
    }

    .footer-contact {
      margin-top: 10px;
      font-family: var(--font-heading);
      font-size: .5rem;
      letter-spacing: .18em;
      text-transform: uppercase;
    }

    .footer-contact a {
      color: #3a2c0e;
      text-decoration: none;
      transition: color .2s;
    }

    .footer-contact a:hover {
      color: var(--gold-dim);
    }

    .footer-oss {
      margin-top: 10px;
      font-family: var(--font-heading);
      font-size: .5rem;
      color: #2a1e08;
      letter-spacing: .06em;
      text-transform: uppercase;
    }

    .footer-oss a {
      color: #3a2c0e;
      text-decoration: none;
      transition: color .2s;
    }

    .footer-oss a:hover {
      color: var(--gold-dim);
    }

    .footer-tip { margin-top: 10px; }
    .footer-tip a { font-family: var(--font-heading); font-size: 10px; letter-spacing: .08em; color: #5a4a28; text-decoration: none; text-transform: uppercase; transition: color .15s; }
    .footer-tip a:hover { color: var(--gold); }

    /* ── Responsive ── */
    @media (max-width: 900px) {
      .tab-full  { display: none; }
      .tab-short { display: inline; }
      .tab-btn   { padding: 10px 10px; }
      .tab-btn.tab-group-start { margin-left: 6px; padding-left: 12px; }
    }

    @media (max-width: 600px) {
      .tab-nav {
        padding: 0 8px;
        gap: 2px;
      }

      .tab-btn {
        font-size: 9px;
        padding: 8px 8px;
        letter-spacing: .08em;
        margin-bottom: 0;
      }

      .tab-btn.tab-group-start {
        margin-left: 4px;
        padding-left: 8px;
      }

      .gallery-grid {
        grid-template-columns: 1fr;
      }

      .col-colour,
      .col-used {
        display: none;
      }

      #controls {
        padding: 8px;
      }

      header {
        padding: 12px 12px 10px;
      }

      .logo {
        height: 88px;
      }

      .table-wrap {
        padding: 0 8px 40px;
      }

      td,
      th {
        padding: 6px 8px;
      }
    }

    /* ── Pull Sheet ── */
    .pull-btn {
      background: rgba(201, 162, 39, .04);
      border: 1px solid #4a3510;
      color: #8a7030;
      font-family: var(--font-heading);
      font-size: 9px;
      letter-spacing: .1em;
      text-transform: uppercase;
      padding: 5px 12px;
      cursor: pointer;
      border-radius: 2px;
      transition: color .15s, border-color .15s, background .15s;
    }

    .pull-btn:hover {
      color: var(--gold);
      border-color: var(--gold);
      background: rgba(201, 162, 39, .08);
    }

    .pull-overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, .82);
      z-index: 280;
      align-items: center;
      justify-content: center;
      padding: 24px;
    }

    .pull-overlay.open {
      display: flex;
    }

    .pull-sheet {
      background: #fff;
      color: #1a1a1a;
      padding: 32px 36px;
      max-width: 480px;
      width: 100%;
      max-height: 80vh;
      overflow-y: auto;
      font-family: var(--font-body);
      box-shadow: 0 4px 32px rgba(0, 0, 0, .6);
    }

    .pull-title {
      font-size: 18px;
      font-weight: bold;
      margin-bottom: 4px;
    }

    .pull-faction {
      font-size: 12px;
      color: #666;
      margin-bottom: 20px;
    }

    .pull-brand-heading {
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: .08em;
      color: #999;
      border-bottom: 1px solid #e0e0e0;
      padding-bottom: 3px;
      margin: 16px 0 6px;
    }

    .pull-paint-list {
      list-style: none;
      padding: 0;
      margin: 0;
    }

    .pull-paint-list li {
      padding: 5px 0;
      font-size: 14px;
      border-bottom: 1px solid #f4f4f4;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .pull-paint-list li::before {
      content: '\2610';
      color: #bbb;
      font-size: 15px;
      flex-shrink: 0;
    }

    .pull-actions {
      margin-top: 24px;
      display: flex;
      gap: 10px;
    }

    .pull-actions button {
      padding: 7px 18px;
      border: 1px solid #ccc;
      background: #f8f8f8;
      cursor: pointer;
      font-family: var(--font-body);
      font-size: 13px;
    }

    .pull-actions button:hover {
      background: #eee;
    }

    .pull-flag {
      font-size: 9px;
      text-transform: uppercase;
      letter-spacing: .06em;
      margin-left: 8px;
      padding: 1px 5px;
      border-radius: 2px;
    }

    .pull-flag.missing {
      background: #fde8e8;
      color: #b91c1c;
    }

    .pull-flag.out {
      background: #fde8e8;
      color: #b91c1c;
    }

    .pull-flag.low {
      background: #fef3e2;
      color: var(--amber);
    }

    .pull-issue-badge {
      font-size: 9px;
      font-family: var(--font-heading);
      letter-spacing: .04em;
      color: var(--amber);
      margin-left: 6px;
    }

    .inv-stock-badge {
      font-size: 9px;
      font-family: var(--font-heading);
      text-transform: uppercase;
      letter-spacing: .05em;
      padding: 1px 5px;
      border-radius: 2px;
      margin-left: 6px;
    }

    .inv-stock-badge.inv-stock-low {
      background: #1a0e00;
      color: var(--amber);
    }

    .inv-stock-badge.inv-stock-out {
      background: #1a0000;
      color: var(--red);
    }

    .inv-stock-badge.inv-stock-wanted {
      background: #001a2a;
      color: #60a5fa;
    }

    @media print {
      body:not(.print-shop)>*:not(#pull-overlay) {
        display: none !important;
      }

      body:not(.print-shop) #pull-overlay {
        display: flex !important;
        position: static;
        background: white;
        padding: 0;
      }

      .pull-sheet {
        box-shadow: none;
        max-height: none;
        overflow: visible;
      }

      body:not(.print-shop) .pull-actions {
        display: none !important;
      }

      body.print-shop>*:not(#shop-overlay) {
        display: none !important;
      }

      body.print-shop #shop-overlay {
        display: flex !important;
        position: static;
        background: white;
        padding: 0;
      }

      .shop-sheet {
        box-shadow: none;
        max-height: none;
        overflow: visible;
      }

      body.print-shop .shop-actions {
        display: none !important;
      }

    }

    /* ── Warpaint Mode ── */
    .warpaint-overlay {
      display: none; position: fixed; inset: 0; z-index: 250;
      background: #060504; flex-direction: row; overflow: hidden;
    }
    .warpaint-overlay.open { display: flex; }

    .wp-image-panel {
      width: 42%; flex-shrink: 0; position: relative;
      display: flex; flex-direction: column;
      background: #060504; border-right: 1px solid #1a1208;
    }
    .wp-main-img-wrap {
      flex: 1; min-height: 0; display: flex;
      align-items: center; justify-content: center; overflow: hidden;
    }
    .wp-main-img { max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; }
    .wp-no-img {
      display: none; flex: 1; width: 100%; align-items: center;
      justify-content: center; font-size: 96px; color: #1a1208;
    }
    .wp-thumbs {
      display: flex; gap: 6px; padding: 8px 12px;
      border-top: 1px solid #1a1208; flex-shrink: 0; overflow-x: auto;
    }
    .wp-thumb {
      width: 64px; height: 48px; object-fit: cover; cursor: pointer; flex-shrink: 0;
      border: 2px solid transparent; border-radius: 2px; opacity: .55;
      transition: opacity .15s, border-color .15s;
    }
    .wp-thumb.active, .wp-thumb:hover { border-color: var(--gold); opacity: 1; }

    .wp-img-overlay {
      position: absolute; bottom: 0; left: 0; right: 0;
      padding: 72px 20px 16px;
      background: linear-gradient(to top, rgba(6,5,4,.96) 0%, transparent 100%);
      pointer-events: none;
    }
    .wp-scheme-name {
      font-family: 'Cinzel', serif; font-size: 34px; color: var(--gold);
      line-height: 1.2; letter-spacing: .02em;
      text-shadow: 0 2px 16px rgba(0,0,0,.9);
    }
    .wp-badges { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }

    .wp-content-panel {
      flex: 1; overflow-y: auto; display: flex; flex-direction: column; min-width: 0;
    }
    .wp-actions {
      position: sticky; top: 0; z-index: 10;
      display: flex; align-items: center; justify-content: flex-end;
      gap: 10px; padding: 14px 20px 10px;
      background: linear-gradient(to bottom, #060504 75%, transparent 100%);
      flex-shrink: 0;
    }
    .wp-pull-btn {
      font-family: var(--font-heading); font-size: 10px; letter-spacing: .06em;
      padding: 5px 12px; background: #0e0a04; border: 1px solid #3a2a08;
      color: var(--text-dim); cursor: pointer; border-radius: 2px;
    }
    .wp-pull-btn:hover { border-color: var(--gold); color: var(--gold); }
    .wp-close-btn {
      background: none; border: 1px solid var(--border); color: var(--text-dim);
      font-size: 22px; cursor: pointer; width: 34px; height: 34px; line-height: 1;
      display: flex; align-items: center; justify-content: center; border-radius: 2px;
    }
    .wp-close-btn:hover { color: var(--gold); border-color: var(--gold); }
    .wp-content-body { padding: 0 28px 48px; flex: 1; }

    .wp-summary {
      display: grid; grid-template-columns: auto 1fr;
      gap: 10px 22px; margin-bottom: 26px;
      padding-bottom: 22px; border-bottom: 1px solid var(--border);
    }
    .wp-sum-lbl {
      font-family: 'Cinzel', serif; font-size: 10px; letter-spacing: .1em;
      color: #5a4a28; text-transform: uppercase; padding-top: 3px; white-space: nowrap;
    }
    .wp-sum-val { font-size: 17px; color: var(--text-brown); line-height: 1.4; }

    .wp-desc { margin-bottom: 26px; padding-bottom: 22px; border-bottom: 1px solid var(--border); }
    .wp-desc-block { margin-bottom: 16px; }
    .wp-desc-hdr {
      font-family: 'Cinzel', serif; font-size: 11px; letter-spacing: .1em;
      text-transform: uppercase; color: #7a6a3a;
      margin: 0 0 8px; padding-bottom: 4px; border-bottom: 1px solid #1a1208;
    }
    .wp-desc-p { font-size: 16px; color: var(--text-brown); margin: 0 0 6px; line-height: 1.5; }
    .wp-desc-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 5px; }
    .wp-desc-list li {
      font-size: 16px; color: var(--text-brown); line-height: 1.4;
      padding-left: 14px; position: relative;
    }
    .wp-desc-list li::before { content: '\25AA'; position: absolute; left: 0; color: #5a4a28; }

    .wp-recipe { margin-bottom: 22px; padding-bottom: 22px; border-bottom: 1px solid var(--border); }
    .wp-recipe-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
    .wp-recipe-name { font-family: 'Cinzel', serif; font-size: 14px; letter-spacing: .05em; color: var(--gold); }
    .wp-recipe-cat { font-size: 11px; color: #4a3a1a; }
    .wp-recipe-desc { font-size: 14px; color: #7a6a4a; font-style: italic; margin-bottom: 12px; }
    .wp-guide-btn {
      font-family: 'Cinzel', serif; font-size: 10px; letter-spacing: .06em;
      padding: 4px 12px; background: #100a04; border: 1px solid #4a3a10;
      color: var(--gold); cursor: pointer; border-radius: 2px; flex-shrink: 0;
    }
    .wp-guide-btn:hover { background: #1a1208; }

    .wp-steps { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
    .wp-step-row {
      display: flex; align-items: flex-start; gap: 10px;
      padding: 10px 14px; background: #0c0907;
      border-left: 2px solid #2a1e08; border-radius: 0 2px 2px 0;
    }
    .wp-step-num { font-family: 'Cinzel', serif; font-size: 11px; color: #4a3a1a; min-width: 18px; padding-top: 4px; }
    .wp-step-body { flex: 1; min-width: 0; }
    .wp-step-paint { font-size: 17px; color: var(--text-brown); display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
    .wp-swatch { width: 14px; height: 14px; border-radius: 50%; border: 1px solid #3a2a10; flex-shrink: 0; display: inline-block; }
    .wp-step-brand { font-size: 11px; color: #4a3a1a; }
    .wp-step-meta { font-size: 11px; color: #5a4a28; }
    .wp-step-note { font-style: italic; font-size: 13px; color: #7a6a4a; margin-top: 4px; }

    .wp-stock-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
    .wp-dot-owned   { background: #2a5a1a; }
    .wp-dot-low     { background: #8a5a10; }
    .wp-dot-out     { background: #8a1a1a; }
    .wp-dot-missing { background: transparent; border: 1px solid #4a3a1a; }

    .wp-palette-hd {
      font-family: 'Cinzel', serif; font-size: 11px; letter-spacing: .1em;
      text-transform: uppercase; color: #5a4a28; margin: 20px 0 10px;
    }
    .wp-palette { display: flex; flex-wrap: wrap; gap: 7px; }
    .wp-palette-pill {
      display: flex; align-items: center; gap: 5px;
      background: #0c0907; border: 1px solid #1a1208;
      border-radius: 12px; padding: 5px 10px 5px 6px;
      font-size: 13px; color: var(--text-brown);
    }
    .wp-palette-swatch { width: 12px; height: 12px; border-radius: 50%; border: 1px solid #3a2a10; flex-shrink: 0; }
    .wp-palette-brand { font-size: 10px; color: #3a2a10; margin-left: 2px; }

    .model-card-btns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
    .warpaint-btn {
      font-family: var(--font-heading); font-size: 10px; letter-spacing: .06em;
      padding: 4px 10px; background: #0e0a04; border: 1px solid #3a2a08;
      color: var(--gold); cursor: pointer; border-radius: 2px;
      transition: background .15s, border-color .15s;
    }
    .warpaint-btn:hover { background: #1a1208; border-color: var(--gold); }

    @media (max-width: 760px) {
      .warpaint-overlay { flex-direction: column; }
      .wp-image-panel { width: 100%; max-height: 38vh; border-right: none; border-bottom: 1px solid #1a1208; }
      .wp-scheme-name { font-size: 22px; }
      .wp-sum-val { font-size: 15px; }
      .wp-step-paint { font-size: 15px; }
      .wp-content-body { padding: 0 16px 40px; }
    }

    /* ── Nixie Counter ── */
    .nixie-display { margin-top: 14px; padding: 0 4px 8px; }
    .nixie-frame { position: relative; width: 100%; max-width: 360px; margin: 0 auto; }
    .nixie-frame::before { content: ''; display: block; padding-bottom: 66.67%; }
    .nixie-frame-img { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
    .nixie-tubes { position: absolute; top: 31%; bottom: 30%; left: 18%; right: 18%; display: flex; align-items: stretch; z-index: 1; }
    .nixie-digit { flex: 1; min-width: 0; display: block; object-fit: cover; object-position: center center; }
    .nixie-pb { text-align: center; font-family: 'Cinzel', serif; font-size: .72rem; color: #7a6a3a; letter-spacing: .06em; margin: 4px 0 0; }
    .nixie-streak { margin-top: 3px; }
    .nixie-streak strong { color: #e07820; text-shadow: 0 0 8px #a04010; font-weight: 700; }
    .streak-flame { animation: streak-flicker 2.4s ease-in-out infinite; display: inline-block; }
    @keyframes streak-flicker { 0%,100% { transform: scale(1) rotate(-2deg); opacity: 1; } 30% { transform: scale(1.08) rotate(1deg); opacity: .88; } 60% { transform: scale(.96) rotate(-1deg); opacity: .96; } 80% { transform: scale(1.04) rotate(2deg); opacity: .92; } }

    /* ── Workhorse count ── */
    .scheme-count {
      font-family: var(--font-heading);
      font-size: 10px;
      color: var(--bg-mid);
      display: inline-block;
      min-width: 16px;
      text-align: center;
    }

    .scheme-count.workhorse {
      color: var(--gold);
      font-weight: 700;
    }

    /* ── Used-In modal ── */
    #tbody tr {
      cursor: pointer;
    }

    .used-in-overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, .82);
      z-index: 200;
      align-items: center;
      justify-content: center;
      padding: 24px;
    }

    .used-in-overlay.open {
      display: flex;
    }

    .used-in-sheet {
      background: #fff;
      color: #1a1a1a;
      padding: 28px 32px;
      max-width: 440px;
      width: 100%;
      max-height: 80vh;
      overflow-y: auto;
      font-family: var(--font-body);
      box-shadow: 0 4px 32px rgba(0, 0, 0, .6);
    }

    .used-in-paint-name {
      font-size: 17px;
      font-weight: bold;
      margin-bottom: 2px;
    }

    .used-in-brand {
      font-size: 10px;
      color: #999;
      text-transform: uppercase;
      letter-spacing: .08em;
      margin-bottom: 18px;
    }

    .used-in-empty {
      color: #999;
      font-style: italic;
      font-size: 14px;
      margin: 12px 0 20px;
    }

    .used-in-item {
      padding: 10px 0;
      border-bottom: 1px solid #f0f0f0;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }

    .used-in-item:last-child {
      border-bottom: none;
    }

    .used-in-model-name {
      font-size: 14px;
      font-weight: bold;
    }

    .used-in-model-meta {
      font-size: 11px;
      color: #888;
      margin-top: 2px;
    }

    .used-in-goto {
      background: none;
      border: 1px solid #ccc;
      padding: 4px 12px;
      cursor: pointer;
      font-family: var(--font-body);
      font-size: 12px;
      white-space: nowrap;
      flex-shrink: 0;
    }

    .used-in-goto:hover {
      background: #f0f0f0;
    }

    .used-in-close {
      margin-top: 20px;
      padding: 7px 18px;
      border: 1px solid #ccc;
      background: #f8f8f8;
      cursor: pointer;
      font-family: var(--font-body);
      font-size: 13px;
    }

    .used-in-close:hover {
      background: #eee;
    }

    /* ── Readiness badges (planned cards) ── */
    .ready-badge {
      display: inline-block;
      font-family: var(--font-heading);
      font-size: 10px;
      letter-spacing: .07em;
      text-transform: uppercase;
      padding: 2px 7px;
      border-radius: 2px;
      font-weight: 700;
      vertical-align: middle;
    }
    .ready-badge.ready  { background: #0a2a0a; color: #60c060; border: 1px solid #1a4a1a; }
    .ready-badge.almost { background: #2a1a08; color: var(--gold); border: 1px solid #4a3010; }
    .ready-badge.needs  { background: #1a0a0a; color: #7a4040; border: 1px solid #3a1a1a; }

    .planned-shop-impact {
      font-size: 11px;
      font-style: italic;
      color: #9a8a50;
      margin-top: 4px;
    }

    /* Readiness filter pills */
    .planned-rp {
      font-family: var(--font-heading);
      font-size: 10px;
      letter-spacing: .06em;
      text-transform: uppercase;
      padding: 3px 8px;
      border: 1px solid var(--border);
      border-radius: 3px;
      background: var(--bg-base);
      color: #7a6a4a;
      cursor: pointer;
      transition: background .15s, color .15s, border-color .15s;
    }
    .planned-rp.active { background: #2a1f0a; border-color: #6a4a10; color: var(--gold); }
    .planned-rp:hover:not(.active) { color: #9a7a30; border-color: var(--bg-mid); }

    /* ── Planned Tab ── */
    #planned-controls {
      position: sticky;
      top: 0;
      z-index: 10;
      background: var(--bg-base);
      border-bottom: 1px solid var(--border);
      padding: 8px 16px;
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      align-items: center;
    }

    #shop-list-btn {
      font-family: var(--font-heading);
      font-size: 9px;
      font-weight: 700;
      letter-spacing: .12em;
      text-transform: uppercase;
      padding: 5px 12px;
      border: 1px solid var(--bg-mid);
      background: none;
      color: #7a6030;
      cursor: pointer;
      border-radius: 3px;
    }

    #shop-list-btn:hover {
      border-color: var(--gold);
      color: var(--gold);
    }

    #planned-count {
      font-size: 12px;
      color: var(--text-brown);
      margin-left: auto;
      font-family: var(--font-heading);
      letter-spacing: .04em;
    }

    /* ── Pile of Shame ── */
    .shame-fp, .rsc-fp {
      font-size: 11px; padding: 4px 10px; border-radius: 3px;
      cursor: pointer; font-family: var(--font-heading); letter-spacing: .04em;
      background: var(--bg-base); color: #7a6a4a; border: 1px solid var(--border);
    }
    .shame-fp.active, .rsc-fp.active { background: #1e1408; color: var(--gold); border-color: var(--gold); }

    .bh-fp {
      font-size: 11px; padding: 4px 10px; border-radius: 3px;
      cursor: pointer; font-family: var(--font-heading); letter-spacing: .04em;
      background: var(--bg-base); color: #7a6a4a; border: 1px solid var(--border);
    }
    .bh-fp.active { background: #1e1408; color: var(--gold); border-color: var(--gold); }
    .bh-fp:hover:not(.active) { color: #9a7a30; border-color: var(--bg-mid); }

    .shame-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; max-width:960px; margin:0 auto; padding:16px; }
    .shame-card { position:relative; background:var(--bg-base); border:1px solid var(--border); border-left-width:3px; border-radius:4px; padding:14px 16px 14px 38px; }
    .shame-card.shame-st-sealed  { border-left-color:#4a4a4a; }
    .shame-card.shame-st-opened  { border-left-color:#c87a30; }
    .shame-card.shame-st-partial { border-left-color:var(--gold); }
    .shame-card-newest { border-color:#8a2020 !important; border-left-color:#d04040 !important; background:linear-gradient(135deg,#120a0a 0%,var(--bg-base) 60%) !important; }
    .shame-card-newest-label { font-size:9px; font-family:var(--font-heading); letter-spacing:.1em; color:#d04040; text-transform:uppercase; margin-bottom:4px; }
    .shame-sys-label { position:absolute; left:3px; top:0; bottom:0; width:22px; display:flex; align-items:center; justify-content:center; writing-mode:vertical-rl; transform:rotate(180deg); font-size:9px; font-family:var(--font-heading); letter-spacing:.12em; text-transform:uppercase; border-radius:2px 0 0 2px; }
    .shame-card-name { font-size:14px; color:var(--gold); font-family:var(--font-heading); letter-spacing:.04em; margin-top:4px; }
    .shame-card-sitting { font-size:12px; color:#c87a30; font-style:italic; margin-top:3px; }
    .shame-card-meta { font-size:11px; color:#7a6a4a; margin-top:5px; display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
    .shame-badge { font-size:10px; padding:2px 7px; border-radius:3px; font-family:var(--font-heading); letter-spacing:.04em; }
    .shame-acquired { font-family:var(--font-heading); font-size:10px; color:#7a6a4a; }
    .shame-notes { font-size:12px; color:#7a6a50; margin-top:6px; font-style:italic; }
    .shame-promoted { font-size:10px; padding:2px 7px; border-radius:3px; background:#1a3a1a; color:#7ad678; font-family:var(--font-heading); }
    .promoted-badge-row { display:flex; justify-content:flex-end; }
    #shame-more { max-width:960px; margin:0 auto; padding:0 16px 28px; position:relative; }
    #shame-more .gallery-more-fade { background:linear-gradient(to bottom, transparent 0%, rgba(14,13,9,.55) 50%, var(--bg-base) 100%); }
    .shame-sys-40k        { background:#8a2020; color:#f08080; }
    .shame-sys-30k        { background:#4a3a10; color:#d4a840; }
    .shame-sys-AoS        { background:#1a2a5a; color:#7090d8; }
    .shame-sys-Epic       { background:#1a3a1a; color:#70b870; }
    .shame-sys-BB         { background:#2a1a4a; color:#9a70d8; }
    .shame-sys-Necromunda { background:#1a3a3a; color:#70c8c8; }
    .shame-sys-KT         { background:#0a3a3a; color:#70c8d8; }
    .shame-sys-OPR        { background:#1a2a3a; color:#708090; }
    .shame-sys-OldWorld   { background:#3a2a0a; color:#d4a040; }
    .shame-sys-Other      { background:#2a2a2a; color:#909090; }
    .shame-st-sealed      { background:#1a1a1a; color:#7a7a7a; }
    .shame-st-opened      { background:#2a1808; color:#c87a30; }
    .shame-st-partial     { background:#1e1808; color:var(--gold); }
    @media (max-width:600px) { .shame-grid { grid-template-columns:1fr; padding:12px; } }

    .planned-grid {
      max-width: 960px;
      margin: 0 auto;
      padding: 16px;
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 16px;
    }

    .planned-card {
      background: var(--bg-base);
      border: 1px solid var(--border);
      border-left: 3px solid var(--bg-mid);
      border-radius: 4px;
      padding: 0;
      overflow: hidden;
    }
    .planned-card-header {
      background: #0a0906;
      border-bottom: 1px solid var(--bg-dark);
      padding: 10px 14px 8px;
    }
    .planned-card-body {
      padding: 10px 14px 12px;
    }

    .planned-card-name {
      font-family: var(--font-heading);
      font-size: .85rem;
      color: var(--gold);
      letter-spacing: .04em;
      margin-bottom: 4px;
    }

    .planned-card-kit {
      font-size: 11px;
      color: var(--text-dim);
      font-family: var(--font-heading);
      letter-spacing: .04em;
      margin-bottom: 2px;
    }

    .planned-card-faction {
      font-size: 11px;
      color: var(--text-brown);
      margin-bottom: 4px;
    }



    .planned-card-desc {
      font-size: 12px;
      color: #7a6a4a;
      margin-bottom: 10px;
      font-style: italic;
    }

    .planned-colors {
      display: flex;
      flex-wrap: wrap;
      gap: 4px;
      margin-bottom: 8px;
    }

    .pcol-pill {
      font-size: 10px;
      padding: 2px 7px;
      border-radius: 3px;
    }

    .pcol-pill.owned {
      background: #0a1a0a;
      border: 1px solid #1a3a1a;
      color: #5a8a5a;
    }

    .pcol-pill.low {
      background: #1a1006;
      border: 1px solid #3a2806;
      color: var(--amber);
    }

    .pcol-pill.missing {
      background: #1a0808;
      border: 1px solid #3a1010;
      color: var(--red);
    }

    .planned-card-footer, .card-footer {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      margin-top: 6px;
    }
    .planned-pull-btn { margin-top: 0; }

    .planned-card-summary {
      font-size: 10px;
      color: var(--bg-mid);
      font-family: var(--font-heading);
      letter-spacing: .04em;
    }

    .planned-empty {
      text-align: center;
      padding: 60px 20px;
      font-family: var(--font-heading);
      font-size: .75rem;
      letter-spacing: .08em;
      color: var(--bg-mid);
    }

    .planned-empty a {
      color: var(--text-dim);
    }

    .planned-empty a:hover {
      color: var(--gold);
    }

    /* ── On the Bench ── */
    #bench-controls {
      position: sticky;
      top: 0;
      z-index: 10;
      background: var(--bg-base);
      border-bottom: 1px solid var(--border);
      padding: 8px 16px;
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      align-items: center;
    }


    #bench-count {
      font-family: var(--font-heading);
      font-size: 10px;
      letter-spacing: .08em;
      color: var(--text-brown);
      white-space: nowrap;
    }

    .bench-filter-pills {
      display: flex;
      gap: 5px;
      flex-wrap: wrap;
    }

    .bench-filter-pill, .recipes-filter-pill, .brush-filter-pill, .equiv-bp, .supply-filter-pill {
      font-family: var(--font-heading);
      font-size: 10px;
      letter-spacing: .07em;
      text-transform: uppercase;
      padding: 3px 10px;
      border: 1px solid var(--border);
      border-radius: 2px;
      background: none;
      color: var(--text-brown);
      cursor: pointer;
      transition: color .12s, border-color .12s;
    }

    .bench-filter-pill:hover, .recipes-filter-pill:hover, .brush-filter-pill:hover, .equiv-bp:hover, .supply-filter-pill:hover {
      color: var(--gold);
      border-color: var(--gold-dim);
    }

    .bench-filter-pill.active, .recipes-filter-pill.active, .brush-filter-pill.active, .equiv-bp.active, .supply-filter-pill.active {
      color: var(--gold);
      border-color: var(--gold-dim);
      background: var(--gold-faint);
    }

    .bench-grid {
      max-width: 1100px;
      margin: 0 auto;
      padding: 16px;
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 16px;
    }

    .bench-card {
      background: var(--bg-base);
      border: 1px solid var(--border);
      border-left: 3px solid var(--bg-mid);
      border-radius: 4px;
      padding: 0;
      overflow: hidden;
    }

    .bench-card-header {
      background: #0a0906;
      border-bottom: 1px solid var(--bg-dark);
      padding: 12px 14px 8px;
    }

    .bench-card-body {
      padding: 10px 14px 14px;
    }

    .bench-card-header .bench-card-faction {
      margin-bottom: 0;
    }

    .bench-card.stage-done {
      border-left-color: #2a5a1a;
      opacity: .85;
    }

    .bench-card.stage-highlighted {
      border-left-color: var(--gold);
    }

    .bench-card-name {
      font-family: var(--font-heading);
      font-size: .9rem;
      color: var(--gold);
      letter-spacing: .04em;
      margin-bottom: 4px;
    }

    .bench-card-faction {
      font-size: 11px;
      color: var(--text-dim);
      font-family: var(--font-heading);
      letter-spacing: .04em;
      margin-bottom: 8px;
    }

    .bench-stage-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 6px;
    }

    .bench-stage-label {
      font-family: var(--font-heading);
      font-size: 9px;
      letter-spacing: .08em;
      text-transform: uppercase;
      padding: 2px 8px;
      border: 1px solid currentColor;
      border-radius: 2px;
      background: rgba(0, 0, 0, .3);
    }

    .bench-stage-label.stage-built {
      color: var(--text-dim);
    }

    .bench-stage-label.stage-primed {
      color: #8a8a8a;
    }

    .bench-stage-label.stage-basecoated {
      color: #6090c0;
    }

    .bench-stage-label.stage-washed {
      color: #5a8aa0;
    }

    .bench-stage-label.stage-highlighted {
      color: var(--gold);
    }

    .bench-stage-label.stage-based {
      color: #a07a4a;
    }

    .bench-stage-label.stage-varnished {
      color: #b8b090;
    }

    .bench-stage-label.stage-done {
      color: #5a9a3a;
    }

    .bench-touched {
      font-size: 10px;
      color: var(--text-brown);
      font-family: var(--font-heading);
      letter-spacing: .03em;
    }

    .bench-progress {
      height: 3px;
      background: var(--bg-dark);
      border-radius: 2px;
      overflow: hidden;
      margin-bottom: 10px;
    }

    .bench-progress-fill {
      height: 100%;
      background: linear-gradient(to right, var(--gold-dim), var(--gold));
      transition: width .3s;
    }

    .bench-wip-row {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
      gap: 4px;
      margin-bottom: 10px;
    }

    .bench-wip-row img {
      width: 100%;
      height: 60px;
      object-fit: cover;
      border-radius: 2px;
      cursor: zoom-in;
      border: 1px solid var(--bg-dark);
    }

    .bench-card-notes {
      font-size: 12px;
      color: #8a7a5a;
      line-height: 1.5;
      margin-bottom: 10px;
      font-style: italic;
    }

    .bench-colors {
      display: flex;
      flex-wrap: wrap;
      gap: 4px;
      margin-bottom: 8px;
    }

    .bench-brush-row {
      display: flex;
      flex-wrap: wrap;
      gap: 4px;
      margin-bottom: 8px;
      padding-top: 8px;
      border-top: 1px dashed var(--bg-dark);
    }

    .bench-brush-pill {
      font-size: 10px;
      padding: 2px 7px;
      border-radius: 3px;
      background: #100c1a;
      border: 1px solid #2a2040;
      color: #6a5a8a;
    }

    .bench-card-summary {
      font-size: 10px;
      color: var(--bg-mid);
      font-family: var(--font-heading);
      letter-spacing: .04em;
    }


    .bench-next-step {
      font-size: 11px;
      color: #7a6840;
      font-style: italic;
      margin-top: 3px;
    }

    .bench-hist-toggle {
      background: none;
      border: none;
      cursor: pointer;
      font-size: 10px;
      color: var(--bg-mid);
      font-family: var(--font-heading);
      letter-spacing: .06em;
      padding: 5px 0 0;
      display: block;
    }
    .bench-hist-toggle:hover { color: var(--text-dim); }
    .bench-hist-list { display: none; margin-top: 6px; border-top: 1px solid var(--bg-dark); padding-top: 6px; }
    .bench-hist-list.bench-hist-open { display: block; }
    .bench-hist-row { display: flex; align-items: center; gap: 5px; font-size: 10px; color: #7a6a4a; padding: 2px 0; }
    .bench-hist-arrow { color: var(--border); }
    .bench-hist-when { margin-left: auto; color: var(--bg-mid); font-family: var(--font-heading); letter-spacing: .03em; }

    .bench-sess-toggle { background: none; border: none; cursor: pointer; font-size: 10px; color: var(--bg-mid); font-family: var(--font-heading); letter-spacing: .06em; padding: 5px 0 0; display: block; }
    .bench-sess-toggle:hover { color: var(--text-dim); }
    .bench-sess-list { display: none; margin-top: 6px; border-top: 1px solid var(--bg-dark); padding-top: 6px; }
    .bench-sess-list.bench-sess-open { display: block; }
    .bench-sess-row { display: flex; align-items: baseline; gap: 6px; font-size: 10px; padding: 3px 0; flex-wrap: wrap; }
    .bench-sess-date { color: #b89040; font-family: var(--font-heading); letter-spacing: .04em; flex-shrink: 0; }
    .bench-sess-dur { color: #8a6a30; flex-shrink: 0; }
    .bench-sess-note { color: var(--text-dim); flex: 1; min-width: 0; }

    .bench-empty {
      text-align: center;
      padding: 60px 20px;
      font-family: var(--font-heading);
      font-size: .75rem;
      letter-spacing: .08em;
      color: var(--bg-mid);
    }

    .bench-empty a {
      color: var(--text-dim);
    }

    .bench-empty a:hover {
      color: var(--gold);
    }

    @media (max-width: 600px) {
      .planned-grid { grid-template-columns: 1fr; padding: 12px; }
    }

    @media (max-width: 600px) {
      .bench-grid {
        grid-template-columns: 1fr;
        padding: 12px;
      }
    }

    /* ── Shopping List Modal ── */
    .shop-overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, .75);
      z-index: 200;
      align-items: center;
      justify-content: center;
    }

    .shop-overlay.open {
      display: flex;
    }

    .shop-sheet {
      background: #fff;
      color: #222;
      max-width: 520px;
      width: 95%;
      max-height: 80vh;
      overflow-y: auto;
      padding: 28px 28px 20px;
      border-radius: 2px;
      box-shadow: 0 8px 40px rgba(0, 0, 0, .6);
    }

    .shop-title {
      font-family: var(--font-heading);
      font-size: 1rem;
      font-weight: 700;
      letter-spacing: .08em;
      text-transform: uppercase;
      color: #1a1208;
      border-bottom: 1px solid #ddd;
      padding-bottom: 8px;
      margin-bottom: 4px;
    }

    .shop-subtitle {
      font-size: 11px;
      color: #888;
      margin-bottom: 16px;
    }

    .shop-section-heading {
      font-family: var(--font-heading);
      font-size: .7rem;
      font-weight: 700;
      letter-spacing: .1em;
      text-transform: uppercase;
      margin: 16px 0 6px;
      padding-bottom: 4px;
    }

    .shop-must {
      color: var(--red);
      border-bottom: 1px solid #f0d0d0;
    }

    .shop-consider {
      color: var(--amber);
      border-bottom: 1px solid #f0e0d0;
    }

    .shop-brand {
      font-family: var(--font-heading);
      font-size: .6rem;
      letter-spacing: .1em;
      text-transform: uppercase;
      color: #aaa;
      margin: 10px 0 4px;
    }

    .shop-paint-list {
      list-style: none;
      padding: 0;
      margin: 0;
    }

    .shop-paint-list li {
      display: flex;
      justify-content: space-between;
      align-items: baseline;
      padding: 4px 0;
      border-bottom: 1px solid #f5f5f5;
      gap: 12px;
    }

    .shop-paint-name {
      font-size: 13px;
      font-weight: 500;
      flex-shrink: 0;
    }

    .shop-schemes {
      font-size: 10px;
      color: #999;
      font-style: italic;
      text-align: right;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .shop-actions {
      margin-top: 20px;
      display: flex;
      gap: 8px;
      justify-content: flex-end;
    }

    .shop-actions button {
      padding: 7px 16px;
      border: 1px solid #ccc;
      background: #f8f8f8;
      cursor: pointer;
      font-family: var(--font-body);
      font-size: 13px;
      border-radius: 2px;
    }

    .shop-actions button:hover {
      background: #eee;
    }

    .shop-all-good {
      color: #5a9a5a;
      font-family: var(--font-heading);
      font-size: 12px;
      text-align: center;
      padding: 24px 0;
      letter-spacing: .06em;
    }

    /* ── What's Inside (contents) ── */
    .contents-wrap {
      max-width: 1100px;
      margin: 0 auto;
      padding: 28px 20px 60px;
    }

    .contents-mast {
      text-align: center;
      padding-bottom: 22px;
      margin-bottom: 28px;
      border-bottom: 1px solid var(--border);
      position: relative;
    }

    .contents-mast::after {
      content: '✦';
      position: absolute;
      bottom: -9px;
      left: 50%;
      transform: translateX(-50%);
      color: var(--gold);
      font-size: 11px;
      background: #0d0d1a;
      padding: 0 12px;
      line-height: 1;
      z-index: 1;
    }

    .contents-issue {
      display: inline-block;
      font-family: var(--font-heading);
      font-size: 10px;
      letter-spacing: .22em;
      text-transform: uppercase;
      color: #8a7030;
      background: rgba(201, 162, 39, .1);
      border: 1px solid #4a3a10;
      padding: 3px 10px 2px;
      border-radius: 2px;
      margin-bottom: 10px;
    }

    .contents-title {
      font-family: var(--font-heading);
      font-weight: 900;
      font-size: 3.4rem;
      letter-spacing: .18em;
      text-transform: uppercase;
      color: var(--gold);
      margin: 0 0 10px;
      text-shadow:
        0 3px 6px rgba(0, 0, 0, .9),
        0 1px 2px rgba(0, 0, 0, .8),
        0 0 28px rgba(201, 162, 39, .45),
        0 0 8px  rgba(201, 162, 39, .3);
    }

    .contents-title-img {
      display: block;
      width: 100%;
      max-width: 580px;
      height: auto;
      margin: 0 auto -8px;
      filter:
        drop-shadow(0 3px 6px rgba(0, 0, 0, .9))
        drop-shadow(0 0 28px rgba(201, 162, 39, .5))
        drop-shadow(0 0 8px  rgba(201, 162, 39, .35));
    }

    .contents-tagline {
      font-family: var(--font-body);
      font-style: italic;
      font-size: 13px;
      color: #7a6a4a;
      max-width: 560px;
      margin: 0 auto;
      line-height: 1.6;
      position: relative;
      z-index: 1;
    }


    /* Hero bar: bench strip + heatmap side by side */
    .hero-bar {
      display: flex;
      gap: 20px;
      align-items: stretch;
      margin: 0 0 28px;
    }


    .hero-wrap {
      position: relative;
    }

    /* ── Hobby Activity Heatmap ── */
    .hero-heatmap {
      flex: 1;
      min-width: 0;
      background: linear-gradient(180deg, var(--bg-base) 0%, #0a0907 100%);
      border: 1px solid var(--border);
      border-top: 2px solid var(--gold);
      border-radius: 4px;
      padding: 18px 20px 16px;
    }

    .hm-header {
      font-family: var(--font-heading);
      font-size: 11px;
      letter-spacing: .2em;
      text-transform: uppercase;
      color: var(--gold);
      margin-bottom: 12px;
    }

    .hm-count {
      color: #7a6a4a;
      letter-spacing: .1em;
    }

    .hm-scroll { overflow-x: hidden; }

    .hm-inner { width: 100%; }

    .hm-months {
      display: grid;
      grid-template-columns: repeat(52, 1fr);
      gap: 2px;
      margin-bottom: 3px;
    }

    .hm-months span {
      font-family: var(--font-heading);
      font-size: 9px;
      letter-spacing: .04em;
      color: #6a5a3a;
      white-space: nowrap;
      overflow: visible;
    }

    .hm-grid {
      display: grid;
      grid-template-columns: repeat(52, 1fr);
      gap: 2px;
    }

    .hm-week {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .hm-day {
      aspect-ratio: 1;
      width: 100%;
      border-radius: 2px;
    }

    .hm-lv0 { background: #1a1508; }
    .hm-lv1 { background: #4a3310; }
    .hm-lv2 { background: #8a6018; }
    .hm-lv3 { background: var(--gold); box-shadow: 0 0 8px rgba(201,162,39,.6), 0 0 3px rgba(201,162,39,.9); }
    .hm-future { background: #0e0c08; }
    .hm-today  { outline: 1px solid #8a6a28; outline-offset: -1px; }

    .hm-legend {
      display: flex;
      align-items: center;
      gap: 4px;
      margin-top: 10px;
      font-family: var(--font-heading);
      font-size: 11px;
      letter-spacing: .1em;
      color: #5a4a2a;
    }

    .hm-legend .hm-lv0,
    .hm-legend .hm-lv1,
    .hm-legend .hm-lv2,
    .hm-legend .hm-lv3 {
      width: 11px;
      height: 11px;
      border-radius: 2px;
      flex-shrink: 0;
      box-shadow: none;
    }

    .hero-goal-strip { display: flex; align-items: center; gap: 10px; background: #0c0b08; border-top: 1px solid #1e1a10; padding: 7px 14px; }
    .pipeline-goal-strip { background: transparent; border-top: none; border-bottom: 1px solid #2a2010; margin: -22px -24px 16px; padding: 7px 24px; border-radius: 3px 3px 0 0; }
    .hero-goal-label { font-family: var(--font-heading); font-size: 9px; color: var(--gold); letter-spacing: .12em; text-transform: uppercase; flex-shrink: 0; }
    .hero-goal-bar-wrap { flex: 1; height: 4px; background: #1e1a10; border-radius: 2px; overflow: hidden; }
    .hero-goal-bar-fill { height: 4px; background: var(--gold); border-radius: 2px; }
    .hero-goal-num { font-size: 11px; color: #6a5a38; flex-shrink: 0; }
    .hero-goal-pct { font-family: var(--font-heading); font-size: 10px; color: var(--gold); letter-spacing: .04em; flex-shrink: 0; }
    .hero-goal-pct.goal-complete { color: #5a9a5a; }
    .pipeline-notes-row { display: flex; align-items: stretch; overflow: visible; margin-bottom: 24px; }
    .pipeline-notes-row .pipeline-band { flex: 1 1 auto; min-width: 0; margin-bottom: 0; }
    .hero-notes-panel {
      flex: 0 0 55%;
      margin-left: -16%;
      margin-right: -48px;
      position: relative;
      align-self: center;
      display: block;
      text-decoration: none;
      cursor: pointer;
      aspect-ratio: 3 / 2;
      background: url('img/notes.png') center/cover no-repeat;
      z-index: 3;
      transition: filter .2s;
    }
    .hero-notes-panel:hover { filter: brightness(1.08); }
    .hero-notes-text {
      position: absolute;
      top: calc(34% - 20px);
      left: 22%;
      right: 22%;
      bottom: 18%;
      font-family: 'Caveat', cursive;
      font-size: 21px;
      font-weight: 700;
      color: #2a1808;
      line-height: 1.45;
      overflow: hidden;
      white-space: pre-wrap;
      word-break: break-word;
      transform: rotate(-8deg);
      transform-origin: center;
    }
    .wm-week { font-size: 8px; color: #7a6a4a; text-align: center; padding: 3px 6px 4px; font-style: italic; line-height: 1.4; }
    /* Wots Next panel */
    .wtn-panel { background: #0b0a08; border: 1px solid #2a2010; border-radius: 3px; padding: 14px 20px 16px; margin: 0 0 22px; }
    .wtn-header { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
    .wtn-title { font-family: var(--font-heading); font-size: .85rem; color: var(--gold); letter-spacing: .06em; text-transform: uppercase; }
    .wtn-sub { font-size: .7rem; color: #7a6a4a; font-style: italic; }
    .wtn-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
    .wtn-card { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; background: #100e0a; border-radius: 2px; border-left: 3px solid #3a3020; text-decoration: none; cursor: pointer; transition: filter .15s; }
    .wtn-card:hover { filter: brightness(1.12); }
    .wtn-card-rescue { border-left-color: #c07030; }
    .wtn-card-ready  { border-left-color: #60a860; }
    .wtn-card-force  { border-left-color: #6080c0; }
    .wtn-card-almost { border-left-color: var(--gold); }
    .wtn-card-shame  { border-left-color: #6a6a6a; }
    .wtn-thumb { width: 48px; height: 48px; flex-shrink: 0; border-radius: 2px; background: #1a1810 center/cover no-repeat; }
    .wtn-body { min-width: 0; flex: 1; }
    .wtn-type { font-family: var(--font-heading); font-size: .55rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 3px; }
    .wtn-card-rescue .wtn-type { color: #c07030; }
    .wtn-card-ready  .wtn-type { color: #60a860; }
    .wtn-card-force  .wtn-type { color: #6080c0; }
    .wtn-card-almost .wtn-type { color: var(--gold); }
    .wtn-card-shame  .wtn-type { color: #6a6a6a; }
    .wtn-name { font-family: var(--font-heading); font-size: .8rem; color: #c4b49a; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .wtn-faction { font-size: .65rem; color: #6a5a38; margin-bottom: 3px; }
    .wtn-reason { font-size: .65rem; color: #7a6a50; }
    .wtn-progress { height: 3px; background: #1a1a1a; border-radius: 1px; margin-top: 5px; }
    .wtn-progress-fill { height: 3px; background: #6080c0; border-radius: 1px; }
    .wtn-card-prepped { border-left-color: #50a860; }
    .wtn-card-prepped .wtn-type { color: #50a860; }
    /* Rescue Tracker */
    .rescues-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 960px; margin: 0 auto; padding: 16px; }
    .rescue-card { position: relative; background: var(--bg-base); border: 1px solid var(--border); border-left-width: 3px; padding: 14px 16px 14px 38px; border-radius: 4px; }
    .rescue-st-bidding    { border-left-color: #5a3a6a; }
    .rescue-st-in_transit { border-left-color: #3a4a7a; }
    .rescue-st-received   { border-left-color: #2a5a5a; }
    .rescue-st-stripping  { border-left-color: #8a4a1a; }
    .rescue-st-prepped    { border-left-color: #3a6a3a; }
    .rescue-stage-badge { font-size: 10px; padding: 2px 7px; border-radius: 3px; text-transform: uppercase; letter-spacing: .06em; }
    .rescue-stage-bidding    { background: #2a1a3a; color: #c090e8; }
    .rescue-stage-in_transit { background: #1a1a4a; color: #8090e8; }
    .rescue-stage-received   { background: #0a3030; color: #70c8c8; }
    .rescue-stage-stripping  { background: #3a1a08; color: #e07030; }
    .rescue-stage-prepped    { background: #0a2a0a; color: #70c870; }
    .rescue-cond-badge { font-size: 10px; padding: 2px 6px; border-radius: 3px; background: #1a1a1a; color: #7a6a50; }
    .rescue-source-badge { font-size: 10px; padding: 2px 6px; border-radius: 3px; background: #101018; color: #6a6a8a; }
    .rescue-photos { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
    .rescue-photo  { width: 56px; height: 56px; border-radius: 2px; background: #1a1810 center/cover no-repeat; cursor: pointer; flex-shrink: 0; }
    .rescue-stage-btn { font-size: 11px; padding: 3px 10px; border-radius: 3px; cursor: pointer; border: 1px solid #3a2a1a; background: none; }
    .rescue-stage-btn.stage-bidding    { background: #2a1a3a; color: #c090e8; border-color: #4a2a6a; }
    .rescue-stage-btn.stage-in_transit { background: #1a1a4a; color: #8090e8; border-color: #2a2a6a; }
    .rescue-stage-btn.stage-received   { background: #0a3030; color: #70c8c8; border-color: #1a5050; }
    .rescue-stage-btn.stage-stripping  { background: #3a1a08; color: #e07030; border-color: #6a3a10; }
    .rescue-stage-btn.stage-prepped    { background: #0a2a0a; color: #70c870; border-color: #1a5a1a; }
    .rescue-card-name { font-size: 14px; color: var(--gold); font-family: var(--font-heading); }
    .rescue-card-sitting { font-size: 12px; color: #c87a30; font-style: italic; }
    .rescue-card-meta { font-size: 11px; color: #7a6a4a; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
    .rescue-card-notes { font-size: 12px; color: #7a6a50; font-style: italic; margin-top: 4px; }
    .rescue-promoted-badge { font-size: 10px; background: #1a3a1a; color: #7ad678; padding: 2px 7px; border-radius: 3px; }
    .gs-type-rescue { background: #3a2a0a; color: #d8902a; }
    .waaagh-meter { margin: 0 10px 8px; padding: 6px 8px; background: #080706; border-radius: 2px; flex-shrink: 0; }
    .wm-title-img { display: block; width: 75%; margin: 0 auto 4px; }
    .wm-gauge { position: relative; width: 100%; aspect-ratio: 3/2; }
    .wm-fill {
      position: absolute; inset: 0;
      clip-path: polygon(50% 80%, 14% 77%, 9% 58%, 8% 44%, 28% 14%, 50% 9%, 72% 14%, 92% 44%, 91% 58%, 86% 77%);
      background: conic-gradient(from 270deg at 50% 80%, #c02010 0deg, #c9a227 90deg, #3a8a3a 180deg, transparent 180deg, transparent 360deg);
      -webkit-mask-image: conic-gradient(from 270deg at 50% 80%, black 0deg, black var(--wm-end), transparent var(--wm-end), transparent 360deg);
      mask-image: conic-gradient(from 270deg at 50% 80%, black 0deg, black var(--wm-end), transparent var(--wm-end), transparent 360deg);
    }
    .meter-s0 .wm-fill { --wm-end: 36deg; }
    .meter-s1 .wm-fill { --wm-end: 72deg; }
    .meter-s2 .wm-fill { --wm-end: 108deg; }
    .meter-s3 .wm-fill { --wm-end: 144deg; }
    .meter-s4 .wm-fill { --wm-end: 180deg; }
    .wm-gauge-img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
    .wm-needle {
      position: absolute; left: 50%; bottom: 20%;
      width: 2px; height: 70%; margin-left: -1px;
      background: linear-gradient(to top, #0a0806 0%, #6a0808 20%, #c01010 60%, #ec2020 85%, #ff3a3a 100%);
      transform-origin: 50% 100%;
      transform: rotate(var(--wm-angle, 0deg));
      border-radius: 1px 1px 0 0;
      pointer-events: none; z-index: 3;
    }
    .meter-s0 .wm-needle { --wm-angle: -72deg; }
    .meter-s1 .wm-needle { --wm-angle: -36deg; }
    .meter-s2 .wm-needle { --wm-angle: 0deg; }
    .meter-s3 .wm-needle { --wm-angle: 36deg; }
    .meter-s4 .wm-needle { --wm-angle: 72deg; }
    .wm-pivot {
      position: absolute; left: 50%; bottom: 20%;
      width: 8px; height: 8px;
      background: radial-gradient(circle at 35% 35%, #4a4030, #1a1208);
      border: 1px solid #3a3020; border-radius: 50%;
      transform: translate(-50%, 50%);
      pointer-events: none; z-index: 4;
    }
    .wm-state { font-family: var(--font-heading); font-size: 7px; letter-spacing: .08em; text-transform: uppercase; text-align: center; margin-top: 2px; }
    .meter-s0 .wm-state { color: #3a3a3a; }
    .meter-s1 .wm-state { color: #7a5020; }
    .meter-s2 .wm-state { color: var(--gold); }
    .meter-s3 .wm-state { color: #c05010; }
    .meter-s4 .wm-state { color: #c02010; }
    @keyframes wm-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
    .meter-s3 .wm-fill, .meter-s3 .wm-state { animation: wm-pulse 1.8s ease-in-out infinite; }
    .meter-s4 .wm-fill, .meter-s4 .wm-state { animation: wm-pulse 1.1s ease-in-out infinite; }
    .pipeline-battle-strip { display:flex; align-items:center; gap:10px; margin-top:14px; padding:7px 12px; background:rgba(0,0,0,.25); border-radius:3px; border:1px solid #1e1a10; border-left:2px solid #2a2010; text-decoration:none; cursor:pointer; transition:background .15s; overflow:hidden; }
    .pipeline-battle-strip:hover { background:rgba(201,162,39,.05); border-left-color:#4a3a10; }
    .pipeline-battle-label { font-family:var(--font-heading); font-size:9px; color:#6a5430; letter-spacing:.1em; text-transform:uppercase; white-space:nowrap; flex-shrink:0; }
    .pipeline-battle-matchup { font-size:11px; color:#5a5040; font-style:italic; flex:1 1 0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0; }
    .pipeline-battle-record { font-family:var(--font-heading); font-size:10px; color:#7a6a3a; letter-spacing:.05em; flex-shrink:0; }
    @media (max-width: 720px) {
      .hero-bar {
        flex-direction: column;
      }
.pipeline-notes-row {
        flex-direction: column;
      }
      .hero-notes-panel {
        display: none;
      }
      .wtn-cards { grid-template-columns: 1fr; }
      .rescues-grid { grid-template-columns: 1fr; padding: 12px; }
    }

    .contents-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 28px;
    }

    .contents-section {
      background: linear-gradient(180deg, var(--bg-base) 0%, #0a0907 100%);
      border: 1px solid var(--border);
      border-radius: 4px;
      padding: 18px 18px 14px;
      box-shadow: 0 2px 12px rgba(0, 0, 0, .4);
    }

    .contents-section-title {
      font-family: var(--font-heading);
      font-weight: 700;
      font-size: .75rem;
      letter-spacing: .18em;
      text-transform: uppercase;
      color: var(--gold);
      margin-bottom: 12px;
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .contents-section-title::before,
    .contents-section-title::after {
      content: '';
      flex: 1;
      height: 1px;
      background: linear-gradient(to right, #3a2a10, transparent);
    }

    .contents-section-title::before {
      background: linear-gradient(to left, #3a2a10, transparent);
    }

    .contents-entry {
      display: block;
      cursor: pointer;
      padding: 10px 4px 12px;
      border-bottom: 1px dashed var(--bg-dark);
      transition: padding-left .18s, background .18s;
      text-decoration: none;
    }

    .contents-entry:last-child {
      border-bottom: none;
    }

    .contents-entry:hover {
      padding-left: 10px;
      background: rgba(201, 162, 39, .04);
    }

    .contents-entry-name {
      font-family: var(--font-heading);
      font-size: .95rem;
      font-weight: 700;
      letter-spacing: .04em;
      color: var(--gold);
      margin-bottom: 4px;
      display: flex;
      align-items: baseline;
      gap: 6px;
    }

    .contents-entry-name::before {
      content: '›';
      color: var(--gold-dim);
      font-size: 14px;
      transition: color .18s;
    }

    .contents-entry:hover .contents-entry-name::before {
      color: var(--gold);
    }

    .contents-entry-blurb {
      font-size: 12px;
      color: #8a7a5a;
      line-height: 1.55;
      font-family: var(--font-body);
      margin-bottom: 5px;
      padding-left: 14px;
    }

    .contents-entry-count {
      font-family: var(--font-heading);
      font-size: 9px;
      letter-spacing: .12em;
      text-transform: uppercase;
      color: var(--text-dim);
      padding-left: 14px;
    }

    /* Section-tinted entry borders */
    .armies-section .contents-entry {
      border-left: 2px solid #3a1010;
      padding-left: 8px;
      transition: padding-left .18s, background .18s, border-left-color .18s;
    }
    .armies-section .contents-entry:hover { border-left-color: #8a2020; }

    .workbench-section .contents-entry {
      border-left: 2px solid #0e2a1a;
      padding-left: 8px;
      transition: padding-left .18s, background .18s, border-left-color .18s;
    }
    .workbench-section .contents-entry:hover { border-left-color: #1a5a36; }

    .library-entries .contents-entry {
      border-left: 2px solid #1a1030;
      padding-left: 8px;
      transition: padding-left .18s, background .18s, border-left-color .18s;
    }
    .library-entries .contents-entry:hover { border-left-color: #4a2a7a; }

    /* Featured Handbook section - full-width, gold-accented */
    .contents-section-featured {
      grid-column: 1 / -1;
      background:
        radial-gradient(ellipse 80% 100% at 0% 0%, rgba(201, 162, 39, .08) 0%, transparent 60%),
        linear-gradient(180deg, #14100a 0%, #0a0907 100%);
      border: 1px solid #5a4a18;
      border-left: 3px solid var(--gold);
      box-shadow: 0 2px 18px rgba(201, 162, 39, .12), inset 0 0 60px rgba(201, 162, 39, .03);
      padding: 22px 24px 18px;
    }

    .contents-section-featured .contents-section-title {
      font-size: .95rem;
      letter-spacing: .22em;
      margin-bottom: 14px;
    }

    .contents-section-featured .contents-section-title::before,
    .contents-section-featured .contents-section-title::after {
      content: none;
    }

    .contents-section-sub {
      font-family: var(--font-body);
      font-style: italic;
      font-weight: 400;
      font-size: 11px;
      letter-spacing: .03em;
      text-transform: none;
      color: #8a7a4a;
      margin-left: 10px;
    }

    .featured-intro {
      font-family: var(--font-body);
      font-size: 14px;
      line-height: 1.7;
      color: #b8a878;
      margin-bottom: 16px;
      max-width: 720px;
    }

    .featured-intro em {
      color: var(--gold);
      font-style: italic;
    }

    .featured-points {
      list-style: none;
      padding: 0;
      margin: 0 0 16px;
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
      gap: 12px 22px;
    }

    .featured-points li {
      font-family: var(--font-body);
      font-size: 12.5px;
      line-height: 1.55;
      color: #8a7a5a;
      padding-left: 16px;
      position: relative;
    }

    .featured-points li::before {
      content: '◆';
      position: absolute;
      left: 0;
      top: 2px;
      color: var(--gold-dim);
      font-size: 9px;
    }

    .featured-points strong {
      color: var(--gold);
      font-family: var(--font-heading);
      font-weight: 700;
      font-size: 10.5px;
      letter-spacing: .12em;
      text-transform: uppercase;
      display: block;
      margin-bottom: 3px;
    }

    .contents-entry-featured {
      padding: 12px 14px;
      background: rgba(201, 162, 39, .05);
      border: 1px solid var(--bg-mid);
      border-radius: 3px;
      margin-top: 4px;
    }

    .contents-entry-featured:hover {
      padding-left: 14px;
      background: rgba(201, 162, 39, .1);
      border-color: #6a4f18;
    }

    .contents-entry-featured .contents-entry-name {
      margin-bottom: 0;
      font-size: 1.05rem;
    }

    .contents-entry-featured .contents-entry-count {
      margin-top: 4px;
    }

    @media (max-width: 600px) {
      .contents-wrap {
        padding: 18px 12px 40px;
      }

      .contents-title {
        font-size: 1.6rem;
        letter-spacing: .1em;
      }

      .contents-tagline {
        font-size: 12px;
      }

      .contents-grid {
        gap: 16px;
        grid-template-columns: minmax(0, 1fr);
      }

      .contents-section {
        padding: 14px 14px 10px;
      }

      .contents-section-featured {
        padding: 16px 14px 12px;
      }

      .contents-section-sub {
        display: block;
        margin: 4px 0 0;
      }

      .featured-intro {
        font-size: 13px;
      }

      .featured-points {
        grid-template-columns: 1fr;
        gap: 10px;
      }
    }

    /* ── Landing: Pipeline band ── */
    .pipeline-band {
      background: linear-gradient(180deg, #14110a 0%, #0e0c08 100%);
      border: 1px solid var(--bg-mid);
      border-left: 3px solid var(--gold);
      border-radius: 4px;
      padding: 22px 24px 20px;
      box-shadow: 0 2px 18px rgba(201, 162, 39, .10), inset 0 0 60px rgba(201, 162, 39, .03);
      margin-bottom: 24px;
    }

    .pipeline-band-title {
      font-family: var(--font-heading);
      font-weight: 700;
      font-size: .95rem;
      letter-spacing: .22em;
      text-transform: uppercase;
      color: var(--gold);
      margin-bottom: 18px;
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .pipeline-band-title::after {
      content: '';
      flex: 1;
      height: 1px;
      background: linear-gradient(to right, #5a4018, transparent);
    }

    .pipeline-band-sub {
      font-family: var(--font-body);
      font-style: italic;
      font-weight: 400;
      font-size: 11px;
      letter-spacing: .03em;
      text-transform: none;
      color: #8a7a4a;
    }

    .pipeline-nodes {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
    }

    .pipeline-arrow { display: none; }

    .pipeline-node {
      flex: none;
      display: block;
      text-decoration: none;
      cursor: pointer;
      background: rgba(201, 162, 39, .04);
      border: 1px solid var(--bg-mid);
      border-radius: 3px;
      padding: 14px 16px 12px;
      transition: background .18s, border-color .18s;
    }

    .pipeline-node:hover {
      background: rgba(201, 162, 39, .09);
      border-color: #6a4f18;
    }

    .pipeline-node-name {
      font-family: var(--font-heading);
      font-size: .8rem;
      font-weight: 700;
      letter-spacing: .1em;
      text-transform: uppercase;
      color: var(--gold);
      margin-bottom: 6px;
    }

    .pipeline-node-num {
      font-family: var(--font-heading);
      font-size: 2rem;
      font-weight: 700;
      color: var(--gold);
      line-height: 1;
      margin-bottom: 6px;
    }

    .pipeline-node-blurb {
      font-family: var(--font-body);
      font-style: italic;
      font-size: 11px;
      color: #7a6840;
      line-height: 1.4;
    }

    .pipeline-bench-node { border-left: 3px solid var(--gold); min-width: 0; overflow: hidden; }
    .pipeline-bench-main { display: flex; align-items: flex-start; gap: 10px; margin-top: 8px; }
    .pipeline-bench-thumb { width: 56px; height: 56px; flex-shrink: 0; border-radius: 3px; background-size: cover; background-position: center; background-color: #0a0806; border: 1px solid var(--border); }
    .pipeline-bench-info { flex: 1; min-width: 0; }
    .pipeline-bench-pname { font-family: var(--font-heading); font-size: 12px; color: #c4b49a; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .pipeline-bench-faction { font-size: 11px; color: var(--text-brown); margin-bottom: 4px; font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .pipeline-bench-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
    .hero-bench-touched { font-size: 11px; color: #8a7a5a; font-style: italic; }

    /* ── Landing: Armies + Workbench row ── */
    .armies-workbench-row {
      grid-column: 1 / -1;
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 24px;
      margin-bottom: 24px;
    }

    .armies-section,
    .workbench-section {
      background: linear-gradient(180deg, var(--bg-base) 0%, #0a0907 100%);
      border: 1px solid var(--border);
      border-radius: 4px;
      padding: 18px 18px 14px;
      box-shadow: 0 2px 12px rgba(0, 0, 0, .4);
    }

    /* ── Landing: Library band ── */
    .library-band {
      grid-column: 1 / -1;
      background: linear-gradient(180deg, #0b0a08 0%, #080706 100%);
      border: 1px solid #1e1a0e;
      border-radius: 4px;
      padding: 18px 22px 16px;
      margin-bottom: 24px;
    }

    .library-band-title {
      font-family: var(--font-heading);
      font-weight: 700;
      font-size: .7rem;
      letter-spacing: .2em;
      text-transform: uppercase;
      color: #7a6a40;
      margin-bottom: 12px;
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .library-band-title::before,
    .library-band-title::after {
      content: '';
      flex: 1;
      height: 1px;
      background: linear-gradient(to right, #2a2010, transparent);
    }

    .library-band-title::before {
      background: linear-gradient(to left, #2a2010, transparent);
    }

    .library-entries {
      display: flex;
      flex-wrap: wrap;
      gap: 0;
    }

    .library-entries .contents-entry {
      flex: 1 1 160px;
      border-bottom: none;
      border-right: 1px dashed var(--bg-dark);
      padding: 8px 14px 10px;
    }

    .library-entries .contents-entry:last-child {
      border-right: none;
    }

    .library-entries .contents-entry-name {
      font-size: .8rem;
      color: #9a8a58;
    }

    .library-entries .contents-entry-blurb {
      color: #5a4e30;
    }

    .library-entries .contents-entry-count {
      color: #4a3e20;
    }

    @media (max-width: 600px) {
      .pipeline-nodes {
        grid-template-columns: 1fr 1fr;
      }

      .pipeline-bench-thumb { display: none; }

      .armies-workbench-row {
        grid-template-columns: 1fr;
        gap: 16px;
      }

      .library-entries {
        flex-direction: column;
      }

      .library-entries .contents-entry {
        border-right: none;
        border-bottom: 1px dashed var(--bg-dark);
      }

      .library-entries .contents-entry:last-child {
        border-bottom: none;
      }
    }

    /* ── Recipes ── */
    #recipes-controls {
      position: sticky;
      top: 0;
      z-index: 10;
      background: var(--bg-base);
      border-bottom: 1px solid var(--border);
      padding: 8px 16px;
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      align-items: center;
    }


    #recipes-count {
      font-family: var(--font-heading);
      font-size: 10px;
      letter-spacing: .08em;
      color: var(--text-brown);
      white-space: nowrap;
    }

    .recipes-filter-pills {
      display: flex;
      gap: 5px;
      flex-wrap: wrap;
    }


    #recipes-grid {
      max-width: 1100px;
      margin: 0 auto;
      padding: 16px;
      column-count: 2;
      column-gap: 16px;
    }

    @media (max-width: 700px) {
      #recipes-grid {
        column-count: 1;
        padding: 12px;
      }
    }

    .recipe-card {
      background: var(--bg-base);
      border: 1px solid var(--border);
      border-left: 3px solid var(--bg-mid);
      border-radius: 4px;
      padding: 0;
      overflow: hidden;
      margin-bottom: 16px;
      break-inside: avoid;
      position: relative;
    }

    .recipe-link-btn {
      position: absolute;
      top: 8px;
      right: 8px;
      background: none;
      border: none;
      color: var(--bg-mid);
      cursor: pointer;
      padding: 2px;
      line-height: 1;
      opacity: .6;
    }

    .recipe-link-btn:hover {
      color: var(--gold);
      opacity: 1;
    }

    .recipe-card.highlight {
      animation: highlightFade 3s forwards;
    }

    .recipe-card-header {
      display: flex;
      align-items: flex-start;
      gap: 10px;
      background: #0a0906;
      border-bottom: 1px solid var(--bg-dark);
      padding: 12px 14px 10px;
      margin-bottom: 0;
    }

    .recipe-card-header-left {
      display: flex;
      align-items: baseline;
      gap: 8px;
      flex-wrap: wrap;
      flex: 1;
      min-width: 0;
    }

    .recipe-hero {
      width: 100%;
      height: 140px;
      object-fit: cover;
      display: block;
      cursor: zoom-in;
      transition: opacity .15s;
    }
    .recipe-hero:hover { opacity: .88; }

    .recipe-card-body {
      padding: 10px 14px 14px;
    }

    .recipe-card-name {
      font-family: var(--font-heading);
      font-size: .9rem;
      color: var(--gold);
      letter-spacing: .04em;
    }

    .recipe-cat-badge {
      font-family: var(--font-heading);
      font-size: 10px;
      letter-spacing: .08em;
      text-transform: uppercase;
      padding: 2px 7px;
      border-radius: 3px;
      background: var(--bg-dark);
      color: var(--gold);
      border: 1px solid #4a3a10;
    }

    .recipe-faction-badge {
      font-size: 9px;
      letter-spacing: .05em;
      color: #8a6a3a;
      font-family: var(--font-heading);
      text-transform: uppercase;
    }

    .recipe-card-desc {
      font-size: 12px;
      color: #7a6a4a;
      margin-bottom: 10px;
      font-style: italic;
      line-height: 1.5;
    }

    .recipe-steps-list {
      margin: 0 0 10px;
      padding: 0;
      list-style: none;
    }

    .recipe-card-desc + .recipe-steps-list {
      border-top: 1px solid var(--border);
      margin-top: 8px;
      padding-top: 10px;
    }

    .recipe-step-row {
      display: flex;
      align-items: flex-start;
      gap: 8px;
      padding: 6px 0;
      border-bottom: 1px dashed var(--bg-dark);
      font-size: 12px;
    }

    .recipe-step-row:last-child {
      border-bottom: none;
    }

    .recipe-step-num {
      font-family: var(--font-heading);
      font-size: 10px;
      color: var(--text-dim);
      letter-spacing: .04em;
      min-width: 18px;
      padding-top: 2px;
      flex-shrink: 0;
    }

    .recipe-step-body {
      flex: 1;
      min-width: 0;
    }

    .recipe-step-line {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-wrap: wrap;
    }

    .recipe-step-tech {
      font-family: var(--font-heading);
      font-size: 10px;
      letter-spacing: .07em;
      text-transform: uppercase;
      padding: 1px 6px;
      border-radius: 2px;
      flex-shrink: 0;
    }

    .recipe-tech-basecoat {
      background: #0e1e30;
      color: #6a8aaa;
      border: 1px solid #1a3050;
    }

    .recipe-tech-wash {
      background: #1a1008;
      color: #8a6020;
      border: 1px solid #3a2810;
    }

    .recipe-tech-shade {
      background: #0a1614;
      color: #3a6a6a;
      border: 1px solid #1a3a3a;
    }

    .recipe-tech-layer {
      background: #0a1806;
      color: #5a8a3a;
      border: 1px solid #2a4a1a;
    }

    .recipe-tech-edge {
      background: #1a1406;
      color: var(--gold);
      border: 1px solid #4a3a10;
    }

    .recipe-tech-highlight {
      background: #14140c;
      color: #d5c888;
      border: 1px solid #3a3a20;
    }

    .recipe-tech-glaze {
      background: #140a1a;
      color: #8a5a9a;
      border: 1px solid #3a1a4a;
    }

    .recipe-tech-drybrush {
      background: #1a1006;
      color: #c07030;
      border: 1px solid #3a2810;
    }

    .recipe-tech-stipple {
      background: #180808;
      color: #a03a3a;
      border: 1px solid #3a1010;
    }

    .recipe-tech-blend {
      background: #180a12;
      color: #c8609a;
      border: 1px solid #3a1a2a;
    }

    .recipe-tech-special {
      background: #1a1a1a;
      color: #8a8a8a;
      border: 1px solid #2a2a2a;
    }

    .recipe-step-paint {
      font-size: 11px;
      padding: 2px 7px;
      border-radius: 3px;
      border: 1px solid var(--border);
      background: var(--bg-input);
      color: var(--text-main);
      display: inline-flex;
      align-items: center;
      gap: 5px;
    }

    .recipe-step-paint.owned {
      border-color: #1a3a1a;
      color: #8aba8a;
    }

    .recipe-step-paint.low {
      border-color: #3a2806;
      color: var(--amber);
    }

    .recipe-step-paint.missing {
      border-color: #3a1010;
      color: var(--red);
    }

    .recipe-step-swatch {
      display: inline-block;
      width: 10px;
      height: 10px;
      border-radius: 2px;
      border: 1px solid rgba(255, 255, 255, .1);
      flex-shrink: 0;
    }

    .recipe-step-meta {
      font-size: 10px;
      color: var(--text-dim);
      font-style: italic;
      margin-top: 2px;
      line-height: 1.4;
    }

    .rc-mix-sep {
      color: #7a6a4a;
      font-size: 10px;
      padding: 0 2px;
      vertical-align: middle;
    }

    .recipe-step-meta .rc-ratio {
      color: #8a6a3a;
      font-style: normal;
      font-family: monospace;
    }

    .recipe-step-meta .rc-brush {
      color: #5a6a8a;
      font-style: normal;
      font-family: var(--font-heading);
      font-size: 9px;
      letter-spacing: .04em;
      text-transform: uppercase;
    }

    .recipe-notes {
      font-size: 11px;
      color: #8a7a5a;
      line-height: 1.5;
      padding-top: 8px;
      border-top: 1px dashed var(--bg-dark);
      margin-top: 6px;
      white-space: pre-wrap;
    }

    .recipe-used-in {
      font-family: var(--font-heading);
      font-size: 9px;
      letter-spacing: .06em;
      color: var(--text-brown);
      padding-top: 8px;
      border-top: 1px dashed var(--bg-dark);
      margin-top: 8px;
    }

    .recipe-used-in a {
      color: #8a6a2a;
      text-decoration: none;
      margin-left: 4px;
    }

    .recipe-used-in a:hover {
      color: var(--gold);
    }

    .recipes-empty {
      text-align: center;
      padding: 60px 20px;
      font-family: var(--font-heading);
      font-size: .75rem;
      letter-spacing: .08em;
      color: var(--bg-mid);
    }

    .recipes-empty a {
      color: var(--text-dim);
    }

    .recipes-empty a:hover {
      color: var(--gold);
    }

    /* Recipe reference badges on gallery/planned/bench cards */
    .recipe-ref-row {
      display: flex;
      flex-wrap: wrap;
      gap: 4px;
      margin: 12px 0 6px;
    }

    .recipe-ref-badge {
      font-family: var(--font-heading);
      font-size: 9px;
      letter-spacing: .06em;
      text-transform: uppercase;
      padding: 2px 7px;
      border-radius: 2px;
      background: var(--gold-faint);
      color: var(--gold);
      border: 1px solid #4a3a10;
      cursor: pointer;
      transition: background .12s, border-color .12s;
    }

    .recipe-ref-badge:hover {
      background: rgba(201, 162, 39, .14);
      border-color: var(--gold);
    }

    .recipe-card-footer { display: flex; justify-content: flex-end; margin-top: 8px; padding-top: 8px; border-top: 1px dashed #2a1e08; }
    .recipe-guide-btn { background: #0e1608; border: 1px solid #2a3a18; color: #5a8a3a; font-family: var(--font-heading); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; padding: 5px 12px; cursor: pointer; border-radius: 3px; }
    .recipe-guide-btn:hover { background: #1a2608; color: #8aba8a; }

    /* ── Recipe Guide Overlay ── */
    .recipe-guide-overlay { position: fixed; inset: 0; z-index: 500; background: rgba(0,0,0,.93); display: none; align-items: center; justify-content: center; }
    .recipe-guide-overlay.open { display: flex; }
    .recipe-guide-card { background: #100e08; border: 1px solid #3a2a10; border-radius: 6px; width: 100%; max-width: 480px; max-height: 90dvh; overflow-y: auto; padding: 28px 24px 20px; position: relative; display: flex; flex-direction: column; gap: 14px; }
    @media (max-width: 520px) { .recipe-guide-card { max-width: 100%; max-height: 100dvh; border-radius: 0; } }
    .recipe-guide-close { position: absolute; top: 10px; right: 14px; background: none; border: none; cursor: pointer; font-size: 22px; color: #7a6a4a; line-height: 1; padding: 0; }
    .recipe-guide-close:hover { color: var(--gold); }
    .recipe-guide-title { font-family: var(--font-heading); font-size: .85rem; color: var(--gold); letter-spacing: .04em; padding-right: 24px; }
    .recipe-guide-counter { font-family: var(--font-heading); font-size: 10px; color: #7a6a4a; letter-spacing: .06em; text-transform: uppercase; margin-top: -8px; }
    .recipe-guide-step-content { display: flex; flex-direction: column; gap: 10px; padding: 12px 0; min-height: 120px; }
    .recipe-guide-tech { display: inline-block; font-size: 12px; padding: 6px 14px; border-radius: 3px; text-transform: uppercase; letter-spacing: .08em; align-self: flex-start; }
    .recipe-guide-paint-row { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
    .recipe-guide-swatch { width: 22px; height: 22px; border-radius: 3px; border: 1px solid rgba(255,255,255,.12); flex-shrink: 0; }
    .recipe-guide-paint-name { font-size: 1.25rem; font-family: var(--font-heading); letter-spacing: .03em; }
    .recipe-guide-paint-name.owned { color: #8aba8a; }
    .recipe-guide-paint-name.low { color: #c8a040; }
    .recipe-guide-paint-name.missing { color: #c05050; }
    .recipe-guide-brand { font-size: 11px; color: #7a6a4a; letter-spacing: .04em; font-family: var(--font-heading); }
    .recipe-guide-meta { font-size: 13px; color: #7a6840; font-style: italic; }
    .recipe-guide-brush { font-size: 10px; color: #5a6a8a; font-family: var(--font-heading); letter-spacing: .04em; text-transform: uppercase; }
    .recipe-guide-dots { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; padding: 4px 0; }
    .recipe-guide-dot { width: 8px; height: 8px; border-radius: 50%; background: #2a2010; border: 1px solid #4a3a18; }
    .recipe-guide-dot.active { background: var(--gold); border-color: var(--gold); }
    .recipe-guide-dot.done { background: #4a3a18; border-color: #7a6a4a; }
    .recipe-guide-nav { display: flex; gap: 10px; }
    .recipe-guide-prev, .recipe-guide-next { flex: 1; padding: 16px 8px; font-size: 2rem; background: #1a1508; border: 1px solid #3a2a10; color: #c4b49a; cursor: pointer; border-radius: 4px; transition: background .15s; line-height: 1; }
    .recipe-guide-prev:hover, .recipe-guide-next:hover { background: #2a1e08; }
    .recipe-guide-prev:disabled { opacity: .3; cursor: default; }
    .recipe-guide-next.done-btn { font-size: .85rem; font-family: var(--font-heading); letter-spacing: .06em; color: #5a9a5a; }

    /* ── Factions Overview ── */
    #factions-controls {
      position: sticky;
      top: 0;
      z-index: 10;
      background: var(--bg-base);
      border-bottom: 1px solid var(--border);
      padding: 8px 16px;
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      align-items: center;
    }


    #factions-count {
      font-family: var(--font-heading);
      font-size: 12px;
      letter-spacing: .04em;
      color: var(--text-brown);
    }

    #factions-empty {
      padding: 60px 20px;
      text-align: center;
      font-family: var(--font-heading);
      font-size: 13px;
      letter-spacing: .08em;
      color: var(--bg-mid);
    }

    #factions-empty a { color: #8a6a2a; text-decoration: none; }
    #factions-empty a:hover { color: var(--gold); }

    #factions-wrap {
      max-width: 1080px;
      margin: 0 auto;
      padding: 16px;
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 22px;
    }

    .faction-card {
      background: var(--bg-base);
      border: 1px solid var(--border);
      border-left: 3px solid var(--bg-mid);
      border-radius: 4px;
      padding: 0;
      overflow: hidden;
      margin-bottom: 0;
      scroll-margin-top: 20px;
    }

    .faction-card.highlight {
      animation: highlightFade 3s forwards;
    }

    .faction-header {
      display: flex;
      flex-wrap: wrap;
      align-items: baseline;
      gap: 16px;
      background: #0a0906;
      border-bottom: 1px solid var(--border);
      padding: 16px 20px 12px;
      margin-bottom: 0;
    }

    .faction-body {
      padding: 14px 20px 16px;
    }

    .faction-name {
      font-family: var(--font-heading);
      font-size: .9rem;
      color: var(--gold);
      letter-spacing: .04em;
    }

    .faction-summary {
      font-family: var(--font-body);
      font-style: italic;
      font-size: 12px;
      color: #8a7a5a;
      margin-left: auto;
    }

    .faction-summary strong {
      font-style: normal;
      color: var(--gold);
      font-weight: 700;
    }

    .faction-section {
      margin-top: 12px;
    }

    .faction-section-title {
      font-family: var(--font-heading);
      font-size: 9px;
      letter-spacing: .22em;
      text-transform: uppercase;
      color: var(--text-dim);
      margin-bottom: 8px;
    }

    .faction-scheme-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
      gap: 10px;
    }

    .faction-scheme-mini {
      cursor: pointer;
      background: #0a0806;
      border: 1px solid var(--bg-dark);
      border-radius: 3px;
      overflow: hidden;
      text-decoration: none;
      color: inherit;
      transition: border-color .15s, transform .15s;
    }

    .faction-scheme-mini:hover {
      border-color: #8a6a18;
      transform: translateY(-1px);
    }

    .faction-scheme-mini-img {
      width: 100%;
      aspect-ratio: 1 / 1;
      background-color: #0a0806;
      overflow: hidden;
      display: flex;
      align-items: center;
      justify-content: center;
      font-family: var(--font-heading);
      font-size: 8px;
      letter-spacing: .14em;
      color: var(--border);
    }

    .faction-scheme-mini-img img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }

    .faction-scheme-mini-name {
      padding: 6px 8px 7px;
      font-family: var(--font-heading);
      font-size: 10px;
      letter-spacing: .04em;
      color: var(--gold);
      text-align: center;
      line-height: 1.25;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .faction-chips {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }

    .faction-chip {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 4px 10px;
      background: var(--bg-input);
      border: 1px solid var(--border);
      border-radius: 3px;
      font-family: var(--font-heading);
      font-size: 10px;
      letter-spacing: .06em;
      color: var(--gold);
      cursor: pointer;
      transition: border-color .15s, color .15s, background .15s;
    }

    .faction-chip:hover {
      border-color: #8a6a18;
      background: var(--bg-dark);
    }

    .faction-chip-kind {
      font-size: 8px;
      letter-spacing: .12em;
      text-transform: uppercase;
      padding: 1px 5px;
      border-radius: 2px;
      font-weight: 700;
    }

    .faction-chip-kind.kind-recipe  { background: #1a0f28; color: #a088c9; }
    .faction-chip-kind.kind-bench   { background: #2a1d0a; color: #e8b060; }
    .faction-chip-kind.kind-planned { background: #0d2a1a; color: #6dc990; }

    .faction-palette {
      display: flex;
      flex-wrap: wrap;
      gap: 4px;
    }

    .faction-palette-pill {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-size: 10px;
      padding: 3px 8px;
      background: #130f06;
      color: #7a6840;
      border: 1px solid var(--border);
      border-radius: 3px;
      letter-spacing: .03em;
      cursor: pointer;
      transition: color .15s, border-color .15s;
    }

    .faction-palette-pill:hover {
      border-color: #8a6a1a;
      color: var(--gold);
    }

    .faction-palette-swatch {
      width: 10px;
      height: 10px;
      border-radius: 2px;
      border: 1px solid rgba(255,255,255,.08);
      flex-shrink: 0;
    }

    .faction-palette-dot {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      flex-shrink: 0;
    }

    .faction-palette-dot.owned   { background: #2d7a3a; box-shadow: 0 0 4px rgba(45,122,58,.6); }
    .faction-palette-dot.low     { background: var(--amber); box-shadow: 0 0 4px rgba(201,122,32,.6); }
    .faction-palette-dot.out     { background: var(--red); box-shadow: 0 0 4px rgba(201,64,64,.6); }
    .faction-palette-dot.wanted  { background: #60a5fa; box-shadow: 0 0 4px rgba(96,165,250,.6); }
    .faction-palette-dot.missing { background: transparent; border: 1px solid var(--bg-mid); }

    .faction-palette-count {
      font-family: var(--font-heading);
      font-size: 8px;
      color: #4a3a10;
      letter-spacing: .06em;
    }

    @media (max-width: 768px) {
      #factions-wrap { grid-template-columns: 1fr; }
    }

    @media (max-width: 600px) {
      .faction-header { gap: 8px; }
      .faction-name { font-size: .9rem; }
      .faction-summary { margin-left: 0; font-size: 11px; }
      .faction-scheme-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 6px; }
      .faction-scheme-mini-name { font-size: 9px; padding: 4px 6px 5px; }
    }

    /* ── Forces & Rosters ── */
    #forces-controls {
      position: sticky;
      top: 0;
      z-index: 10;
      background: var(--bg-base);
      padding: 10px 16px;
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 10px;
      border-bottom: 1px solid var(--bg-dark);
    }


    #forces-count {
      font-size: 12px;
      color: var(--text-brown);
      margin-left: auto;
      font-family: var(--font-heading);
      letter-spacing: .04em;
    }

    .forces-grid {
      max-width: 960px;
      margin: 0 auto;
      padding: 16px;
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 16px;
    }

    .force-card {
      background: var(--bg-base);
      border: 1px solid var(--border);
      border-left: 3px solid var(--bg-mid);
      border-radius: 4px;
      overflow: hidden;
    }

    .force-card-hero {
      width: 100%;
      height: 160px;
      object-fit: cover;
      display: block;
      cursor: pointer;
      transition: opacity .15s;
    }
    .force-card-hero:hover { opacity: .88; }

    .force-card-header {
      background: #0a0906;
      border-bottom: 1px solid var(--bg-dark);
      padding: 12px 14px 10px;
    }

    .force-card-header .force-card-meta {
      margin-bottom: 0;
    }

    .force-card-body {
      padding: 10px 14px 14px;
    }

    .force-card-name {
      font-family: var(--font-heading);
      font-size: 15px;
      color: var(--gold);
      letter-spacing: .04em;
      margin-bottom: 4px;
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .force-card-name span { flex: 1; min-width: 0; }
    .force-pin-indicator { font-size: 11px; color: var(--gold); flex-shrink: 0; }
    .force-card-pinned { border-top: 2px solid #4a3810; }

    .force-card-meta {
      font-size: 11px;
      color: #7a6a4a;
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: center;
      margin-bottom: 10px;
    }

    .force-progress {
      height: 4px;
      background: var(--bg-dark);
      border-radius: 2px;
      margin-bottom: 12px;
      overflow: hidden;
    }

    .force-progress-fill {
      height: 100%;
      background: var(--gold);
      border-radius: 2px;
      transition: width .3s ease;
    }

    .force-card-notes {
      font-size: 11px;
      color: #7a6a4a;
      font-style: italic;
      margin-top: 4px;
    }

    .force-roster-link {
      display: inline-block;
      margin-top: 10px;
      padding: 4px 10px;
      font-family: var(--font-heading);
      font-size: 10px;
      letter-spacing: .08em;
      text-transform: uppercase;
      color: var(--gold);
      border: 1px solid #3a2e0f;
      border-radius: 3px;
      text-decoration: none;
      transition: border-color .15s, color .15s;
    }
    .force-roster-link:hover { border-color: var(--gold); color: #e0b840; }

    @media (max-width: 600px) {
      .forces-grid { grid-template-columns: 1fr; }
    }

    /* ── Battle Honours ── */
    .bh-force-record { font-family: var(--font-heading); font-size: 10px; letter-spacing: .06em; color: #7a6a4a; background: #1a1408; border: 1px solid #2a2010; border-radius: 3px; padding: 1px 6px; }

    .battles-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; max-width: 960px; margin: 0 auto; padding: 16px; }

    .battle-card { background: var(--bg-base); border: 1px solid var(--border); border-radius: 4px; padding: 12px 14px; border-left: 3px solid #2a2010; }
    .battle-card.bh-result-border-win  { border-left-color: #2a5a2a; }
    .battle-card.bh-result-border-loss { border-left-color: #5a2020; }
    .battle-card.bh-result-border-draw { border-left-color: #4a3a10; }

    .bh-card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
    .bh-date { font-family: var(--font-heading); font-size: 11px; color: var(--gold); letter-spacing: .04em; }

    .bh-result-badge { font-family: var(--font-heading); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; padding: 2px 7px; border-radius: 3px; font-weight: 700; }
    .bh-result-win  { background: #1a3a1a; color: #80d880; }
    .bh-result-loss { background: #3a1a1a; color: #d88080; }
    .bh-result-draw { background: #3a2a10; color: #d8a840; }

    .bh-sys-chip { font-family: var(--font-heading); font-size: 9px; letter-spacing: .06em; color: #c4b49a; padding: 2px 6px; border-radius: 2px; opacity: .85; }
    .bh-pts-chip { font-size: 10px; color: #7a6a4a; }

    .bh-matchup { font-size: 12px; color: #c4b49a; display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-bottom: 4px; }
    .bh-my-army { color: #c9a227; font-family: var(--font-heading); font-size: 11px; letter-spacing: .03em; }
    .bh-force-chip { font-size: 10px; color: #7a6a4a; background: #1a1408; border: 1px solid #2a2010; border-radius: 3px; padding: 1px 5px; }
    .bh-force-chip-link { cursor: pointer; color: #7a6030; border-color: #3a2a10; }
    .bh-force-chip-link:hover { color: var(--gold); border-color: #7a6a4a; background: #1e1608; }
    .bh-vs { color: #3a2a10; font-size: 10px; }
    .bh-opp { color: #9a8a6a; }

    .bh-mission { font-size: 11px; color: #7a6a4a; font-style: italic; margin-top: 4px; }
    .bh-notes   { font-size: 11px; color: #7a6a4a; margin-top: 4px; }

    @media (max-width: 600px) {
      .battles-grid { grid-template-columns: 1fr; }
    }

    /* gs badge for battle type */
    .gs-type-battle { background: #1a2a3a; color: #80c0e0; }

    .wishlist-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; max-width:960px; margin:0 auto; padding:16px; }
    .wishlist-card { background:var(--bg-base); border:1px solid var(--border); border-radius:4px; display:flex; overflow:hidden; }
    .wish-spine { width:22px; flex-shrink:0; display:flex; align-items:center; justify-content:center; writing-mode:vertical-rl; text-orientation:mixed; transform:rotate(180deg); font-family:var(--font-heading); font-size:8px; letter-spacing:.12em; text-transform:uppercase; font-weight:700; }
    .wishlist-card.wtype-paint .wish-spine { background:#1a4a4a; color:#a0e8e8; }
    .wishlist-card.wtype-model .wish-spine { background:#1a3a1a; color:#80d880; }
    .wishlist-card.wtype-brush .wish-spine { background:#3a1a10; color:#f09070; }
    .wishlist-card.wtype-codex .wish-spine { background:#2a1a4a; color:#b898e8; }
    .wishlist-card.wtype-wd    .wish-spine { background:#3a2a08; color:#d4a840; }
    .wish-body { flex:1; min-width:0; padding:12px 14px 10px; }
    .wl-badge-row { display:flex; align-items:center; gap:6px; flex-wrap:wrap; margin-bottom:6px; }
    .wl-card-name { font-family:'Cinzel',serif; font-size:13px; color:#c4b49a; font-weight:600; }
    .wl-card-meta { font-size:11px; color:var(--text-brown); margin-top:2px; }
    .wl-card-notes { font-size:12px; color:var(--text-brown); margin-top:3px; }
    .wl-card-url { font-size:11px; color:#6a8a6a; text-decoration:none; display:block; margin-top:2px; }
    .wl-card-url:hover { color:var(--gold); }
    .wl-card-timestamp { font-size:10px; color:var(--text-brown); margin-top:6px; text-align:right; }
    .brush-cinzel-date { font-family:'Cinzel',serif; letter-spacing:.03em; }
    .wpri-badge { font-size:10px; padding:2px 7px; border-radius:3px; font-family:var(--font-heading); letter-spacing:.04em; }
    .wpri-high   { background:rgba(239,68,68,.18);  color:#ef4444; }
    .wpri-medium { background:rgba(249,115,22,.14); color:#f97316; }
    .wpri-low    { background:rgba(80,80,80,.2);    color:#7a7a7a; }
    .wish-ordered-badge { display:inline-block; padding:2px 7px; border-radius:3px; font-size:10px; background:#3a2800; color:#f0a030; letter-spacing:.04em; font-family:var(--font-heading); margin-bottom:4px; }
    .wish-fp, .wish-pp { font-size:10px; font-family:var(--font-heading); letter-spacing:.06em; background:none; border:1px solid var(--border); color:#7a6a4a; border-radius:3px; padding:3px 10px; cursor:pointer; transition:all .15s; }
    .wish-fp.active, .wish-pp.active { background:#c9a22722; border-color:var(--gold); color:var(--gold); }
    @media (max-width:600px) { .wishlist-grid { grid-template-columns:1fr; padding:12px; } }
    body.print-wishlist > *:not(#tab-wishlist) { display:none !important; }
    body.print-wishlist #tab-wishlist { display:block !important; }

    /* ── Equivalency Search ── */
    #equiv-controls {
      position: sticky;
      top: 0;
      z-index: 10;
      background: var(--bg-base);
      border-bottom: 1px solid var(--border);
      padding: 8px 16px;
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      align-items: center;
    }



    #equiv-count {
      font-size: 12px;
      color: var(--text-brown);
      white-space: nowrap;
      font-family: var(--font-heading);
      margin-left: auto;
    }

    .equiv-legend {
      display: flex;
      align-items: center;
      gap: 16px;
      flex-wrap: wrap;
      padding: 7px 18px;
      font-size: 10px;
      color: var(--text-brown);
      font-family: var(--font-heading);
      letter-spacing: .05em;
      text-transform: uppercase;
      border-bottom: 1px solid var(--bg-dark);
      background: #0c0b08;
    }

    .equiv-legend-item {
      display: flex;
      align-items: center;
      gap: 5px;
    }

    .eq-dot {
      display: inline-block;
      width: 8px;
      height: 8px;
      border-radius: 50%;
      flex-shrink: 0;
      vertical-align: middle;
    }

    .eq-dot.owned {
      background: #3a7a3a;
      box-shadow: 0 0 4px rgba(58, 122, 58, .5);
    }

    .eq-dot.low {
      background: var(--amber);
      box-shadow: 0 0 4px rgba(201, 122, 32, .4);
    }

    .eq-dot.out {
      background: var(--red);
      box-shadow: 0 0 4px rgba(201, 64, 64, .4);
    }

    .eq-dot.wanted {
      background: #2a5a9a;
      box-shadow: 0 0 4px rgba(42, 90, 154, .4);
    }

    .eq-dot.missing {
      background: transparent;
      border: 1px solid #3a3040;
    }

    .eq-match-dot {
      display: inline-block;
      width: 6px;
      height: 6px;
      border-radius: 50%;
      flex-shrink: 0;
      vertical-align: middle;
    }

    .eq-match-near {
      background: var(--gold);
    }

    .eq-match-usable {
      background: #6a4e14;
    }

    .eq-match-avoid {
      background: #7a2020;
    }

    .tab-blurb {
      text-align: center;
      padding: 8px 24px 10px;
      font-size: 11px;
      font-style: italic;
      color: var(--text-brown);
      font-family: var(--font-body);
      border-bottom: 1px solid var(--bg-dark);
      background: #0b0a07;
      line-height: 1.6;
    }

    .equiv-explainer {
      padding: 10px 18px 9px;
      border-bottom: 1px solid var(--bg-dark);
      background: #0b0a07;
    }

    .equiv-explainer p {
      font-size: 11px;
      color: var(--text-brown);
      line-height: 1.6;
      margin: 0 0 8px;
    }

    .equiv-explainer p:last-child {
      margin-bottom: 0;
    }

    .equiv-match-legend {
      display: flex;
      align-items: center;
      gap: 14px;
      flex-wrap: wrap;
      font-size: 10px;
      color: var(--text-brown);
      font-family: var(--font-heading);
      letter-spacing: .05em;
      text-transform: uppercase;
    }

    .equiv-table-wrap {
      overflow-x: auto;
      padding: 0 16px 40px;
    }

    .equiv-table {
      width: 100%;
      border-collapse: collapse;
      background: var(--bg-base);
      margin-top: 12px;
      border-radius: 4px;
      overflow: hidden;
      box-shadow: 0 2px 16px rgba(0, 0, 0, .6), 0 0 0 1px var(--border);
      table-layout: fixed;
    }

    .equiv-table thead tr {
      background: #130f06;
    }

    .equiv-table th {
      padding: 9px 12px;
      text-align: left;
      font-size: 11px;
      font-weight: 700;
      font-family: var(--font-heading);
      text-transform: uppercase;
      letter-spacing: .08em;
      color: var(--gold);
      white-space: nowrap;
      border-bottom: 2px solid var(--border);
    }

    .equiv-table td {
      padding: 7px 12px;
      border-bottom: 1px solid var(--bg-dark);
      vertical-align: middle;
      color: var(--text-main);
      font-size: 13px;
    }

    .equiv-table tr:last-child td {
      border-bottom: none;
    }

    .equiv-table tr:hover td {
      background: rgba(255, 255, 255, .03) !important;
    }

    /* Brand column tints */
    .equiv-table th:nth-child(1),
    .equiv-table td:nth-child(1) {
      background-color: #161208;
      width: 28%;
    }

    .equiv-table th:nth-child(2),
    .equiv-table td:nth-child(2) {
      background-color: #091410;
      width: 24%;
    }

    .equiv-table th:nth-child(3),
    .equiv-table td:nth-child(3) {
      background-color: #0a1018;
      width: 24%;
    }

    .equiv-table th:nth-child(4),
    .equiv-table td:nth-child(4) {
      background-color: #100e14;
      width: 24%;
    }

    .eq-cell {
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .eq-nil {
      color: #2a2218;
      font-size: 15px;
    }

    .eq-quality-badge {
      display: inline-block;
      font-size: 9px;
      font-family: var(--font-heading);
      text-transform: uppercase;
      letter-spacing: .05em;
      padding: 2px 6px;
      border-radius: 3px;
      white-space: nowrap;
    }

    .eq-near {
      background: #061a0a;
      color: #4a8a4a;
      border: 1px solid #1a4a1a;
    }

    .eq-usable {
      background: #1a1206;
      color: #8a6a1a;
      border: 1px solid #3a2a06;
    }

    .eq-avoid {
      background: #1a0606;
      color: #8a2a2a;
      border: 1px solid #3a1010;
    }

    #equiv-empty {
      text-align: center;
      padding: 40px 20px;
      color: var(--text-brown);
      font-family: var(--font-heading);
      font-size: 13px;
      letter-spacing: .06em;
      display: none;
    }

    /* ── Notes Drawer ── */
    .notes-overlay {
      display: none;
      position: fixed;
      inset: 0;
      z-index: 250;
      background: rgba(0, 0, 0, .7);
      align-items: flex-end;
      justify-content: center;
    }

    .notes-overlay.open {
      display: flex;
    }

    .notes-sheet {
      background: #100d06;
      border: 1px solid var(--gold-dim);
      border-bottom: none;
      border-radius: 6px 6px 0 0;
      width: 100%;
      max-width: 560px;
      padding: 20px 20px 28px;
      box-shadow: 0 -4px 32px rgba(0, 0, 0, .7);
      animation: slideUp .18s ease-out;
    }

    @keyframes slideUp {
      from {
        transform: translateY(40px);
        opacity: 0;
      }

      to {
        transform: translateY(0);
        opacity: 1;
      }
    }

    .notes-sheet-header {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 14px;
      padding-bottom: 12px;
      border-bottom: 1px solid var(--border);
    }

    .notes-sheet-name {
      font-family: var(--font-heading);
      font-size: 13px;
      font-weight: 700;
      color: var(--gold);
      letter-spacing: .05em;
    }

    .notes-sheet-brand {
      font-size: 10px;
      color: var(--text-brown);
      font-family: var(--font-heading);
      letter-spacing: .06em;
      text-transform: uppercase;
      margin-top: 2px;
    }

    .notes-close {
      background: none;
      border: none;
      color: var(--text-brown);
      font-size: 20px;
      cursor: pointer;
      padding: 0;
      line-height: 1;
      flex-shrink: 0;
    }

    .notes-close:hover {
      color: var(--gold);
    }

    .notes-body {
      font-size: 14px;
      color: var(--text-main);
      line-height: 1.6;
      white-space: pre-wrap;
    }

    .notes-empty {
      font-size: 12px;
      color: var(--bg-mid);
      font-style: italic;
    }

    /* Notes icon in inventory rows */
    .notes-btn {
      background: none;
      border: none;
      cursor: pointer;
      padding: 0 0 0 5px;
      font-size: 12px;
      line-height: 1;
      vertical-align: middle;
      color: #3a2810;
      transition: color .12s;
    }

    .notes-btn.has-notes {
      color: var(--gold);
    }

    .notes-btn:hover {
      color: #e8c84a;
    }

    .star-rate-btn {
      background: none;
      border: none;
      cursor: pointer;
      padding: 0 0 0 4px;
      font-size: 12px;
      line-height: 1;
      vertical-align: middle;
      color: #3a2810;
      transition: color .12s;
    }
    .star-rate-btn.has-stars { color: var(--gold); }
    .star-rate-btn:hover { color: #e8c84a; }

    .notes-stars-row {
      display: flex;
      gap: 6px;
      margin-bottom: 14px;
    }
    .nsp-star {
      font-size: 28px;
      color: #2a1808;
      line-height: 1;
      user-select: none;
    }
    .nsp-star.on { color: var(--gold); }
    .notes-stars-label {
      font-size: 10px;
      color: #6a5830;
      font-family: var(--font-heading);
      letter-spacing: .1em;
      text-transform: uppercase;
      margin-bottom: 6px;
    }

    /* ── PWA Install Banner ── */
    #install-banner {
      display: none;
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      z-index: 300;
      background: #100d06;
      border-top: 1px solid var(--gold-dim);
      padding: 12px 16px;
      align-items: center;
      gap: 12px;
      box-shadow: 0 -4px 20px rgba(0, 0, 0, .6);
    }

    #install-banner.visible {
      display: flex;
    }

    .install-banner-text {
      flex: 1;
      font-family: var(--font-heading);
      font-size: 11px;
      letter-spacing: .06em;
      text-transform: uppercase;
      color: #8a7a4a;
    }

    .install-banner-text strong {
      color: var(--gold);
      display: block;
      margin-bottom: 2px;
    }

    #install-btn {
      font-family: var(--font-heading);
      font-size: 10px;
      font-weight: 700;
      letter-spacing: .1em;
      text-transform: uppercase;
      color: #0d0d1a;
      background: var(--gold);
      border: none;
      padding: 8px 16px;
      cursor: pointer;
      border-radius: 3px;
      white-space: nowrap;
      flex-shrink: 0;
    }

    #install-btn:hover {
      background: #e8c84a;
    }

    #install-dismiss {
      background: none;
      border: none;
      color: var(--text-brown);
      font-size: 18px;
      cursor: pointer;
      padding: 0 4px;
      line-height: 1;
      flex-shrink: 0;
    }

    #install-dismiss:hover {
      color: #8a6a2a;
    }

    .equiv-brand-pills {
      display: none;
    }


    @media (max-width: 600px) {
      .equiv-brand-pills {
        display: flex;
        gap: 5px;
        flex-wrap: wrap;
        padding: 8px 16px;
        border-bottom: 1px solid var(--bg-dark);
        background: #0b0a07;
      }

      .equiv-table th:nth-child(3),
      .equiv-table td:nth-child(3) {
        display: none;
      }

      .equiv-table th:nth-child(4),
      .equiv-table td:nth-child(4) {
        display: none;
      }

      .equiv-table th:nth-child(1),
      .equiv-table td:nth-child(1) {
        width: 50%;
      }

      .equiv-table th:nth-child(2),
      .equiv-table td:nth-child(2) {
        width: 50%;
      }

      /* Pro Acryl comparison mode */
      #tab-equiv.compare-pa .equiv-table th:nth-child(2),
      #tab-equiv.compare-pa .equiv-table td:nth-child(2) {
        display: none;
      }

      #tab-equiv.compare-pa .equiv-table th:nth-child(3),
      #tab-equiv.compare-pa .equiv-table td:nth-child(3) {
        display: table-cell;
        width: 50%;
      }

      /* Two Thin Coats comparison mode */
      #tab-equiv.compare-ttc .equiv-table th:nth-child(2),
      #tab-equiv.compare-ttc .equiv-table td:nth-child(2) {
        display: none;
      }

      #tab-equiv.compare-ttc .equiv-table th:nth-child(4),
      #tab-equiv.compare-ttc .equiv-table td:nth-child(4) {
        display: table-cell;
        width: 50%;
      }
    }

    /* ── Brush Inventory ── */
    #brush-controls {
      position: sticky;
      top: 0;
      z-index: 10;
      background: var(--bg-base);
      border-bottom: 1px solid var(--border);
      padding: 8px 16px;
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 8px;
    }


    #brush-count, #bh-count {
      font-family: var(--font-heading);
      font-size: 10px;
      letter-spacing: .08em;
      color: var(--text-brown);
      white-space: nowrap;
    }

    .brush-filter-pills {
      display: flex;
      gap: 5px;
      flex-wrap: wrap;
    }


    #brush-list {
      max-width: 960px;
      margin: 0 auto;
      column-count: 2;
      column-gap: 16px;
      padding: 16px;
    }

    .brush-card {
      background: #0e0c08;
      border: 1px solid var(--border);
      border-radius: 3px;
      break-inside: avoid;
      margin-bottom: 16px;
    }

    .brush-card-header {
      font-family: var(--font-heading);
      font-size: .8rem;
      color: var(--gold);
      letter-spacing: .1em;
      text-transform: uppercase;
      padding: 9px 14px;
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .brush-card-count {
      font-size: 10px;
      color: var(--text-brown);
      letter-spacing: .05em;
      font-weight: 400;
    }

    .brush-entry {
      padding: 0;
      background: var(--bg-base);
      border: 1px solid var(--border);
      border-left: 3px solid var(--bg-mid);
      border-radius: 3px;
      overflow: hidden;
    }

    .brush-entry-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      background: #0a0906;
      border-bottom: 1px solid #140f08;
      padding: 7px 14px;
    }

    .brush-entry-series {
      font-size: 13px;
      color: var(--text-main);
    }

    .brush-entry-right {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-shrink: 0;
    }

    .brush-entry-bottom {
      font-size: 11px;
      color: #5a4a2a;
      margin-top: 0;
      padding: 6px 14px 7px;
      display: flex;
      justify-content: space-between;
      gap: 8px;
    }

    .brush-entry-notes {
      font-size: 11px;
      color: #6a5a3a;
      font-style: italic;
      margin-top: 0;
      padding: 0 14px 7px;
    }

    .brush-cond-badge {
      display: inline-block;
      font-family: var(--font-heading);
      font-size: 9px;
      letter-spacing: .07em;
      text-transform: uppercase;
      border-radius: 2px;
      padding: 1px 6px;
    }

    .brush-cond-badge.cond-prime {
      background: #0e1a0a;
      color: #5a9a3a;
      border: 1px solid #2a5a1a;
    }

    .brush-cond-badge.cond-workhorse {
      background: #1a1006;
      color: var(--amber);
      border: 1px solid #4a3010;
    }

    .brush-cond-badge.cond-retired {
      background: #1a0808;
      color: #6a3a3a;
      border: 1px solid #3a1010;
    }

    .brush-stars {
      display: flex;
      gap: 1px;
    }

    .br-star {
      font-size: 11px;
      color: #2a1808;
      line-height: 1;
    }

    .br-star.on {
      color: var(--gold);
    }

    #brush-empty {
      padding: 32px 16px;
      font-family: var(--font-heading);
      font-size: 11px;
      letter-spacing: .06em;
      color: var(--bg-mid);
      text-align: center;
    }

    #brush-empty a {
      color: var(--text-dim);
    }

    #brush-empty a:hover {
      color: var(--gold);
    }

    @media (max-width: 600px) {
      #brush-list {
        column-count: 1;
        padding: 12px;
      }
    }

    /* ── Supplies ── */
    #supply-controls {
      position: sticky;
      top: 0;
      z-index: 10;
      background: var(--bg-base);
      border-bottom: 1px solid #1a1208;
      padding: 10px 16px;
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 12px;
    }

    #supply-count {
      font-family: var(--font-heading);
      font-size: 10px;
      letter-spacing: .06em;
      color: var(--bg-mid);
      margin-left: auto;
    }

    .supply-filter-pills {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
    }

    .supply-filter-pill {
      font-family: var(--font-heading);
      font-size: 10px;
      letter-spacing: .06em;
      padding: 4px 10px;
      border-radius: 20px;
      border: 1px solid #2a1e0a;
      background: transparent;
      color: var(--text-dim);
      cursor: pointer;
      transition: background .15s, color .15s, border-color .15s;
    }

    .supply-filter-pill:hover {
      background: #1a1208;
      color: var(--gold);
    }

    .supply-filter-pill.active {
      background: #1a1208;
      color: var(--gold);
      border-color: #6a4f10;
    }

    #supply-list {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
      padding: 16px;
      max-width: 960px;
      margin: 0 auto;
    }

    .supply-card {
      background: #100e08;
      border: 1px solid #1e1810;
      border-radius: 4px;
      padding: 12px 14px;
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .supply-card-top {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }

    .supply-card-name {
      font-family: var(--font-heading);
      font-size: .85rem;
      color: var(--gold);
      letter-spacing: .04em;
    }

    .supply-type-badge {
      font-family: var(--font-heading);
      font-size: 9px;
      letter-spacing: .07em;
      text-transform: uppercase;
      padding: 2px 7px;
      border-radius: 3px;
      background: #1a1a2a;
      color: #7a8aaa;
      white-space: nowrap;
    }

    .supply-card-meta {
      display: flex;
      gap: 10px;
      align-items: center;
      flex-wrap: wrap;
    }

    .supply-card-brand {
      font-size: 11px;
      color: var(--text-dim);
    }

    .supply-card-date {
      font-family: var(--font-heading);
      font-size: 10px;
      color: #7a6a4a;
      letter-spacing: .03em;
    }

    .supply-card-bottom {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .supply-card-notes {
      font-size: 11px;
      color: #7a6a4a;
      font-style: italic;
      line-height: 1.4;
    }

    #supply-empty {
      padding: 32px 16px;
      font-family: var(--font-heading);
      font-size: 11px;
      letter-spacing: .06em;
      color: var(--bg-mid);
      text-align: center;
    }

    .gs-type-supply { background: #1a1a2a; color: #7a8aaa; }

    @media (max-width: 600px) {
      #supply-list {
        grid-template-columns: 1fr;
        padding: 12px;
      }
    }

    /* ── Codices ── */
    #bl-controls {
      position: sticky;
      top: 0;
      z-index: 10;
      background: var(--bg-base);
      border-bottom: 1px solid #1a1820;
      padding: 10px 16px;
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 12px;
    }


    #bl-count {
      font-family: var(--font-heading);
      font-size: 10px;
      letter-spacing: .08em;
      color: var(--text-brown);
      white-space: nowrap;
    }

    #bl-list {
      max-width: 960px;
      margin: 0 auto;
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 14px;
      padding: 16px;
    }

    @media (max-width: 600px) {
      #bl-list { grid-template-columns: 1fr; }
    }

    .bl-row {
      display: flex;
      background: #0e0c08;
      border: 1px solid var(--border);
      border-radius: 3px;
      overflow: hidden;
      min-height: 100px;
    }

    .bl-type-spine {
      width: 22px;
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      writing-mode: vertical-rl;
      text-orientation: mixed;
      transform: rotate(180deg);
      font-family: var(--font-heading);
      font-size: 8px;
      letter-spacing: .12em;
      text-transform: uppercase;
      color: #0e1a1a;
      font-weight: 700;
    }

    .bl-row-codex .bl-type-spine {
      background: #1a4a4a;
      color: #a0e8e8;
    }

    .bl-row-supplement .bl-type-spine {
      background: #1a3a28;
      color: #80d8a8;
    }

    .bl-body {
      flex: 1;
      padding: 12px 14px;
      min-width: 0;
    }

    .bl-codex-faction {
      font-size: .9rem;
      font-family: var(--font-heading);
      letter-spacing: .04em;
      color: var(--gold);
      margin-bottom: 3px;
    }

    .bl-title {
      font-size: 12px;
      color: #9a8a6a;
      letter-spacing: .02em;
      line-height: 1.4;
      margin-bottom: 4px;
    }

    .bl-edition {
      font-size: 10px;
      color: #4a6a6a;
      font-family: var(--font-heading);
      letter-spacing: .04em;
      margin-bottom: 4px;
    }

    .bl-author {
      font-size: 10px;
      color: #5a4a2a;
      margin-bottom: 6px;
    }

    .bl-notes {
      font-size: 12px;
      color: #b8a88a;
      white-space: pre-wrap;
      line-height: 1.6;
      word-break: break-word;
      border-top: 1px solid #1a1208;
      margin-top: 6px;
      padding-top: 6px;
    }

    .bl-row-codex { border-left: none; }
    .bl-codex-badge { display:none; }
    .bl-series { display:none; }
    .bl-faction-tag { display:none; }
    .codex-source-badge { display:inline-block; font-size:9px; font-family:var(--font-heading); letter-spacing:.05em; background:#0e1a1a; color:#70c8c8; border:1px solid #1a3a3a; border-radius:2px; padding:2px 7px; margin-bottom:6px; }

    #bl-empty {
      padding: 32px 16px;
      font-family: var(--font-heading);
      font-size: 11px;
      letter-spacing: .06em;
      color: var(--bg-mid);
      text-align: center;
    }

    #bl-empty a {
      color: var(--text-dim);
    }

    #bl-empty a:hover {
      color: var(--gold);
    }

    @media (max-width: 600px) {
      #bl-list {
        column-count: 1;
        padding: 12px;
      }

      .bl-meta {
        width: auto;
      }
    }

    /* ── Hobby Journal ── */
    #jn-controls {
      position: sticky;
      top: 0;
      z-index: 10;
      background: var(--bg-base);
      border-bottom: 1px solid #1a1820;
      padding: 10px 16px;
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 12px;
    }


    #jn-count {
      font-family: var(--font-heading);
      font-size: 10px;
      letter-spacing: .08em;
      color: var(--text-brown);
      white-space: nowrap;
    }

    .jn-month-nav {
      display: flex;
      align-items: center;
      gap: 2px;
    }

    .jn-nav-btn {
      background: #12100a;
      border: 1px solid #4a3818;
      color: var(--gold);
      font-size: 18px;
      line-height: 1;
      padding: 1px 7px 3px;
      border-radius: 3px;
      cursor: pointer;
      transition: background .15s, color .15s, border-color .15s;
    }

    .jn-nav-btn:hover:not(:disabled) { background: #1e1810; border-color: #8a6020; color: #e8c040; }
    .jn-nav-btn:disabled { color: #3a3020; border-color: #221a0a; cursor: default; }

    .jn-month-label {
      background: #12100a;
      border: 1px solid #4a3818;
      color: var(--gold);
      font-family: var(--font-heading);
      font-size: 10px;
      letter-spacing: .1em;
      text-transform: uppercase;
      padding: 4px 12px;
      border-radius: 3px;
      cursor: pointer;
      white-space: nowrap;
      transition: background .15s, border-color .15s;
    }

    .jn-month-label:hover { background: #1e1810; border-color: #8a6020; }

    .jn-year-picker {
      max-width: 1100px;
      margin: 0 auto;
      padding: 10px 16px;
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      border-bottom: 1px solid var(--border);
      background: #0a0906;
    }

    .jn-year-picker.hidden { display: none; }

    .jn-year-btn {
      background: #12100a;
      border: 1px solid var(--border);
      color: var(--text-brown);
      font-family: var(--font-heading);
      font-size: 11px;
      letter-spacing: .08em;
      padding: 5px 16px;
      border-radius: 3px;
      cursor: pointer;
      transition: background .15s, color .15s, border-color .15s;
    }

    .jn-year-btn:hover, .jn-year-btn.active { background: #1a1408; color: var(--gold); border-color: #5a4010; }

    #jn-list {
      max-width: 1100px;
      margin: 0 auto;
      padding: 16px;
      column-count: 2;
      column-gap: 16px;
    }

    .jn-card {
      background: var(--bg-base);
      border: 1px solid var(--border);
      border-left: 3px solid var(--bg-mid);
      border-radius: 3px;
      padding: 0;
      overflow: hidden;
      break-inside: avoid;
      margin-bottom: 16px;
    }

    .jn-card-header {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
      background: #0a0906;
      border-bottom: 1px solid var(--bg-dark);
      padding: 12px 16px 10px;
      margin-bottom: 0;
    }

    .jn-date {
      font-family: var(--font-heading);
      font-size: 11px;
      color: var(--gold);
      letter-spacing: .07em;
    }

    .jn-mood {
      font-family: var(--font-heading);
      font-size: 9px;
      font-weight: 700;
      letter-spacing: .1em;
      text-transform: uppercase;
      padding: 2px 7px;
      border-radius: 2px;
    }

    .jn-mood-great { background: #1c3a1c; color: #7ad678; }
    .jn-mood-good  { background: #1c2a1a; color: #a0c878; }
    .jn-mood-okay  { background: #3a2d10; color: #e8b060; }
    .jn-mood-rough { background: #3a1c1c; color: #e88080; }

    .jn-title {
      font-size: 12px;
      color: #a89868;
      font-style: italic;
    }

    .jn-body {
      padding: 12px 16px 14px;
      font-size: 13px;
      color: #b8a88a;
      white-space: pre-wrap;
      line-height: 1.75;
      word-break: break-word;
    }
    .jn-mention { display:inline-block; padding:1px 7px; border-radius:3px; font-size:11px; font-family:var(--font-heading); letter-spacing:.04em; cursor:pointer; text-decoration:none; vertical-align:baseline; line-height:1.6; }
    .jn-mention:hover { filter:brightness(1.25); }
    .jn-mention-scheme { background:#1e3a50; color:#80c0e8; border:1px solid #2a5070; }
    .jn-mention-recipe { background:#2e1a4a; color:#b090e0; border:1px solid #4a2a6a; }
    .jn-mention-wd     { background:#3a2a08; color:#e8c040; border:1px solid #5a4010; }
    .jn-mention-bench  { background:#1a3a28; color:#80d0a0; border:1px solid #2a5a38; }

    #jn-empty {
      padding: 32px 16px;
      font-family: var(--font-heading);
      font-size: 11px;
      letter-spacing: .06em;
      color: var(--bg-mid);
      text-align: center;
    }

    @media (max-width: 600px) {
      #jn-list { column-count: 1; padding: 12px; }
    }

    #jn-empty a { color: var(--text-dim); }
    #jn-empty a:hover { color: var(--gold); }

  #back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    background: #1a1208;
    border: 1px solid #6a4f10;
    color: #c9a227;
    font-family: 'Cinzel', serif;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    line-height: 1;
    box-shadow: 0 4px 16px rgba(0,0,0,.6), 0 0 0 1px rgba(201,162,39,.12);
    transition: background .15s, border-color .15s, transform .15s;
  }
  #back-to-top:hover {
    background: #2a1e0a;
    border-color: #c9a227;
    transform: translateY(-2px);
  }

  /* ── Sidebar layout ── */
  body.has-sidebar {
    display: flex;
    min-height: 100vh;
  }

  .sidebar {
    width: 210px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    background: #0a0906;
    border-right: 1px solid #1a1408;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: width .25s ease;
  }

  .sidebar::-webkit-scrollbar { width: 4px; }
  .sidebar::-webkit-scrollbar-track { background: #0a0906; }
  .sidebar::-webkit-scrollbar-thumb { background: #2a1e0a; border-radius: 2px; }

  .main-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }

  .main-content footer {
    margin-top: auto;
  }

  .sidebar-header {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 18px 14px 14px;
    border-bottom: 1px solid #1a1408;
    flex-shrink: 0;
    position: relative;
  }

  .nav-fade {
    position: sticky;
    bottom: 0;
    height: 56px;
    margin-top: -56px;
    background: linear-gradient(to bottom, transparent, #0a0906);
    pointer-events: none;
    flex-shrink: 0;
    transition: opacity .3s ease;
  }
  .nav-fade.hidden { opacity: 0; }

  .sidebar-collapse-btn {
    display: none;
    background: none;
    border: none;
    color: #2a1e0a;
    font-size: 22px;
    cursor: pointer;
    padding: 2px 6px;
    line-height: 1;
    position: absolute;
    top: 10px;
    right: 6px;
    transition: color .12s;
  }
  .sidebar-collapse-btn:hover { color: #6a5a30; }

  @media (min-width: 769px) {
    .sidebar-collapse-btn { display: block; }
    body.sidebar-collapsed .sidebar { width: 0; min-width: 0; overflow: hidden; border: none; }
    body.sidebar-collapsed #sidebar-toggle { display: flex; }
  }

  .sidebar-logo {
    width: 144px;
    height: auto;
    filter: drop-shadow(0 0 10px rgba(201,162,39,.6));
  }

  .sidebar-wordmark {
    font-family: var(--font-heading);
    font-size: .72rem;
    font-weight: 900;
    color: var(--gold);
    letter-spacing: .08em;
    line-height: 1.3;
    text-transform: uppercase;
  }

  .sidebar-nav {
    flex: 1;
    padding: 6px 0;
    overflow-y: auto;
    scrollbar-width: none;
  }
  .sidebar-nav::-webkit-scrollbar { display: none; }

  .sidebar-home {
    padding: 2px 0 8px;
    border-bottom: 1px solid #1a1408;
    margin-bottom: 4px;
  }

  .sidebar-home a {
    display: block;
    font-family: var(--font-heading);
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #7a6030;
    text-decoration: none;
    padding: 8px 14px;
    transition: color .15s;
  }

  .sidebar-home a:hover { color: var(--gold); }

  .sidebar-home a.active {
    color: var(--gold);
    border-left: 2px solid var(--gold);
    padding-left: 12px;
    background: rgba(201,162,39,.05);
  }

  .sidebar-group { margin-bottom: 2px; }

  .sg-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    background: rgba(255,255,255,.025);
    border: none;
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #7a6a4a;
    transition: color .15s;
  }

  .sg-header:hover { color: #7a6030; }

  .sg-arrow {
    font-size: 7px;
    transition: transform .2s ease;
    flex-shrink: 0;
  }

  .sidebar-group.collapsed .sg-arrow { transform: rotate(-90deg); }

  .sg-items {
    list-style: none;
    padding: 0;
    overflow: hidden;
    max-height: 400px;
    transition: max-height .2s ease, opacity .15s ease;
    opacity: 1;
  }

  .sidebar-group.collapsed .sg-items {
    max-height: 0;
    opacity: 0;
  }

  .sg-item a {
    display: block;
    font-family: var(--font-heading);
    font-size: .74rem;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: #5a4828;
    text-decoration: none;
    padding: 6px 14px 6px 28px;
    transition: color .15s, background .15s;
  }

  .sg-item a:hover {
    color: #8a7040;
    background: rgba(201,162,39,.04);
  }

  .sg-item a.active {
    color: var(--gold);
    border-left: 2px solid var(--gold);
    padding-left: 26px;
    background: rgba(201,162,39,.06);
  }

  .sidebar-footer {
    padding: 10px 14px 14px;
    border-top: 1px solid #1a1408;
    flex-shrink: 0;
  }

  .sidebar-disclaimer {
    font-size: .52rem;
    color: #2a2010;
    letter-spacing: .04em;
    line-height: 1.6;
  }

  #sidebar-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 210;
    width: 40px;
    height: 40px;
    background: #1a1208;
    border: 1px solid #6a4f10;
    color: var(--gold);
    font-size: 20px;
    cursor: pointer;
    border-radius: 4px;
    align-items: center;
    justify-content: center;
    line-height: 1;
  }

  #sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 190;
  }

  #sidebar-backdrop.visible { display: block; }

  @media (max-width: 768px) {
    .sidebar {
      position: fixed;
      top: 0;
      left: 0;
      height: 100vh;
      width: 230px;
      transform: translateX(-100%);
      transition: transform .25s ease;
      z-index: 200;
    }

    .sidebar.open { transform: translateX(0); }

    #sidebar-toggle { display: flex; }

    .main-content {
      padding-top: 52px;
      width: 100%;
    }
  }

/* ── COMMISSAR TAB ─────────────────────────────────────────── */
.ci-wrap { max-width: 1100px; margin: 0 auto; }

.ci-hero { position: relative; overflow: hidden; background: linear-gradient(135deg,#0a0805 0%,#1a1006 55%,#0d0c09 100%); border-bottom: 2px solid #3a2010; padding: 36px 24px 28px; min-height: 180px; display: flex; align-items: flex-end; }
.ci-hero-text { position: relative; z-index: 2; }
.ci-hero-eyebrow { font-family: var(--font-heading); font-size: .58rem; letter-spacing: .22em; color: #4a3010; text-transform: uppercase; }
.ci-hero-title { font-family: var(--font-heading); font-size: 1.6rem; color: #c9a227; letter-spacing: .06em; text-transform: uppercase; text-shadow: 0 0 24px rgba(201,162,39,.22); margin: 6px 0 4px; }
.ci-hero-sub { font-size: .68rem; color: #5a4828; font-style: italic; }
.ci-hero-portrait { position: absolute; right: 0; top: 0; bottom: 0; width: 240px; overflow: hidden; pointer-events: none; }
.ci-hero-portrait img { height: 100%; width: auto; min-width: 100%; object-fit: cover; object-position: top center; filter: grayscale(15%) contrast(1.08); -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,.9) 20%, transparent 100%); mask-image: linear-gradient(to left, rgba(0,0,0,.9) 20%, transparent 100%); }

.ci-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; padding: 14px; }
.ci-full { grid-column: 1 / -1; }
.ci-card { background: #0e0c08; border: 1px solid #2a1e08; border-top: 3px solid #4a3010; padding: 14px 16px; }
.ci-alert { border-top-color: #8a2020; }
.ci-card-hd { font-family: var(--font-heading); font-size: .58rem; letter-spacing: .2em; color: #6a5020; text-transform: uppercase; border-bottom: 1px solid #2a1e08; padding-bottom: 6px; margin-bottom: 10px; }
.ci-alert .ci-card-hd { color: #8a3020; }
.ci-big { font-family: var(--font-heading); font-size: 2rem; color: #c9a227; line-height: 1.1; }
.ci-label { font-size: .68rem; color: #7a6a3a; margin-top: 2px; }
.ci-sub { font-size: .7rem; color: #6a5828; margin-top: 6px; }
.ci-warn { color: #8a2020; }

.ci-orders { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.ci-order { display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: rgba(255,255,255,.02); border-left: 2px solid #3a2810; }
.ci-order-rank { font-family: var(--font-heading); font-size: .9rem; color: #4a3a18; min-width: 18px; }
.ci-order-name { font-family: var(--font-heading); font-size: .75rem; color: #c4b49a; flex: 1; }
.ci-badge-type { font-size: .58rem; padding: 2px 7px; border-radius: 2px; text-transform: uppercase; letter-spacing: .08em; flex-shrink: 0; }
.ci-type-bench { background: #1a2a1a; color: #6a9a6a; }
.ci-type-planned { background: #1a1a2a; color: #6a6a9a; }
.ci-order-reasons { display: flex; gap: 4px; flex-wrap: wrap; }
.ci-reason { font-size: .6rem; background: #1a1508; color: #7a6a3a; padding: 2px 6px; border-radius: 2px; }

.ci-dow-chart { display: flex; gap: 3px; align-items: flex-end; height: 52px; margin: 8px 0 4px; }
.ci-dow-bar-wrap { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; flex: 1; gap: 2px; }
.ci-dow-bar { width: 100%; background: #2a1e08; border-radius: 2px 2px 0 0; }
.ci-dow-bar.best { background: #c9a227; }
.ci-dow-lbl { font-size: .5rem; color: #4a3a18; text-transform: uppercase; flex-shrink: 0; }

.ci-stage-dist { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.ci-stage-pip { font-size: .58rem; padding: 2px 7px; border-radius: 2px; background: #1a1508; color: #4a3a18; }
.ci-stage-pip.has-models { color: #c4b49a; }

.ci-force-row { margin-bottom: 10px; }
.ci-force-name { font-family: var(--font-heading); font-size: .72rem; color: #c4b49a; }
.ci-force-bar-wrap { background: #1a1508; height: 4px; border-radius: 2px; margin: 4px 0 3px; }
.ci-force-bar-fill { height: 100%; background: #c9a227; border-radius: 2px; }
.ci-force-meta { font-size: .62rem; color: #6a5828; }

.ci-wld { display: flex; gap: 20px; margin: 4px 0 8px; }
.ci-wld-w { font-family: var(--font-heading); font-size: 1.6rem; color: #4a8a4a; line-height: 1.1; }
.ci-wld-l { font-family: var(--font-heading); font-size: 1.6rem; color: #8a2020; line-height: 1.1; }
.ci-wld-d { font-family: var(--font-heading); font-size: 1.6rem; color: #5a5a5a; line-height: 1.1; }

.ci-risk-item { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid #1a1408; font-size: .7rem; color: #c4b49a; }
.ci-risk-item:last-child { border-bottom: none; }
.ci-risk-uses { color: #5a4828; font-size: .62rem; }
.ci-risk-low { color: #c98020; font-size: .6rem; font-weight: 700; }
.ci-risk-out { color: #8a2020; font-size: .6rem; font-weight: 700; }

.ci-divider { font-family: var(--font-heading); font-size: .58rem; letter-spacing: .22em; color: #4a3010; text-transform: uppercase; text-align: center; padding: 16px 14px 10px; border-top: 1px solid #2a1e08; margin: 4px 14px 0; }

.ci-legacy { padding: 0 14px 32px; }
.ci-legacy-stat-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.ci-legacy-stat { background: #0e0c08; border: 1px solid #2a1e08; padding: 10px 16px; min-width: 90px; }
.ci-legacy-stat-num { font-family: var(--font-heading); font-size: 1.3rem; color: #c9a227; }
.ci-legacy-stat-lbl { font-size: .6rem; color: #5a4828; text-transform: uppercase; letter-spacing: .08em; margin-top: 2px; }

@media (max-width: 600px) {
  .ci-grid { grid-template-columns: 1fr; padding: 10px; }
  .ci-hero-portrait { display: none; }
  .ci-hero-title { font-size: 1.2rem; }
  .ci-hero { padding: 24px 16px 20px; min-height: 140px; }
}

/* ── WC News Headlines ──────────────────────────── */
.wc-news-section { border-top: 2px solid #3a2a08; padding: 18px 0 20px; }
.wc-news-heading { font-family: var(--font-heading); font-size: .72rem; letter-spacing: .18em; color: #c9a227; text-transform: uppercase; text-align: center; margin-bottom: 4px; text-shadow: 0 0 18px rgba(201,162,39,.2); }
.wc-news-sub { font-size: .58rem; color: #4a3a18; text-align: center; letter-spacing: .08em; margin-bottom: 14px; font-style: italic; }
.wc-news-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.wc-news-card { display: flex; flex-direction: column; background: #0e0c08; border: 1px solid #2a1e08; border-top: 2px solid #3a2a08; text-decoration: none; position: relative; transition: border-color .15s; }
.wc-news-card:hover { border-color: #c9a227; }
.wc-news-card.wc-ork { border-top-color: #3a6a20; }
.wc-news-card.wc-ork:hover { border-color: #6aaa30; }
.wc-news-thumb { width: 100%; aspect-ratio: 4/3; background-size: cover; background-position: center; background-color: #1a1508; flex-shrink: 0; }
.wc-news-thumb-empty { background-image: repeating-linear-gradient(45deg, #1a1508 0, #1a1508 4px, #0e0c08 4px, #0e0c08 8px); }
.wc-ork-badge { position: absolute; top: 5px; right: 5px; font-family: var(--font-heading); font-size: .48rem; letter-spacing: .1em; background: #2a5a10; color: #8adf30; padding: 2px 5px; border-radius: 2px; text-transform: uppercase; }
.wc-news-title { font-family: var(--font-heading); font-size: .62rem; color: #c4b49a; line-height: 1.4; padding: 7px 8px 9px; flex: 1; }
.wc-news-card:hover .wc-news-title { color: #c9a227; }
.wc-news-card.wc-ork .wc-news-title { color: #b0d4a0; }
.wc-news-card.wc-ork:hover .wc-news-title { color: #8adf30; }
@media (max-width: 700px) { .wc-news-grid { grid-template-columns: repeat(2, 1fr); } }

/* ── Sidebar Tip Jar ──────────────────────────── */
.sidebar-tipjar { display: block; padding: 10px 12px 6px; }
.sidebar-tipjar img { display: block; width: 100%; height: auto; }

/* ── Restock List ──────────────────────────── */
.inv-restock-btn { padding: 4px 10px; border: 1px solid var(--border); border-radius: 4px; font-size: 11px; background: var(--bg-input); cursor: pointer; color: var(--text-dim); font-family: var(--font-heading); letter-spacing: .06em; }
.inv-restock-btn:hover { border-color: #8a6a1a; color: var(--gold); }
.restock-trigger { background: none; border: none; color: #c97a20; font: inherit; font-size: inherit; cursor: pointer; padding: 0; text-decoration: underline dotted; }
.restock-trigger:hover { color: #c9a227; }
.restock-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.75); z-index: 290; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .15s; }
.restock-overlay.open { opacity: 1; pointer-events: all; }
.shop-wanted { color: #4a8ab8; border-color: #1a3a5a; }
