/* Loaded by every page except the graph builder. */
html {
  scrollbar-gutter: stable;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(0, 3fr);
  gap: 16px;
  padding: 16px 24px;
}

.topbar > *,
.layout > *,
.section > *,
.search-band > *,
.queue-grid > *,
.two-column > *,
.steam-profile-hero > * {
  min-width: 0;
}

.topbar h1,
.topbar p,
.section h2,
.metric,
.status,
.empty,
.doc-note,
.legacy-note,
.doc-card,
.doc-callout,
.source-view-meta,
.source-card-header,
#current-user {
  overflow-wrap: anywhere;
}

.session-box {
  gap: 8px;
}

.session-box .button {
  min-height: 36px;
  padding: 0 10px;
}

.layout,
.docs-layout {
  width: calc(100% - 32px);
  max-width: 1480px;
}

.docs-layout {
  max-width: 1320px;
}

.search-band {
  grid-template-columns: minmax(0, 1fr) minmax(0, 360px);
}

.input-row,
.section-head,
.queue-toolbar-actions {
  flex-wrap: wrap;
}

.input-row > input {
  flex: 1 1 180px;
  width: auto;
  min-width: 0;
}

input,
textarea,
select {
  min-width: 0;
  max-width: 100%;
}

.button {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
  text-align: center;
}

.section-head {
  gap: 10px 16px;
  align-items: flex-start;
}

.section-head > h2 {
  flex: 1 1 240px;
}

.summary-grid,
.queue-summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.section + .summary-grid,
.layout > .summary-grid {
  margin-top: 16px;
}

.two-column {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.table-wrap:focus-visible,
.button:focus-visible,
.nav-toggle:focus-visible,
summary:focus-visible,
.column-copy-button:focus-visible,
.wallet-expand-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

table {
  min-width: 0;
}

table:has(> thead > tr > th:nth-child(5)) {
  min-width: 680px;
}

table:has(> thead > tr > th:nth-child(8)) {
  min-width: 980px;
}

table:has(> thead > tr > th:nth-child(14)) {
  min-width: 1500px;
}

th,
td {
  padding: 5px 8px;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

th {
  overflow-wrap: normal;
}

td {
  max-width: 360px;
}

td a[href^="/?uid="],
td a[href^="/session?id="],
td a[href^="/ip?ip="],
td a[href^="/steam-profile?uid="] {
  white-space: nowrap;
}

#profile-table table {
  table-layout: fixed;
}

#profile-table th:first-child {
  width: 180px;
}

.flag-pill,
.badge,
.pill {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

td code,
.source-field-list code,
.doc-card code,
.doc-steps code,
.section > p code {
  overflow-wrap: anywhere;
}

.wallet-cell,
.wallet-copy-text {
  min-width: 0;
}

/* Expanded inner tables must not change the outer table's intrinsic width. */
.wallet-detail-panel {
  contain: inline-size;
  min-width: 0;
}

.plain-details summary {
  padding: 8px 0;
  line-height: 1.4;
}

.suspects-filter-controls {
  grid-template-columns: minmax(0, 320px);
}

.suspects-filter-field {
  grid-template-columns: minmax(0, 125px) minmax(0, 1fr);
}

.suspects-filter-chip {
  max-width: 100%;
  flex-wrap: wrap;
  overflow-wrap: anywhere;
}

.scam-input-grid {
  grid-template-columns: minmax(0, 1fr);
}

.steam-profile-hero {
  grid-template-columns: 164px minmax(0, 1fr);
}

.kv-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.steam-report-summary {
  grid-template-columns: 44px minmax(0, 1fr);
}

.steam-report-summary:not(:has(> .steam-report-avatar)) {
  grid-template-columns: minmax(0, 1fr);
}

.source-list,
.source-queue-list {
  grid-template-columns: minmax(0, 1fr);
}

.source-card,
.source-queue-panel,
.source-card-header > * {
  min-width: 0;
}

.doc-code,
.raw-json {
  max-width: 100%;
  min-width: 0;
  overscroll-behavior-x: contain;
}

.knowledge-nav summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
  cursor: pointer;
}

