/* Reference containment and density. No hidden levels, numeric changes or private-page selectors. */
body.site-ui :is(#gear-detail,#hero-detail,#beast-detail,#trooper-detail,#formation-detail,#technology-detail,#detail){box-sizing:border-box;max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);overflow-x:hidden;scroll-padding-top:calc(var(--tv340-dialog-head,80px) + 12px)}
body.site-ui :is(.cr-reference,.or-reference,.fc-reference,.pr339-reference,.ar-full-reference,.weekly-full-reference,.fn-main,.htd-main,#detail-body,#gear-detail-body,#hero-detail-body,#beast-detail-body,#trooper-detail-body,#formation-detail-body){min-width:0;max-width:100%;box-sizing:border-box}
body.site-ui .tv340-table-help{font-size:12px;line-height:1.5;color:#b7d0db;margin:8px 0}
body.site-ui .tv340-scroll{position:relative;min-width:0!important;max-width:100%!important;width:100%;box-sizing:border-box;overflow:auto!important;overscroll-behavior:contain;scrollbar-gutter:stable;scroll-padding:48px 12px 12px;border:1px solid #476372;border-radius:8px}
body.site-ui .tv340-scroll:focus-visible{outline:2px solid #a3dacb;outline-offset:3px}
body.site-ui .tv340-scroll.tv340-long{max-height:min(62dvh,620px)!important}
body.site-ui .tv340-scroll table{margin:0!important;box-sizing:border-box}
body.site-ui .tv340-scroll caption{padding:12px!important}
body.site-ui .tv340-scroll thead th{position:sticky!important;top:0!important;z-index:3;background:#25404f!important;color:#e2eee9}
body.site-ui table.tv340-numeric{display:table!important;min-width:calc(var(--tv340-cols,3)*52px)!important;width:100%!important;max-width:none!important;border-collapse:separate!important;border-spacing:0!important;table-layout:fixed!important;font-size:13px!important;line-height:1.45!important}
body.site-ui table.tv340-numeric caption{display:table-caption!important;text-align:start}
body.site-ui table.tv340-numeric thead{display:table-header-group!important;position:static!important;width:auto!important;height:auto!important;overflow:visible!important;clip-path:none!important;white-space:normal!important}
body.site-ui table.tv340-numeric tbody{display:table-row-group!important;width:auto!important}
body.site-ui table.tv340-numeric tr{display:table-row!important;background:#18303d!important}
body.site-ui table.tv340-numeric tr:nth-child(even){background:#213c49!important}
body.site-ui table.tv340-numeric :is(th,td){display:table-cell!important;width:auto!important;min-width:0!important;max-width:none!important;padding:8px 7px!important;border:0!important;border-bottom:1px solid #405c6a!important;vertical-align:top!important;white-space:normal!important;overflow-wrap:anywhere!important;font-size:13px!important}
body.site-ui table.tv340-numeric td::before{display:none!important;content:none!important}
body.site-ui table.tv340-numeric tbody th:first-child{position:sticky!important;left:0!important;z-index:2;background:#254550!important;color:#d9eee6}
body.site-ui table.tv340-numeric thead th:first-child{left:0!important;z-index:4}
body.site-ui table.tv340-numeric :is(input,select){max-width:100%;min-width:0}
body.site-ui .tv340-scroll .ar-reference-value{min-width:0}
body.site-ui.site-refresh #detail .weekly-full-reference .item-main{flex:1 1 90px}
body.site-ui.site-refresh #gear-detail .upgrade-step.cr-reference{border:0;border-top:1px solid #486170;border-radius:0;padding:9px 0 0;margin:8px 0 0;background:transparent}
body.site-ui.site-refresh #gear-detail .upgrade-step.cr-reference>h3{font-size:13px;margin:0 0 5px}
body.site-ui.site-refresh #gear-detail .upgrade-step.cr-reference p{margin:5px 0;line-height:1.5}
body.site-ui.site-refresh #gear-detail .earlier-levels .upgrade-row.unavailable{margin:6px 0;padding:10px}
body.site-ui .fc-stats li{min-width:0;grid-template-columns:minmax(0,1fr) minmax(0,auto)}
body.site-ui .fc-stats strong,body.site-ui .fc-costs strong{white-space:normal;overflow-wrap:anywhere;max-width:100%}
@media(max-width:650px){
 body.site-ui .tv340-scroll .cr-table:not(.tv340-numeric) tbody tr{margin-bottom:8px;padding:4px}
 body.site-ui .tv340-scroll .cr-table:not(.tv340-numeric) :is(th,td){padding:7px}
 body.site-ui table.tv340-numeric :is(th,td){padding:7px 5px!important;font-size:12px!important}
 body.site-ui .cr-reference{padding:10px}
 body.site-ui.site-refresh #gear-detail .upgrade-row{gap:8px;padding-block:10px}
}
body.site-ui table.tv340-numeric tbody :is(td,td>strong,td>span){white-space:nowrap!important;overflow-wrap:normal!important;font-variant-numeric:tabular-nums}
@media(max-width:650px){body.site-ui table.tv340-numeric tbody :is(td,th){padding-inline:3px!important}}
body.site-ui :is(#gear-detail,#hero-detail,#beast-detail,#trooper-detail,#formation-detail) :is(.detail-tabs,.hero-section-tabs){position:sticky;top:var(--tv340-dialog-head,80px);z-index:5;background:#1b3342;padding-block:8px;border-bottom:1px solid #526d7a;max-width:100%;min-width:0;box-sizing:border-box}
/* Let complete numeric values determine column width; containment handles a narrow screen. */
body.site-ui table.tv340-numeric{table-layout:auto!important}
body.site-ui #gear-detail .tv340-gear{display:table!important;table-layout:fixed!important;min-width:720px;width:100%;border-collapse:separate;border-spacing:0;font-size:13px}
body.site-ui #gear-detail .tv340-gear thead{display:table-header-group!important;position:static!important;width:auto!important;height:auto!important;clip-path:none!important;overflow:visible!important}
body.site-ui #gear-detail .tv340-gear tbody{display:table-row-group!important}
body.site-ui #gear-detail .tv340-gear tr{display:table-row!important}
body.site-ui #gear-detail .tv340-gear :is(th,td){display:table-cell!important;padding:10px!important;border:0!important;border-bottom:1px solid #48616e!important;vertical-align:top;text-align:start;overflow-wrap:anywhere;background:#19323f!important}
body.site-ui #gear-detail .tv340-gear td::before{content:none!important;display:none!important}
body.site-ui #gear-detail .tv340-gear th:nth-child(1){width:54px;position:sticky;left:0;z-index:2;background:#264b47!important}
body.site-ui #gear-detail .tv340-gear thead th:first-child{z-index:4}
body.site-ui #gear-detail .tv340-gear th:nth-child(2),body.site-ui #gear-detail .tv340-gear th:nth-child(4){width:250px}
body.site-ui #gear-detail .tv340-gear th:nth-child(3){width:110px}
body.site-ui #gear-detail .tv340-gear :is(.upgrade-level,.upgrade-cost,.upgrade-bonuses){display:block;min-width:0;max-width:100%;padding:0;border:0}
body.site-ui #gear-detail .tv340-gear .upgrade-step.cr-reference{margin:0;padding:0;border:0}
body.site-ui #gear-detail .tv340-gear .upgrade-step>h3{display:none}
body.site-ui #gear-detail .tv340-gear .cost-chips{gap:7px}
body.site-ui #gear-detail .tv340-gear .cost-chip{font-size:12px;min-width:0}
body.site-ui #gear-detail .tv340-gear tr.current :is(th,td){background:#2b4c47!important}

body.site-ui.site-refresh #gear-detail .dp-all-levels.cr-reference{padding:12px!important}
/* Keep star attributes aligned; the final column retains the full ability text. */
body.site-ui[data-page="heroes"] .hero-panel.cr-reference .tv340-scroll table{display:table!important;table-layout:fixed!important;min-width:650px!important;width:100%!important;border-collapse:separate!important;border-spacing:0;font-size:13px}
body.site-ui[data-page="heroes"] .hero-panel.cr-reference .tv340-scroll thead{display:table-header-group!important;position:static!important;width:auto!important;height:auto!important;clip-path:none!important;overflow:visible!important}
body.site-ui[data-page="heroes"] .hero-panel.cr-reference .tv340-scroll tbody{display:table-row-group!important}
body.site-ui[data-page="heroes"] .hero-panel.cr-reference .tv340-scroll tr{display:table-row!important}
body.site-ui[data-page="heroes"] .hero-panel.cr-reference .tv340-scroll :is(th,td){display:table-cell!important;vertical-align:top!important;padding:8px!important;border-bottom:1px solid #48616e;overflow-wrap:normal!important;background:#19323f!important}
body.site-ui[data-page="heroes"] .hero-panel.cr-reference .tv340-scroll th:not(:last-child){width:54px}
body.site-ui[data-page="heroes"] .hero-panel.cr-reference .tv340-scroll td:not(:last-child){white-space:nowrap!important;font-variant-numeric:tabular-nums}
body.site-ui[data-page="heroes"] .hero-panel.cr-reference .tv340-scroll th:first-child{position:sticky!important;left:0;z-index:2;background:#264b47!important}
body.site-ui[data-page="heroes"] .hero-panel.cr-reference .tv340-scroll thead th:first-child{z-index:4}
body.site-ui[data-page="heroes"] .hero-panel.cr-reference .tv340-scroll td::before{display:none!important;content:none!important}
/* Mixed-text comparisons keep one row per tier; full explanations stay in their cells. */
body.site-ui .tv340-scroll table:not(.tv340-numeric,.tv340-gear,.fc-table):has(thead th:nth-child(4)):not(.hero-panel table){display:table!important;table-layout:fixed!important;min-width:820px!important;width:100%!important;border-collapse:separate!important;border-spacing:0}
body.site-ui .tv340-scroll table:not(.tv340-numeric,.tv340-gear,.fc-table):has(thead th:nth-child(4)) :is(thead,tbody){display:table-row-group!important;position:static!important;height:auto!important;width:auto!important;clip-path:none!important;overflow:visible!important}
body.site-ui .tv340-scroll table:not(.tv340-numeric,.tv340-gear,.fc-table):has(thead th:nth-child(4)) tr{display:table-row!important}
body.site-ui .tv340-scroll table:not(.tv340-numeric,.tv340-gear,.fc-table):has(thead th:nth-child(4)) :is(th,td){display:table-cell!important;vertical-align:top!important;padding:10px!important;font-size:13px!important;border-bottom:1px solid #48616e;background:#19323f!important;overflow-wrap:anywhere!important}
body.site-ui .tv340-scroll table:not(.tv340-numeric,.tv340-gear,.fc-table):has(thead th:nth-child(4)) th:first-child{width:72px;position:sticky!important;left:0;z-index:2;background:#264b47!important}
body.site-ui .tv340-scroll table:not(.tv340-numeric,.tv340-gear,.fc-table):has(thead th:nth-child(4)) thead th:first-child{z-index:4}
body.site-ui .tv340-scroll table:not(.tv340-numeric,.tv340-gear,.fc-table):has(thead th:nth-child(4)) td::before{display:none!important;content:none!important}

body.site-ui .tv340-scroll thead th{z-index:3!important}
body.site-ui .tv340-scroll thead th:first-child{z-index:4!important}
body.site-ui .tv340-scroll tr{overflow:visible!important}
body.site-ui .tv340-scroll table:not(.tv340-numeric,.tv340-gear,.fc-table):has(thead th:nth-child(4)) th:first-child{width:86px!important}
body.site-ui .tv340-scroll .or-table tbody th .trooper-art{display:block;margin:8px 0}
body.site-ui .tv340-scroll .or-table tbody th .htd-item-link{display:block;width:fit-content;padding:8px 0;min-height:24px;line-height:1.5}
/* A single rectangular link target remains tappable when its label wraps. */
body.site-ui .tv340-scroll a{display:inline-flex;align-items:center;gap:4px;max-width:100%;min-height:32px}
body.site-ui.site-refresh #detail .weekly-full-reference .tv340-scroll table{min-width:820px!important;max-width:none!important}
body.site-ui.site-refresh #detail .weekly-full-reference .tv340-scroll th:first-child{width:70px!important}
body.site-ui.site-refresh #detail .weekly-full-reference .tv340-scroll th:nth-child(2){width:100px!important}
body.site-ui.site-refresh #detail .weekly-full-reference .tv340-scroll th:nth-child(3),body.site-ui.site-refresh #detail .weekly-full-reference .tv340-scroll th:nth-child(4){width:auto!important}
body.site-ui #technology-detail .planner-level-details.pr339-reference .tech-costs .tv340-scroll tr>:is(th,td){width:auto!important;max-width:none!important}
body.site-ui #technology-detail .planner-level-details.pr339-reference .tech-costs .tv340-scroll thead th{position:sticky!important;top:0!important;left:auto!important;z-index:3!important;white-space:normal!important}
body.site-ui #technology-detail .planner-level-details.pr339-reference .tech-costs .tv340-scroll tr>th:first-child{width:86px!important;position:sticky!important;left:0!important;background:#264b47!important}
body.site-ui #technology-detail .planner-level-details.pr339-reference .tech-costs .tv340-scroll thead th:first-child{z-index:4!important}
body.site-ui #technology-detail .tv340-scroll thead{display:table-header-group!important;white-space:normal!important}
