:root {
  --bg:       #0d1117;
  --surface:  #161b22;
  --surface2: #21262d;
  --border:   #30363d;
  --text:     #e6edf3;
  --muted:    #8b949e;
  --accent:   #58a6ff;
  --danger:   #f85149;
  --green:    #3fb950;
  --yellow:   #d29922;
  --sidebar-w: 290px;
  --font-mono: "JetBrains Mono", "Consolas", "SF Mono", "Fira Code", monospace;
}

body.light-mode {
  --bg:       #ffffff;
  --surface:  #f6f8fa;
  --surface2: #eaeef2;
  --border:   #d0d7de;
  --text:     #1f2328;
  --muted:    #57606a;
  --accent:   #0969da;
  --danger:   #cf222e;
  --green:    #1a7f37;
  --yellow:   #9a6700;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 26px;
  min-height: 100vh;
}

.layout-wrapper {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  min-height: 100vh;
}

#sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  max-width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  align-self: flex-start;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: width 0.25s ease, min-width 0.25s ease;
}
body.sidebar-collapsed #sidebar {
  width: 0;
  min-width: 0;
  border-right: none;
  overflow: hidden;
}

.sidebar-header {
  padding: 16px 14px 12px;
  border-bottom: 1px solid var(--border);
}
.sidebar-header h1 {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.3px;
}
.sidebar-header .version {
  font-size: 14px;
  color: var(--muted);
  margin-top: 2px;
}

.sidebar-section {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.sidebar-section-title {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  margin-bottom: 8px;
}

input[type="text"], input[type="url"], input[type="password"],
select, textarea {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 14px;
  width: 100%;
  outline: none;
}
input[type="text"]:focus, input[type="url"]:focus,
input[type="password"]:focus, select:focus, textarea:focus {
  border-color: var(--accent);
}
input[type="checkbox"] { accent-color: var(--accent); cursor: pointer; }
label { cursor: pointer; user-select: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface2); border-color: var(--accent); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
  font-weight: 600;
}
.btn-primary:hover { background: #79b8ff; border-color: #79b8ff; }
.btn-danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}
.btn-danger:hover { background: rgba(248,81,73,0.1); }
.btn-full { width: 100%; }
.btn-sm { padding: 4px 8px; font-size: 15px; }

#runBtn {
  width: 100%;
  margin-top: 4px;
  font-size: 15px;
  padding: 9px;
}
.progress-wrap {
  margin-top: 8px;
  display: none;
}
.progress-bar-track {
  height: 4px;
  background: var(--surface2);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 5px;
}
.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s;
  width: 0%;
}
.status-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  color: var(--muted);
}
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--muted);
}
.status-dot.green  { background: var(--green); }
.status-dot.yellow { background: var(--yellow); animation: pulse 1s infinite; }
.status-dot.red    { background: var(--danger); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

.query-list { display: flex; flex-direction: column; gap: 4px; }
.query-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s;
  user-select: none;
  position: relative;
}
.query-pill:hover { background: var(--surface2); }
.query-pill.active {
  background: var(--surface2);
  border-color: var(--border);
}
.query-pill.inactive { opacity: 0.45; }
.query-color-bar {
  width: 3px;
  border-radius: 2px;
  align-self: stretch;
  flex-shrink: 0;
}
.query-name {
  flex: 1;
  font-size: 15px;
  line-height: 1.3;
  font-weight: 500;
}
.query-badge {
  font-size: 15px;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 700;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.query-badge.custom-badge {
  background: rgba(88,166,255,0.2);
  color: var(--accent);
  border: 1px solid rgba(88,166,255,0.3);
}
.query-delete-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 15px;
  padding: 0 2px;
  line-height: 1;
}
.query-pill:hover .query-delete-btn { display: block; }

.export-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.watchdog-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
#wdCountdown {
  font-size: 14px;
  color: var(--muted);
  margin-top: 4px;
}

.feed-status {
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 6px;
  line-height: 1.5;
}
.feed-status a { color: var(--accent); text-decoration: none; }
.feed-status a:hover { text-decoration: underline; }