.knowledge-nav summary::-webkit-details-marker {
  display: none;
}

.knowledge-nav summary h2 {
  margin: 0;
}

.knowledge-nav-links {
  margin-top: 10px;
}

.layout-icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  background: currentColor;
  mask: var(--layout-icon) center / contain no-repeat;
  -webkit-mask: var(--layout-icon) center / contain no-repeat;
}

.layout-icon-menu {
  --layout-icon: url('/vendor/lucide/menu.svg');
}

.layout-icon-close {
  --layout-icon: url('/vendor/lucide/x.svg');
}

.layout-icon-chevron {
  --layout-icon: url('/vendor/lucide/chevron-down.svg');
}

.knowledge-nav details[open] > summary .layout-icon {
  transform: rotate(180deg);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}

.auth-shell {
  margin: 24px auto;
}

@media (max-width: 1100px) {
  .knowledge-layout {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .source-probe-form,
  .doc-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .topbar.nav-enhanced {
    grid-template-columns: minmax(0, 1fr) 44px;
    align-items: start;
  }

  .nav-enhanced .nav-toggle {
    display: inline-flex;
  }

  .nav-enhanced .session-box {
    display: none;
    grid-column: 1 / -1;
  }

  .nav-enhanced.nav-open .session-box {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .session-box {
    justify-content: flex-start;
  }

  .session-box #current-user {
    grid-column: 1 / -1;
  }

  .session-box .button {
    min-height: 44px;
  }

  .search-band,
  .knowledge-layout,
  .two-column {
    grid-template-columns: minmax(0, 1fr);
  }

  .knowledge-nav {
    margin-top: 0;
  }

  .knowledge-content > .section:first-child {
    margin-top: 0;
  }

  .knowledge-cards,
  .doc-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .steam-profile-hero {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .profile-avatar {
    width: 96px;
    height: 96px;
  }

  .source-probe-options > label:not(.queue-toggle) {
    width: min(160px, 100%);
  }
}

@media (max-width: 560px) {
  .topbar {
    padding: 14px 12px;
    gap: 12px;
  }

  .topbar h1 {
    font-size: 20px;
  }

  .topbar p {
    font-size: 13px;
    line-height: 1.4;
  }

  .layout,
  .docs-layout {
    width: calc(100% - 24px);
    margin-top: 14px;
  }

  .section,
  .search-band,
  .queue-toolbar {
    padding: 12px;
  }

  .input-row > input {
    flex-basis: 100%;
  }

  .input-row > .button {
    flex: 1 1 110px;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }

  input,
  select,
  .button {
    min-height: 44px;
  }

  .queue-toggle input {
    min-height: auto;
    width: 18px;
    height: 18px;
  }

  .queue-toggle {
    min-height: 44px;
  }

  .scam-actions,
  .scam-secondary-actions {
    justify-content: flex-start;
  }

  .summary-grid,
  .queue-summary-grid,
  .kv-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .metric {
    padding: 10px;
  }

  .metric strong {
    font-size: 18px;
    line-height: 1.35;
  }

  .metric span {
    font-size: 11px;
  }

  .metric .button {
    width: 100%;
    margin-top: 8px;
  }

  .doc-grid,
  .doc-grid.two,
  .knowledge-cards,
  .source-probe-form,
  .steam-profile-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .suspects-filter-field {
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
  }

  .suspects-filter-field input,
  .suspects-filter-field select {
    min-height: 44px;
    font-size: 16px;
  }

  .suspects-filter-actions .button {
    min-height: 44px;
  }

  th,
  td {
    padding: 8px;
  }

  #profile-table th:first-child {
    width: 34%;
  }

  .column-copy-button,
  .wallet-expand-button {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .wallet-expand-icon {
    width: 22px;
    height: 22px;
  }

  .auth-panel {
    padding: 22px;
  }
}
