.modnest-audit {
  max-width: 860px;
  margin: 2rem auto;
  color: var(--text-primary, #e6edf3);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
}

.modnest-audit *,
.modnest-audit *::before,
.modnest-audit *::after {
  box-sizing: border-box;
}

.modnest-audit__form,
.modnest-audit__result {
  padding: clamp(1.1rem, 3vw, 2rem);
  border: 1px solid var(--border, #30363d);
  border-radius: 18px;
  background: var(--bg-card, #1c2128);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.3);
}

.modnest-audit__intro h2 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.45rem, 3vw, 2rem);
}

.modnest-audit__intro p,
.modnest-audit__small {
  color: var(--text-secondary, #8b949e);
}

.modnest-audit label {
  display: grid;
  gap: 0.4rem;
  margin-top: 1rem;
  font-weight: 600;
}

.modnest-audit input,
.modnest-audit select,
.modnest-audit button {
  min-height: 46px;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border, #30363d);
  border-radius: 10px;
  background: var(--bg-primary, #0d1117);
  color: var(--text-primary, #e6edf3);
  font: inherit;
}

.modnest-audit__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.modnest-audit__consent {
  grid-template-columns: auto 1fr;
  align-items: start;
  font-weight: 400 !important;
}

.modnest-audit__consent input {
  min-height: 0;
  margin-top: 0.25rem;
}

.modnest-audit button {
  width: 100%;
  margin-top: 1.2rem;
  border-color: var(--accent-blue, #58a6ff);
  background: var(--accent-blue, #58a6ff);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.modnest-audit button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.modnest-audit__result {
  margin-top: 1rem;
}

.modnest-audit__score {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 800;
  line-height: 1;
}

.modnest-audit__issue {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid rgba(210, 154, 30, 0.35);
  border-left: 4px solid #d29922;
  background: rgba(210, 153, 34, 0.08);
}

.modnest-audit__facts {
  padding-left: 1.25rem;
  color: var(--text-secondary, #8b949e);
}

.modnest-audit__table-wrap {
  margin: 1rem 0;
  overflow-x: hidden;
  border: 1px solid var(--border, #30363d);
  border-radius: 10px;
}

.modnest-audit__result h4 {
  margin: 1.25rem 0 0.25rem;
  color: var(--text-primary, #e6edf3);
  font-size: 1rem;
}

.modnest-audit__gap-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
}

.modnest-audit__gap-table th:nth-child(1) {
  width: 46%;
}

.modnest-audit__gap-table th:nth-child(2) {
  width: 18%;
}

.modnest-audit__gap-table th:nth-child(3) {
  width: 12%;
}

.modnest-audit__gap-table th:nth-child(4) {
  width: 24%;
}

.modnest-audit__gap-table th,
.modnest-audit__gap-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border, #30363d);
  text-align: left;
}

.modnest-audit__gap-table th {
  color: var(--text-secondary, #8b949e);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: normal;
}

.modnest-audit__gap-table td:first-child {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.modnest-audit__gap-table td:not(:first-child) {
  white-space: nowrap;
}

.modnest-audit__gap-table tbody tr:last-child td {
  border-bottom: 0;
}

.modnest-audit__error {
  color: #ff7b72;
}

.modnest-audit__retry {
  width: auto !important;
  margin-top: 1rem !important;
  padding: 0.55rem 0.9rem !important;
  background: transparent !important;
  border-color: var(--border, #30363d) !important;
  color: var(--text-primary, #e6edf3) !important;
}

.modnest-audit__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin: 1rem 0.75rem 0 0;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  background: var(--accent-blue, #58a6ff);
  color: #fff !important;
  font-weight: 700;
  text-decoration: none;
}

.modnest-audit__cta:hover {
  filter: brightness(0.92);
}

@media (max-width: 640px) {
  .modnest-audit__grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .modnest-audit__gap-table thead {
    display: none;
  }

  .modnest-audit__gap-table,
  .modnest-audit__gap-table tbody,
  .modnest-audit__gap-table tr,
  .modnest-audit__gap-table td {
    display: block;
    width: 100%;
  }

  .modnest-audit__gap-table tr {
    padding: 0.7rem 0.8rem;
    border-bottom: 1px solid var(--border, #30363d);
  }

  .modnest-audit__gap-table tbody tr:last-child {
    border-bottom: 0;
  }

  .modnest-audit__gap-table td,
  .modnest-audit__gap-table td:not(:first-child) {
    display: grid;
    grid-template-columns: 7.5rem minmax(0, 1fr);
    gap: 0.5rem;
    padding: 0.15rem 0;
    border: 0;
    white-space: normal;
  }

  .modnest-audit__gap-table td::before {
    content: attr(data-label);
    color: var(--text-secondary, #8b949e);
    font-size: 0.78rem;
    font-weight: 700;
  }
}
