:root {
  --bg: #f7f8fa;
  --panel: #ffffff;
  --text: #1f2933;
  --muted: #667085;
  --border: #d7dde5;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --danger: #b42318;
  --warn: #b54708;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: var(--accent-strong);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

.topbar h1 {
  margin: 0;
  font-size: 22px;
}

.topbar p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.layout {
  width: min(1480px, calc(100vw - 32px));
  margin: 22px auto 48px;
}

.search-band,
.section,
.metric,
.auth-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.search-band {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 18px;
  padding: 18px;
  margin-bottom: 18px;
}

.search-band.steam-search-band {
  grid-template-columns: 1fr;
}

.queue-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  margin-bottom: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.queue-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.queue-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

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

.search-form label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.input-row {
  display: flex;
  gap: 10px;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 15px;
}

input,
select {
  min-height: 40px;
  padding: 0 12px;
  background: #fff;
}

textarea {
  min-height: 160px;
  padding: 10px 12px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  line-height: 1.35;
}

.button {
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 14px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.button.active,
.button[aria-current="page"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.session-box {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

.status {
  margin: 16px 0;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
}

.status.error {
  border-color: #fecdca;
  color: var(--danger);
  background: #fffbfa;
}

.hidden {
  display: none;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.metric {
  padding: 14px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
}

.queue-summary-grid {
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  margin-bottom: 14px;
}

.queue-metric small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.queue-grid {
  display: grid;
  gap: 14px;
}

.queue-grid h3 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

.danger-text {
  color: var(--danger);
}

.section {
  margin-top: 16px;
  padding: 16px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.section h2 {
  margin: 0;
  font-size: 17px;
}

.block-timing {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  margin-left: 6px;
  line-height: 1.35;
  vertical-align: middle;
}

.block-timing:empty {
  display: none;
}

.muted-small {
  color: var(--muted);
  font-size: 11px;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 6px;
  min-height: 16px;
  font-size: 11px;
  font-weight: 700;
  background: #eef4ff;
  color: #3538cd;
  white-space: nowrap;
}

.badge.ok {
  background: #ecfdf3;
  color: #027a48;
}

.badge.warn {
  background: #fffaeb;
  color: #b54708;
}

.badge.danger {
  background: #fef3f2;
  color: #b42318;
}

.badge.muted {
  background: #f2f4f7;
  color: var(--muted);
}

.steam-profile-hero {
  display: grid;
  grid-template-columns: 164px 1fr;
  gap: 18px;
  align-items: start;
}

.profile-avatar {
  width: 164px;
  height: 164px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f2f4f7;
  object-fit: cover;
}

.avatar-thumb {
  width: 32px;
  height: 32px;
  display: block;
  border-radius: 4px;
  background: #f2f4f7;
  object-fit: cover;
}

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

.kv-item {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px;
  background: #fff;
}

.kv-item span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.kv-item strong {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.25;
}

.raw-json {
  max-height: 520px;
  overflow: auto;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #0f172a;
  color: #e5e7eb;
  font-size: 11px;
  line-height: 1.35;
}

.steam-report-summary {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 8px;
  align-items: center;
}

.steam-report-avatar {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #f2f4f7;
  object-fit: cover;
}

.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  font-size: 12px;
  line-height: 1.2;
  color: #111827;
}

th,
td {
  padding: 2px 6px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

th {
  background: #f2f4f7;
  color: #111827;
  font-size: 11px;
  line-height: 1.15;
  text-transform: uppercase;
  padding-top: 3px;
  padding-bottom: 3px;
}

td {
  color: #111827;
}

tr:last-child td {
  border-bottom: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 5px;
  font-weight: 700;
  font-size: 11px;
  line-height: 1.25;
  background: #eef4ff;
  color: #3538cd;
}

.pill.strong {
  background: #ecfdf3;
  color: #027a48;
}

.pill.warn {
  background: #fffaeb;
  color: var(--warn);
}

.flag-pill {
  display: inline-flex;
  margin: 0 4px 2px 0;
  padding: 0 5px;
  border-radius: 4px;
  background: #f2f4f7;
  color: #111827;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

.flag-pill.danger {
  background: #fee4e2;
  color: #b42318;
}

.empty {
  color: var(--muted);
  padding: 4px 0;
  font-size: 12px;
  line-height: 1.2;
}

.error-text {
  color: #b42318;
  font-weight: 700;
}

.plain-details {
  margin-top: 6px;
}

.plain-details summary {
  cursor: pointer;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
}

.plain-details .table-wrap {
  margin-top: 4px;
}

.browser-links-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 8px;
}

.steam-id-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.scam-input-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.scam-input-grid label {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.scam-input-grid span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.scam-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.scam-secondary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 12px;
}

.selectable-code {
  user-select: text;
  overflow-wrap: anywhere;
}

.wallet-type-list {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.wallet-amount-lines {
  display: inline-block;
  white-space: nowrap;
  line-height: 1.35;
}

.wallet-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}

.wallet-expand-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  user-select: none;
}

.wallet-copy-text {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
  cursor: text;
  user-select: text;
  overflow-wrap: anywhere;
}

.wallet-expand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #f2f4f7;
  color: var(--text);
  font-size: 12px;
  line-height: 1;
}

.wallet-group-row.expanded td {
  background: #fbfcfd;
}

.wallet-group-detail-row td {
  padding: 8px;
  background: #fbfcfd;
}

.wallet-detail-panel {
  width: 100%;
}

.wallet-detail-panel .table-wrap {
  max-height: 360px;
}

.doc-note,
.legacy-note {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

.docs-layout {
  width: min(1320px, calc(100vw - 32px));
}

.knowledge-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.knowledge-nav {
  position: sticky;
  top: 18px;
  padding: 14px;
}

.knowledge-nav h2 {
  margin: 0 0 10px;
  font-size: 14px;
}

.knowledge-nav a {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.knowledge-nav a:hover,
.knowledge-nav a.active {
  background: #ecfdf3;
  color: var(--accent-strong);
}

.knowledge-content {
  min-width: 0;
}

.knowledge-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.knowledge-card {
  display: block;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: #fff;
  text-decoration: none;
}

.knowledge-card strong {
  display: block;
  margin-bottom: 6px;
  color: var(--accent-strong);
  font-size: 15px;
}

.knowledge-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.docs-intro p,
.doc-card p,
.section > p {
  margin: 0 0 10px;
  max-width: 980px;
  line-height: 1.55;
  font-size: 14px;
}

.doc-callout {
  margin-top: 12px;
  padding: 10px 12px;
  border-left: 4px solid var(--warn);
  background: #fffaeb;
  color: #7a2e0e;
  font-size: 13px;
  line-height: 1.45;
}

.doc-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

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

.doc-card {
  min-width: 0;
}

.doc-card h3 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

.doc-card ul,
.doc-steps {
  margin: 0;
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.55;
}

.doc-card li,
.doc-steps li {
  margin: 4px 0;
}

.doc-code {
  overflow: auto;
  margin: 8px 0 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f8fafc;
  color: #111827;
  font-size: 12px;
  line-height: 1.45;
}

.source-probe-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.source-probe-form label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.source-probe-form label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.source-probe-params,
.source-probe-options {
  grid-column: 1 / -1;
}

.source-probe-options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  justify-content: flex-end;
}

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

.source-probe-result {
  margin-top: 12px;
}

.source-gateway-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.source-list,
.source-queue-list {
  display: grid;
  gap: 14px;
}

.source-card,
.source-queue-panel {
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.source-card:first-child,
.source-queue-panel:first-child {
  padding-top: 0;
  border-top: 0;
}

.source-card-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
  margin-bottom: 10px;
}

.source-card-header h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.source-card-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.source-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.source-view-meta {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
}

.source-field-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.source-field-list code {
  padding: 1px 4px;
  border-radius: 4px;
  background: #f2f4f7;
}

.source-queue-compact {
  margin-top: 10px;
}

.graph-layout {
  width: min(1800px, calc(100vw - 24px));
  margin-top: 14px;
}

.graph-search {
  grid-template-columns: minmax(420px, 1fr) auto;
  align-items: end;
}

.graph-meta {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 26px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.graph-side-panel {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.graph-zoom-control {
  display: grid;
  grid-template-columns: auto 180px 48px auto auto;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.graph-zoom-control input[type="range"] {
  width: 180px;
  min-height: auto;
  padding: 0;
}

.compact-button {
  min-height: 28px;
  padding: 0 9px;
  font-size: 12px;
}

.graph-meta span:not(:empty) {
  padding: 4px 7px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #fff;
}

.graph-shell {
  position: relative;
  min-height: 660px;
  height: calc(100vh - 190px);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.graph-canvas {
  width: 100%;
  height: 100%;
}

.graph-details {
  position: absolute;
  left: 12px;
  top: 12px;
  max-width: min(760px, calc(100% - 260px));
  max-height: calc(100% - 24px);
  overflow: auto;
  pointer-events: auto;
  color: #111827;
  font-size: 12px;
  line-height: 1.3;
  z-index: 2;
}

.graph-details > div {
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.graph-profile-details {
  display: grid;
  gap: 2px;
}

.graph-profile-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.graph-profile-row span {
  color: var(--muted);
  font-weight: 700;
}

.graph-profile-row strong {
  min-width: 0;
  color: #111827;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.graph-edge-details {
  display: grid;
  gap: 8px;
}

.graph-edge-section {
  display: grid;
  gap: 3px;
}

.graph-edge-title {
  display: flex;
  gap: 8px;
  align-items: baseline;
  color: #111827;
  font-weight: 700;
}

.graph-edge-title span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.graph-edge-reasons {
  display: grid;
  gap: 2px;
}

.graph-edge-reason {
  padding: 2px 5px;
  border-left: 2px solid var(--border);
  background: rgba(247, 248, 250, 0.8);
  overflow-wrap: anywhere;
}

.graph-legend {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  gap: 8px;
  width: 260px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  color: #111827;
  font-size: 12px;
  line-height: 1.25;
  pointer-events: none;
}

.graph-legend strong {
  font-size: 12px;
}

.legend-section {
  display: grid;
  gap: 5px;
}

.legend-section b {
  color: #475467;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.graph-legend span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-depths {
  grid-template-columns: 1fr 1fr;
  column-gap: 10px;
}

.legend-depths b {
  grid-column: 1 / -1;
}

.legend-node {
  display: inline-block;
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #0f766e;
}

.legend-root {
  width: 18px;
  height: 18px;
  background: #b42318;
}

.legend-admin {
  border-color: #d4af37;
  border-width: 3px;
}

.legend-depth-2-node {
  background: #b42318;
}

.legend-banned {
  border-color: #b42318;
}

.legend-new {
  width: 0;
  height: 0;
  border-top: 0;
  border-right: 8px solid transparent;
  border-bottom: 14px solid #15803d;
  border-left: 8px solid transparent;
  border-radius: 0;
  background: transparent;
}

.legend-loaded {
  border-radius: 50%;
}

.legend-expanded {
  border-radius: 2px;
}

.legend-sized {
  width: 22px;
  height: 22px;
}

.legend-weak-leaf {
  background: #15803d;
  border-color: #15803d;
  opacity: 0.34;
}

.legend-selected-node {
  border-color: #111827;
  border-width: 3px;
}

.legend-edge {
  display: inline-block;
  flex: 0 0 32px;
  width: 32px;
  border-top: 3px solid #0f766e;
}

.legend-weak {
  border-top: 2px dashed #15803d;
  opacity: 0.18;
}

.legend-wide {
  border-top-width: 5px;
  border-top-color: #667085;
}

.legend-selected-edge {
  border-top-width: 5px;
  border-top-color: #111827;
}

.legend-depth-1 {
  border-top-color: #15803d;
}

.legend-depth-2 {
  border-top-color: #b42318;
}

.legend-depth-3 {
  border-top-color: #2563eb;
}

.legend-depth-4 {
  border-top-color: #b54708;
}

.legend-depth-5 {
  border-top-color: #7c3aed;
}

.legend-depth-more {
  border-top-color: #111827;
}

.legend-action {
  display: inline-flex;
  flex: 0 0 42px;
  align-items: center;
  justify-content: center;
  height: 16px;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  background: #f9fafb;
  color: #344054;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  line-height: 1;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.auth-shell {
  width: min(420px, calc(100vw - 32px));
}

.auth-panel {
  padding: 28px;
}

.auth-panel h1 {
  margin: 0;
  font-size: 28px;
}

.auth-panel p {
  margin: 8px 0 24px;
  color: var(--muted);
}

@media (max-width: 920px) {
  .topbar,
	  .queue-toolbar,
	  .search-band,
	  .two-column,
	  .doc-grid,
	  .doc-grid.two,
	  .knowledge-layout,
	  .knowledge-cards,
	  .scam-input-grid,
	  .source-probe-form,
	  .summary-grid {
	    grid-template-columns: 1fr;
	  }

  .topbar {
    display: grid;
  }

  .queue-toolbar {
    display: grid;
  }

  .source-card-header {
    display: grid;
  }

  .source-badge-row,
  .source-probe-options {
    justify-content: flex-start;
  }

  .knowledge-nav {
    position: static;
  }

  .graph-shell {
    min-height: 520px;
    height: calc(100vh - 260px);
  }

  .graph-meta {
    justify-content: flex-start;
  }

  .graph-side-panel {
    justify-items: start;
  }

  .graph-zoom-control {
    grid-template-columns: auto minmax(140px, 1fr) 48px auto auto;
    width: 100%;
  }

  .graph-zoom-control input[type="range"] {
    width: 100%;
  }

  .graph-legend {
    top: 8px;
    right: 8px;
    width: min(210px, calc(100% - 16px));
    pointer-events: none;
  }
}
