/* History views use Foundation colors and keep wide tables inside their panels. */
.history-view { min-width: 0; color: var(--elevenx-foreground); }
.history-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.history-tabs { flex: none; }
.history-tabs > button { min-height: 40px; gap: 8px; }
.history-tabs svg { width: 18px; height: 18px; flex: none; }
.history-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; min-width: 0; }
.history-filter { display: flex; align-items: center; gap: 8px; color: var(--elevenx-muted); font-size: var(--elevenx-font-subheadline); }
.history-filter > span { flex: none; white-space: nowrap; }
.history-filter select { max-width: 260px; min-width: 160px; }
.history-search { display: block; width: 200px; }
.history-search input { width: 100%; }
.history-count { color: var(--elevenx-muted); font-size: var(--elevenx-font-footnote); white-space: nowrap; font-variant-numeric: tabular-nums; }
.history-table-scroll { max-width: 100%; overflow: auto; border: 1px solid var(--elevenx-border-soft); border-radius: var(--elevenx-radius-control); overscroll-behavior-x: contain; }
.history-table-scroll:focus-visible { outline: 2px solid var(--elevenx-focus); outline-offset: 3px; }
.history-table { border-collapse: separate; border-spacing: 0; }
.history-table :is(th,td) { box-sizing: border-box; min-width: 110px; padding: 12px 16px; text-align: center; vertical-align: middle; border-bottom: 1px solid var(--elevenx-border-soft); white-space: nowrap; }
.history-table th { color: var(--elevenx-foreground); }
.history-table thead th { background: var(--elevenx-surface-raised); font-size: var(--elevenx-font-subheadline); font-weight: 500; }
.history-table thead :is(strong,small), .history-table tbody th > :is(strong,small), .history-total :is(strong,small) { display: block; }
.history-table small { color: var(--elevenx-muted); font-size: var(--elevenx-font-footnote); font-weight: 400; line-height: 1.5; }
.history-table tr:last-child :is(th,td) { border-bottom: 0; }
.history-table tbody tr { background: var(--elevenx-surface); }
.history-table tbody tr:hover { background: var(--elevenx-surface-raised); }
.history-table :is(.history-player-heading,.history-player-cell) { position: sticky; left: 0; z-index: 1; width: 230px; min-width: 190px; max-width: 260px; text-align: left; border-right: 1px solid var(--elevenx-border-soft); background: var(--elevenx-surface); white-space: normal; overflow-wrap: anywhere; }
.history-table .history-player-heading { background: var(--elevenx-surface-raised); }
.history-table tbody tr:hover .history-player-cell { background: var(--elevenx-surface-raised); }
.history-player { display: grid; gap: 3px; }
.history-player > strong { font-size: var(--elevenx-font-callout); font-weight: 500; line-height: 1.5; }
.history-player > small { display: block; }
.history-player-link { display: block; width: fit-content; min-height: 40px; padding: 4px 0; border: 0; background: transparent; color: var(--elevenx-primary); font: 500 var(--elevenx-font-callout)/1.5 var(--elevenx-font); text-align: left; cursor: pointer; }
.history-player-link:hover { text-decoration: underline; }
.history-record-link { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; padding: 2px; border: 1px solid transparent; border-radius: var(--elevenx-radius-sm); background: transparent; cursor: pointer; color: inherit; font: inherit; }
.history-record-link:hover { border-color: var(--elevenx-border); }
.history-record-link:focus-visible,.history-player-link:focus-visible { outline: 2px solid var(--elevenx-focus); outline-offset: 3px; }
.history-state { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 28px; padding: 4px 10px; border-radius: 8px; background: var(--elevenx-fill); color: var(--elevenx-foreground); font-size: var(--elevenx-font-subheadline); font-weight: 500; font-variant-numeric: tabular-nums; }
.history-state-positive { background: var(--elevenx-success-soft); color: var(--elevenx-success); }
.history-state-warning { background: var(--elevenx-warning-soft); color: var(--elevenx-warning); }
.history-state-unknown { background: transparent; color: var(--elevenx-muted); font-weight: 400; }
.history-state small { color: inherit; }
.history-state-note { font-weight: 400; }
.history-participation-note { display: block; color: var(--elevenx-muted); font-size: var(--elevenx-font-footnote); }
.history-total strong { font-weight: 500; }
.history-legend { margin: 12px 0 0; color: var(--elevenx-muted); font-size: var(--elevenx-font-footnote); line-height: 1.6; }
.history-empty { padding: 28px 16px; color: var(--elevenx-muted); text-align: center; font-size: var(--elevenx-font-callout); }
.history-warning { margin-top: 12px; color: var(--elevenx-warning); font-size: var(--elevenx-font-callout); }
.player-history { margin-top: 24px; }
.player-history > h3 { margin-bottom: 12px; }
.player-history .history-tabs { margin-bottom: 16px; }
.player-history-activity + .player-history-activity { margin-top: 24px; }
.player-history-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px; margin-bottom: 8px; }
.player-history-heading h4 { margin: 0; font-size: var(--elevenx-font-headline); font-weight: 600; }
.player-history .history-table tbody th { font-size: var(--elevenx-font-callout); font-weight: 500; }
@media (max-width: 600px) {
  .history-toolbar,.history-filters { align-items: stretch; }
  .history-tabs { width: 100%; }
  .history-tabs > button { min-width: 0; padding-inline: 8px; white-space: normal; }
  .history-filters { width: 100%; gap: 8px; }
  .history-filter { width: 100%; }
  .history-filter select { min-width: 0; max-width: none; flex: 1; width: 100%; }
  .history-search { flex: 1; min-width: 160px; }
  .history-count { align-self: center; }
  .history-table :is(th,td) { padding: 10px 12px; min-width: 100px; }
  .history-table :is(.history-player-heading,.history-player-cell) { min-width: 144px; max-width: 170px; }
  .history-player-link { font-size: var(--elevenx-font-subheadline); }
}
@media (max-width: 360px) {
  .history-tabs svg { display: none; }
  .history-tabs > button { padding-inline: 4px; }
}
@media (pointer: coarse) {
  .history-tabs > button,.history-record-link,.history-player-link { min-height: 44px; }
}
@media (forced-colors: active) {
  .history-state { border: 1px solid CanvasText; }
}
