/* Unit archive layout. Detail dialogs keep their existing presentation. */
body.units-view { background: #0b0e12; color: #f0f1f3; }
.units-view > .header { height: 76px; min-height: 76px; padding: 0 max(24px,calc((100vw - 1360px)/2)); gap: 24px; background: #0d1116f5; border-bottom: 1px solid #ffffff20; box-shadow: none; }
.units-view > .header .brand img.project-g-logo { width: 190px; height: 62px; filter: none; }
.units-view > .header nav { margin-left: auto; gap: 0; height: 100%; }
.units-view > .header nav a { display: flex; align-items: center; padding: 0 16px; color: #d1d5da; font-size: 14px; border: 0; border-radius: 0; }
.units-view > .header nav a.catalog-active { background: linear-gradient(0deg,#e7476220,transparent); color: #fff; box-shadow: inset 0 -3px #e74762; }
.units-view > .header .nav-actions { gap: 12px; margin: 0; }
.units-view > .header .language { border: 0; background: none; padding: 8px 2px; font-size: 12px; }
.units-view > .header .button.small { padding: 8px 12px; font-size: 12px; background: #ffffff08; border-color: #ffffff28; color: #d4dbe3; }
.catalog-nav-toggle { display: none; }
.units-view .unit-database.section { width: min(1360px,calc(100% - 64px)); max-width: 1360px; padding: 24px 0 40px; margin: 0 auto; }
.catalog-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.catalog-heading .eyebrow { display: flex; align-items: center; gap: 10px; color: #d3d7dc; font-size: 12px; font-weight: 600; letter-spacing: .06em; }
.catalog-heading .eyebrow::before { content: ''; width: 15px; height: 8px; background: #e74762; transform: skew(-30deg); }
.units-view .catalog-heading h1 { margin: 3px 0 0; color: #f4f5f7; font-size: 42px; font-weight: 750; line-height: 1.25; letter-spacing: -.03em; text-shadow: none; }
.catalog-count { margin: 0 0 6px; color: #b8bfc8; font-size: 16px; white-space: nowrap; }
.catalog-count strong { color: #d9dee4; font-weight: 600; font-variant-numeric: tabular-nums; }
.catalog-count-divider { margin: 0 10px; color: #6d7783; }
.catalog-search { display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 14px; border: 1px solid #6b747d; border-radius: 6px; background: linear-gradient(#20262d,#191f26); color: #c1cad5; }
.catalog-search:focus-within { border-color: #e74762; box-shadow: 0 0 0 2px #e7476218; }
.catalog-search svg { flex: 0 0 20px; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.units-view .catalog-search input { box-sizing: border-box; width: 100%; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; box-shadow: none; background: transparent; color: #f0f2f5; font: inherit; font-size: 15px; }
.catalog-search input::placeholder { color: #a7b0bc; opacity: 1; }
.units-view .hangar-browser { margin-top: 14px; padding: 0; border: 0; background: none; box-shadow: none; }
.units-view .hangar-tabs { display: flex; justify-content: flex-start; gap: 18px; padding: 0; margin: 0 0 20px; border: 0; border-bottom: 1px solid #ffffff26; background: none; border-radius: 0; }
.units-view .hangar-tabs button { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 9px 16px; margin-bottom: -1px; border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: none; box-shadow: none; color: #b4bdc9; font-size: 15px; font-weight: 600; }
.units-view .hangar-tabs button[aria-pressed='true'] { color: #ef566f; border-bottom-color: #e74762; background: none; box-shadow: none; }
.units-view .hangar-tabs button b { padding: 0; background: none; color: #798695; font-size: 10px; font-weight: 400; }
.catalog-shell { display: grid; grid-template-columns: 224px minmax(0,1fr); gap: 24px; align-items: start; }
.catalog-sidebar { position: sticky; top: 92px; box-sizing: border-box; max-height: calc(100dvh - 112px); overflow-y: auto; padding: 16px; border: 1px solid #ffffff18; border-radius: 7px; background: linear-gradient(130deg,#1a2026,#14191f); scrollbar-width: thin; scrollbar-color: #43505c transparent; }
.catalog-sidebar > h2 { margin: 0 0 14px; padding-bottom: 12px; border-bottom: 1px solid #ffffff20; font-size: 18px; color: #f0f1f4; }
.catalog-sidebar fieldset { min-width: 0; margin: 0 0 14px; padding: 0 0 15px; border: 0; border-bottom: 1px solid #ffffff20; }
.catalog-sidebar legend { padding: 0 0 10px; color: #d7dce3; font-size: 13px; font-weight: 600; }
.catalog-ranks { display: flex; flex-wrap: wrap; gap: 5px; }
.catalog-ranks button { min-width: 37px; min-height: 31px; padding: 5px 9px; border: 1px solid #505861; border-radius: 5px; background: linear-gradient(#282e35,#1b2027); color: #d1d7de; font: inherit; font-size: 12px; cursor: pointer; }
.catalog-ranks button[aria-pressed='true'] { border-color: #e74762; background: linear-gradient(#b5374b,#742235); color: #fff; }
.catalog-types { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
.catalog-types button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-height: 62px; padding: 6px 2px; border: 1px solid #505861; border-radius: 5px; background: #22282f; color: #c4ccd6; font: inherit; font-size: 11px; cursor: pointer; }
.catalog-types button[aria-pressed='true'] { border-color: #e74762; color: #ff90a2; background: #e7476214; }
.catalog-types svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.catalog-mobile-select { display: none; }
.catalog-series-list { display: grid; gap: 2px; max-height: 260px; overflow-y: auto; padding-right: 3px; scrollbar-width: thin; scrollbar-color: #44515f transparent; }
.catalog-series-list button { position: relative; min-height: 30px; padding: 5px 0 5px 24px; border: 0; background: none; color: #b9c3ce; text-align: left; font: inherit; font-size: 12px; line-height: 1.5; cursor: pointer; }
.catalog-series-list button::before { content: ''; position: absolute; left: 1px; top: 9px; width: 12px; height: 12px; border: 1px solid #83909c; border-radius: 50%; }
.catalog-series-list button[aria-pressed='true'] { color: #fff; }
.catalog-series-list button[aria-pressed='true']::before { border-color: #ef5671; background: #fff; box-shadow: inset 0 0 0 3px #e74762; }
.catalog-reset { width: 100%; padding: 4px 0; border: 0; background: none; color: #ef5c73; text-align: left; font: inherit; font-size: 12px; cursor: pointer; }
.catalog-reset::before { content: '↺'; margin-right: 7px; font-size: 17px; vertical-align: -1px; }
.catalog-results { min-width: 0; }
.catalog-results-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 30px; margin-bottom: 12px; color: #b5bfcb; font-size: 12px; scroll-margin-top: 92px; }
.catalog-sort { display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.catalog-sort select { box-sizing: border-box; max-width: 180px; padding: 6px 25px 6px 9px; border: 1px solid #59616b; border-radius: 5px; background: #1b2128; color: #dce1e7; font: inherit; font-size: 12px; }
.units-view .unit-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; }
.units-view .unit-card { display: flex; flex-direction: column; min-width: 0; padding: 0; overflow: hidden; border: 1px solid #41484f; border-radius: 7px; background: #181d23; color: #f0f2f5; text-align: left; box-shadow: 0 4px 12px #0002; animation: none; opacity: 1; transition: border-color .16s,box-shadow .16s; }
.units-view .unit-card::before,.units-view .unit-card::after { display: none; }
.units-view .unit-card:hover { border-color: #ed526c; box-shadow: 0 0 0 1px #ed526c,0 8px 16px #0003; transform: none; }
.units-view .unit-card:focus-visible { outline: 2px solid #f08093; outline-offset: 3px; }
.units-view .unit-art { position: relative; flex: none; width: 100%; height: auto; min-height: 0; aspect-ratio: 1.24; overflow: hidden; margin: 0; padding: 0; background: radial-gradient(ellipse at 50% 65%,#27313a77,transparent 65%),linear-gradient(0deg,#3c4145 0,#242a2e 12%,#11161b 35%,#11161b 100%); border: 0; border-bottom: 1px solid #ffffff12; }
.units-view .unit-art::before { content: ''; position: absolute; inset: 77% 0 0; background: repeating-linear-gradient(0deg,transparent 0 19px,#ffffff0a 20px 21px); transform: perspective(70px) rotateX(15deg); }
.units-view .unit-art::after { display: none; }
.units-view .unit-card .unit-art > .unit-portrait { position: absolute; z-index: 1; left: 50%; top: auto; bottom: 2px; width: calc(100% - 8px); height: calc(100% - 16px); max-width: none; padding: 0; margin: 0; transform: translateX(-50%); object-fit: contain; object-position: center; border: 0; border-radius: 0; filter: brightness(1.08); mix-blend-mode: screen; clip-path: inset(2px); }
.units-view .unit-card .unit-art > .unit-portrait.is-model-card { width: 100%; height: 100%; bottom: 0; filter: none; mix-blend-mode: normal; clip-path: none; }
.units-view .unit-card .unit-art .rank-badge { position: absolute; z-index: 2; left: 8px; top: 8px; min-width: 30px; width: auto; height: 24px; padding: 2px 7px; border: 1px solid #a78d5a; border-radius: 3px; background: #322a1b; box-shadow: none; font-size: 13px; font-weight: 700; line-height: 19px; }
.units-view .unit-card .unit-art .rank-badge.has-rank-art { width: 72px; height: 24px; min-width: 0; padding: 0; border: 0; background: none; border-radius: 0; color: transparent; font-size: 0; line-height: 0; }
.units-view .unit-card .unit-art .rank-badge .unit-rank-art { position: static; display: block; width: 72px; height: 24px; max-width: none; margin: 0; padding: 0; border: 0; object-fit: contain; filter: none; transform: none; mix-blend-mode: normal; clip-path: none; }
.units-view .unit-card .unit-type { display: none; }
.units-view .unit-copy { display: flex; flex: 1; flex-direction: column; padding: 10px 11px 0; min-height: 0; background: linear-gradient(135deg,#1e242a,#171c22); }
.units-view .unit-copy h3 { min-height: 2.5em; margin: 0 0 5px; color: #f1f3f6; font-size: 14px; font-weight: 700; line-height: 1.25; letter-spacing: -.015em; text-transform: uppercase; overflow-wrap: anywhere; }
.units-view .unit-series-label { display: block; overflow: hidden; margin: auto 0 0; padding: 0 0 7px; color: #aeb9c5; font-size: 11px; font-weight: 400; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; text-transform: none; letter-spacing: 0; }
.units-view .unit-features { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin: 0; padding: 7px 0; border-top: 1px solid #ffffff20; color: #c6d0db; font-size: 11px; line-height: 1.4; }
.units-view .unit-features > span { display: inline; padding: 0; border: 0; background: none; color: inherit; font-size: inherit; line-height: inherit; }
.units-view .mode-count::before { content: '▱'; margin-right: 5px; color: #a8b8c7; font-size: 15px; vertical-align: -1px; }
.units-view .unit-features .unit-card-id { margin-left: auto; color: #748493; font-size: 9px; }
.units-view .unit-filter-match { margin: 0; padding: 0 0 7px; font-size: 10px; color: #d7bc85; }
.units-view .global-pagination { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 22px 0 0; padding: 0; border: 0; background: none; }
.catalog-page-buttons { display: flex; align-items: center; gap: 6px; }
.units-view .global-pagination button { display: grid; place-items: center; min-width: 31px; height: 32px; margin: 0; padding: 4px 8px; border: 1px solid #414b56; border-radius: 5px; background: #1a2027; color: #c8d2de; font: inherit; font-size: 12px; cursor: pointer; }
.units-view .global-pagination button[aria-current='page'] { background: linear-gradient(#b83a50,#7d293c); border-color: #ed526c; color: #fff; }
.units-view .global-pagination button:disabled { opacity: .35; cursor: default; }
.catalog-page-gap { padding: 0 2px; color: #8c9aa8; }
.units-view #unit-view,.units-view #series-view { margin-top: 18px; }
.units-view .series-grid { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 18px; }
.units-view .series-card { background: #161d24; border-color: #39444f; border-radius: 7px; }
.units-view .series-art { background: radial-gradient(ellipse,#24303c,#12171d); }
.units-view .series-hangar-ring,.units-view .series-open { display: none; }
.units-view .series-copy { background: #191f26; }
.units-view .series-era { color: #d77c8c; }
.units-view .series-enter { color: #ee6a81; }
.units-view > footer { margin-top: 12px; padding: 24px max(24px,calc((100vw - 1360px)/2)); border-top: 1px solid #ffffff16; background: #0d1116; }
.units-view > footer .project-g-footer-logo { width: 120px; height: 40px; object-fit: contain; }
@media(max-width:1200px) and (min-width:761px) {
  .units-view > .header { flex-wrap: nowrap; padding-inline: 24px; height: 72px; min-height: 72px; gap: 16px; }
  .units-view > .header .brand img.project-g-logo { width: 150px; }
  .units-view > .header nav { order: 0; width: auto; justify-content: flex-end; padding: 0; gap: 0; }
  .units-view > .header nav a { padding-inline: 10px; font-size: 12px; }
  .units-view > .header .nav-actions { margin-left: 0; }
  .catalog-shell { grid-template-columns: 200px minmax(0,1fr); gap: 18px; }
  .catalog-sidebar { padding: 13px; }
  .units-view .unit-grid { gap: 12px; }
  .units-view .unit-copy h3 { font-size: 12px; }
}
@media(min-width:761px) and (max-width:980px) {
  .units-view .unit-database.section { width: calc(100% - 40px); }
  .units-view > .header .nav-actions .button.small { display: none; }
  .catalog-shell { grid-template-columns: 180px minmax(0,1fr); gap: 16px; }
  .units-view .unit-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .catalog-heading h1 { font-size: 36px; }
  .catalog-count { font-size: 13px; }
}
@media(max-width:760px) {
  .units-view > .header { position: relative; flex-wrap: wrap; height: auto; min-height: 62px; padding: 5px 16px; gap: 0; }
  .units-view > .header .brand img.project-g-logo { width: 155px; height: 48px; }
  .catalog-nav-toggle { display: flex; flex-direction: column; justify-content: center; gap: 5px; width: 38px; height: 38px; margin-left: auto; padding: 8px; border: 1px solid #ffffff20; border-radius: 4px; background: #191f26; color: #d6dee8; }
  .catalog-nav-toggle span { width: 100%; height: 2px; background: currentColor; }
  .units-view > .header nav { display: none; order: 3; width: 100%; height: auto; margin: 0; padding: 8px 0; overflow: visible; }
  .units-view > .header nav a { display: block; padding: 12px; font-size: 14px; }
  .units-view > .header .nav-actions { display: none; order: 4; width: 100%; justify-content: space-between; padding: 4px 12px 12px; }
  .units-view > .header.catalog-menu-open nav { display: grid; }
  .units-view > .header.catalog-menu-open .nav-actions { display: flex; }
  .units-view .unit-database.section { width: calc(100% - 32px); padding-top: 20px; }
  .catalog-heading { gap: 12px; margin-bottom: 16px; }
  .catalog-heading .eyebrow { gap: 8px; font-size: 10px; }
  .units-view .catalog-heading h1 { margin-top: 4px; font-size: 32px; }
  .catalog-count { margin-bottom: 5px; font-size: 12px; }
  .catalog-count strong { font-size: 16px; }
  .catalog-count-divider,.catalog-count-divider ~ strong,.catalog-count-divider ~ span { display: none; }
  .catalog-search { height: 43px; gap: 9px; padding-inline: 12px; }
  .units-view .catalog-search input { font-size: 13px; }
  .units-view .hangar-browser { margin-top: 9px; }
  .units-view .hangar-tabs { gap: 10px; margin-bottom: 15px; }
  .units-view .hangar-tabs button { gap: 5px; min-height: 40px; padding: 8px 10px; font-size: 13px; }
  .units-view .hangar-tabs button b { display: none; }
  .catalog-shell { display: block; }
  .catalog-sidebar { position: static; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; max-height: none; overflow: visible; margin: 0 0 12px; padding: 0; border: 0; background: none; border-radius: 0; }
  .catalog-sidebar > h2,.catalog-sidebar legend { display: none; }
  .catalog-sidebar fieldset { margin: 0; padding: 0; border: 0; }
  .catalog-rank-field { grid-column: 1 / -1; order: 1; }
  .catalog-series-field { order: 2; }
  .catalog-type-field { order: 3; }
  .catalog-ranks { display: grid; grid-template-columns: 1.5fr repeat(6,minmax(0,1fr)); gap: 4px; }
  .catalog-ranks button { min-width: 0; min-height: 32px; padding: 5px 1px; font-size: 12px; }
  .catalog-types,.catalog-series-list { display: none; }
  .catalog-mobile-select { display: block; }
  .catalog-mobile-select select { box-sizing: border-box; width: 100%; min-width: 0; height: 36px; padding: 6px 26px 6px 8px; border: 1px solid #616b75; border-radius: 4px; background: #20262d; color: #d8dfe7; font: inherit; font-size: 12px; text-overflow: ellipsis; }
  .catalog-reset { grid-column: 1 / -1; order: 4; width: auto; justify-self: end; padding: 0; font-size: 11px; }
  .catalog-sidebar:not(.has-filters) .catalog-reset { display: none; }
  .catalog-results-toolbar { min-height: 30px; gap: 8px; margin-bottom: 9px; font-size: 11px; }
  .catalog-sort { gap: 4px; }
  .catalog-sort > span { display: none; }
  .catalog-sort select { max-width: 126px; padding: 4px 20px 4px 6px; font-size: 11px; border-color: #ffffff20; background: #151b22; }
  .units-view .unit-grid,.units-view .series-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .units-view .unit-art { aspect-ratio: 1.15; }
  .units-view .unit-copy { padding: 9px 9px 0; }
  .units-view .unit-copy h3 { min-height: 2.5em; font-size: 13px; line-height: 1.25; margin-bottom: 5px; }
  .units-view .unit-series-label { padding-bottom: 6px; font-size: 10px; }
  .units-view .unit-features { padding-block: 6px; gap: 4px; font-size: 10px; }
  .units-view .unit-features .unit-card-id { display: none; }
  .units-view .unit-card .unit-art .rank-badge { left: 6px; top: 6px; }
  .units-view .unit-card .unit-art .rank-badge.has-rank-art,.units-view .unit-card .unit-art .rank-badge .unit-rank-art { width: 64px; height: 22px; }
  .units-view .global-pagination { gap: 5px; margin-top: 18px; }
  .catalog-page-buttons { gap: 4px; }
  .units-view .global-pagination button { min-width: 27px; height: 29px; padding: 3px 5px; font-size: 11px; }
  .units-view .global-pagination #global-prev,.units-view .global-pagination #global-next { width: 28px; min-width: 28px; padding: 3px; font-size: 0; }
  #global-prev::before { content: '‹'; font-size: 20px; }
  #global-next::before { content: '›'; font-size: 20px; }
  .catalog-page-gap { font-size: 12px; }
  .units-view > footer { padding: 18px 16px; font-size: 12px; }
}
@media(max-width:360px) {
  .units-view .unit-database.section { width: calc(100% - 24px); }
  .units-view .unit-grid,.units-view .series-grid { gap: 9px; }
  .units-view .unit-copy h3 { font-size: 12px; }
  .units-view .unit-copy { padding-inline: 7px; }
  .catalog-ranks button { font-size: 11px; }
  .catalog-count { font-size: 11px; }
  .catalog-page-buttons { gap: 3px; }
  .units-view .global-pagination button { min-width: 25px; padding-inline: 3px; }
}
@media(prefers-reduced-motion:reduce) { .units-view .unit-card { transition: none; } }

/* Custom entries retain the same card layout and native rank badge. */
.units-view .unit-custom-tag{position:absolute;right:8px;bottom:8px;padding:3px 6px;border:1px solid #d15268;border-radius:3px;background:#28141bd9;color:#ffb7c4;font-size:10px;line-height:1.4}
@media(max-width:400px){.units-view .hangar-tabs button{padding-left:9px;padding-right:9px;font-size:12px}}
