:root {
  --bg: #08101d;
  --panel: #101b2d;
  --panel2: #142239;
  --text: #eef4ff;
  --muted: #91a4bf;
  --line: #223654;
  --accent: #42e6b3;
  --accent2: #63a8ff;
  --danger: #ff6b7a;
  --warn: #ffc857;
  --good: #45df8a;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font: 15px/1.55 Inter, "Segoe UI", Arial, sans-serif;
  background: linear-gradient(180deg, #08101d, #0b1422 45%, #09111d);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

.container {
  max-width: 1180px;
  margin: auto;
  padding: 0 22px;
}

.narrow {
  max-width: 760px;
}

/* =========================================================
   Header / Navigation
   ========================================================= */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(8, 16, 29, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.nav {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  line-height: 1;
}

.brand img {
  display: block;
  height: 50px;
  width: auto;
  max-width: 310px;
  object-fit: contain;
}

nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

nav a {
  color: var(--muted);
  font-weight: 500;
  transition: color 0.15s ease;
}

nav a:hover {
  color: #fff;
}

.demo {
  background: #463a16;
  color: #ffe393;
  padding: 8px 22px;
  text-align: center;
  font-size: 12px;
  border-bottom: 1px solid #6b581d;
}

/* =========================================================
   Typography
   ========================================================= */

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

h1 {
  letter-spacing: -0.02em;
}

h2 {
  font-size: 24px;
}

.muted {
  color: var(--muted);
}

.eyebrow {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 12px;
}

/* =========================================================
   Hero
   ========================================================= */

.hero {
  padding: 70px 0 42px;
}

.hero h1 {
  max-width: 820px;
  margin: 10px 0 14px;
  font-size: 48px;
  line-height: 1.08;
}

.hero p {
  max-width: 720px;
  color: var(--muted);
  font-size: 18px;
}

/* =========================================================
   Search / Forms
   ========================================================= */

.search {
  display: flex;
  gap: 10px;
  margin-top: 28px;
}

.search input,
input,
select,
textarea {
  width: 100%;
  background: #0b1627;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 10px;
  outline: none;
}

.search input:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent2);
}

textarea {
  min-height: 110px;
  resize: vertical;
}

button,
.btn {
  display: inline-block;
  border: 1px solid var(--line);
  background: #172640;
  color: #fff;
  padding: 11px 16px;
  border-radius: 10px;
  cursor: pointer;
}

button:hover,
.btn:hover {
  filter: brightness(1.08);
}

.btn.primary,
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #052116;
  font-weight: 800;
}

.btn.danger {
  background: #3a1920;
  border-color: #66303a;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

label {
  display: block;
  color: #b9c7da;
  font-size: 13px;
  margin-bottom: 5px;
}

/* =========================================================
   Layout / Cards
   ========================================================= */

.section {
  padding: 28px 0;
}

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

.grid {
  display: grid;
  gap: 16px;
}

.two {
  grid-template-columns: 1.2fr 0.8fr;
}

.three {
  grid-template-columns: repeat(3, 1fr);
}

.card {
  background: linear-gradient(180deg, var(--panel), #0d1828);
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.2);
}

.stats {
  grid-template-columns: repeat(5, 1fr);
  margin: 10px 0 38px;
}

.stat strong {
  display: block;
  font-size: 30px;
}

.stat span {
  color: var(--muted);
}

/* =========================================================
   Meta blocks
   ========================================================= */

.meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.meta .item {
  min-height: 82px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0b1627;
}

.meta small {
  display: block;
  color: var(--muted);
  margin-bottom: 4px;
}

/* =========================================================
   Tables
   ========================================================= */

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

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

th {
  color: #a9bad1;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #0d1727;
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: #132037;
}

/* =========================================================
   Badges / Status
   ========================================================= */

.badge {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--line);
  color: #bdcbe0;
  white-space: nowrap;
}

.badge.hot {
  background: #451f28;
  color: #ff9da7;
  border-color: #65323b;
}

.badge.warn {
  background: #493b1a;
  color: #ffd878;
  border-color: #715b20;
}

