:root {
  color-scheme: light;
  --bg: #f5f7f3;
  --surface: #ffffff;
  --surface-2: #eef4f1;
  --text: #18211f;
  --muted: #65706b;
  --line: #dbe2dd;
  --teal: #08756d;
  --teal-dark: #075a55;
  --amber: #b66524;
  --berry: #8c3e5c;
  --green: #3c743f;
  --red: #b6423e;
  --shadow: 0 14px 34px rgba(25, 36, 33, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(8, 117, 109, 0.08), rgba(8, 117, 109, 0) 280px),
    var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

a {
  color: var(--teal-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

main {
  width: calc(100% - 40px);
  max-width: 1500px;
  margin: 0 auto 56px;
}

.topbar {
  min-height: 230px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  width: calc(100% - 40px);
  max-width: 1500px;
  margin: 0 auto;
  padding: 42px 0 28px;
}

.topbar > *,
.partner-strip > *,
.workspace > *,
.panel-heading > *,
.standard-definition,
.standards-detail-card {
  min-width: 0;
}

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

h1,
h2,
h3,
p {
  margin-top: 0;
  overflow-wrap: break-word;
}

h1 {
  max-width: 820px;
  margin-bottom: 12px;
  font-size: 4.4rem;
  line-height: 0.98;
  letter-spacing: 0;
  overflow-wrap: break-word;
}

h2 {
  margin-bottom: 0;
  font-size: 1.45rem;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 12px;
  font-size: 1rem;
  letter-spacing: 0;
}

.lede {
  max-width: 820px;
  width: 100%;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.04rem;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.primary-action,
.secondary-action {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.primary-action {
  background: var(--teal);
  color: white;
  box-shadow: var(--shadow);
}

.secondary-action {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}

.primary-action:hover,
.secondary-action:hover {
  transform: translateY(-1px);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric {
  min-height: 130px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
  box-shadow: var(--shadow);
}

.metric-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.metric strong {
  font-size: 2.2rem;
  line-height: 1;
}

.metric span:last-child {
  color: var(--muted);
  font-size: 0.9rem;
}

.partner-strip {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) 360px;
  gap: 22px;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 22px;
  box-shadow: var(--shadow);
}

.partner-copy {
  display: flex;
  min-height: 300px;
  flex-direction: column;
  justify-content: center;
}

.partner-copy h2 {
  max-width: 780px;
  margin-bottom: 12px;
  font-size: 2rem;
  line-height: 1.1;
}

.partner-copy p {
  max-width: 820px;
  color: var(--muted);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tag-row span,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 750;
}

.product-visual {
  margin: 0;
  min-height: 300px;
  border-radius: 8px;
  background: #f7faf8;
  overflow: hidden;
}

.product-visual img {
  width: 100%;
  height: 100%;
  min-height: 300px;
  object-fit: cover;
  display: block;
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.insight {
  min-height: 210px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
}

.insight span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.insight strong {
  display: block;
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.insight p {
  margin: 0;
  color: var(--muted);
}

.accent-teal {
  border-top: 5px solid var(--teal);
}

.accent-amber {
  border-top: 5px solid var(--amber);
}

.accent-berry {
  border-top: 5px solid var(--berry);
}

.workspace {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}

.filters {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
  box-shadow: var(--shadow);
}

.filters label,
.filters legend {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.filters input[type="search"],
.filters select {
  width: 100%;
  min-height: 40px;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  color: var(--text);
  padding: 0 10px;
}

.filters fieldset {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0;
  padding: 12px;
}

.check {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--text) !important;
  font-weight: 650 !important;
}

.check input {
  width: 16px;
  height: 16px;
  accent-color: var(--teal);
}

.full-width {
  width: 100%;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
  box-shadow: var(--shadow);
}

.panel + .panel {
  margin-top: 18px;
}

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

.result-count {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}

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

.supplier-card {
  display: grid;
  min-height: 310px;
  grid-template-rows: auto auto 1fr auto;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
  padding: 14px;
  cursor: pointer;
}

.supplier-card:hover {
  border-color: rgba(8, 117, 109, 0.5);
  transform: translateY(-2px);
}

.card-top {
  display: flex;
  gap: 12px;
  align-items: start;
  justify-content: space-between;
}

.supplier-name {
  margin: 0 0 4px;
  font-size: 1.05rem;
}

.model-name {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.priority {
  min-width: 68px;
  border-radius: 999px;
  padding: 4px 8px;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.priority.high {
  background: rgba(8, 117, 109, 0.12);
  color: var(--teal-dark);
}

.priority.medium {
  background: rgba(182, 101, 36, 0.14);
  color: #824311;
}

.priority.watch {
  background: rgba(140, 62, 92, 0.14);
  color: var(--berry);
}

.summary {
  color: var(--muted);
  font-size: 0.92rem;
}

.fact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.fact {
  min-height: 64px;
  border-radius: 8px;
  background: var(--surface-2);
  padding: 9px;
}

.fact span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.fact strong {
  display: block;
  font-size: 0.86rem;
}

.card-footer {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.source-count {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.table-wrap,
.score-table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

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

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f0f6f3;
  color: #33413d;
  font-size: 0.78rem;
  text-transform: uppercase;
}

td {
  color: #2e3935;
  font-size: 0.9rem;
}

tbody tr:hover {
  background: #f8fbf9;
}

.links-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.status-pill {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 0.76rem;
  font-weight: 800;
}

.status-good {
  background: rgba(60, 116, 63, 0.15);
  color: var(--green);
}

.status-risk {
  background: rgba(182, 101, 36, 0.15);
  color: #824311;
}

.status-gap {
  background: rgba(182, 66, 62, 0.14);
  color: var(--red);
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.comparison-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
  padding: 16px;
}

.comparison-grid ul,
.details-dialog ul {
  margin: 0;
  padding-left: 18px;
}

.comparison-grid li + li,
.details-dialog li + li {
  margin-top: 8px;
}

.score-table {
  min-width: 960px;
}

.message-chart {
  display: grid;
  gap: 12px;
}

.chart-row {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 44px;
  gap: 12px;
  align-items: center;
}

.chart-label {
  color: #2e3935;
  font-weight: 750;
}

.bar-track {
  height: 18px;
  border-radius: 999px;
  background: #e3ebe6;
  overflow: hidden;
}

.bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--amber));
}

.chart-value {
  color: var(--muted);
  font-weight: 800;
  text-align: right;
}

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

.source-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
  padding: 14px;
}

.source-item h3 {
  margin-bottom: 8px;
}

.source-item p {
  margin-bottom: 10px;
  color: var(--muted);
}

.source-item a {
  word-break: break-word;
}

.details-dialog {
  width: min(760px, calc(100% - 28px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  color: var(--text);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.24);
}

.details-dialog::backdrop {
  background: rgba(19, 29, 26, 0.42);
}

#dialogContent {
  padding: 24px;
}

.close-button {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  font-weight: 900;
}

.dialog-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 18px;
}

.dialog-section {
  margin-top: 20px;
}

.empty-state {
  min-height: 160px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.standards-hero {
  min-height: 250px;
}

.standards-metrics {
  margin-bottom: 18px;
}

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

.standard-definition {
  min-height: 170px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
  padding: 14px;
}

.standard-definition span {
  display: block;
  margin-bottom: 8px;
  color: var(--teal-dark);
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
}

.standard-definition h3 {
  margin-bottom: 8px;
}

.standard-definition p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.matrix-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  justify-content: flex-end;
}

.matrix-controls label {
  display: grid;
  gap: 6px;
  min-width: 220px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.matrix-controls input,
.matrix-controls select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  color: var(--text);
  padding: 0 10px;
}

.legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: -2px 0 14px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.legend-row span {
  display: inline-flex;
  gap: 7px;
  align-items: center;
}

.dot {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 50%;
}

.dot.good {
  background: var(--green);
}

.dot.partial {
  background: var(--amber);
}

.dot.missing {
  background: var(--red);
}

.standards-table {
  min-width: 1500px;
}

.standards-table td {
  font-size: 0.86rem;
}

.standard-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.standard-chip {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 0.74rem;
  font-weight: 800;
  white-space: nowrap;
}

.standard-chip.good {
  background: rgba(60, 116, 63, 0.13);
  color: var(--green);
}

.standard-chip.partial {
  background: rgba(182, 101, 36, 0.15);
  color: #824311;
}

.standard-chip.missing {
  background: rgba(182, 66, 62, 0.13);
  color: var(--red);
}

.compact-list {
  margin: 0;
  padding-left: 17px;
}

.compact-list li + li {
  margin-top: 4px;
}

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

.standards-detail-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
  padding: 14px;
}

.standards-detail-card h3 {
  margin-bottom: 4px;
}

.standards-card-section {
  display: grid;
  gap: 7px;
}

.standards-card-section strong {
  font-size: 0.82rem;
  text-transform: uppercase;
  color: #33413d;
}

.standards-card-section p {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 1180px) {
  h1 {
    font-size: 3.25rem;
  }

  .metrics-grid,
  .insight-grid,
  .cards-grid,
  .comparison-grid,
  .standard-definition-grid,
  .standards-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .partner-strip {
    grid-template-columns: 1fr;
  }

  .product-visual {
    max-height: 360px;
  }
}

@media (max-width: 860px) {
  h1 {
    font-size: 2.45rem;
  }

  main,
  .topbar {
    width: calc(100% - 24px);
    max-width: 1500px;
  }

  .topbar {
    min-height: auto;
    grid-template-columns: 1fr;
    padding-top: 26px;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .metrics-grid,
  .insight-grid,
  .cards-grid,
  .comparison-grid,
  .source-library,
  .standard-definition-grid,
  .standards-card-grid {
    grid-template-columns: 1fr;
  }

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

  .filters {
    position: static;
  }

  .partner-copy {
    min-height: auto;
  }

  .partner-copy h2 {
    font-size: 1.55rem;
  }

  .chart-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .chart-value {
    text-align: left;
  }

  .matrix-controls {
    justify-content: stretch;
  }

  .matrix-controls label {
    min-width: 100%;
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: 1.72rem;
    line-height: 1.12;
  }

  .topbar > div:first-child,
  .partner-copy,
  .partner-copy h2,
  .partner-copy p,
  .lede {
    max-width: calc(100vw - 52px);
  }

  .partner-copy p,
  .lede {
    max-width: 300px;
  }

  .standard-definition,
  .standards-detail-card {
    max-width: calc(100vw - 52px);
  }

  .standard-definition p,
  .standards-card-section p,
  .compact-list {
    max-width: 300px;
  }

  .primary-action,
  .secondary-action {
    width: 100%;
  }

  .metric,
  .panel,
  .partner-strip,
  .filters {
    padding: 14px;
  }
}
