:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --ink: #14161f;
  --muted: #6b7180;
  --line: #e6e8ef;
  --brand: #ff642d;
  --brand-dark: #e5551f;
  --indigo: #3b47c4;
  --good: #1f9d61;
  --warn: #e8a213;
  --bad: #d64541;
  --crit: #b0201c;
  --radius: 14px;
  font-size: 16px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg); color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--indigo); text-decoration: none; }
.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ---------- topbar ---------- */
.topbar {
  background: #101223; color: #fff;
  padding: 14px 0;
}
.topbar .container { display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; letter-spacing: .2px; color:#fff; }
.logo .mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), #ff9d2d);
  display: grid; place-items: center; font-size: .95rem; color: #fff; font-weight: 800;
}
.topbar .nav a { color: #c6c9d8; margin-left: 22px; font-size: .92rem; }
.topbar .nav a:hover { color: #fff; }

/* ---------- hero ---------- */
.hero {
  background: #101223;
  color: #fff; padding: 64px 0 84px;
  background-image: radial-gradient(800px 300px at 70% 0%, rgba(255,100,45,.18), transparent),
                    radial-gradient(600px 260px at 20% 100%, rgba(59,71,196,.25), transparent);
}
.hero h1 { font-size: 2.5rem; line-height: 1.15; max-width: 640px; }
.hero h1 em { color: var(--brand); font-style: normal; }
.hero p.sub { color: #b7bccd; margin: 16px 0 32px; max-width: 560px; font-size: 1.06rem; }
.audit-form { display: flex; gap: 10px; max-width: 640px; }
.audit-form input {
  flex: 1; padding: 16px 18px; font-size: 1.05rem; border-radius: 10px;
  border: 1px solid #33364a; background: #1a1d31; color: #fff; outline: none;
}
.audit-form input::placeholder { color: #7a7f95; }
.audit-form input:focus { border-color: var(--brand); }
.btn {
  background: var(--brand); color: #fff; border: none; cursor: pointer;
  padding: 16px 28px; font-size: 1.02rem; font-weight: 700; border-radius: 10px;
  transition: background .15s;
}
.btn:hover { background: var(--brand-dark); }
.btn[disabled] { opacity: .6; cursor: default; }
.form-error { color: #ff8a80; margin-top: 10px; font-size: .95rem; min-height: 1.2em; }
.hero .checks { display: flex; gap: 26px; margin-top: 26px; color: #9fa5ba; font-size: .9rem; flex-wrap: wrap; }
.hero .checks span::before { content: "✓ "; color: var(--good); font-weight: 700; }

/* ---------- progress ---------- */
.progress-wrap { max-width: 640px; margin-top: 8px; display: none; }
.progress-card {
  background: #1a1d31; border: 1px solid #33364a; border-radius: var(--radius);
  padding: 26px;
}
.progress-msg { color: #dfe2ee; font-size: 1rem; margin-bottom: 14px; }
.bar { height: 10px; border-radius: 6px; background: #2a2d44; overflow: hidden; }
.bar > div { height: 100%; width: 0%; background: linear-gradient(90deg, var(--brand), #ff9d2d); transition: width .6s; }
.progress-steps { margin-top: 18px; color: #8b90a8; font-size: .88rem; line-height: 1.8; }

/* ---------- sections ---------- */
.section { padding: 56px 0; }
.section h2 { font-size: 1.5rem; margin-bottom: 8px; }
.section p.lead { color: var(--muted); margin-bottom: 28px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px;
}
.card h3 { font-size: 1.02rem; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: .92rem; line-height: 1.55; }
.card .ico { font-size: 1.5rem; margin-bottom: 12px; }

.recent-table { width: 100%; border-collapse: collapse; }
.recent-table th, .recent-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: .93rem; }
.recent-table th { color: var(--muted); font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .5px; }
.recent-table tr:hover td { background: #fafbff; }

.footer { padding: 36px 0 48px; color: var(--muted); font-size: .85rem; text-align: center; }

/* ---------- report ---------- */
.report-head {
  background: #101223; color: #fff; padding: 34px 0 30px;
}
.report-head .container { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.report-title h1 { font-size: 1.7rem; }
.report-title .meta { color: #9fa5ba; margin-top: 6px; font-size: .9rem; }
.head-actions { display: flex; gap: 10px; }
.btn-ghost {
  background: transparent; border: 1px solid #3a3e57; color: #d7dae8;
  padding: 10px 18px; border-radius: 9px; cursor: pointer; font-size: .92rem; font-weight: 600;
}
.btn-ghost:hover { border-color: #6a6f92; }

.score-band { background: #fff; border-bottom: 1px solid var(--line); }
.score-band .container { display: grid; grid-template-columns: 220px 1fr; gap: 34px; padding-top: 28px; padding-bottom: 28px; align-items: center; }
.gauge { position: relative; width: 190px; height: 190px; }
.gauge svg { transform: rotate(-90deg); }
.gauge .val { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.gauge .val b { font-size: 2.6rem; line-height: 1; }
.gauge .val span { color: var(--muted); font-size: .8rem; }
.sev-summary { display: grid; grid-template-columns: repeat(4, minmax(120px,1fr)); gap: 14px; }
.sev-box { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.sev-box b { font-size: 1.7rem; display: block; }
.sev-box span { font-size: .8rem; text-transform: uppercase; letter-spacing: .6px; font-weight: 700; }
.sev-CRITICAL { color: var(--crit); }
.sev-HIGH { color: var(--bad); }
.sev-MEDIUM { color: var(--warn); }
.sev-LOW { color: var(--muted); }

.report-body { padding: 40px 0 70px; }
.rsection { margin-bottom: 40px; }
.rsection > h2 { font-size: 1.28rem; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 2px solid var(--line); }

.summary-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.summary-card p { line-height: 1.65; margin-bottom: 14px; }
.summary-card .plain { background: #fff7f2; border-left: 4px solid var(--brand); padding: 14px 16px; border-radius: 6px; color: #5a3d2e; font-size: .95rem; }
.top-issue { display: flex; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.top-issue:first-of-type { border-top: none; }
.top-issue .txt b { display: block; margin-bottom: 4px; }
.top-issue .txt p { color: var(--muted); font-size: .93rem; margin: 0; }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .72rem;
  font-weight: 800; letter-spacing: .5px; color: #fff; height: fit-content; white-space: nowrap;
}
.badge.CRITICAL { background: var(--crit); }
.badge.HIGH { background: var(--bad); }
.badge.MEDIUM { background: var(--warn); }
.badge.LOW { background: #8b90a0; }
.badge.GOOD { background: var(--good); }
.badge.WARN { background: var(--warn); }
.badge.BAD { background: var(--bad); }
.badge.NA { background: #b8bcc8; }

.scorecard { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.scorecard th, .scorecard td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--line); font-size: .93rem; }
.scorecard th { background: #fafbfe; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .5px; }
.scorecard tr:last-child td { border-bottom: none; }

.issue { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; overflow: hidden; }
.issue-head { display: flex; align-items: center; gap: 14px; padding: 15px 18px; cursor: pointer; user-select: none; }
.issue-head:hover { background: #fafbff; }
.issue-head .t { flex: 1; font-weight: 600; font-size: .97rem; }
.tech-tag {
  display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 5px;
  background: #f0f1f6; color: #8b90a0; font-size: .72rem; font-weight: 500; white-space: nowrap;
}
.issue-head .cnt { color: var(--muted); font-size: .88rem; white-space: nowrap; }
.issue-head .chev { color: var(--muted); transition: transform .2s; }
.issue.open .chev { transform: rotate(90deg); }
.issue-body { display: none; padding: 4px 18px 18px; border-top: 1px solid var(--line); }
.issue.open .issue-body { display: block; }
.issue-body h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 14px 0 6px; }
.issue-body p { font-size: .93rem; line-height: 1.6; }
.pages-table { width: 100%; border-collapse: collapse; margin-top: 6px; }
.pages-table td { padding: 7px 10px; border-bottom: 1px solid var(--line); font-size: .85rem; word-break: break-all; }
.pages-table td.d { color: var(--muted); white-space: nowrap; }
.cat-tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.cat-tab {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 8px 16px; font-size: .88rem; cursor: pointer; color: var(--muted); font-weight: 600;
}
.cat-tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.phase { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 16px; }
.phase h3 { margin-bottom: 4px; }
.phase .sub { color: var(--muted); font-size: .9rem; margin-bottom: 14px; }
.phase table { width: 100%; border-collapse: collapse; }
.phase td { padding: 9px 10px; border-bottom: 1px solid var(--line); font-size: .92rem; vertical-align: top; }
.phase tr:last-child td { border-bottom: none; }
.phase td.b { width: 90px; }

.offgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.metric-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .93rem; }
.metric-row:last-child { border-bottom: none; }
.metric-row b.good { color: var(--good); }
.metric-row b.warn { color: var(--warn); }
.metric-row b.bad { color: var(--bad); }
.notice { background: #f2f4ff; border-left: 4px solid var(--indigo); padding: 13px 16px; border-radius: 6px; font-size: .9rem; color: #3a3f66; }

.loading-screen { text-align: center; padding: 110px 20px; }
.spinner { width: 46px; height: 46px; border: 4px solid var(--line); border-top-color: var(--brand); border-radius: 50%; margin: 0 auto 22px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 860px) {
  .grid3 { grid-template-columns: 1fr; }
  .score-band .container { grid-template-columns: 1fr; justify-items: center; }
  .sev-summary { grid-template-columns: repeat(2, 1fr); width: 100%; }
  .offgrid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.9rem; }
  .audit-form { flex-direction: column; }
}
@media print {
  .topbar, .head-actions, .cat-tabs, .footer, .no-print { display: none !important; }
  body { background: #fff; }
  .issue-body { display: block !important; }
  .report-head { background: #101223 !important; -webkit-print-color-adjust: exact; }
}
