:root {
  --ink: #17201b;
  --muted: #5f6e65;
  --paper: #fbf7ed;
  --panel: #fffdf8;
  --line: #ded5c2;
  --green: #236756;
  --teal: #177f89;
  --amber: #bf7a1f;
  --red: #b24a34;
  --blue: #315f96;
  --shadow: 0 24px 70px rgba(43, 36, 20, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Avenir Next", "Trebuchet MS", Verdana, sans-serif;
  background:
    radial-gradient(circle at 8% 8%, rgba(35, 103, 86, 0.18), transparent 26rem),
    radial-gradient(circle at 90% 12%, rgba(191, 122, 31, 0.16), transparent 22rem),
    linear-gradient(135deg, #f7efe0 0%, #fdfaf2 48%, #edf3ee 100%);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 20;
  padding: 10px 14px;
  border-radius: 999px;
  color: #fffdf8;
  background: var(--green);
  font-weight: 900;
}

.skip-link:focus {
  top: 16px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.shell {
  width: min(1440px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 56px;
}

.hero {
  display: grid;
  grid-template-columns: 1fr 390px;
  gap: 28px;
  align-items: stretch;
  margin-bottom: 24px;
}

.hero,
.card,
.metric {
  border: 1px solid rgba(112, 96, 65, 0.2);
  background: rgba(255, 253, 248, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero {
  border-radius: 34px;
  padding: 34px;
  overflow: hidden;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  right: 28%;
  bottom: -80px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: repeating-linear-gradient(45deg, rgba(35, 103, 86, 0.12), rgba(35, 103, 86, 0.12) 8px, transparent 8px, transparent 16px);
  pointer-events: none;
}

.eyebrow,
.section-title span {
  margin: 0 0 12px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  max-width: 820px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 5vw, 5.7rem);
  line-height: 0.94;
  letter-spacing: -0.06em;
}

.hero-text {
  max-width: 760px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.6;
}

.run-panel {
  display: grid;
  align-content: center;
  gap: 14px;
  padding: 22px;
  border-radius: 24px;
  background: linear-gradient(180deg, #ffffff 0%, #f4efe3 100%);
  border: 1px solid var(--line);
  z-index: 1;
}

label {
  font-weight: 800;
}

select,
input,
button {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  font: inherit;
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(35, 103, 86, 0.38);
  outline-offset: 3px;
}

select,
input {
  color: var(--ink);
  background: #fffaf0;
}

button {
  border: 0;
  color: #fffdf8;
  background: linear-gradient(135deg, var(--green), var(--teal));
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(23, 127, 137, 0.22);
}

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

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

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

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

.metric {
  min-height: 130px;
  border-radius: 26px;
  padding: 22px;
}

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

.metric strong {
  display: block;
  margin-top: 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.3rem;
  letter-spacing: -0.04em;
}

.two-column {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 16px;
  margin-bottom: 16px;
}

.card {
  border-radius: 28px;
  padding: 24px;
  margin-bottom: 16px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: baseline;
  margin-bottom: 18px;
}

.section-title strong {
  font-size: 1rem;
}

.source-list,
.insight-grid,
.lens-grid {
  display: grid;
  gap: 12px;
}

.source-item,
.insight,
.lens-item {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: #fffaf0;
}

.source-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.source-item h3,
.insight h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.source-item p,
.insight p,
.lens-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

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

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

.lens-item span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.lens-item strong {
  display: block;
  margin: 8px 0;
  color: var(--green);
  font-size: 1.25rem;
}

.lens-item.primary {
  background: linear-gradient(180deg, #fffdf8 0%, #ecf4ef 100%);
}

.lens-item .ok {
  color: var(--green);
}

.lens-item .warn {
  color: var(--amber);
}

.source-item button,
.table-button {
  width: auto;
  align-self: center;
  padding: 10px 13px;
  border-radius: 999px;
  font-size: 0.84rem;
  box-shadow: none;
}

.table-button {
  color: #fffdf8;
  white-space: nowrap;
}

.bars {
  display: grid;
  gap: 12px;
}

.bar-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.9rem;
}

.bar-progress {
  appearance: none;
  width: 100%;
  height: 13px;
  border: 0;
  border-radius: 999px;
  background: #eee5d4;
  overflow: hidden;
}

.bar-progress::-webkit-progress-bar {
  border-radius: 999px;
  background: #eee5d4;
}

.bar-progress::-webkit-progress-value {
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--amber));
}

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

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

.filter-panel {
  display: grid;
  grid-template-columns: 1.4fr minmax(190px, 0.65fr) minmax(220px, 0.75fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fffaf0;
}

.filter-panel label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.86rem;
}

.filter-count {
  align-self: center;
  padding: 12px 14px;
  border-radius: 999px;
  color: var(--green);
  background: #e9f2ee;
  font-weight: 900;
  white-space: nowrap;
}

.severity {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 5px 9px;
  border-radius: 999px;
  color: #fff;
  background: var(--blue);
  font-size: 0.78rem;
  font-weight: 900;
}

.severity.high {
  background: var(--red);
}

.severity.medium {
  background: var(--amber);
}

.table-wrap,
.preview {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fffaf0;
}

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

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

th {
  color: var(--green);
  background: #f5ecd9;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

td {
  color: #27332d;
}

.pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 9px;
  background: #e9f2ee;
  color: var(--green);
  font-weight: 800;
}

.negative {
  color: var(--green);
  font-weight: 900;
}

.positive {
  color: var(--red);
  font-weight: 900;
}

.preview {
  max-height: 420px;
  padding: 0;
}

.preview table {
  min-width: 980px;
}

.empty {
  padding: 18px;
  color: var(--muted);
}

.detail-panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fffaf0;
  padding: 16px;
}

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

.detail-box {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: #fffdf8;
}

.detail-box h3 {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 0.9rem;
}

.detail-box p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.detail-evidence {
  max-height: 360px;
}

@media (max-width: 980px) {
  .shell {
    width: min(100% - 24px, 760px);
  }

  .hero,
  .two-column,
  .metrics,
  .insight-grid,
  .lens-grid,
  .filter-panel,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 24px;
  }

  table {
    min-width: 720px;
  }

  .source-item {
    grid-template-columns: 1fr;
  }
}

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

  .hero,
  .card,
  .metric {
    border-radius: 20px;
  }

  .hero,
  .card {
    padding: 18px;
  }

  table {
    min-width: 640px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}
