:root {
  color-scheme: light;
  --ink: #15201d;
  --muted: #60706b;
  --line: #dce5e1;
  --surface: #f7faf8;
  --panel: #ffffff;
  --teal: #0e8f7e;
  --teal-dark: #096c61;
  --coral: #f36f4f;
  --amber: #efb046;
  --blue: #2f6df6;
  --charcoal: #101816;
  --shadow: 0 24px 70px rgba(21, 32, 29, 0.11);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(140deg, rgba(14, 143, 126, 0.12), transparent 34%),
    linear-gradient(20deg, rgba(243, 111, 79, 0.12), transparent 34%),
    var(--surface);
}

button,
input {
  font: inherit;
}

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

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 0 34px;
}

.brand,
.nav-links,
.input-row,
.control-row,
.panel-head,
.tabs,
.mini-stats {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 800;
  font-size: 1.08rem;
}

.brand-mark,
.metric-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: #fff;
  background: var(--charcoal);
  border-radius: 8px;
}

.brand-mark svg,
.metric-icon svg,
button svg {
  width: 20px;
  height: 20px;
}

.nav-links {
  gap: 8px;
  color: var(--muted);
  font-size: 0.94rem;
}

.nav-links a {
  padding: 10px 12px;
  border-radius: 8px;
}

.nav-links a:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.74fr);
  gap: 30px;
  align-items: end;
  min-height: 440px;
  padding: 54px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background:
    radial-gradient(circle at 86% 18%, rgba(255, 255, 255, 0.96) 0 12%, transparent 13%),
    linear-gradient(135deg, rgba(16, 24, 22, 0.92), rgba(15, 80, 76, 0.88)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='540' viewBox='0 0 900 540'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.18' stroke-width='2'%3E%3Cpath d='M0 438C102 372 181 373 278 418s198 80 314 17 177-151 308-113'/%3E%3Cpath d='M0 327c115-77 229-64 342 41s216 97 332 0 146-96 226-57'/%3E%3Cpath d='M0 203c119-40 217-15 292 75s176 115 303 35 210-154 305-131'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
  color: #fff;
  box-shadow: var(--shadow);
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.5rem, 5.4vw, 5.3rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.hero-text {
  max-width: 660px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.08rem;
  line-height: 1.7;
}

.eyebrow,
.metric-label {
  margin: 0 0 10px;
  color: var(--teal);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #9ee4d8;
}

.test-panel,
.panel,
.score-card,
.metric-card {
  border: 1px solid rgba(220, 229, 225, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  box-shadow: 0 18px 50px rgba(21, 32, 29, 0.09);
}

.test-panel {
  padding: 22px;
  backdrop-filter: blur(16px);
}

.test-panel label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.input-row {
  gap: 10px;
}

.input-row input {
  min-width: 0;
  width: 100%;
  height: 52px;
  padding: 0 16px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  outline: none;
}

.input-row input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(14, 143, 126, 0.14);
}

.primary-btn,
.ghost-btn,
.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}

.primary-btn {
  height: 52px;
  padding: 0 18px;
  color: #fff;
  background: var(--coral);
  font-weight: 800;
}

.primary-btn:disabled {
  cursor: wait;
  opacity: 0.7;
}

.ghost-btn,
.tab {
  color: var(--muted);
  background: #edf4f1;
  font-weight: 750;
}

.ghost-btn {
  padding: 0 13px;
}

.ghost-btn:hover,
.tab:hover,
.tab.active {
  color: var(--ink);
  background: #dceee8;
}

.control-row {
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf8;
}

.chip input {
  accent-color: var(--teal);
}

.hint {
  min-height: 22px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.summary-grid,
.content-grid {
  display: grid;
  gap: 18px;
}

.summary-grid {
  grid-template-columns: 1.25fr repeat(3, 1fr);
  margin-top: 18px;
}

.score-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  align-items: center;
  padding: 24px;
}

.score-ring {
  display: grid;
  place-items: center;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  background: conic-gradient(var(--teal) calc(var(--score) * 1%), #e8efec 0);
  position: relative;
}

.score-ring::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: #fff;
}

.score-ring span {
  position: relative;
  z-index: 1;
  font-size: 2rem;
  font-weight: 900;
}

.score-card h2,
.panel h2 {
  margin: 0;
  font-size: 1.25rem;
}

.score-card p:last-child,
.dark-panel p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.metric-card {
  padding: 22px;
}

.metric-icon {
  width: 44px;
  height: 44px;
  margin-bottom: 18px;
  color: var(--teal-dark);
  background: #dceee8;
}

.metric-card strong {
  display: block;
  font-size: 1.75rem;
  line-height: 1;
}

.metric-card small {
  display: block;
  margin-top: 9px;
  color: var(--muted);
}

.content-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  margin-top: 18px;
}

.panel {
  padding: 24px;
}

