@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@300;400;500&family=DM+Sans:wght@300;400;500;600&display=swap');

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:       #0d0d0f;
  --bg2:      #141416;
  --bg3:      #1a1a1e;
  --border:   rgba(255,255,255,0.07);
  --border2:  rgba(255,255,255,0.12);
  --text:     #e8e6e0;
  --muted:    #7a7870;
  --accent:   #c8f064;
  --accent2:  #64d4f0;
  --accent3:  #f0a064;
  --danger:   #f06464;
  --tag-bg:   rgba(200,240,100,0.08);
  --tag-border: rgba(200,240,100,0.2);
  --mono: 'DM Mono', monospace;
  --sans: 'DM Sans', sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Header ── */
header {
  padding: 32px 40px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  gap: 16px;
}
header h1 {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text);
}
header span {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--mono);
}

/* ── Layout ── */
.layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: calc(100vh - 73px);
}

/* ── Sidebar ── */
.sidebar {
  border-right: 1px solid var(--border);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Drop zone ── */
.drop-zone {
  border: 1.5px dashed var(--border2);
  border-radius: 12px;
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  background: var(--bg2);
}
.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--accent);
  background: rgba(200,240,100,0.04);
}
.drop-zone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
}
.drop-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.drop-zone p { font-size: 13px; color: var(--muted); }
.drop-zone strong { color: var(--text); font-weight: 500; }
.drop-zone .formats { margin-top: 8px; font-size: 11px; }

/* ── Preview ── */
.preview-wrap {
  display: none;
  flex-direction: column;
  gap: 12px;
}
.preview-wrap.show { display: flex; }

.preview-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.preview-thumb {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg2);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.preview-thumb img {
  width: 48px;
  height: 36px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.tlabel { font-size: 11px; color: var(--muted); }
.tval   { font-size: 12px; font-family: var(--mono); }
.file-info { font-size: 12px; color: var(--muted); }
.file-info strong { color: var(--text); font-weight: 500; }

/* ── Filter pills ── */
.filter-group .section-label {
  margin-bottom: 8px;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.filter-pill {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border2);
  background: transparent;
  color: var(--muted);
  font-family: var(--sans);
  transition: all 0.15s;
  white-space: nowrap;
}
.filter-pill:hover {
  color: var(--text);
  border-color: rgba(255,255,255,0.2);
}
.filter-pill.active {
  background: var(--tag-bg);
  border-color: var(--tag-border);
  color: var(--accent);
}

/* ── Map link ── */
.map-link {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(100,212,240,0.06);
  border: 1px solid rgba(100,212,240,0.2);
  border-radius: 8px;
  text-decoration: none;
  color: var(--accent2);
  font-size: 12px;
  font-weight: 500;
  transition: background 0.15s;
}
.map-link:hover { background: rgba(100,212,240,0.1); }
.map-link.show  { display: flex; }

/* ── Results panel ── */
.results {
  padding: 24px 32px;
  overflow-y: auto;
}

/* ── Empty state ── */
.empty-state {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
  text-align: center;
}
.empty-state .big { font-size: 48px; opacity: 0.3; }
.empty-state h2   { font-size: 16px; font-weight: 500; color: var(--text); opacity: 0.5; }
.empty-state p    { font-size: 13px; max-width: 280px; }

/* ── Section ── */
.section {
  margin-bottom: 28px;
  display: none;
}
.section.show { display: block; }

.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.section-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.section-count {
  font-size: 10px;
  font-family: var(--mono);
  padding: 2px 7px;
  background: var(--bg3);
  border-radius: 10px;
  color: var(--muted);
  border: 1px solid var(--border);
}
.section-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Field grid ── */
.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1px;
  background: var(--border);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.field {
  background: var(--bg2);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: background 0.1s;
}
.field:hover { background: var(--bg3); }
.field-key {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--mono);
}
.field-val {
  font-size: 13px;
  color: var(--text);
  font-weight: 400;
  word-break: break-all;
  line-height: 1.4;
}
.field-val.mono    { font-family: var(--mono); font-size: 12px; }
.field-val.accent  { color: var(--accent); }
.field-val.accent2 { color: var(--accent2); }
.field-val.accent3 { color: var(--accent3); }

/* ── Keywords ── */
.kw-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
}
.kw {
  padding: 2px 8px;
  background: var(--tag-bg);
  border: 1px solid var(--tag-border);
  border-radius: 20px;
  font-size: 11px;
  color: var(--accent);
  font-family: var(--mono);
}

/* ── No-data notice ── */
.no-data {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  padding: 8px 0;
}

/* ── Export bar ── */
.export-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 24px;
}
.export-bar.show { display: flex; }
.export-bar p    { font-size: 12px; color: var(--muted); }
.export-bar strong { color: var(--text); }

.btn-export {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--sans);
  background: var(--tag-bg);
  border: 1px solid var(--tag-border);
  color: var(--accent);
  transition: all 0.15s;
}
.btn-export:hover { background: rgba(200,240,100,0.14); }

/* ── Privacy badge ── */
.privacy-badge {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(240,100,100,0.07);
  border: 1px solid rgba(240,100,100,0.2);
  border-radius: 8px;
  font-size: 12px;
  color: var(--danger);
  margin-bottom: 20px;
}
.privacy-badge.show { display: flex; }

/* ── Loading ── */
.loading {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 60px;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}
.loading.show { display: flex; }

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
