:root {
  color-scheme: dark;
  --bg: #09110f;
  --panel: #111b18;
  --panel-2: #17231f;
  --line: #2d3b36;
  --text: #edf7f2;
  --muted: #9fb0aa;
  --green: #42f59b;
  --green-soft: rgba(66, 245, 155, 0.14);
  --yellow: #ffd166;
  --red: #ff6b6b;
  --blue: #7cc7ff;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(140deg, rgba(20, 80, 57, 0.22), transparent 32%),
    radial-gradient(circle at 80% 0%, rgba(124, 199, 255, 0.1), transparent 34%),
    var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input {
  font: inherit;
}

.shell {
  width: min(1480px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 4.6rem);
  line-height: 0.96;
}

h2 {
  margin-bottom: 10px;
  font-size: 1rem;
}

.status-card,
.controls,
.metric-strip article,
.side-panel,
.notes,
.table-wrap {
  border: 1px solid var(--line);
  background: rgba(17, 27, 24, 0.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.status-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 230px;
  padding: 13px 14px;
  border-radius: 8px;
}

.status-card span:not(.pulse) {
  display: block;
  font-weight: 800;
}

.status-card small {
  color: var(--muted);
}

.pulse {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 8px rgba(66, 245, 155, 0.12);
}

.pulse.busy {
  background: var(--yellow);
  box-shadow: 0 0 0 8px rgba(255, 209, 102, 0.12);
}

.pulse.error {
  background: var(--red);
  box-shadow: 0 0 0 8px rgba(255, 107, 107, 0.12);
}

.controls {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(140px, 180px) minmax(130px, 150px) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border-radius: 8px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #33443e;
  border-radius: 7px;
  padding: 0 12px;
  background: #0b1412;
  color: var(--text);
  outline: none;
}

input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(66, 245, 155, 0.15);
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border: 0;
  border-radius: 7px;
  padding: 0 18px;
  background: var(--green);
  color: #03100b;
  cursor: pointer;
  font-weight: 900;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.icon {
  font-size: 1.16rem;
  line-height: 1;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.metric-strip article {
  border-radius: 8px;
  padding: 18px;
}

.metric-strip span {
  display: block;
  margin-bottom: 4px;
  font-size: clamp(1.6rem, 3vw, 2.5rem);
  font-weight: 950;
  line-height: 1;
}

.metric-strip small,
td small {
  color: var(--muted);
}

.scanner-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 14px;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 940px;
  border-collapse: collapse;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #13201c;
  color: var(--muted);
  font-size: 0.72rem;
  text-align: left;
  text-transform: uppercase;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 15px 14px;
  vertical-align: top;
}

td strong,
td small {
  display: block;
}

td strong {
  margin-bottom: 3px;
  font-size: 1.05rem;
}

a {
  color: var(--text);
  font-weight: 850;
  text-decoration: none;
}

a:hover {
  color: var(--green);
}

.hit-list {
  max-width: 260px;
}

.hit {
  display: inline-flex;
  margin: 0 5px 6px 0;
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--green-soft);
  color: #c9ffe1;
  font-size: 0.76rem;
  font-weight: 750;
}

.side-panel,
.notes {
  border-radius: 8px;
  padding: 18px;
}

.side-panel p,
.notes p {
  color: var(--muted);
  line-height: 1.55;
}

.keyword-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.keyword-cloud span {
  border: 1px solid #365248;
  border-radius: 999px;
  padding: 6px 9px;
  color: #c9d8d2;
  font-size: 0.76rem;
  font-weight: 750;
}

.notes {
  margin-top: 14px;
}

.empty-row td {
  padding: 42px 20px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1120px) {
  .controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  button {
    grid-column: span 3;
  }

  .scanner-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 20px, 1480px);
    padding-top: 16px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .controls,
  .metric-strip {
    grid-template-columns: 1fr;
  }

  button {
    grid-column: auto;
  }

  .status-card {
    min-width: 0;
  }
}