#main {
  flex: 1;
  min-width: 0;
  overflow-x: clip;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}
.sidebar-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--muted);
  cursor: pointer;
  padding: 3px 9px;
  font-size: 16px;
  line-height: 1.4;
  transition: color 0.15s, border-color 0.15s;
}
.sidebar-toggle:hover { color: var(--text); border-color: var(--muted); }
.topbar-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.3px;
}
.wordmark-glyph {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--green);
  margin-right: 6px;
  opacity: 0.85;
}
.wordmark-glyph::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 12px;
  margin-left: 1px;
  background: var(--green);
  vertical-align: -2px;
  animation: cursor-blink 1.1s steps(1) infinite;
}
@keyframes cursor-blink {
  0%, 49%  { opacity: 1; }
  50%, 100% { opacity: 0; }
}
.topbar-version {
  font-size: 14px;
  color: var(--muted);
}

.sticky-header {
  position: sticky;
  top: 0;
  z-index: 50;
  flex-shrink: 0;
}

.tab-bar {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.tab-btn {
  padding: 12px 20px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.panel { display: none; padding: 16px; }
.panel.active { display: block; }

.filter-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.filter-bar input[type="text"] { flex: 1; min-width: 160px; }
.filter-bar select { width: auto; }

.batch-dom-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.batch-dom-badge {
  display: inline-block;
  background: var(--yellow);
  color: #000;
  font-size: 14px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: 4px;
}
.batch-dom-progress {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  color: var(--muted);
}

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

.result-group {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 6px;
}
.result-group > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  cursor: pointer;
  background: var(--surface2);
  font-weight: 600;
  font-size: 14px;
  list-style: none;
  user-select: none;
}
.result-group > summary::-webkit-details-marker { display: none; }
.result-group > summary::marker { display: none; }
.result-group-chevron {
  margin-left: auto;
  font-size: 15px;
  color: var(--muted);
  display: inline-block;
  transition: transform 0.2s;
}
.result-group[open] > summary .result-group-chevron { transform: rotate(90deg); }
.result-group-body {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg);
}
.result-group-body table { background: var(--surface); }
.result-group-count {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  white-space: nowrap;
}
.source-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.result-group-section-label {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--muted);
  padding: 2px 0 6px;
}

