:root {
  color-scheme: light;
  --bg: #f2f4f1;
  --panel: #ffffff;
  --ink: #191d1f;
  --muted: #657176;
  --soft: #eef2ef;
  --line: #d9dfda;
  --accent: #0e6f65;
  --accent-dark: #0a4c46;
  --brass: #a16818;
  --rose: #9c3d33;
  --ok: #1f7a55;
  --shadow: 0 24px 80px rgba(25, 29, 31, .09);
  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;
  background:
    linear-gradient(180deg, #fbfcfa 0%, var(--bg) 48%, #e9eeec 100%);
  color: var(--ink);
}
a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }

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

.audit-panel,
.results {
  background: rgba(255,255,255,.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.audit-panel { padding: 24px; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: .78rem;
  font-weight: 900;
}
.brand strong,
.brand small { display: block; }
.brand small { color: var(--muted); margin-top: 1px; }
.surface {
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: .86rem;
  background: #fff;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
  gap: 34px;
  align-items: start;
  padding-top: 30px;
}
.intro { padding: 20px 6px 0; }
.eyebrow {
  margin-bottom: 11px;
  color: var(--accent);
  font-size: .76rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}
h1 {
  max-width: 760px;
  margin-bottom: 17px;
  font-size: 4.35rem;
  line-height: .98;
  letter-spacing: 0;
}
.lead {
  max-width: 640px;
  color: #425056;
  font-size: 1.12rem;
  line-height: 1.62;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 660px;
  margin-top: 34px;
}
.metrics div {
  min-height: 96px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #f8faf7);
}
.metrics strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.02rem;
}
.metrics span {
  display: block;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.35;
}

.audit-form {
  display: grid;
  gap: 15px;
  padding: 22px;
  border: 1px solid #cfd9d4;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f7faf8 100%);
}
.form-head {
  display: grid;
  gap: 3px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e4ebe7;
}
.form-head strong { font-size: 1.05rem; }
.form-head span {
  color: var(--muted);
  font-size: .88rem;
}
.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.field-row.stack-row { grid-template-columns: 1fr; }
label span {
  display: block;
  margin-bottom: 6px;
  color: #354147;
  font-size: .84rem;
  font-weight: 800;
}
label { display: grid; }
input,
textarea {
  width: 100%;
  min-height: 52px;
  border: 1px solid #cbd4cf;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 12px;
  outline: none;
}
input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 111, 101, .14);
}
button {
  width: 100%;
  min-height: 52px;
  margin-top: 2px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}
button:hover { background: var(--accent-dark); }
button:disabled {
  cursor: wait;
  background: #7f8e8b;
}
.fine-print {
  margin: 0;
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.42;
}

.results {
  margin-top: 20px;
  padding: 24px;
}
.result-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 124px;
  gap: 22px;
  align-items: start;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.result-hero h2 {
  max-width: 760px;
  margin-bottom: 10px;
  font-size: 2.25rem;
  line-height: 1.08;
  letter-spacing: 0;
}
.status-line {
  max-width: 760px;
  margin-bottom: 0;
  color: #465257;
  font-size: 1.03rem;
  line-height: 1.52;
}
.score-card {
  display: grid;
  place-items: center;
  width: 124px;
  height: 124px;
  border: 1px solid #c8d8d3;
  border-radius: 8px;
  background:
    linear-gradient(180deg, #ffffff 0%, #edf7f4 100%);
}
.score-card strong {
  margin-top: 16px;
  color: var(--accent-dark);
  font-size: 2.8rem;
  line-height: 1;
}
.score-card span {
  margin-top: -18px;
  color: var(--muted);
  font-size: .86rem;
}

.at-a-glance {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}
.at-a-glance div {
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}
.at-a-glance span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}
.at-a-glance strong {
  display: block;
  font-size: 1rem;
  line-height: 1.25;
}

.priority-panel {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 20px;
  padding: 18px;
  border: 1px solid #cbd8d4;
  border-radius: 8px;
  background: #f7fbf9;
}
.section-head h3,
.result-section h3,
.live-section h3 {
  margin-bottom: 0;
  font-size: 1.04rem;
}
.fix-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.fix-list li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  margin: 0;
  padding: 12px;
  border: 1px solid #d8e2de;
  border-radius: 8px;
  background: #fff;
}
.fix-list li > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 900;
}
.fix-list strong { display: block; margin-bottom: 4px; }
.fix-list p {
  margin: 0;
  color: var(--muted);
  line-height: 1.42;
}

.detail-panel,
.result-section,
.live-section {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.detail-panel summary {
  cursor: pointer;
  padding: 15px 16px;
  color: var(--ink);
  font-weight: 900;
}
.findings-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 0 16px 16px;
}
.finding {
  min-height: 138px;
  padding: 12px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}
.finding.pass { border-top-color: var(--ok); }
.finding.partial { border-top-color: var(--brass); }
.finding.fail { border-top-color: var(--rose); }
.finding span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: .74rem;
  font-weight: 900;
  text-transform: uppercase;
}
.finding strong {
  display: block;
  margin-bottom: 7px;
  font-size: .95rem;
}
.finding p {
  margin: 0;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.42;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.result-section,
.live-section { padding: 16px; }
.key-value {
  display: grid;
  gap: 9px;
  margin-top: 13px;
}
.kv {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 9px;
  border-bottom: 1px solid #edf0ed;
}
.kv strong { flex: 0 0 auto; }
.kv span {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  text-align: right;
}
.prompt {
  padding: 12px 0;
  border-bottom: 1px solid #edf0ed;
}
.prompt strong {
  display: block;
  margin-bottom: 4px;
  color: var(--accent-dark);
  font-size: .84rem;
}
.prompt span {
  display: block;
  color: var(--muted);
  line-height: 1.42;
}
.live-section p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.5;
}
pre {
  max-height: 340px;
  overflow: auto;
  margin: 12px 0 0;
  padding: 14px;
  border-radius: 8px;
  background: #111718;
  color: #eef5f0;
  white-space: pre-wrap;
}
.error {
  color: var(--rose);
  font-weight: 800;
}

@media (max-width: 980px) {
  .split,
  .priority-panel,
  .result-grid { grid-template-columns: 1fr; }
  .findings-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  h1 { font-size: 3.2rem; }
}

@media (max-width: 640px) {
  .app-shell { width: min(100% - 18px, 1180px); padding-top: 9px; }
  .audit-panel,
  .results { padding: 14px; }
  .topbar,
  .result-hero { grid-template-columns: 1fr; }
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .field-row,
  .at-a-glance,
  .findings-list { grid-template-columns: 1fr; }
  .metrics { display: none; }
  .split { gap: 20px; padding-top: 24px; }
  .intro { padding-top: 0; }
  h1 { font-size: 2.45rem; line-height: 1.03; }
  .lead { font-size: 1rem; line-height: 1.5; }
  .result-hero h2 { font-size: 1.78rem; }
  .score-card { width: 100%; height: 104px; }
  .kv {
    display: grid;
    gap: 4px;
  }
  .kv span { text-align: left; }
}