.panel-head {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

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

.bar-row {
  display: grid;
  grid-template-columns: 118px 1fr 78px;
  align-items: center;
  gap: 14px;
}

.bar-name,
.bar-value {
  color: var(--muted);
  font-size: 0.9rem;
}

.track {
  height: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9f0ed;
}

.fill {
  display: block;
  width: var(--width, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--blue));
  transition: width 420ms ease;
}

.signal-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.signal-list div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.signal-list dt {
  color: var(--muted);
}

.signal-list dd {
  margin: 0;
  font-weight: 800;
  text-align: right;
  word-break: break-word;
}

.lab-panel {
  margin-top: 18px;
  background:
    linear-gradient(180deg, rgba(14, 143, 126, 0.08), rgba(255, 255, 255, 0.94) 42%),
    #fff;
}

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

.lab-card {
  min-height: 132px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
  position: relative;
}

.lab-card p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.lab-card strong {
  display: block;
  font-size: 1.5rem;
  line-height: 1;
}

.lab-card small {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.35;
}

.lab-status {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--amber);
}

.lab-card.good .lab-status,
.audit-row.pass .audit-dot {
  background: var(--teal);
}

.lab-card.warn .lab-status {
  background: var(--amber);
}

.lab-card.bad .lab-status,
.audit-row.fail .audit-dot {
  background: var(--coral);
}

.audit-list,
.origin-list {
  display: grid;
  gap: 9px;
}

.audit-row {
  display: grid;
  grid-template-columns: 14px minmax(110px, 0.7fr) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.audit-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.audit-row strong,
.origin-row strong {
  font-size: 0.92rem;
}

.audit-row small {
  overflow-wrap: anywhere;
  color: var(--muted);
  line-height: 1.35;
}

.origin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.origin-row span {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.origin-row strong {
  display: grid;
  place-items: center;
  width: 34px;
  height: 28px;
  border-radius: 999px;
  color: var(--teal-dark);
  background: #dceee8;
}

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

.tabs {
  gap: 8px;
  flex-wrap: wrap;
}

.tab {
  min-height: 36px;
  padding: 0 12px;
}

.asset-table {
  display: grid;
  gap: 8px;
}

.asset-row {
  display: grid;
  grid-template-columns: 90px 1fr 90px;
  gap: 12px;
  align-items: center;
  min-height: 46px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.asset-type {
  color: var(--teal-dark);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.asset-url {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-risk {
  justify-self: end;
  padding: 5px 9px;
  border-radius: 999px;
  color: #744400;
  background: #fff1d6;
  font-size: 0.78rem;
  font-weight: 800;
}

.asset-risk.is-local {
  color: var(--teal-dark);
  background: #dceee8;
}

.recommendations {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.recommendations li {
  padding: 15px 14px 15px 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
  position: relative;
}

.recommendations li::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 17px;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: var(--teal);
}

.dark-panel {
  color: #fff;
  background: var(--charcoal);
}

.dark-panel .eyebrow {
  color: #9ee4d8;
}

.dark-panel p,
.dark-panel .mini-stats span {
  color: rgba(255, 255, 255, 0.7);
}

.mini-stats {
  gap: 14px;
  margin-top: 26px;
}

.mini-stats span {
  flex: 1;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
}

.mini-stats strong {
  display: block;
  margin-bottom: 6px;
  color: #fff;
  font-size: 1.2rem;
}

@media (max-width: 980px) {
  .hero,
  .summary-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

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

  .hero {
    padding: 38px;
  }

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

  .score-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .app-shell {
    width: min(100% - 22px, 1180px);
    padding-top: 12px;
  }

  .topbar,
  .panel-head,
  .input-row,
  .mini-stats {
    align-items: stretch;
    flex-direction: column;
  }

  .nav-links {
    width: 100%;
    justify-content: space-between;
  }

  .hero {
    min-height: auto;
    padding: 26px;
    background:
      linear-gradient(135deg, rgba(16, 24, 22, 0.94), rgba(15, 80, 76, 0.9)),
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='540' viewBox='0 0 900 540'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.18' stroke-width='2'%3E%3Cpath d='M0 438C102 372 181 373 278 418s198 80 314 17 177-151 308-113'/%3E%3Cpath d='M0 327c115-77 229-64 342 41s216 97 332 0 146-96 226-57'/%3E%3Cpath d='M0 203c119-40 217-15 292 75s176 115 303 35 210-154 305-131'/%3E%3C/g%3E%3C/svg%3E");
  }

  .hero h1 {
    font-size: 2.55rem;
  }

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

  .score-card,
  .bar-row,
  .asset-row,
  .audit-row {
    grid-template-columns: 1fr;
  }

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

  .score-ring {
    width: 104px;
    height: 104px;
  }

  .primary-btn,
  .ghost-btn {
    width: 100%;
  }

  .asset-risk {
    justify-self: start;
  }
}