.artifact-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
  margin-bottom: 2px;
}
.artifact-tag {
  font-size: 14px;
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.2px;
}
.artifact-tag--red    { background: rgba(248,81,73,0.15);  color: #f85149; border: 1px solid rgba(248,81,73,0.3); }
.artifact-tag--orange { background: rgba(227,132,74,0.15); color: #e3844a; border: 1px solid rgba(227,132,74,0.3); }
.artifact-tag--yellow { background: rgba(210,153,34,0.15); color: #d29922; border: 1px solid rgba(210,153,34,0.3); }
.artifact-tag--blue   { background: rgba(88,166,255,0.15); color: #58a6ff; border: 1px solid rgba(88,166,255,0.3); }
.artifact-tag--muted  { background: var(--surface2); color: var(--muted); border: 1px solid var(--border); font-weight: 400; }

#results-list { display: flex; flex-direction: column; gap: 8px; }
.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.15s;
}
.result-card:hover { border-color: #484f58; }
.card-main {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 12px 14px;
  align-items: start;
}
.card-body { min-width: 0; }
.card-domain {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  word-break: break-all;
  margin-bottom: 4px;
}
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 4px;
}
.chip {
  font-size: 14px;
  padding: 2px 7px;
  border-radius: 10px;
  border: 1px solid var(--border);
  color: var(--muted);
  white-space: nowrap;
}
.chip.country { background: var(--surface2); }
.source-badge {
  font-size: 14px;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
  white-space: nowrap;
}
.card-field {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 3px;
  font-size: 15px;
  min-width: 0;
}
.card-field-label {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.card-field-value {
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-field-value.mono {
  font-family: var(--font-mono);
}
.card-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
}
.card-screenshot {
  width: 120px;
  height: 75px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
  cursor: pointer;
  background: var(--surface2);
}
.card-screenshot.hidden { display: none; }
.card-btn-row {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dom-panel {
  display: none;
  padding: 10px 14px 12px;
  border-top: 1px solid var(--border);
  background: var(--surface2);
}
.dom-panel.open { display: block; }
.dom-section { margin-bottom: 10px; }
.dom-section-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  margin-bottom: 5px;
}
.dom-item {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--text);
  padding: 3px 6px;
  background: var(--surface);
  border-radius: 4px;
  margin-bottom: 3px;
  word-break: break-all;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.dom-item .copy-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  line-height: 1;
}
.dom-item .copy-btn:hover { color: var(--accent); }
.dom-bool {
  font-size: 15px;
  color: var(--green);
  font-family: var(--font-mono);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 14px 18px;
  text-align: left;
}
.stat-card--green  { border-left-color: var(--green); }
.stat-card--yellow { border-left-color: var(--yellow); }
.stat-card--blue   { border-left-color: var(--accent); }
.stat-card .stat-label {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
}
.stat-card .stat-value {
  font-size: 36px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.findings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.findings-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.findings-table-wrap h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
table { width: 100%; border-collapse: collapse; }
th, td {
  padding: 7px 14px;
  text-align: left;
  font-size: 15px;
  border-bottom: 1px solid var(--border);
}
th { color: var(--muted); font-weight: 600; }
td { color: var(--text); }
td.mono { font-family: var(--font-mono); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface2); }

.tbl-total { font-weight: 400; color: var(--muted); font-size: 14px; }
.findings-table-wrap h3 { display: flex; align-items: center; gap: 6px; }
.findings-table-scroll { max-height: 260px; overflow-y: auto; }
.findings-table-scroll thead th { position: sticky; top: 0; background: var(--surface2); z-index: 1; }

.cluster-section { margin-bottom: 14px; }
.cluster-section h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 6px;
}
.accordion-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 5px;
  overflow: hidden;
}
.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  cursor: pointer;
  user-select: none;
  font-family: var(--font-mono);
  font-size: 14px;
}
.accordion-header:hover { background: var(--surface2); }
.accordion-header .count-badge {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 14px;
  color: var(--muted);
}
.accordion-body { display: none; border-top: 1px solid var(--border); }
.accordion-body.open { display: block; }
.accordion-body table { font-size: 15px; }

.home-section-label {
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 8px;
  margin-top: 4px;
}
.home-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}
@media (max-width: 820px) {
  .home-grid { grid-template-columns: 1fr; }
}
.home-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.home-section-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 9px 14px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.home-section-full {
  margin-top: 16px;
}
.home-domain-table { width: 100%; font-size: 14px; border-collapse: collapse; }
.home-domain-table thead th {
  text-align: left;
  padding: 7px 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.home-domain-table tbody td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.home-domain-table tbody tr:last-child td { border-bottom: none; }
.home-domain-table tbody tr:hover { background: var(--surface2); }

.home-screenshots-strip {
  display: flex;
  gap: 10px;
  padding: 12px;
  overflow-x: auto;
}
.home-screenshot-item {
  flex: 0 0 auto;
  width: 653px;
  cursor: pointer;
}
.home-screenshot-item img {
  width: 100%;
  height: 490px;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid var(--border);
  display: block;
  transition: border-color 0.15s;
}
.home-screenshot-item:hover img {
  border-color: var(--accent);
}
.home-screenshot-domain {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--muted);
  margin-top: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.analyzer-legend {
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 16px;
}
.analyzer-legend-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 7px 12px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.analyzer-legend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}
.legend-group {
  padding: 10px 12px;
  border-right: 1px solid var(--border);
}
.legend-group:last-child { border-right: none; }
.legend-group-title {
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
  margin-bottom: 7px;
}
.legend-item { margin-bottom: 6px; }
.legend-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  display: block;
}
.legend-desc {
  font-size: 14px;
  color: var(--muted);
  display: block;
  line-height: 1.4;
}
.legend-desc code {
  font-family: var(--font-mono);
  font-size: 15px;
  background: var(--surface2);
  padding: 0 3px;
  border-radius: 3px;
}

