/* Collection and upgrade screens: readable text, bounded scrolling, clear actions. */
.unit-picker-pages { flex-wrap: wrap; margin: 12px 0; }
.unit-picker-pages nav { display: flex; gap: 8px; flex-wrap: wrap; }
.unit-picker-pages button:disabled { opacity: .45; cursor: default; }
.collection-retry { min-height: 44px; padding: 10px 18px; border: 1px solid #526a79; border-radius: 8px; background: #192d39; color: #e6f5fc; }
.hud-exact-balance { color: #c2d7e4; font: 400 14px/1.5 var(--sans); margin: 12px 0 18px; }
.hud-exact-balance strong { display: block; min-width: 0; color: #ecf8ff; font: 600 22px/1.4 var(--mono); overflow-wrap: anywhere; }
#screen-farm .stats-grid-2x2 { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
#screen-farm .stat-box-prime { min-width: 0; min-height: 68px; cursor: pointer; }
#screen-farm .stat-box-prime .label { font-size: 10px; line-height: 1.3; letter-spacing: 0; overflow-wrap: anywhere; }
#screen-farm .stat-box-prime .value { display: block; font-size: clamp(16px, 4.5vw, 22px); line-height: 1.25; white-space: normal; overflow: visible; overflow-wrap: anywhere; letter-spacing: -.3px; }
#nexus-modal .trade-ticket .tt-value, #nexus-modal .trade-ticket .tt-route-fee-value { min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
#nexus-modal .trade-ticket .tt-metric { min-width: 0; }
#screen-profile button.p-vault-tab-item { border: 0; background: transparent; color: inherit; font-family: inherit; min-height: 44px; }
#screen-profile .vault-card-unit .vc-info-main { min-width: 0; }
#screen-profile .vault-card-unit .vc-name-apex, #screen-profile .vc-stat-badge { overflow-wrap: anywhere; }
#screen-farm .stat-box-prime:focus-visible, .unit-picker-pages button:focus-visible, .collection-retry:focus-visible { outline: 2px solid #9ceeff; outline-offset: 3px; }
#screen-farm .bot-card-nexus:not(.terminal-active) { height: auto; min-height: 384px; align-items: stretch; }
#screen-farm .bot-card-nexus:not(.terminal-active) .bot-card-main { min-width: 0; grid-template-columns: minmax(0,1fr); grid-template-rows: auto auto auto auto; }
#screen-farm .bot-card-nexus:not(.terminal-active) .fleet-unit-img { position: absolute; inset: 0; }
#screen-farm .bot-card-nexus .fleet-card-meta-row { flex-wrap: wrap; }
#screen-farm .bot-card-nexus .fleet-work-status { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
#screen-farm .bot-card-nexus .unit-name-label { line-height: 1.2; }
#nexus-modal .trade-ticket .tt-profit-row { grid-template-columns: minmax(0,1fr); gap: 6px; }
#nexus-modal .trade-ticket .tt-profit { white-space: normal; overflow-wrap: anywhere; }
#nexus-modal .trade-ticket .tt-market-pill strong { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
@media (max-width: 380px) {
    #screen-farm .bot-card-nexus:not(.terminal-active) .unit-name-label { font-size: 16px; }
    #nexus-modal .trade-ticket .tt-command-strip { grid-template-columns: minmax(0,1fr); }
}
#nexus-modal .modal-content:has(.forge-modal-wrapper),
#nexus-modal .modal-content:has(.polish-synthesis) {
    width: min(960px, calc(100vw - 20px)); max-width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px); padding: 10px; overflow: hidden;
    border: 1px solid #243943; background: #071015; box-shadow: 0 22px 70px #000b;
}
#nexus-modal .modal-content:has(.forge-modal-wrapper) .m-close,
#nexus-modal .modal-content:has(.polish-synthesis) .m-close {
    top: 12px; right: 12px; width: 40px; height: 40px; font-size: 18px;
    border: 1px solid #49606e; border-radius: 50%; color: #e8f6fa; background: #10202b;
    box-shadow: none; z-index: 30;
}
#nexus-modal .forge-shell { height: min(740px, calc(100dvh - 44px)); padding: 12px; gap: 12px; }
#nexus-modal .forge-work-panel { min-height: 0; overflow-y: auto; padding: 14px; gap: 12px; scrollbar-width: thin; }
#nexus-modal .forge-phase-title { font-size: 22px; line-height: 1.2; font-weight: 700; margin: 4px 0 6px; }
#nexus-modal .forge-phase-copy { font-size: 13px; line-height: 1.45; font-weight: 400; color: #b9cbd5; }
#nexus-modal .forge-phase-kicker, .polish-kicker { font: 500 10px/1.4 var(--mono); color: #5ce6e3; letter-spacing: .1em; }
#nexus-modal .forge-unit-name { border: 0; background: none; color: #f2f7fa; text-align: left; padding: 0; cursor: pointer; font-weight: 700; line-height: 1.25; }
#nexus-modal .forge-info-btn { display: none; }
#nexus-modal .forge-chip { font: 400 11px/1.3 var(--sans); letter-spacing: 0; }
#nexus-modal .forge-chip strong { font-weight: 600; }
#nexus-modal .forge-mini-stat { font: 400 11px/1.35 var(--sans); }
#nexus-modal .forge-mini-stat b { font: 600 12px/1.4 var(--mono); }
#nexus-modal .forge-module-deck { gap: 9px; }
#nexus-modal .forge-module-choice { border-radius: 10px; }
#nexus-modal .forge-module-main { padding: 11px; gap: 10px; }
#nexus-modal .forge-module-label { font: 600 15px/1.2 var(--sans); }
#nexus-modal .forge-module-level { font: 500 11px/1.3 var(--mono); color: #b6cad5; }
#nexus-modal .forge-module-purpose { font: 400 12px/1.4 var(--sans); color: #bdcbd4; white-space: normal; display: block; -webkit-line-clamp: unset; }
#nexus-modal .forge-module-values { font: 600 14px/1.4 var(--mono); margin-top: 4px; }
#nexus-modal .forge-module-values strong, #nexus-modal .forge-module-values b { font: 600 13px/1.4 var(--mono); }
#nexus-modal .forge-module-progress { display: flex; gap: 2px; }
#nexus-modal .forge-module-progress i { flex: 1; min-width: 0; height: 3px; box-shadow: none; }
#nexus-modal .forge-action-zone { min-width: 54px; min-height: 54px; background: #122a31; color: var(--module-tone); }
#nexus-modal .forge-action-zone.ready { background: color-mix(in srgb, var(--module-tone) 16%, #10191d); }
#nexus-modal .forge-action-zone .forge-action-label { font: 600 11px/1.3 var(--sans); }
#nexus-modal .forge-action-arrow { border: 0; font: 400 25px/1 var(--sans); }
#nexus-modal .forge-module-glyph { width: 32px; height: 36px; }
#nexus-modal .forge-module-title { font-size: 16px; font-weight: 600; }
#nexus-modal .forge-value-card small, #nexus-modal .forge-prob-chip small { font: 400 11px/1.3 var(--sans); color: #c1d0d9; text-transform: none; letter-spacing: 0; }
#nexus-modal .forge-value-card b { font-size: 22px; font-weight: 700; }
#nexus-modal .forge-prob-chip b { font: 600 16px/1.4 var(--mono); }
#nexus-modal .forge-prob-chip { padding: 7px; }
#nexus-modal .forge-luck-head { font: 400 12px/1.45 var(--sans); flex-wrap: wrap; gap: 6px; color: #c4d3dd; }
#nexus-modal .forge-mini-btn, #nexus-modal .reactor-v1-mini { min-height: 40px; font: 600 12px/1.3 var(--sans); }
#nexus-modal .forge-sticky-action { position: sticky; bottom: -14px; background: #0b151c; padding: 12px 0 max(10px, env(safe-area-inset-bottom)); margin-top: auto; z-index: 5; }
#nexus-modal .forge-btn { min-height: 46px; font: 600 12px/1.3 var(--sans); letter-spacing: 0; text-transform: none; }
#nexus-modal .forge-btn.primary { color: #06211c; background: #5ce6cc; box-shadow: none; border-color: #79f2db; }
#nexus-modal .forge-btn:disabled { opacity: .45; cursor: not-allowed; }
.forge-resource-table { border: 1px solid #2b3a42; border-radius: 10px; padding: 10px 12px; background: #0d171e; }
.forge-resource-heading, .forge-resource-line, .polish-resource-row, .polish-action-meta { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.forge-resource-heading { font: 400 11px/1.4 var(--sans); color: #aac0cb; margin-bottom: 5px; }
.forge-resource-line { font: 500 13px/1.7 var(--mono); }
.forge-resource-line strong { font-weight: 600; color: #eff6f9; }
.forge-resource-line strong span { font: 400 12px/1.4 var(--sans); color: #bdccd5; }
.forge-action-notice { color: #ffe09b; border: 1px solid #655535; border-radius: 10px; padding: 10px; font: 400 13px/1.5 var(--sans); }
.forge-action-notice button { width: 100%; margin-top: 8px; }
.polish-shortfall { color: #ff9b9b !important; font: 500 12px/1.4 var(--sans); margin: 6px 0; }
#nexus-modal .polish-synthesis .reactor-v1-layout { display: grid; height: min(760px, calc(100dvh - 68px)); min-height: 0; gap: 16px; grid-template-columns: minmax(200px,.65fr) minmax(340px,1fr); grid-template-rows: minmax(0,1fr); }
#nexus-modal .polish-synthesis { padding: 12px; border: 0; max-height: none; background: radial-gradient(ellipse at 0 0, #15364588, transparent 60%), #081219; }
#nexus-modal .polish-synthesis .reactor-v1-console { padding: 0; min-height: 0; display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
#nexus-modal .polish-synthesis .reactor-v1-visual { min-height: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: center; align-items: center; border: 1px solid #24434c; border-radius: 12px; background: radial-gradient(circle, #14627133, #081219 70%); }
#nexus-modal .polish-synthesis .reactor-v1-object { position: relative; min-height: 220px; display: grid; place-items: center; width: 100%; }
#nexus-modal .polish-synthesis .reactor-v1-footer p { font: 400 14px/1.6 var(--sans); color: #b7cbd5; }
.polish-synthesis-heading { padding: 0 42px 0 0; flex-shrink: 0; }
.polish-synthesis-heading h2 { font: 700 22px/1.25 var(--sans); color: #ecf5f8; margin: 5px 0 6px; }
.polish-synthesis-heading p { font: 400 13px/1.45 var(--sans); color: #bacdd8; margin: 0; }
.polish-synthesis-body { display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow-y: auto; flex: 1; scrollbar-width: thin; padding: 0 2px; }
#nexus-modal .polish-synthesis .synthesis-v1-slots { flex: 0 0 auto; gap: 6px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
#nexus-modal .polish-synthesis .synthesis-v1-slot { min-height: 58px; padding: 4px; }
#nexus-modal .polish-synthesis .synthesis-v1-slot-thumb { width: 36px; height: 42px; }
#nexus-modal .polish-synthesis .synthesis-v1-slot-meta { font: 500 10px/1.3 var(--sans); }
#nexus-modal .polish-synthesis .synthesis-v1-units { min-height: 100px; max-height: none; overflow-y: auto; flex: 1 1 auto; gap: 6px; }
#nexus-modal .polish-synthesis .synthesis-v1-unit { min-height: 64px; padding: 8px; gap: 9px; grid-template-columns: 42px minmax(0,1fr) auto; box-shadow: none; }
#nexus-modal .polish-synthesis .synthesis-v1-thumb { width: 42px; height: 46px; }
#nexus-modal .polish-synthesis .synthesis-v1-unit-name { font: 600 13px/1.35 var(--sans); color: #f2f6f8; }
#nexus-modal .polish-synthesis .synthesis-v1-unit-meta { font: 400 11px/1.4 var(--sans); color: #c0cfd9; }
#nexus-modal .polish-synthesis .synthesis-v1-badge { font: 500 10px/1.3 var(--sans); max-width: 65px; text-align: center; white-space: normal; grid-column: 3; grid-row: 1; position: static; }
#nexus-modal .polish-synthesis .reactor-v1-action { flex-shrink: 0; position: static; padding: 10px 0 max(2px, env(safe-area-inset-bottom)); border: 0; border-top: 1px solid #2e424f; background: #081219; box-shadow: none; }
#nexus-modal .polish-synthesis .synthesis-v1-actions { grid-template-columns: .7fr 1.3fr; gap: 8px; margin-top: 8px; }
#nexus-modal .polish-synthesis .reactor-v1-execute { min-height: 46px; padding: 10px; font: 600 13px/1.3 var(--sans); letter-spacing: 0; color: #051e24; background: #6ee1ef; border: 1px solid #8ce7f2; border-radius: 10px; box-shadow: none; text-transform: none; }
#nexus-modal .polish-synthesis .reactor-v1-execute.secondary { color: #d8e8ed; background: #13252e; border-color: #3c515c; }
#nexus-modal .polish-synthesis .reactor-v1-execute:disabled { opacity: .4; cursor: not-allowed; }
.polish-action-meta { color: #c1d6df; font: 400 12px/1.4 var(--sans); }
.polish-action-meta strong { font: 600 13px/1.4 var(--mono); color: #f4e4a9; }
.polish-recipe { padding: 12px; background: #101f29; border: 1px solid #304552; border-radius: 12px; }
.polish-recipe-head { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.polish-recipe-head small { font: 400 11px/1.4 var(--sans); color: #b7cbd5; }
.polish-recipe-head h3 { margin: 4px 0 0; font: 600 15px/1.35 var(--sans); color: #e8f6fb; }
.polish-chance { text-align: right; flex-shrink: 0; }
.polish-chance b { display: block; font: 700 24px/1.15 var(--sans); color: #74ebce; }
.polish-chance span { font: 400 10px/1.4 var(--sans); color: #b9d1d9; }
.polish-materials { display: grid; gap: 5px; margin-bottom: 12px; }
.polish-material { display: grid; grid-template-columns: 30px minmax(0,1fr) auto; align-items: center; gap: 8px; }
.polish-material img { width: 30px; height: 32px; object-fit: contain; border-radius: 4px; }
.polish-material span { font: 500 12px/1.35 var(--sans); color: #e5f0f4; }
.polish-material small { color: #b2c5ce; font: 500 10px/1.4 var(--mono); }
.polish-resource-row { font: 400 12px/1.6 var(--sans); color: #d9e6ec; }
.polish-resource-row strong { font: 600 14px/1.6 var(--mono); color: #f7e6ab; }
.polish-resource-row.muted { color: #b2c6d1; }
.polish-consequence { font: 400 12px/1.45 var(--sans); color: #e0c995; margin: 9px 0 0; }
#nexus-modal .polish-synthesis .reactor-v1-luck { padding: 10px 12px; border: 1px solid #3c453d; border-radius: 10px; background: #171e19; }
#nexus-modal .polish-synthesis .reactor-v1-luck-meta { font: 400 11px/1.45 var(--sans); color: #d4dfd2; display: flex; flex-wrap: wrap; gap: 4px; }
.unit-picker { flex-shrink: 0; display: grid; gap: 8px; padding: 2px 0; }
.unit-picker-search > span { display: none; }
.unit-picker-search input, .unit-picker-options select { width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid #415663; border-radius: 9px; background: #101d27; color: #ebf4f8; font: 400 14px/1.4 var(--sans); }
.unit-picker-search input::placeholder { color: #aac1ce; opacity: 1; }
.unit-picker-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.unit-picker-options select { min-width: 0; font-size: 12px; }
.unit-picker-toggle { min-height: 44px; display: flex; gap: 7px; align-items: center; color: #c4d8e2; font: 400 12px/1.35 var(--sans); }
.unit-picker-toggle input { width: 18px; height: 18px; accent-color: #6ee1ef; flex-shrink: 0; }
.unit-picker-footer { display: flex; gap: 8px; justify-content: space-between; align-items: center; flex-shrink: 0; color: #b2c9d6; font: 400 12px/1.4 var(--sans); }
.unit-picker-footer button { min-height: 44px; border: 1px solid #425965; border-radius: 8px; padding: 8px 14px; color: #e6f5fc; background: #192d39; font: 500 13px/1.4 var(--sans); }
.unit-picker-empty { font: 400 14px/1.5 var(--sans); color: #c9dce6; padding: 18px 0; }
.forge-work-panel, .polish-synthesis-body, .synthesis-v1-units { overscroll-behavior: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
.forge-luck-slider, .reactor-v1-slider { touch-action: pan-x; }
#screen-profile .vc-name-apex { font: 600 16px/1.35 var(--sans); }
#screen-profile .vc-meta-apex { font: 400 11px/1.45 var(--sans); letter-spacing: .02em; }
#screen-profile .vc-stat-badge { font: 400 11px/1.4 var(--sans); color: #c6d4de; }
#screen-profile .vault-card-unit { border-radius: 12px; }
#screen-profile .vault-card-unit:hover { transform: none; }
#screen-profile .btn-deploy-apex { min-height: 44px; font: 600 12px/1.3 var(--sans); }
.unit-picker :focus-visible, #nexus-modal .forge-modal-wrapper :focus-visible, #nexus-modal .polish-synthesis :focus-visible { outline: 2px solid #9ceeff; outline-offset: 3px; }
@media (max-width: 760px) {
    #nexus-modal .forge-shell { grid-template-columns: 1fr; grid-template-rows: auto minmax(0,1fr); padding: 8px; gap: 8px; }
    #nexus-modal .forge-shell.mobile-compact .forge-unit-panel { padding: 10px 42px 10px 10px; grid-template-columns: 48px minmax(0,1fr); gap: 7px 10px; }
    #nexus-modal .forge-shell.mobile-compact .forge-art-stage { min-height: 64px; }
    #nexus-modal .forge-shell.mobile-compact .forge-unit-img { width: 48px; height: 64px; max-height: 64px; filter: none; }
    #nexus-modal .forge-shell.mobile-compact .forge-unit-name { font-size: 17px; line-height: 1.2; white-space: normal; overflow-wrap: anywhere; }
    #nexus-modal .forge-shell.mobile-compact .forge-chip { font-size: 10px; padding: 2px 4px; }
    #nexus-modal .forge-shell.mobile-compact .forge-chip:nth-child(2) { display: none; }
    #nexus-modal .forge-shell.mobile-compact .forge-stat-stack { margin-right: -32px; }
    #nexus-modal .forge-work-panel { padding: 11px; gap: 10px; }
    #nexus-modal .forge-phase-copy { font-size: 12px; }
    #nexus-modal .forge-sticky-action { bottom: -11px; }
    #nexus-modal .polish-synthesis { padding: 8px; }
    #nexus-modal .polish-synthesis .reactor-v1-layout { display: block; height: calc(100dvh - 60px); }
    #nexus-modal .polish-synthesis .reactor-v1-visual { display: none; }
    #nexus-modal .polish-synthesis .reactor-v1-console { height: 100%; }
    .polish-synthesis-heading h2 { font-size: 20px; }
    .polish-synthesis-heading p { font-size: 12px; }
}
@media (max-width: 380px) {
    #nexus-modal .forge-module-purpose { font-size: 11px; }
    #nexus-modal .forge-module-main { padding: 8px; gap: 6px; }
    #nexus-modal .forge-module-glyph { display: none; }
    .polish-materials { gap: 4px; }
    .polish-material img { height: 28px; }
}
@media (prefers-reduced-motion: reduce) {
    #nexus-modal .polish-synthesis *, #nexus-modal .forge-modal-wrapper * { animation: none !important; transition: none !important; }
}
@media (max-height: 520px) {
    #nexus-modal .polish-synthesis .reactor-v1-layout { display: block; height: calc(100dvh - 64px); }
    #nexus-modal .polish-synthesis .reactor-v1-visual { display: none; }
    #nexus-modal .polish-synthesis .reactor-v1-console { height: 100%; }
    .polish-synthesis-heading p, .polish-kicker { display: none; }
    #nexus-modal .forge-shell { display: block; }
    #nexus-modal .forge-unit-panel { display: none; }
    #nexus-modal .forge-work-panel { height: 100%; }
}
