:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --paper: #ffffff;
  --ink: #18202a;
  --muted: #53606f;
  --line: #d8dee8;
  --teal: #0f766e;
  --teal-dark: #115e59;
  --plum: #7c3aed;
  --rust: #9a3412;
  --code-bg: #111827;
  --code-ink: #f9fafb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

a {
  color: var(--teal-dark);
  font-weight: 650;
}

.page-shell {
  width: min(948px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 64px;
}

.hero {
  padding: 24px 0 30px;
  border-bottom: 1px solid var(--line);
}

.hero h1 {
  max-width: 860px;
  margin: 0 0 16px;
  font-size: clamp(2.3rem, 6vw, 4.8rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero p {
  max-width: 760px;
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 1.12rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 14px;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
}

button.button {
  appearance: none;
}

.button-primary {
  border-color: var(--teal);
  background: var(--teal);
  color: #ffffff;
}

.copy-status {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  color: var(--teal-dark);
  font-size: 0.95rem;
  font-weight: 700;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 28px 0 36px;
}

.summary-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 20px;
}

.summary-card h2 {
  margin-top: 0;
  font-size: 1.08rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--muted);
  text-decoration: none;
}

.markdown-page {
  max-width: 920px;
}

h2 {
  margin-top: 42px;
  padding-top: 8px;
  font-size: 1.55rem;
  line-height: 1.2;
}

table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 18px 0;
  background: var(--paper);
}

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

th {
  background: #eef2f7;
  text-align: left;
}

ol,
ul {
  padding-left: 1.35rem;
}

li + li {
  margin-top: 0.38rem;
}

.workflow {
  counter-reset: step;
  list-style: none;
  padding-left: 0;
}

.workflow li {
  position: relative;
  margin-top: 12px;
  padding: 14px 16px 14px 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.workflow li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  top: 14px;
  left: 16px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--plum);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 0.82rem;
  font-weight: 800;
}

code {
  border-radius: 4px;
  background: #edf2f7;
  color: var(--ink);
  padding: 0.12rem 0.25rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
}

pre {
  overflow-x: auto;
  border-radius: 8px;
  background: var(--code-bg);
  padding: 16px;
}

pre code {
  background: transparent;
  color: var(--code-ink);
  padding: 0;
}

.highlight {
  border-radius: 8px;
  background: var(--code-bg);
}

.highlight {
  overflow-x: auto;
}

.highlight pre,
pre.highlight {
  margin: 0;
  background: var(--code-bg) !important;
}

.highlight code,
pre.highlight code {
  background: transparent;
  color: var(--code-ink);
}

.highlight .err,
.highlight .o,
.highlight .p {
  color: var(--code-ink) !important;
  background: transparent !important;
}

blockquote {
  margin: 20px 0;
  border-left: 4px solid var(--rust);
  padding: 4px 0 4px 16px;
  color: var(--muted);
}

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

.audit-tool {
  margin: 26px 0 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  padding: 24px;
}

.audit-tool-heading,
.audit-results-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.audit-tool-heading h3,
.audit-results-header h3 {
  margin: 0 0 6px;
  font-size: 1.25rem;
  line-height: 1.25;
}

.audit-tool-heading p,
.audit-results-header p {
  margin: 0;
  color: var(--muted);
}

.privacy-badge,
.severity-badge,
.status-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.2;
}

.privacy-badge {
  background: #dff7f3;
  color: var(--teal-dark);
}

.drop-zone {
  display: flex;
  min-height: 220px;
  margin-top: 20px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  border: 2px dashed #9aa7b7;
  border-radius: 10px;
  background: #fbfcfe;
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

.drop-zone:hover,
.drop-zone:focus,
.drop-zone.is-dragging {
  outline: none;
  border-color: var(--teal);
  background: #effaf8;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.drop-zone-title {
  color: var(--ink);
  font-size: 1.12rem;
  font-weight: 800;
}

.drop-zone-help {
  color: var(--muted);
  font-size: 0.95rem;
}

.privacy-note {
  margin-top: 16px;
  border-left: 4px solid var(--teal);
  border-radius: 4px;
  background: #effaf8;
  padding: 12px 14px;
  color: var(--muted);
  font-size: 0.92rem;
}

.privacy-note strong {
  color: var(--teal-dark);
}

.audit-status {
  min-height: 1.6em;
  margin: 14px 0 0;
  color: var(--teal-dark);
  font-weight: 700;
}

.audit-error {
  margin-top: 14px;
  border-left: 4px solid var(--rust);
  border-radius: 4px;
  background: #fff4ef;
  padding: 12px 14px;
  color: var(--rust);
  font-weight: 700;
}

.audit-results {
  scroll-margin-top: 18px;
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.audit-result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.audit-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0;
}

.metric-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 13px;
}

.metric-value {
  color: var(--ink);
  font-size: 1.45rem;
  font-weight: 850;
  line-height: 1.1;
}

.metric-label {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.finding-list {
  display: grid;
  gap: 12px;
}

.finding-card {
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 8px;
  background: #ffffff;
  padding: 16px;
}

.finding-card.severity-critical {
  border-left-color: #991b1b;
}

.finding-card.severity-high {
  border-left-color: var(--rust);
}

.finding-card.severity-moderate {
  border-left-color: #b7791f;
}

.finding-card.severity-low {
  border-left-color: #64748b;
}

.finding-header {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.severity-badge {
  background: #fff1ed;
  color: var(--rust);
}

.status-badge {
  background: #eef2f7;
  color: var(--muted);
}

.finding-card h4 {
  margin: 10px 0 5px;
  font-size: 1.05rem;
}

.finding-card p {
  margin: 7px 0 0;
}

.finding-location {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.86rem;
}

.finding-recommendation {
  color: var(--teal-dark);
}

.no-findings {
  border: 1px solid #b8e5dd;
  border-radius: 8px;
  background: #effaf8;
  padding: 14px;
  color: var(--teal-dark);
}

.report-preview {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 12px 14px;
}

.report-preview summary {
  cursor: pointer;
  color: var(--teal-dark);
  font-weight: 800;
}

.report-preview pre {
  max-height: 560px;
  margin: 12px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--code-ink);
}

.deep-audit-callout {
  margin: 30px 0 38px;
  border: 2px solid var(--plum);
  border-radius: 10px;
  background: #f7f2ff;
  padding: 22px 24px;
  box-shadow: 0 8px 22px rgba(124, 58, 237, 0.08);
}

.deep-audit-callout h3 {
  margin: 0 0 10px;
  color: #5b21b6;
  font-size: 1.25rem;
  line-height: 1.3;
}

.deep-audit-callout p {
  margin: 10px 0 0;
}

.deep-audit-privacy {
  border-top: 1px solid #d8c7f5;
  padding-top: 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 22px, 948px);
    padding-top: 18px;
  }

  .hero {
    padding-top: 24px;
  }

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

  .button {
    width: 100%;
  }

  .audit-tool {
    padding: 16px;
  }

  .audit-tool-heading,
  .audit-results-header {
    flex-direction: column;
  }

  .drop-zone {
    min-height: 190px;
    padding: 20px 14px;
  }

  .audit-result-actions {
    width: 100%;
  }

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