.badge.good {
  background: #123b2a;
  color: #7af0af;
  border-color: #20563e;
}

.badge.neutral {
  background: #172338;
  color: #bdcbe0;
}

.score {
  font-size: 20px;
  font-weight: 900;
}

.score.high {
  color: var(--accent);
}

.progress {
  height: 8px;
  background: #1b2a43;
  border-radius: 20px;
  overflow: hidden;
}

.progress i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent2), var(--accent));
}

/* =========================================================
   Alerts / Toolbar
   ========================================================= */

.alert {
  padding: 12px 14px;
  border-radius: 10px;
  margin: 14px 0;
}

.alert.success {
  background: #123b2a;
  color: #8df2ba;
}

.alert.danger {
  background: #451f28;
  color: #ffb1ba;
}

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pill {
  border: 1px solid var(--line);
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--muted);
}

/* =========================================================
   GenericRadar Patent Assessment
   ========================================================= */

.radar-card {
  margin: 14px 0 18px;
}

.radar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.radar-head > div:first-child {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.radar-title {
  font-size: 20px;
}

.radar-confidence {
  text-align: right;
}

.radar-confidence small,
.radar-block small,
.radar-note small,
.radar-entry small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.radar-confidence strong {
  font-size: 14px;
}

.radar-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1.35fr 0.8fr;
  gap: 12px;
}

.radar-block {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0b1627;
  min-width: 0;
}

.radar-block strong {
  display: block;
  font-size: 16px;
  overflow-wrap: anywhere;
}

.radar-block p,
.radar-note p,
.radar-entry p {
  margin: 0;
}

.radar-reason {
  border-color: #2b4968;
  background: linear-gradient(180deg, #0e1c30, #0b1627);
}

.radar-reason p {
  color: #dbe7f7;
}

.radar-note,
.radar-entry {
  margin-top: 12px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0b1627;
}

.radar-entry {
  border-color: #315071;
  background: #0c192a;
}

.radar-sources {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 14px;
  font-size: 13px;
}

.radar-sources a {
  color: var(--accent2);
}

.radar-sources a:hover {
  color: #fff;
}

/* =========================================================
   API Sourcing
   ========================================================= */

.api-sourcing-table {
  overflow-x: auto;
  border-radius: 12px;
}

.api-sourcing-table table {
  min-width: 1050px;
}

.api-sourcing-table td:nth-child(4),
.api-sourcing-table td:nth-child(5),
.api-sourcing-table td:nth-child(6),
.api-sourcing-table td:nth-child(7),
.api-sourcing-table td:nth-child(8) {
  white-space: nowrap;
}

.status-verified {
  color: var(--good);
  font-weight: 700;
}

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

/* =========================================================
   Footer / Misc
   ========================================================= */

footer {
  color: var(--muted);
  padding: 42px 0;
  margin-top: 40px;
  border-top: 1px solid var(--line);
}

code {
  background: #07101d;
  padding: 2px 6px;
  border-radius: 5px;
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 1000px) {
  .brand img {
    height: 46px;
    max-width: 270px;
  }

  nav {
    gap: 14px;
  }

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

@media (max-width: 850px) {
  nav {
    display: none;
  }

  .stats,
  .meta,
  .three,
  .two {
    grid-template-columns: 1fr 1fr;
  }

  .hero h1 {
    font-size: 38px;
  }

  .brand img {
    height: 44px;
  }
}

@media (max-width: 560px) {
  .container {
    padding: 0 16px;
  }

  .nav {
    min-height: 62px;
  }

  .brand img {
    height: 38px;
    max-width: 235px;
  }

  .stats,
  .meta,
  .three,
  .two,
  .form-grid,
  .radar-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 42px;
  }

  .hero h1 {
    font-size: 32px;
  }

  .search {
    display: block;
  }

  .search button {
    width: 100%;
    margin-top: 8px;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .radar-head {
    display: block;
  }

  .radar-confidence {
    text-align: left;
    margin-top: 10px;
  }

  th,
  td {
    padding: 11px 10px;
  }
}
