:root {
  --bg: #0f1115;
  --panel: #181b22;
  --panel-2: #1f232c;
  --border: #2a2f3a;
  --text: #e6e8ee;
  --muted: #9aa3b2;
  --accent: #5b9dff;
  --accent-2: #7c5bff;
  --ok: #3ecf8e;
  --warn: #f0b429;
  --error: #ff6b6b;
  --region: #2a2140;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(1200px 600px at 50% -10%, #1b2030 0%, var(--bg) 60%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.hero { text-align: center; margin-bottom: 2rem; }
.hero h1 {
  font-size: 2rem;
  margin: 0 0 .4rem;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tagline { color: var(--muted); margin: 0 0 .6rem; }
.privacy {
  display: inline-block;
  background: rgba(62, 207, 142, .1);
  color: var(--ok);
  border: 1px solid rgba(62, 207, 142, .25);
  padding: .35rem .8rem;
  border-radius: 999px;
  font-size: .85rem;
  margin: 0;
}

.dropzone {
  border: 2px dashed var(--border);
  border-radius: 16px;
  background: var(--panel);
  padding: 2.5rem 1.5rem;
  text-align: center;
  transition: border-color .15s, background .15s;
}
.dropzone.drag { border-color: var(--accent); background: var(--panel-2); }
.drop-title { font-size: 1.15rem; font-weight: 600; margin: 0 0 .25rem; }
.drop-sub { color: var(--muted); margin: .25rem 0; }
.formats { color: var(--muted); font-size: .8rem; letter-spacing: .04em; margin: 1rem 0 0; }

.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  padding: .6rem 1.1rem;
  border-radius: 10px;
  font-size: .95rem;
  cursor: pointer;
  transition: border-color .15s, transform .05s;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(90deg, var(--accent), var(--accent-2)); border: none; color: white; font-weight: 600; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.controls {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin: 1.25rem 0 .5rem;
}
.controls label { color: var(--muted); font-size: .9rem; }
select {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .45rem .6rem;
  font-size: .9rem;
}

.status { min-height: 1.4rem; font-size: .9rem; margin: .5rem 0; }
.status.ok { color: var(--ok); }
.status.warn { color: var(--warn); }
.status.error { color: var(--error); }

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: 1.5rem 0 0;
  border-bottom: 1px solid var(--border);
  padding-bottom: .5rem;
}
.tab {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 9px 9px 4px 4px;
  padding: .4rem .35rem .4rem .7rem;
  cursor: pointer;
  max-width: 240px;
  transition: border-color .15s, background .15s;
}
.tab:hover { border-color: var(--accent); }
.tab.active { background: var(--panel-2); border-color: var(--accent); }
.tab-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .85rem; }
.tab-badge {
  background: var(--border);
  color: var(--muted);
  border-radius: 999px;
  padding: 0 .45rem;
  font-size: .72rem;
  min-width: 1.2rem;
  text-align: center;
}
.tab.active .tab-badge { background: var(--accent); color: #fff; }
.tab-close {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 .25rem;
  border-radius: 4px;
}
.tab-close:hover { color: var(--error); background: rgba(255, 107, 107, .12); }

#results { margin-top: 1.25rem; }
.results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.results-head h2 { margin: 0; font-size: 1.2rem; word-break: break-all; }
.head-actions { display: flex; gap: .6rem; flex-wrap: wrap; }

.summary {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin: 1rem 0;
}
.chip {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .5rem .8rem;
  min-width: 110px;
}
.chip-k { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
.chip-v { font-size: 1rem; font-weight: 600; }

.meta { margin: 1rem 0 1.5rem; }
.meta h3 { margin: 0 0 .5rem; font-size: 1rem; }
table.kv { border-collapse: collapse; width: 100%; max-width: 640px; }
table.kv th, table.kv td {
  text-align: left;
  padding: .4rem .7rem;
  border: 1px solid var(--border);
  font-size: .88rem;
}
table.kv th { color: var(--muted); font-weight: 500; width: 220px; background: var(--panel); }

.markers-head { display: flex; align-items: baseline; gap: .75rem; margin: 1.25rem 0 .6rem; }
.markers-head h3 { margin: 0; font-size: 1rem; }
.muted { color: var(--muted); font-size: .85rem; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
table.markers { border-collapse: collapse; width: 100%; font-size: .88rem; }
table.markers th, table.markers td {
  padding: .5rem .7rem;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
table.markers thead th {
  position: sticky;
  top: 0;
  background: var(--panel-2);
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: .72rem;
  letter-spacing: .04em;
}
table.markers tbody tr:hover { background: rgba(91, 157, 255, .07); }
table.markers tr.type-region { background: var(--region); }
table.markers tr.type-region:hover { background: #332a4d; }
td.mono, .mono { font-family: var(--mono); }

.empty { color: var(--muted); padding: 1.5rem; text-align: center; }

footer { margin-top: 3rem; color: var(--muted); font-size: .8rem; text-align: center; }
