/* ── Tokens ── */
:root {
  --bg:        #0c0c18;
  --panel:     #18181b;
  --border:    #2e2e3a;
  --border-lo: #1e1e2e;
  --text:      #fafafa;
  --text-dim:  #d0d0d0;
  --muted:     #71717a;
  --indigo:    #6366f1;
  --indigo-hi: #818cf8;
  --indigo-lo: rgba(99,102,241,0.12);
  --amber:     #f59e0b;
  --green:     #4ade80;
  --radius:    12px;
  --radius-sm: 8px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── Grid background (matches marketing site) ── */
.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(255,255,255,0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.028) 1px, transparent 1px);
  background-size: 72px 72px;
}
.page-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 50% -5%, rgba(99,102,241,0.38) 0%, transparent 65%),
    radial-gradient(ellipse 40% 30% at 50% -2%, rgba(139,92,246,0.22) 0%, transparent 55%);
  animation: glow-breathe 7s ease-in-out infinite;
}
@keyframes glow-breathe {
  0%, 100% { opacity: 0.75; }
  50%       { opacity: 1;    }
}

/* ── Topbar ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  transition: background 0.25s, backdrop-filter 0.25s, border-color 0.25s;
  border-bottom: 1px solid transparent;
}
.topbar-scrolled {
  background: rgba(12,12,24,0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--border);
}
.logo {
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 5px;
}
.logo-bar  { color: var(--amber); }
.logo-text { color: var(--text); }
.navlinks { display: flex; gap: 20px; }
.navlinks a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.15s;
}
.navlinks a:hover { color: var(--text); }

/* ── Layout ── */
.layout {
  max-width: 1440px;
  margin: 20px auto 0;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 14px;
  align-items: start;
}

/* ── Filter panel ── */
.filter-panel {
  background: rgba(18,18,27,0.85);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(8px);
  max-height: calc(100vh - 90px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.filter-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
h1 {
  margin: 0 0 4px;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.subtitle {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}

/* Live badge */
.lead-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  background: rgba(13,13,22,0.7);
  border: 1px solid rgba(99,102,241,0.35);
  color: var(--indigo-hi);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 9999px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: blink 2s ease-in-out infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

/* ── Config warning ── */
.config-warning {
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.35);
  border-radius: var(--radius-sm);
  color: #fcd34d;
  font-size: 0.8rem;
  padding: 10px 12px;
  margin-bottom: 14px;
  line-height: 1.5;
}
.hidden { display: none !important; }

/* ── Schema sections ── */
.section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-lo);
}
.section:first-child { margin-top: 8px; border-top: none; padding-top: 0; }
.section h3 {
  margin: 0 0 12px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

.accordion-section {
  margin-top: 12px;
  padding-top: 0;
  border-top: none;
  border: 1px solid var(--border-lo);
  border-radius: var(--radius-sm);
  background: rgba(8,8,12,0.55);
  overflow: hidden;
}
.accordion-summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 12px;
  border-bottom: 1px solid transparent;
  background: rgba(12,12,20,0.65);
}
.accordion-summary::-webkit-details-marker {
  display: none;
}
.accordion-summary::before {
  content: ">";
  display: inline-block;
  margin-right: 8px;
  color: var(--muted);
  transition: transform 0.15s ease;
}
.accordion-section[open] .accordion-summary::before {
  transform: rotate(90deg);
}
.accordion-section[open] .accordion-summary {
  border-bottom-color: var(--border-lo);
}
.accordion-title {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.accordion-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.accordion-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(99, 102, 241, 0.35);
  font-size: 0.9rem;
}
.accordion-heading {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.accordion-subtitle {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 500;
}
.accordion-badge {
  margin-left: auto;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(113, 113, 122, 0.16);
  border: 1px solid rgba(113, 113, 122, 0.35);
  border-radius: 999px;
  padding: 4px 8px;
  white-space: nowrap;
}
.accordion-badge.has-selection {
  color: #c7d2fe;
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.45);
}
.accordion-content {
  padding: 10px 12px 6px;
}

/* ── Fields ── */
.field { margin-bottom: 12px; }
.field label {
  display: block;
  margin-bottom: 5px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-dim);
}

input[type="text"],
input[type="number"],
textarea,
select {
  width: 100%;
  background: rgba(9,9,14,0.9);
  color: var(--text);
  border: 1px solid #2a2a36;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 0.825rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
  -webkit-appearance: none;
}
input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
  border-color: rgba(99,102,241,0.7);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}