.analyzer-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 14px;
}
#domInput {
  font-family: var(--font-mono);
  font-size: 15px;
  resize: vertical;
  min-height: 100px;
}
.ioc-output { display: flex; flex-direction: column; gap: 10px; }
.ioc-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.ioc-section-header {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.ioc-items { padding: 8px 12px; display: flex; flex-direction: column; gap: 4px; }
.ioc-item {
  font-family: var(--font-mono);
  font-size: 15px;
  word-break: break-all;
  padding: 3px 6px;
  background: var(--surface2);
  border-radius: 4px;
}
.ioc-item.copyable {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  cursor: default;
}
.ioc-copy-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
}
.ioc-copy-btn:hover { color: var(--accent); }

.domain-link { color: var(--accent); text-decoration: none; }
.domain-link:hover { text-decoration: underline; }

#clustersOnlyBtn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  max-width: 800px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
}
.modal-box h2 {
  font-size: 14px;
  margin-bottom: 14px;
  color: var(--text);
}
.modal-close {
  position: absolute;
  top: 12px; right: 14px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover { color: var(--text); }
#screenshotImg {
  width: 100%;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.resolve-ip-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 14px;
}
.resolve-ip-card .ip-addr {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}

.qgen-platform { margin-bottom: 14px; }
.qgen-platform h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.qgen-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 6px;
}
.qgen-label { font-size: 15px; color: var(--muted); margin-bottom: 3px; }
.qgen-query {
  font-family: var(--font-mono);
  font-size: 15px;
  word-break: break-all;
  cursor: pointer;
}
.qgen-query:hover { color: var(--accent); }

.run-history-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-top: 16px;
}
.run-history-wrap h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

details { margin-bottom: 10px; }
summary {
  cursor: pointer;
  font-size: 15px;
  color: var(--muted);
  user-select: none;
  padding: 4px 0;
}
summary:hover { color: var(--text); }
#debugLog {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--muted);
  max-height: 150px;
  overflow-y: auto;
  margin-top: 4px;
  white-space: pre-wrap;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  font-size: 15px;
}
.mt4 { margin-top: 4px; }
.mt8 { margin-top: 8px; }
.mt12 { margin-top: 12px; }
.gap4 { gap: 4px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
hr.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 8px 0;
}

.qm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.qm-section-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--muted);
  margin-bottom: 8px;
}
.qm-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
}
.qm-form-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}
.qm-form-grid {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 8px 12px;
  align-items: center;
  margin-bottom: 14px;
}
.qm-form-grid label {
  font-size: 15px;
  color: var(--muted);
  text-align: right;
}
.qm-form-grid textarea {
  font-family: var(--font-mono);
  font-size: 15px;
  resize: vertical;
}
.qm-form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.qm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.qm-table thead th {
  padding: 8px 12px;
  text-align: left;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.qm-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.qm-table tbody tr:last-child { border-bottom: none; }
.qm-table tbody tr:hover { background: var(--surface2); }
.qm-table tbody td { padding: 8px 12px; vertical-align: middle; }
.qm-name { font-weight: 500; white-space: nowrap; }
.qm-query-text {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 340px;
  cursor: default;
}
.qm-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.artifact-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 16px;
}
.artifact-section-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.artifact-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
.artifact-table thead th {
  padding: 7px 14px;
  text-align: left;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.artifact-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.artifact-table tbody tr:last-child { border-bottom: none; }
.artifact-table tbody tr:hover { background: var(--surface2); }
.artifact-table tbody td { padding: 7px 14px; vertical-align: middle; }

.qm-toggle {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 18px;
  cursor: pointer;
}
.qm-toggle input { opacity: 0; width: 0; height: 0; }
.qm-toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 18px;
  transition: background 0.2s;
}
.qm-toggle-slider::before {
  content: '';
  position: absolute;
  height: 12px;
  width: 12px;
  left: 2px;
  top: 2px;
  background: var(--muted);
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}
.qm-toggle input:checked + .qm-toggle-slider { background: var(--green); border-color: var(--green); }
.qm-toggle input:checked + .qm-toggle-slider::before {
  transform: translateX(14px);
  background: #fff;
}
