:root {
  color-scheme: dark;
  --bg: #000;
  --panel: #050505;
  --panel-2: #090909;
  --field: #020202;
  --line: #fff1;
  --line-2: #ffffff1f;
  --text: #f2f0ea;
  --soft: #c8c2b6;
  --muted: #8b8790;
  --faint: #5d5962;
  --gold: #aa8846;
  --gold-2: #d1b064;
  --red: #d45e55;
  --green: #42b08a;
  --shadow: 0 10px 26px #00000047;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  background: var(--bg);
  min-height: 100%;
  color: var(--text);
  margin: 0;
  overflow-x: hidden;
}

body {
  font-size: 15px;
}

button, input, select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

input, select {
  border: 1px solid var(--line);
  background: var(--field);
  width: 100%;
  min-width: 0;
  height: 42px;
  color: var(--text);
  border-radius: 6px;
  outline: none;
}

input {
  padding: 0 13px;
}

input::placeholder {
  color: var(--faint);
}

a {
  color: var(--gold-2);
}

.hidden {
  display: none !important;
}

.app-shell {
  width: min(100%, 1760px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 16px 22px 34px;
}

.topbar {
  border-bottom: 1px solid var(--line);
  background: #000;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  margin: -16px -22px 20px;
  padding: 18px 22px;
  display: grid;
}

.brand-lockup {
  text-align: center;
  flex-direction: column;
  grid-column: 2;
  justify-content: center;
  align-items: center;
  gap: 4px;
  min-width: 0;
  display: flex;
}

.brand-title {
  justify-content: center;
  align-items: center;
  gap: 12px;
  display: flex;
}

.brand-mark, .brand-mark img {
  flex: 0 0 62px;
  width: 62px;
  height: 62px;
}

.brand-mark img {
  object-fit: contain;
  display: block;
}

.brand-lockup h1 {
  letter-spacing: 0;
  margin: 0;
  font-size: 30px;
  line-height: 1;
}

.brand-tagline {
  margin: 0;
  line-height: 1.2;
}

.eyebrow {
  color: #b8a06a;
  letter-spacing: .22em;
  text-transform: uppercase;
  margin: 0 0 7px;
  font-size: 11px;
  font-weight: 800;
}

.topbar-actions {
  grid-column: 3;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  display: flex;
}

.control-rail, .workbench {
  gap: 14px;
  min-width: 0;
  display: grid;
}

.tool-panel, .utility-panel, .empty-workbench, .progress-panel, .results-panel, .analysis-grid, .chart-card, .match-card, .timeline-wrap, .rank-list, .match-list {
  min-width: 0;
  max-width: 100%;
}

.tool-panel, .utility-panel, .empty-workbench, .progress-panel, .results-panel, .metric-card, .chart-card, .match-card, .steam-result, .steam-data-section, .report-table, .candidate-list, .confidence-card, .file-item, .mini-stat, .steam-field, .upload-drop, .timeline-wrap, .raw-json pre {
  border: 1px solid var(--line);
  background: #030303;
  border-radius: 6px;
}

.section-heading, .results-heading {
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  display: flex;
}

.section-heading.compact {
  align-items: center;
  margin-bottom: 12px;
}

.section-heading h2, .results-heading h2, .section-heading h3 {
  margin: 0;
  line-height: 1.08;
}

.section-heading h2, .results-heading h2 {
  font-size: 22px;
}

.section-heading h3 {
  font-size: 18px;
}

.topbar-link, .status-pill, .primary-button, .ghost-button, .file-button, .filter-tab, .match-filter {
  border: 1px solid var(--line);
  min-height: 40px;
  color: var(--text);
  background: none;
  border-radius: 6px;
  font-weight: 750;
}

.topbar-link, .status-pill {
  white-space: nowrap;
  justify-content: center;
  align-items: center;
  padding: 0 14px;
  font-size: 14px;
  text-decoration: none;
  display: inline-flex;
}

.primary-button, .ghost-button, .file-button, .filter-tab {
  justify-content: center;
  align-items: center;
  padding: 0 15px;
  display: inline-flex;
}

.primary-button {
  color: var(--gold-2);
  background: #aa88461f;
}

.topbar-link:hover, .ghost-button:hover:not(:disabled), .file-button:hover, .filter-tab:hover, .match-filter:hover, .primary-button:hover:not(:disabled) {
  border-color: var(--line-2);
  color: var(--text);
}

.filter-tab.active, .match-filter:focus {
  color: var(--gold-2);
  border-color: #d8b76880;
}

.status-pill.ok {
  color: var(--green);
  border-color: #48ad8773;
}

.status-pill.bad, .error-text {
  color: var(--red);
}

.upload-panel.dragging, .report-block.selected {
  background: #d1b06405;
  border-color: #d1b06457;
}

.upload-drop {
  text-align: center;
  background: #000;
  border-style: dashed;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 112px;
  display: flex;
}

.upload-drop span, .tool-note, .empty-copy, .match-meta, .steam-field span, .rank-row span, .id-stack {
  color: var(--muted);
}

.upload-actions, .match-fetch-row, .steam-lookup-row {
  grid-template-columns: minmax(0, 1fr) 116px;
  gap: 10px;
  margin-top: 14px;
  display: grid;
}

.file-button {
  position: relative;
}

.file-button input {
  opacity: 0;
  position: absolute;
  inset: 0;
}

.target-row {
  gap: 8px;
  margin-top: 14px;
  display: grid;
}

.target-row label {
  color: var(--soft);
  font-size: 13px;
  font-weight: 700;
}

.target-row label span {
  color: var(--muted);
}

.file-list {
  gap: 8px;
  display: grid;
}

.file-list.empty, .steam-result.empty, .steam-result.loading {
  color: var(--muted);
  line-height: 1.45;
}

.file-list.empty, .steam-result.empty {
  border: 1px dashed var(--line);
  background: #020202;
  align-content: center;
  min-height: 58px;
  display: grid;
}

.file-item {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px;
  display: grid;
}

.file-item span:first-child {
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.match-fetch-panel {
  gap: 12px;
  display: grid;
}

.tool-note {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.fetch-steps {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  display: grid;
}

.fetch-steps span, .fetch-status-line {
  border: 1px solid var(--line);
  min-height: 28px;
  color: var(--muted);
  background: #000;
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 700;
}

.fetch-steps span.done, .fetch-status-line.complete strong, .fetch-status-line.complete b {
  color: var(--green);
}

.fetch-steps span.active, .fetch-status-line.downloading strong, .fetch-status-line.downloading b, .fetch-status-line.parsing strong, .fetch-status-line.parsing b {
  color: var(--gold-2);
}

.fetch-steps span.failed, .fetch-status-line.failed strong, .fetch-status-line.failed b {
  color: var(--red);
}

.fetch-status-line {
  grid-template-columns: minmax(82px, auto) minmax(76px, auto) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  display: grid;
}

.fetch-status-line strong, .fetch-status-line b {
  color: var(--text);
}

.fetch-status-line em {
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  font-style: normal;
  overflow: hidden;
}

.discord-panel {
  padding: 0;
  overflow: hidden;
}

.discord-banner {
  border-bottom: 1px solid var(--line);
  background: #050505;
  height: 64px;
}

.discord-card-body {
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 13px;
  margin-top: -22px;
  padding: 0 15px 14px;
  display: grid;
}
