:root {
  color-scheme: light;
  --ink: #0f172a;
  --muted: #5b6475;
  --paper: #f4f1ea;
  --accent: #e29f3f;
  --accent-2: #1f9fa8;
  --card: #ffffff;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  --border: rgba(15, 23, 42, 0.08);
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --sans: "Space Grotesk", "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  font-family: var(--sans);
  background: radial-gradient(circle at 15% 15%, #fff2dd 0%, transparent 45%),
    radial-gradient(circle at 80% 10%, #dff7f6 0%, transparent 35%),
    var(--paper);
  color: var(--ink);
  min-height: 100vh;
}

.navbar {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.navbar .nav-link.active {
  background: rgba(226, 159, 63, 0.18);
  font-weight: 600;
  border-radius: 999px;
  padding: 6px 12px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-pill {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  display: inline-block;
}

.app-shell {
  padding: 32px 0 48px;
}

.card {
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 16px;
}

.card-header {
  background: transparent;
  border-bottom: 1px solid var(--border);
}

.badge-soft {
  background: rgba(15, 23, 42, 0.08);
  color: var(--ink);
  font-weight: 600;
}

.badge-confirmed {
  background: rgba(31, 159, 168, 0.15);
  color: #0f766e;
}

.badge-rejected {
  background: rgba(239, 68, 68, 0.15);
  color: #b91c1c;
}

.badge-pending {
  background: rgba(226, 159, 63, 0.15);
  color: #b45309;
}

.table thead th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.table td {
  vertical-align: middle;
}

.table-mono td,
.table-mono th {
  font-family: var(--mono);
}

.subtle {
  color: var(--muted);
  font-size: 0.9rem;
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  align-items: end;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
}

.fade-in {
  animation: fadeUp 0.6s ease both;
  transform: none;
}

@keyframes fadeUp {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

.match-panel {
  background: var(--card);
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 16px;
}

.summary-float {
  position: fixed;
  right: 12px;
  bottom: 12px;
  width: min(280px, calc(100vw - 24px));
  background: #0f172a;
  color: #f8fafc;
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: var(--shadow);
  z-index: 10;
}

.summary-float h5 {
  margin-bottom: 8px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--mono);
  font-size: 0.8rem;
}

.summary-row + .summary-row {
  margin-top: 4px;
}

.match-tabs {
  display: none;
}

@media (max-width: 992px) {
  .match-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .summary-float {
    position: static;
    width: 100%;
  }
  .match-tabs {
    display: flex;
    gap: 8px;
  }
  .match-panel[data-hidden="true"] {
    display: none;
  }
}

.table-wrap {
  max-height: 480px;
  overflow: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.code-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  font-family: var(--mono);
  font-size: 0.75rem;
}

.empty-state {
  text-align: center;
  padding: 32px;
  color: var(--muted);
}

.row-clickable {
  cursor: pointer;
}

.pop-anchor {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.info-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 40;
  min-width: 220px;
  width: 260px;
  max-width: 320px;
  padding: 10px 12px;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.note-preview {
  font-size: 0.85rem;
  color: var(--ink);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-popover {
  width: 300px;
}

.note-hover {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.note-pop:hover .note-hover {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.edit-popover {
  width: 280px;
}

.popover-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
}

.hash-full {
  font-family: var(--mono);
  font-size: 0.75rem;
  word-break: break-all;
  color: var(--ink);
}

.chain-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  color: var(--accent-2);
}

.chain-icon svg {
  width: 16px;
  height: 16px;
}