input::placeholder,
textarea::placeholder { color: #3d3d50; }

textarea {
  min-height: 68px;
  resize: vertical;
  line-height: 1.5;
}

/* Multi-select */
select[multiple] {
  padding: 4px 0;
  background: rgba(9,9,14,0.9);
}
select[multiple] option {
  padding: 5px 10px;
  border-radius: 0;
  cursor: pointer;
}
select[multiple] option:checked {
  background: var(--indigo);
  color: #fff;
}

/* Checkbox rows */
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-dim);
  cursor: pointer;
  margin-bottom: 8px;
}
.checkbox-row input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--indigo);
  cursor: pointer;
  flex-shrink: 0;
}

/* ── Action buttons ── */
.filter-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.btn-primary {
  flex: 1 1 180px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--indigo);
  color: #fff;
  border: 1px solid #5153c8;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}
.btn-primary:hover {
  background: #5153c8;
  box-shadow: 0 0 18px rgba(99,102,241,0.35);
}
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.json-action-status {
  margin-top: 8px;
  min-height: 18px;
  font-size: 0.74rem;
  color: var(--muted);
}
.btn-ghost:hover {
  border-color: #4a4a5a;
  color: var(--text);
}

/* ── Actor JSON details ── */
.json-details {
  margin-top: 16px;
  border-top: 1px solid var(--border-lo);
  padding-top: 14px;
}
.json-details summary {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  letter-spacing: 0.02em;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s;
}
.json-details summary:hover { color: var(--text-dim); }
.json-details summary::before {
  content: '›';
  display: inline-block;
  transition: transform 0.15s;
  font-size: 1rem;
  line-height: 1;
}
.json-details[open] summary::before { transform: rotate(90deg); }
.jsonbox {
  margin-top: 10px;
  background: rgba(8,8,12,0.95);
  color: #a1a1aa;
  border: 1px solid #22222e;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  max-height: 220px;
  overflow: auto;
  font-size: 0.72rem;
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', ui-monospace, monospace;
  line-height: 1.6;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* ── Results panel ── */
.results-panel {
  background: rgba(18,18,27,0.85);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
  overflow: hidden;
  min-height: calc(100vh - 90px);
  display: flex;
  flex-direction: column;
}
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--border-lo);
  flex-shrink: 0;
}
.results-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  border-top: 1px solid var(--border-lo);
  flex-shrink: 0;
}
.page-size-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.page-size-wrap label {
  font-size: 0.76rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.page-size-wrap select {
  width: auto;
  min-width: 70px;
  padding: 6px 8px;
  font-size: 0.8rem;
}
.pager-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pager-controls .btn-ghost {
  padding: 6px 10px;
  font-size: 0.78rem;
}
.page-indicator {
  min-width: 90px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-dim);
}
h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.result-meta {
  font-size: 0.78rem;
  color: var(--muted);
  text-align: right;
  max-width: 55%;
  line-height: 1.4;
}
.result-meta.has-results {
  color: var(--indigo-hi);
  font-weight: 500;
}

/* ── Table ── */
.table-wrap {
  overflow: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}
thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #0f0f1a;
  text-align: left;
  padding: 9px 12px;
  white-space: nowrap;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border-lo);
}
thead th:last-child { border-right: none; }
tbody tr { transition: background 0.1s; }
tbody tr:hover { background: rgba(99,102,241,0.04); }
tbody td {
  border-bottom: 1px solid var(--border-lo);
  border-right: 1px solid var(--border-lo);
  padding: 9px 12px;
  vertical-align: top;
  color: var(--text-dim);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
tbody td:last-child { border-right: none; }

/* Masked value badges */
tbody td .masked-found {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #6ee7a0;
  background: rgba(74,222,128,0.08);
  border: 1px solid rgba(74,222,128,0.2);
  border-radius: 4px;
  padding: 1px 6px;
}
tbody td .masked-notfound {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #71717a;
  background: rgba(39,39,42,0.5);
  border: 1px solid #2a2a36;
  border-radius: 4px;
  padding: 1px 6px;
}

/* Empty / error state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  border: none !important;
  white-space: normal !important;
  max-width: none !important;
  width: 100%;
  overflow: visible !important;
}

.status-found {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #22c55e;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.45);
  border-radius: 999px;
  padding: 2px 8px;
}

.status-missing {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.45);
  border-radius: 999px;
  padding: 2px 8px;
}

/* ── Footer ── */
.footer {
  margin-top: 14px;
  padding: 0 20px 28px;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-lo);
}
.footer-logo {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}
.footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.75rem;
  transition: color 0.15s;
}
.footer-links a:hover { color: var(--text-dim); }

/* ── Responsive ── */
@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 360px 1fr;
  }
}
@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .filter-panel {
    max-height: none;
  }
  .results-panel {
    min-height: 500px;
  }
}
@media (max-width: 600px) {
  .topbar { padding: 14px 16px; }
  .layout { padding: 0 12px; }
  .results-toolbar {
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 12px;
  }
  .footer { padding: 0 12px 20px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
