:root {
  color-scheme: light;
  --bg: #f5f6f7;
  --panel: #ffffff;
  --ink: #17202a;
  --muted: #667085;
  --line: #d8dee5;
  --soft: #f0f4f7;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --warn: #a33b20;
  --gold: #a16207;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.detail-shell {
  width: min(1120px, 100%);
}

.toolbar,
.results-pane,
.opportunity-hero,
.business-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.toolbar {
  padding: 20px;
}

.product-hero {
  display: grid;
  gap: 18px;
}

.hero-copy h1 {
  margin-bottom: 10px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.02;
}

.toolbar-copy {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 18px;
  font-size: 28px;
  line-height: 1.2;
}

h2 {
  font-size: 20px;
}

.filters,
.search-workbench {
  display: grid;
  gap: 12px;
}

.primary-search {
  gap: 8px;
}

.primary-search input {
  min-height: 56px;
  border-color: #b8c5cf;
  font-size: 17px;
}

.filter-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  gap: 12px;
  align-items: stretch;
}

.filter-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.sort-panel {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.sort-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.industry-nav {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

.industry-nav > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.industry-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.industry-chip {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
  font-size: 13px;
  font-weight: 750;
}

.industry-chip:hover {
  border-color: var(--accent);
  background: #f4fbf9;
  color: var(--accent-strong);
}

.industry-chip b {
  color: var(--muted);
  font-size: 12px;
}

.industry-chip.skeleton {
  color: var(--muted);
  cursor: default;
}

.quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.quick-filter {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 800;
}

.quick-filter:hover,
.quick-filter.is-active {
  border-color: var(--accent);
  background: #f4fbf9;
  color: var(--accent-strong);
}

.intel-overview {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.hero-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.stat-card b {
  display: block;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.1;
}

.stat-card span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.intel-panels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.intel-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.panel-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.panel-heading h2 {
  margin: 0;
  font-size: 16px;
}

.panel-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.sector-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.sector-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 10px;
  text-align: left;
}

.sector-row:hover {
  border-color: var(--accent);
  background: #f4fbf9;
  color: var(--ink);
}

.sector-row span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.sector-row b,
.sector-row em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sector-row b {
  font-size: 14px;
}

.sector-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.sector-row strong {
  flex: 0 0 auto;
  color: var(--accent-strong);
  font-size: 18px;
}

.source-ranking {
  display: grid;
  gap: 8px;
}

.source-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  width: 100%;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 10px;
  text-align: left;
}

.source-row:hover {
  border-color: var(--accent);
  background: #f4fbf9;
}

.source-row span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.source-row b,
.source-row em,
.source-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-row em,
.source-row small {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.source-row strong {
  color: var(--accent-strong);
  font-size: 18px;
}

.source-row small {
  grid-column: 1 / -1;
}

.keyword-cloud,
.keyword-tags,
.sector-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.keyword-pill,
.keyword-tag,
.sector-signals a {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 0 9px;
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
}

.keyword-pill {
  gap: 6px;
}

.keyword-pill:hover,
.keyword-tag:hover,
.sector-signals a:hover {
  border-color: var(--accent);
  background: #f4fbf9;
  color: var(--accent-strong);
}

.keyword-pill b {
  color: var(--muted);
  font-size: 11px;
}

.keyword-tags {
  margin-top: 2px;
}

.keyword-tag {
  min-height: 26px;
  background: #f8fafc;
  color: #344054;
  cursor: pointer;
}

.detail-keywords {
  margin-top: 14px;
}

.sector-signals {
  align-items: center;
  margin-top: 12px;
}

.sector-signals span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.state.compact {
  padding: 6px 0;
  font-size: 13px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

input,
select,
button {
  min-height: 42px;
  border-radius: 6px;
  font: inherit;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
}

button {
  border: 0;
  background: var(--accent);
  color: #fff;
  padding: 0 18px;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: var(--accent-strong);
}

.results-pane {
  margin-top: 18px;
  min-height: 560px;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.results-header h2 {
  margin: 0;
}

#count {
  color: var(--muted);
  font-size: 14px;
}

.results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
}

.result-card {
  display: grid;
  gap: 10px;
  min-height: 240px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  padding: 16px;
  text-decoration: none;
}

.result-card:hover {
  border-color: var(--accent);
  background: #f4fbf9;
}

.result-card strong {
  font-size: 18px;
  line-height: 1.35;
}

.card-topline,
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.source,
.confidence,
.pool-badge {
  width: fit-content;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 800;
}

.source {
  background: #e7f4f1;
  color: var(--accent-strong);
}

.fit {
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
}

.pool-badge {
  border: 1px solid transparent;
}

.pool-content {
  background: #e7f4f1;
  color: var(--accent-strong);
}

.pool-export {
  background: #fff7ed;
  color: #9a3412;
}

.pool-ai {
  background: #eef2ff;
  color: #3730a3;
}

.pool-thin {
  background: #f2f4f7;
  color: var(--muted);
}

.confidence-high {
  background: #e7f4f1;
  color: var(--accent-strong);
}

.confidence-medium {
  background: #fff7ed;
  color: #9a3412;
}

.confidence-low {
  background: #f2f4f7;
  color: var(--muted);
}

.original-title,
.card-facts span,
.state {
  color: var(--muted);
}

.original-title {
  font-size: 13px;
  line-height: 1.45;
}

.summary {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: #344054;
  font-size: 14px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.card-highlight {
  display: grid;
  gap: 3px;
  border-left: 3px solid #cbd5e1;
  padding-left: 9px;
  color: #344054;
  font-size: 13px;
  line-height: 1.45;
}

.card-highlight b {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.card-highlight span {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: auto;
}

.card-facts span {
  display: grid;
  gap: 2px;
  min-width: 0;
  border-top: 1px solid var(--line);
  padding-top: 8px;
  font-size: 13px;
}

.card-facts b {
  color: var(--ink);
  font-size: 12px;
}

.state {
  padding: 24px 12px;
}

.state.error {
  color: var(--warn);
}

.education-showcase {
  display: grid;
  grid-column: 1 / -1;
  gap: 16px;
}

.education-intro,
.education-detail,
.education-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.education-intro h3,
.education-group-heading h3 {
  margin: 0;
  font-size: 18px;
}

.education-intro p {
  max-width: 900px;
  margin-bottom: 8px;
  color: #344054;
  line-height: 1.6;
}

.education-intro p:last-child {
  margin-bottom: 0;
}

.education-detail {
  display: grid;
  gap: 14px;
}

.education-detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.education-detail-heading h3 {
  margin: 8px 0 0;
  font-size: 22px;
  line-height: 1.3;
}

.education-official-link {
  flex: 0 0 auto;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent-strong);
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.education-official-link:hover {
  background: #f4fbf9;
}

.education-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.education-detail-grid span,
.education-project-explanation,
.education-intelligence section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.education-detail-grid span {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.education-detail-grid b,
.education-project-explanation h4,
.education-intelligence h4 {
  color: var(--ink);
  font-size: 12px;
}

.education-project-explanation {
  background: #ffffff;
  border-color: #cce7de;
  padding: 16px;
}

.education-project-explanation h4 {
  margin: 0 0 8px;
  text-transform: uppercase;
}

.education-project-explanation p {
  margin: 0;
  color: #1f2937;
  font-size: 15px;
  line-height: 1.7;
}

.education-intelligence {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.education-intelligence h4 {
  margin: 0 0 6px;
  text-transform: uppercase;
}

.education-intelligence p {
  margin: 0;
  color: #344054;
  font-size: 14px;
  line-height: 1.6;
}

.education-intelligence p b {
  color: var(--ink);
}

.education-group-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.education-group-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.education-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.education-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 14px;
  text-decoration: none;
  text-align: left;
}

.education-card:hover {
  border-color: var(--accent);
  background: #f4fbf9;
}

.education-card[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.education-card strong {
  font-size: 17px;
  line-height: 1.35;
}

.education-type {
  width: fit-content;
  border-radius: 999px;
  background: #f2f4f7;
  color: #475467;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 800;
}

.education-card-facts {
  display: grid;
  gap: 8px;
  margin-top: auto;
}

.education-card-facts span {
  display: grid;
  gap: 2px;
  min-width: 0;
  border-top: 1px solid var(--line);
  padding-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.education-card-facts b {
  color: var(--ink);
  font-size: 12px;
}

.breadcrumb {
  margin-bottom: 14px;
}

.breadcrumb a,
.links a {
  color: var(--accent-strong);
  font-weight: 700;
}

.opportunity-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 22px;
  padding: 22px;
}

.opportunity-hero h1 {
  margin: 14px 0 8px;
  font-size: 30px;
}

.hero-facts,
.facts {
  display: grid;
  gap: 12px;
  margin: 0;
}

.hero-facts {
  grid-template-columns: 1fr;
}

.facts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hero-facts div,
.facts div {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
}

dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

dd {
  margin: 4px 0 0;
  line-height: 1.45;
}

.business-section {
  margin-top: 14px;
  padding: 18px;
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.analysis-grid article {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.analysis-grid h3,
.raw-section h3 {
  margin-bottom: 8px;
  font-size: 15px;
}

.business-section p,
.business-list,
pre {
  color: #344054;
  line-height: 1.6;
}

.business-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

.evidence-list {
  display: grid;
  gap: 10px;
}

.evidence-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.evidence-item b,
.evidence-item span {
  display: block;
  overflow-wrap: anywhere;
}

.evidence-item b {
  color: var(--ink);
  font-size: 13px;
}

.evidence-item span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.evidence-item p {
  margin: 8px 0 0;
}

pre {
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
}

@media (max-width: 900px) {
  .shell {
    padding: 14px;
  }

  .filters,
  .filter-layout,
  .filter-panel,
  .results,
  .education-cards,
  .education-detail-grid,
  .education-project-explanation,
  .education-intelligence,
  .opportunity-hero,
  .analysis-grid,
  .facts,
  .stat-grid,
  .intel-panels,
  .sector-list {
    grid-template-columns: 1fr;
  }

  .industry-nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .education-group-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .education-detail-heading {
    flex-direction: column;
  }

  .results-pane {
    min-height: 0;
  }
}
