:root {
  --bg: #0f1117;
  --panel: #171a23;
  --panel-2: #1e2230;
  --border: #2a2f42;
  --text: #e8eaf2;
  --muted: #9aa3b8;
  --accent: #6c5ce7;
  --accent-2: #a29bfe;
  --green: #2ecc71;
  --yellow: #f1c40f;
  --red: #e74c3c;
  --radius: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}
a { color: var(--accent-2); text-decoration: none; }
.container { max-width: 960px; margin: 0 auto; padding: 24px 20px 80px; }

header.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--border);
}
.brand { font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }
.brand .lens { color: var(--accent-2); }
nav a { margin-left: 18px; color: var(--muted); font-size: 14px; }

.hero { text-align: center; padding: 56px 0 28px; }
.hero h1 { font-size: 40px; letter-spacing: -0.03em; line-height: 1.15; }
.hero p.sub { color: var(--muted); max-width: 620px; margin: 14px auto 0; font-size: 17px; }

.audit-form {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; margin: 30px auto 0; max-width: 720px;
}
.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tab-btn {
  background: none; border: 1px solid var(--border); color: var(--muted);
  padding: 8px 14px; border-radius: 8px; cursor: pointer; font-size: 14px;
}
.tab-btn.active { background: var(--panel-2); color: var(--text); border-color: var(--accent); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }
input[type="text"], input[type="email"], textarea {
  width: 100%; background: var(--panel-2); border: 1px solid var(--border);
  color: var(--text); border-radius: 8px; padding: 12px 14px; font-size: 15px;
  font-family: inherit;
}
textarea { min-height: 160px; resize: vertical; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.btn {
  display: inline-block; background: var(--accent); color: #fff; border: none;
  border-radius: 8px; padding: 13px 22px; font-size: 15px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.btn:hover { background: #7d6ef0; }
.btn-small { display: inline-block; margin-top: 8px; padding: 6px 14px; font-size: 13px; text-decoration: none; }
.btn.secondary { background: var(--panel-2); border: 1px solid var(--border); color: var(--text); }
.error { background: rgba(231, 76, 60, 0.12); border: 1px solid var(--red); color: #ffb3a7;
  border-radius: 8px; padding: 12px 14px; margin-bottom: 16px; font-size: 14px; }

/* Sections */
section { margin-top: 56px; }
section h2 { font-size: 26px; letter-spacing: -0.02em; margin-bottom: 8px; }
section .lead { color: var(--muted); margin-bottom: 22px; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px;
}
.card h3 { font-size: 16px; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 14px; }
.card .score-pill {
  display: inline-block; font-weight: 800; font-size: 18px; padding: 4px 12px;
  border-radius: 20px; margin-bottom: 10px;
}
.pill-A, .pill-good { background: rgba(46,204,113,.15); color: var(--green); }
.pill-C, .pill-ok { background: rgba(241,196,15,.15); color: var(--yellow); }
.pill-F, .pill-bad { background: rgba(231,76,60,.15); color: var(--red); }

.faq details { background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
  padding: 14px 16px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { color: var(--muted); margin-top: 8px; font-size: 14px; }

/* Result page */
.gauge-wrap { display: flex; align-items: center; gap: 24px; }
.gauge {
  width: 168px; height: 168px; border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--pct) * 1%), var(--panel-2) 0);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.gauge .inner {
  width: 130px; height: 130px; border-radius: 50%; background: var(--panel);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.gauge .num { font-size: 40px; font-weight: 800; }
.gauge .max { color: var(--muted); font-size: 13px; }
.grade-badge { font-size: 15px; font-weight: 700; color: var(--accent-2); }

.bars { flex: 1; }
.bar-row { margin-bottom: 12px; }
.bar-row .bar-label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.bar-row .bar-label .dims { color: var(--muted); }
.bar-track { height: 10px; background: var(--panel-2); border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; }
.grade-good { background: var(--green); }
.grade-ok { background: var(--yellow); }
.grade-bad { background: var(--red); }

.fixes ol { padding-left: 20px; }
.fixes li { margin-bottom: 12px; }
.fixes .dim { color: var(--accent-2); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.fixes .fix { color: var(--muted); font-size: 14px; }

.copy-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; margin-bottom: 16px; position: relative;
}
.copy-card h3 { font-size: 14px; color: var(--muted); margin-bottom: 10px; text-transform: uppercase; letter-spacing: .05em; }
.copy-card .content { white-space: pre-wrap; font-size: 15px; }
.copy-btn {
  position: absolute; top: 14px; right: 14px; background: var(--panel-2);
  border: 1px solid var(--border); color: var(--text); border-radius: 6px;
  padding: 5px 10px; font-size: 12px; cursor: pointer;
}

.gate {
  position: relative; padding: 18px;
}
.gate .blurred { filter: blur(6px); user-select: none; pointer-events: none; }
.gate-box {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(15,17,23,.55); border-radius: var(--radius);
}
.gate-form { background: var(--panel-2); border: 1px solid var(--accent); border-radius: 10px; padding: 18px; width: 320px; text-align: center; }
.gate-form h4 { margin-bottom: 6px; }
.gate-form p { font-size: 13px; color: var(--muted); margin-bottom: 12px; }

.delta-up { color: var(--green); font-weight: 700; }
.delta-down { color: var(--red); font-weight: 700; }
.delta-same { color: var(--yellow); font-weight: 700; }

.meta { color: var(--muted); font-size: 13px; margin-top: 26px; }
.meta a { color: var(--accent-2); }
.source-chip { display:inline-block; background: var(--panel-2); border:1px solid var(--border);
  padding: 2px 10px; border-radius: 20px; font-size: 12px; margin-left: 8px; }

footer { margin-top: 60px; text-align: center; color: var(--muted); font-size: 13px; }
pre.selftest-out {
  background: #0b0d12; border: 1px solid var(--border); border-radius: 10px;
  padding: 18px; overflow-x: auto; font-size: 13px; line-height: 1.5; white-space: pre-wrap;
}
.ok { color: var(--green); font-weight: 700; }
.fail { color: var(--red); font-weight: 700; }
.blocked-banner {
  background: rgba(241,196,15,.08); border: 1px solid var(--yellow); color: #ffe28a;
  border-radius: 10px; padding: 16px 18px; margin-bottom: 20px; font-size: 14px;
}
