/* Site Validator — dark theme.
 * Breakpoint system:
 *   ≥1600px  widescreen (content cap grows to 1240px)
 *   ≤1200px  small laptops
 *   ≤900px   tablets (charts stack, stat/plans grids reflow)
 *   ≤700px   large phones / small tablets (header wraps, forms stack, touch targets)
 *   ≤480px   phones (compact type/padding)
 *   ≤360px   small phones (final squeeze)
 */
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,sans-serif;background:#0f172a;color:#e2e8f0;overflow-x:hidden}
img,svg{max-width:100%}
a{color:#38bdf8}

/* header */
.top{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;padding:16px 24px;background:linear-gradient(90deg,#020617,#1e293b);border-bottom:1px solid #334155;position:sticky;top:0;z-index:5}
.brand{display:flex;gap:12px;align-items:center;min-width:0}
.brand strong{font-size:20px;display:block}
.brand small{color:#94a3b8}
.logo{width:42px;height:42px;flex:none;border-radius:12px;display:block;object-fit:cover}
.top-actions{display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.userbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
#userEmail{word-break:break-all}

/* layout + cards */
main{max-width:1100px;margin:0 auto;padding:24px}
.card{background:#1e293b;border:1px solid #334155;border-radius:16px;padding:20px;margin:16px 0}
.plans{width:min(1100px,calc(100% - 48px));margin:16px auto}
.login{max-width:480px;margin:40px auto;width:calc(100% - 32px)}

/* forms + buttons — 16px inputs prevent iOS focus zoom */
label{display:block;margin:12px 0;color:#cbd5e1;font-size:14px}
input,select{width:100%;padding:12px;border-radius:10px;border:1px solid #475569;background:#0f172a;color:white;margin-top:6px;font-size:16px}
button{cursor:pointer;border-radius:10px;padding:12px 18px;border:1px solid #475569;background:#334155;color:white;font-weight:700}
button.primary{background:linear-gradient(135deg,#22c55e,#0ea5e9);border:none}
button.ghost{background:transparent}
button:disabled{opacity:.45;cursor:not-allowed}
button.mini{padding:4px 10px;font-size:12px}
.hidden{display:none!important}
.muted{color:#94a3b8}
.error{color:#f87171}
.small{font-size:12px}
.badge{background:#22c55e;color:#052e16;padding:4px 10px;border-radius:999px;font-size:12px;font-weight:800}
.badge.viewer{background:#f59e0b;color:#451a03}
.badge.plan{background:#38bdf8;color:#082f49}
.avatar{width:28px;height:28px;border-radius:50%;object-fit:cover;flex:none}

/* social sign-in (V1.7) */
.social{margin-top:6px}
.divider{display:flex;align-items:center;gap:10px;color:#94a3b8;font-size:12px;margin:16px 0 6px}
.divider::before,.divider::after{content:'';flex:1;border-top:1px solid #334155}
.social-btn{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;margin:8px 0 0;background:#0f172a;font-weight:600}
.social-btn:hover:not(:disabled){border-color:#94a3b8}
.social-btn svg{width:18px;height:18px;flex:none}
.social-cap{margin:3px 0 6px;text-align:center}

/* scan form */
.scanrow{display:grid;grid-template-columns:1fr 110px auto auto;gap:10px}
.scanrow2{grid-template-columns:1fr 140px 110px auto auto}
.progress{margin-top:16px}
.progress .bar{height:8px;border-radius:999px;background:#0f172a;border:1px solid #334155;overflow:hidden}
.bar-fill{height:100%;width:0;border-radius:999px;background:linear-gradient(90deg,#22c55e,#38bdf8,#a78bfa);transition:width .5s ease}
.progress span{display:block;margin-top:8px;color:#cbd5e1;font-size:14px;word-break:break-word}

/* report header + stats */
.report-head{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;align-items:center}
.report-head h2{word-break:break-word}
.actions{display:flex;gap:10px;flex-wrap:wrap}
.grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}
.grid .card{margin:0}
.stat b{font-size:28px;display:block;margin-top:6px}
.stat.ok b{color:#4ade80}.stat.warn b{color:#facc15}.stat.err b{color:#f87171}.stat.blank b{color:#c084fc}
.score-card{display:flex;align-items:center;gap:16px;grid-column:span 2}
.ring{width:110px;height:110px;flex:none;transform:rotate(-90deg)}
.ring-bg{fill:none;stroke:#334155;stroke-width:10}
.ring-fg{fill:none;stroke:#22c55e;stroke-width:10;stroke-linecap:round;stroke-dasharray:326;stroke-dashoffset:0}
.score-num b{font-size:36px}
.score-num small{display:block;color:#94a3b8}

/* charts */
.charts-row{display:grid;grid-template-columns:1fr 1.4fr 1fr;gap:12px;margin:16px 0}
.charts-row .card{margin:0}
.charts-row.two{grid-template-columns:1fr 1fr}
.donut-wrap{display:grid;place-items:center}
.donut{width:150px;height:150px}
.donut-num{fill:#e2e8f0;font-size:26px;font-weight:800}
.donut-sub{fill:#94a3b8;font-size:11px}
.legend{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin-top:8px}
.lg{font-size:12px;color:#cbd5e1}
.lg i{display:inline-block;width:10px;height:10px;border-radius:3px;margin-right:5px}
.hbar{display:grid;grid-template-columns:150px 1fr 64px;gap:8px;align-items:center;margin:7px 0;font-size:12px}
.hbar-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#cbd5e1}
.hbar-track{background:#0f172a;border:1px solid #334155;border-radius:999px;height:14px;overflow:hidden}
.hbar-fill{height:100%;border-radius:999px;transition:width .4s}
.hbar-val{text-align:right;color:#e2e8f0;font-weight:700}

/* tables — wide ones scroll sideways inside .table-scroll / .tablewrap */
.table-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch;max-width:100%}
.table-scroll table{min-width:520px}
.table-scroll table.compare{min-width:420px}
.tablewrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
.tablewrap table{min-width:640px}
table{width:100%;border-collapse:collapse;font-size:14px}
th,td{padding:10px;border-bottom:1px solid #334155;text-align:left;vertical-align:top}
th{color:#94a3b8}
.urlcell{word-break:break-all;font-size:13px}
.pill{padding:3px 9px;border-radius:999px;font-size:12px;font-weight:800;white-space:nowrap}
.pill.OK{background:#14532d;color:#86efac}.pill.WARNING{background:#713f12;color:#fde68a}.pill.ERROR{background:#7f1d1d;color:#fca5a5}.pill.BLANK{background:#581c87;color:#d8b4fe}
.pill.form{background:#1e3a5f;color:#7dd3fc}

/* per-page detail */
.detail{background:#0f172a;border-radius:10px;padding:12px;margin:8px 0;white-space:pre-wrap;word-break:break-word;overflow-wrap:anywhere;font-size:13px}
.dsec{margin:10px 0;border-top:1px dashed #334155;padding-top:8px}
.dsec:first-child{border-top:none;padding-top:0}
.kv{font-size:13px;color:#cbd5e1;margin-top:4px;word-break:break-word;overflow-wrap:anywhere}
.err-t{color:#f87171}.warn-t{color:#facc15}

/* issues */
.issue{border:1px solid #334155;border-radius:10px;padding:10px 12px;margin:8px 0;background:#0f172a}
.issue-head{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.issue-head b{word-break:break-word}

/* history */
.history{display:flex;flex-wrap:wrap;gap:10px}
.history button{text-align:left;word-break:break-word}
.srv{color:#38bdf8;font-size:11px;font-weight:700}

/* nav tabs (V1.6) */
.tabs{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.tab{color:#cbd5e1;text-decoration:none;padding:10px 14px;border-radius:10px;border:1px solid transparent;font-weight:700;font-size:14px;white-space:nowrap}
.tab:hover{border-color:#475569;color:white}
.tab.active{background:linear-gradient(135deg,#22c55e,#0ea5e9);color:white;border:none}

/* reports view + recent strip (V1.6) */
.report-row{display:flex;gap:12px;align-items:center;padding:12px 4px;border-bottom:1px solid #334155;flex-wrap:wrap}
.report-row:last-child{border-bottom:none}
.report-row .rr-main{flex:1;min-width:200px;word-break:break-word}
.report-row.recent{padding:10px 0}
.pager{display:flex;gap:12px;align-items:center;margin-top:14px;flex-wrap:wrap}
#reportSearch{margin:6px 0 10px}

/* site checks chips (V1.6) */
.chips{display:flex;flex-wrap:wrap;gap:8px}
.chip{padding:6px 12px;border-radius:999px;font-size:13px;font-weight:700;border:1px solid #334155;background:#0f172a;color:#cbd5e1}
.chip.ok{border-color:#14532d;color:#86efac}
.chip.bad{border-color:#7f1d1d;color:#fca5a5}
.chip.na{color:#94a3b8}

/* why-your-score + guides (V1.6) */
.why-item{margin:10px 0;padding:10px 12px;background:#0f172a;border:1px solid #334155;border-radius:10px;font-size:14px}
.guide{background:#0f172a;border-top:1px dashed #334155;margin-top:10px;padding:10px 4px 2px;font-size:13px;color:#cbd5e1}
.guide p{margin:4px 0 8px}
.guide ol{margin:4px 0 10px;padding-left:20px}
.guide li{margin:3px 0}
.guide .kv{margin-bottom:8px}
.ditem{margin:4px 0;line-height:1.55}
.ditem .pill{margin-left:4px;vertical-align:1px}

/* plans */
.plans-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin:16px 0}
.plan-card{border:1px solid #334155;border-radius:16px;padding:20px;background:#0f172a}
.plan-card.popular{border-color:#22c55e;background:linear-gradient(180deg,#0f172a,#052e16)}
.plan-card.current{outline:2px solid #38bdf8}
.plan-card .price{font-size:34px;font-weight:900;margin:8px 0}
.plan-card .price small{font-size:14px;color:#94a3b8}
.plan-card ul{padding-left:18px;color:#cbd5e1;font-size:14px;line-height:1.7}
.plan-card button{width:100%}
table.compare td,table.compare th{text-align:center}
table.compare td:first-child,table.compare th:first-child{text-align:left}

/* modal */
.modal{position:fixed;inset:0;background:rgba(2,6,23,.75);display:grid;place-items:center;z-index:50;padding:16px}
.modal-card{max-width:440px;width:100%;margin:0}

footer{text-align:center;color:#64748b;padding:24px;font-size:13px}

/* ---------- ≤1200px: small laptops ---------- */
@media(max-width:1200px){
  .charts-row{grid-template-columns:1fr 1.3fr 1fr}
  .scanrow2{grid-template-columns:1fr 130px 100px auto auto}
}

/* ---------- ≤900px: tablets ---------- */
@media(max-width:900px){
  .grid{grid-template-columns:repeat(2,1fr)}
  .charts-row,.charts-row.two{grid-template-columns:1fr}
  .plans-grid{grid-template-columns:1fr}
  .scanrow2{grid-template-columns:1fr 1fr}
  .scanrow2 #siteUrl{grid-column:1/-1}
  .scanrow2 #scanBtn,.scanrow2 #quickBtn{width:100%}
}

/* ---------- ≤700px: large phones / small tablets ---------- */
@media(max-width:700px){
  .top{padding:12px 14px}
  .brand strong{font-size:18px}
  .logo{width:36px;height:36px;border-radius:10px}
  main{padding:16px 12px}
  .card{padding:16px;margin:12px 0}
  .plans{width:calc(100% - 24px)}
  .scanrow{grid-template-columns:1fr}
  .scanrow2{grid-template-columns:1fr}
  .scanrow2 #siteUrl{grid-column:auto}
  button{min-height:44px}
  button.mini{min-height:36px}
  .top-actions button,.userbar button{min-height:40px}
  .history button{flex:1 1 100%}
  .hbar{grid-template-columns:110px 1fr 56px}
  footer{padding:18px 12px}
}

/* ---------- ≤480px: phones ---------- */
@media(max-width:480px){
  main{padding:12px 10px}
  .card{padding:14px}
  .login{margin:20px auto}
  .brand small{display:none}
  #userEmail{font-size:13px}
  .grid{gap:8px}
  .stat{padding:12px}
  .stat b{font-size:22px}
  .score-card{gap:10px;padding:12px}
  .ring{width:84px;height:84px}
  .score-num b{font-size:28px}
  th,td{padding:7px;font-size:13px}
  .table-scroll table{min-width:460px}
  .tablewrap table{min-width:560px}
  .hbar{grid-template-columns:88px 1fr 50px;font-size:11px;gap:6px}
  .donut{width:128px;height:128px}
  .plan-card .price{font-size:28px}
  .report-head .actions{width:100%}
  .report-head .actions button{flex:1}
  .modal{padding:10px}
}

/* ---------- ≤360px: small phones ---------- */
@media(max-width:360px){
  .top{padding:10px}
  .brand strong{font-size:16px}
  .logo{width:32px;height:32px}
  .card{padding:12px}
  .stat b{font-size:19px}
  .score-num b{font-size:24px}
  .ring{width:72px;height:72px}
  .hbar{grid-template-columns:76px 1fr 46px}
  button{padding:10px 12px}
  .badge{font-size:11px;padding:3px 8px}
}

/* ---------- ≥1600px: widescreen ---------- */
@media(min-width:1600px){
  main{max-width:1240px}
  .plans{width:min(1240px,calc(100% - 48px))}
}

@media(max-width:700px){
  .tabs{order:3;width:100%}
  .tab{flex:1;text-align:center;padding:10px 6px}
  .report-row .rr-main{min-width:0;flex:1 1 100%}
}

@media print{body{background:white;color:black;overflow-x:visible}.top,.hero,.history,footer,.actions,.plans,.modal,.tabs,#view-reports,#recentCard{display:none}.card{background:white;color:black;border-color:#ddd}.hbar-label,.hbar-val,.kv,.donut-sub{color:#333}.donut-num{fill:#111}.detail{display:block!important}.guide,.why-item,.issue{background:white;color:black;border-color:#ddd}.chip{color:#111;border-color:#999}}
