:root {
  --bg: #eef5f2;
  --surface: #ffffff;
  --ink: #1e2d2a;
  --muted: #5a706a;
  --line: #d5e3de;
  --brand: #0f766e;
  --brand-deep: #115e59;
  --warn: #b45309;
  --danger: #b91c1c;
  --ok: #166534;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: radial-gradient(circle at 10% 0%, #f8fffc, var(--bg) 60%);
  color: var(--ink);
}

.hero {
  position: relative;
  height: 250px;
  overflow: hidden;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.1) contrast(1.05);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(15, 118, 110, 0.82), rgba(17, 94, 89, 0.32));
  color: #f8fdfc;
  padding: 26px clamp(16px, 4vw, 44px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
}

.hero-overlay h1 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  letter-spacing: 0.03em;
}

.hero-overlay p {
  margin: 0;
  max-width: 900px;
  font-size: 0.95rem;
}

.page-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px 0;
}

.page-tab-btn {
  border: 1px solid #bad0c9;
  background: #f5fbf8;
  color: #11453f;
  border-radius: 999px;
  padding: 8px 13px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 180ms ease;
}

.page-tab-btn:hover {
  border-color: var(--brand);
  color: var(--brand-deep);
}

.page-tab-btn.active {
  background: var(--brand);
  color: #f8fffd;
  border-color: var(--brand);
}

.page-section {
  display: none;
}

.page-section.active {
  display: block;
}

.layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 14px;
  padding: 14px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 16px rgba(16, 40, 35, 0.04);
  padding: 14px;
}

.controls h2,
.visual h2 {
  margin-top: 0;
}

.block-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

input[type="file"] {
  width: 100%;
}

.hint {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 10px 0 12px;
}

.threshold-grid {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.threshold-grid h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.threshold-grid label {
  display: grid;
  gap: 5px;
  font-size: 0.87rem;
}

.threshold-grid input,
.threshold-grid select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  font-size: 0.95rem;
  background: #ffffff;
  color: var(--ink);
}

.threshold-grid input:disabled,
.threshold-grid select:disabled {
  background: #f1f5f3;
  color: #637870;
}

.tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.tab-btn {
  border: 1px solid #bad0c9;
  background: #f5fbf8;
  color: #11453f;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.86rem;
  cursor: pointer;
  transition: all 180ms ease;
}

.tab-btn:hover {
  border-color: var(--brand);
  color: var(--brand-deep);
}

.tab-btn.active {
  background: var(--brand);
  color: #f8fffd;
  border-color: var(--brand);
}

.tab-illustration {
  margin: 6px 0 10px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.tab-plate {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f6faf8;
  padding: 6px;
  display: grid;
  gap: 6px;
  cursor: pointer;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.tab-plate:hover {
  border-color: #8ec2b4;
  transform: translateY(-1px);
}

.tab-plate.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.12);
}

.tab-plate img {
  display: block;
  width: 100%;
  height: 110px;
  border-radius: 8px;
  object-fit: cover;
}

.tab-plate span {
  font-size: 0.8rem;
  font-weight: 600;
  color: #274c43;
  text-align: center;
}

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

.canvas-grid h3,
.analytics-grid h3 {
  margin: 0 0 6px;
  font-size: 0.95rem;
}

canvas {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f9fbfa;
}

.analytics-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 130px 1fr 250px;
  gap: 10px;
}

.legend-wrap,
.hist-wrap,
.status-wrap {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #fcfefd;
}

.small {
  margin: 6px 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.status {
  display: inline-block;
  margin: 0;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
}

.status-head {
  margin-bottom: 8px;
}

.status.neutral {
  background: #e2e8f0;
  color: #334155;
}

.status.ok {
  background: #dcfce7;
  color: var(--ok);
}

.status.warn {
  background: #fef3c7;
  color: var(--warn);
}

.status.bad {
  background: #fee2e2;
  color: var(--danger);
}

.status-summary {
  margin: 0 0 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f2f8f5;
  border: 1px solid #d8e8e2;
  color: #294f45;
  font-size: 0.82rem;
  line-height: 1.35;
}

.status-rule {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f9fcfb;
  border: 1px dashed #c8ddd5;
  color: #3d5d54;
  font-size: 0.81rem;
  line-height: 1.35;
}

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

.metric-card {
  border: 1px solid #dbe9e4;
  background: #ffffff;
  border-radius: 8px;
  padding: 8px 9px;
  display: grid;
  gap: 3px;
}

.metric-label {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #6b827a;
  font-weight: 700;
}

.metric-value {
  font-size: 0.9rem;
  color: #1f3f37;
  font-weight: 700;
}

.developers-wrap,
.funding-wrap {
  max-width: 1240px;
  margin: 14px;
}

.developers-wrap h2,
.funding-wrap h2 {
  margin: 0 0 10px;
}

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

.dev-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fcfefd;
  padding: 16px;
}

.dev-photo {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0 auto 12px;
  border: 4px solid #e4f1ec;
}

.dev-card h3 {
  margin: 0 0 10px;
  text-align: center;
  color: #23453d;
}

.dev-card p {
  margin: 0;
  color: #33574d;
  font-size: 0.93rem;
  line-height: 1.55;
  text-align: justify;
}

.developers-divider {
  border: 0;
  border-top: 1px dashed #c8ddd5;
  margin: 20px 0 14px;
}

.scholars-title {
  margin: 0 0 12px;
  color: #23453d;
}

.scholar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.scholar-photo {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  border: 4px solid #e4f1ec;
}

.scholar-card p {
  text-align: left;
}

.scholar-card p + p {
  margin-top: 10px;
}

.funding-wrap > p {
  margin: 0 0 10px;
  color: #33574d;
}

.funding-callout {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #c8ddd5;
  background: #f2f8f5;
  color: #274a41;
  font-size: 0.9rem;
  line-height: 1.45;
}

.funding-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.funding-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fcfefd;
  padding: 14px;
  display: grid;
  gap: 8px;
  justify-items: center;
  text-align: center;
}

.funding-logo {
  width: 100%;
  max-width: 210px;
  height: 92px;
  object-fit: contain;
  border: 1px solid #dbe7e2;
  border-radius: 10px;
  background: #ffffff;
  padding: 8px;
}

.funding-item h3 {
  margin: 0;
  color: #21453c;
}

.funding-item p {
  margin: 0;
  color: #33574d;
  line-height: 1.5;
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 1fr;
  }

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

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

  .tab-illustration {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }

  .hero {
    height: 220px;
  }

  .developers-wrap,
  .funding-wrap {
    margin: 14px;
  }

  .dev-grid,
  .funding-list {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .status-metrics {
    grid-template-columns: 1fr;
  }

  .tab-illustration {
    grid-template-columns: 1fr;
  }
}
