/* Opt-in historical TB presentation. Live TB and other pages are unchanged. */
.historic-tb-pilot [hidden] { display:none!important; }
.historic-tb-pilot .page-shell { padding:24px var(--site-gutter) 48px; }
.historic-tb-pilot .page-heading { margin-bottom:20px; }
.historic-tb-pilot h1 { font-size:clamp(26px,3vw,34px); margin:8px 0; }
.historic-tb-pilot h2 { font-size:20px; }
.historic-tb-pilot .table-subsection h2,.historic-tb-pilot #missed-platoons h2 { border-left:3px solid var(--accent); padding:0 0 0 12px; margin:24px 0 12px; }
.historic-tb-pilot h3 { font-size:17px; border-left:3px solid var(--accent); padding-left:12px; margin:24px 0 12px; }
.historic-tb-pilot .table-subsection h3 { padding:0 0 0 12px; }
.historic-tb-pilot .stat-card::before { display:none; }
.historic-tb-pilot .page-heading p { margin:0; }
.historic-tb-pilot .tb-return-link { display:inline-block; padding:6px 0; font-size:14px; }
.historic-tb-pilot .tb-note,.historic-tb-pilot .empty-state { font-family:var(--font-label); font-size:13px; line-height:1.65; color:var(--text-secondary); }
.historic-tb-pilot .tb-summary-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin:0 0 16px; }
.historic-tb-pilot .stat-card { padding:18px 20px; border:1px solid #2b3d57; border-radius:8px; box-shadow:none; background:var(--surface); min-width:0; min-height:0; }
.historic-tb-pilot .stat-card strong { font-size:24px; white-space:nowrap; }
.historic-tb-pilot .tb-facts { display:flex; flex-wrap:wrap; gap:12px; margin:12px 0; }
.historic-tb-pilot .tb-facts > div { padding:12px 16px; background:var(--surface); border:1px solid #2b3d57; border-radius:8px; max-width:100%; }
.historic-tb-pilot .tb-facts dt { font-size:14px; color:var(--text-secondary); margin-bottom:6px; }
.historic-tb-pilot .tb-facts dd { margin:0; font-family:var(--font-number); font-size:18px; font-weight:400; font-variant-numeric:tabular-nums; }
.historic-tb-pilot .tb-secondary-details { margin-bottom:16px; display:flex; flex-wrap:wrap; gap:12px; }
.historic-tb-pilot .tb-secondary-details > details { max-width:100%; }
.historic-tb-pilot summary { display:inline-flex; align-items:center; gap:12px; min-height:40px; padding:9px 12px; border:1px solid #647896; border-radius:6px; background:var(--surface-alt); cursor:pointer; list-style:none; font-size:14px; }
.historic-tb-pilot summary::-webkit-details-marker { display:none; }
.historic-tb-pilot summary::after { content:'+'; }
.historic-tb-pilot details[open] > summary::after { content:'−'; }
.historic-tb-pilot .tb-current-tabs { margin:0 0 20px; padding:0; background:transparent; border:0; border-bottom:1px solid #2b3d57; box-shadow:none; max-width:100%; }
.historic-tb-pilot .tb-current-tab-list { display:flex; flex-wrap:nowrap; gap:4px; overflow-x:auto; padding:0; min-width:0; }
.historic-tb-pilot .tb-local-tab-list { display:flex; flex-wrap:nowrap; flex-shrink:0; gap:4px; }
.historic-tb-pilot .tb-current-tab-list a { flex:0 0 auto; white-space:nowrap; padding:12px; min-width:0; border:0; border-bottom:3px solid transparent; border-radius:6px 6px 0 0; background:transparent; color:var(--text-secondary); box-shadow:none; }
.historic-tb-pilot .tb-current-tab-list a:is([aria-selected=true],[aria-current=page]) { color:var(--text); border-bottom-color:var(--accent); background:var(--surface); }
.historic-tb-pilot .tb-current-tab-list .tb-section-page-link { margin-left:8px; border-left:1px solid #2b3d57; }
.historic-tb-pilot .table-panel { background:transparent; border:0; box-shadow:none; padding:0; margin:0 0 20px; overflow:visible; min-width:0; }
.historic-tb-pilot .tb-filter-toolbar { display:flex; flex-wrap:wrap; align-items:end; gap:12px; padding:16px; background:var(--surface); border:1px solid #2b3d57; border-radius:8px; position:relative; z-index:5; }
.historic-tb-pilot .tb-filter-toolbar form { display:contents; }
.historic-tb-pilot .tb-filter-toolbar label { display:grid; gap:6px; flex:0 1 260px; min-width:0; font-size:14px; }
.historic-tb-pilot :is(input,select) { min-width:0; max-width:100%; }
.historic-tb-pilot .tb-filter-toolbar :is(input,select) { width:100%; min-height:40px; border:1px solid #647896; border-radius:6px; padding:8px 10px; font-size:14px; background:var(--surface-alt); color:var(--text); }
.historic-tb-pilot .official-filter-actions { gap:8px; }
.historic-tb-pilot .button { min-height:40px; width:auto; padding:9px 12px; background:#285e99; border-color:#285e99; color:white; }
.historic-tb-pilot .button:hover { background:#316faa; border-color:#316faa; }
.historic-tb-pilot .button.secondary { background:var(--surface-alt); border-color:#647896; color:var(--text); }
.historic-tb-pilot :focus-visible { outline:2px solid var(--text); outline-offset:3px; }
.historic-tb-pilot .table-subsection { position:relative; min-width:0; margin-bottom:24px; }
.historic-tb-pilot .profile-table-toolbar { margin-bottom:12px; }
.historic-tb-pilot .tb-filter-toolbar .profile-table-toolbar { margin:0; }
.historic-tb-pilot .profile-column-menu { position:absolute; z-index:20; top:auto; left:0; width:min(440px,100%); max-width:100%; overflow:auto; padding:16px; border:1px solid #647896; border-radius:8px; background:var(--surface); box-shadow:var(--shadow-soft); }
.historic-tb-pilot .profile-column-menu.opens-above { transform:translateY(calc(-100% - 44px)); }
.historic-tb-pilot .profile-column-menu fieldset { border:0; margin:0; padding:0; }
.historic-tb-pilot .profile-column-menu legend { margin-bottom:8px; }
.historic-tb-pilot [data-column-options] { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px 12px; margin-bottom:12px; }
.historic-tb-pilot [data-column-options] label { display:flex; align-items:center; gap:8px; font-size:13px; min-height:32px; overflow-wrap:anywhere; }
.historic-tb-pilot [data-column-options] input { width:auto; min-height:0; flex-shrink:0; }
.historic-tb-pilot .table-wrap { max-width:100%; overflow:auto; max-height:70vh; border-radius:8px; }
.historic-tb-pilot table { width:max-content; min-width:100%; table-layout:auto; }
.historic-tb-pilot :is(th,td) { padding:10px 12px; font-size:14px; white-space:nowrap; }
.historic-tb-pilot th { position:sticky; top:0; z-index:2; background:var(--surface-alt); }
.historic-tb-pilot th,.historic-tb-pilot th button { text-transform:none; letter-spacing:normal; font-weight:600; }
.historic-tb-pilot td { background:transparent; border-bottom:1px solid #23334a; }
.historic-tb-pilot td:has(a),.historic-tb-pilot .tb-description { white-space:normal; overflow-wrap:anywhere; min-width:140px; max-width:300px; }
.historic-tb-pilot :is(#historic-tb-zones,#historic-tb-combat) td:is(:nth-child(2),:nth-child(3),:nth-child(6)),
.historic-tb-pilot #historic-tb-special td:is(:nth-child(2),:nth-child(3),:nth-child(4),:nth-child(5),:nth-child(8),:nth-child(9)),
.historic-tb-pilot #historic-tb-operations td:is(:nth-child(2),:nth-child(3),:nth-child(7),:nth-child(8)),
.historic-tb-pilot #missed-platoons td { white-space:normal; overflow-wrap:anywhere; min-width:120px; max-width:360px; }
.historic-tb-pilot .profile-mobile-nav { display:none; }
@media(max-width:1000px) {
  .historic-tb-pilot .tb-summary-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(max-width:760px) {
  .historic-tb-pilot .page-shell { padding-top:16px; }
  .historic-tb-pilot .profile-desktop-nav { display:none; }
  .historic-tb-pilot .profile-mobile-nav { display:block; position:relative; }
  .historic-tb-pilot .site-header .header-inner { display:flex; flex-direction:row; align-items:center; flex-wrap:nowrap; gap:12px; padding:10px var(--site-gutter); }
  .historic-tb-pilot .site-header .guild-name { font-size:15px; min-width:0; }
  .historic-tb-pilot .brand-mark { width:32px; height:32px; flex-shrink:0; }
  .historic-tb-pilot .profile-mobile-nav summary { min-height:44px; white-space:nowrap; }
  .historic-tb-pilot .profile-mobile-nav nav { position:absolute; right:0; top:100%; width:240px; display:flex; flex-direction:column; align-items:stretch; padding:12px; border:1px solid var(--border); border-radius:8px; background:var(--surface); box-shadow:var(--shadow-soft); z-index:30; }
  .historic-tb-pilot .profile-mobile-nav nav a,.historic-tb-pilot .button { min-height:44px; }
  .historic-tb-pilot .stat-card { padding:16px; }
}
@media(max-width:480px) {
  .historic-tb-pilot .tb-summary-grid { grid-template-columns:1fr; }
  .historic-tb-pilot [data-column-options] { grid-template-columns:1fr; }
  .historic-tb-pilot .tb-filter-toolbar label { flex:1 1 100%; }
}
