:root {
  --navy: #0b3b5c; --navy2: #0e4a73; --green: #16a34a; --green2: #22c55e;
  --red: #dc2626; --amber: #d97706; --blue: #2563eb;
  --bg: #f3f6f9; --card: #fff; --ink: #0f172a; --muted: #64748b; --line: #e2e8f0;
  --radius: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Lato", system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); line-height: 1.5; }
.ur { font-family: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", serif; direction: rtl; unicode-bidi: isolate; line-height: 2.1; font-weight: 400; }
.ur.big { font-size: 1.05rem; }
h1, h2, h3 { margin: .2em 0 .5em; line-height: 1.3; }
h2 .ur, h3 .ur, button .ur, .tabs .ur { font-size: .82em; margin-inline-start: .4em; color: inherit; opacity: .85; }
.muted { color: var(--muted); font-size: .92rem; }
a { color: var(--blue); }

.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  background: var(--navy); color: #fff; padding: .55rem 1.2rem; box-shadow: 0 2px 10px rgba(0,0,0,.15); }
.brand { display: flex; align-items: center; gap: .6rem; }
.brand b { font-size: 1.25rem; letter-spacing: .3px; display: block; line-height: 1; }
.brand small { opacity: .75; font-size: .75rem; }
.tabs { display: flex; gap: .25rem; flex-wrap: wrap; }
.tabs button { background: transparent; color: #cfe3f2; border: 0; padding: .35rem .8rem; border-radius: 9px; cursor: pointer; font: inherit; font-weight: 700; }
.tabs button.active, .tabs button:hover { background: rgba(255,255,255,.14); color: #fff; }
.tabs .ur { font-size: .78rem; }

main { max-width: 1150px; margin: 1.2rem auto; padding: 0 1rem; }
.tab { display: none; } .tab.active { display: block; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.4rem; margin-bottom: 1.1rem; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.hero h1 { font-size: 1.6rem; margin-bottom: 0; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin: .8rem 0; }
input, select, textarea { width: 100%; font: inherit; padding: .62rem .75rem; border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--green2); border-color: transparent; }
label { display: block; font-size: .85rem; font-weight: 700; color: #334155; }
label input, label select { margin-top: .25rem; font-weight: 400; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; margin-top: .7rem; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: .7rem; }
.span2 { grid-column: span 2; } .span3 { grid-column: span 3; }
details.biz { border: 1px dashed #cbd5e1; border-radius: 12px; padding: .6rem .9rem; }
details.biz summary { cursor: pointer; font-weight: 700; }
details.biz summary em { font-weight: 400; color: var(--muted); font-style: normal; font-size: .85rem; }

button, .btn { font: inherit; font-weight: 700; border-radius: 10px; padding: .6rem 1.1rem; cursor: pointer; border: 1px solid transparent; text-decoration: none; display: inline-flex; align-items: center; gap: .3rem; }
.primary { background: var(--green); color: #fff; } .primary:hover { background: #15803d; }
.primary:disabled { opacity: .6; cursor: wait; }
.ghost { background: #fff; color: var(--navy); border-color: #cbd5e1; } .ghost:hover { background: #f1f5f9; }
.big { font-size: 1.05rem; padding: .8rem 1.4rem; }
.actions { display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; margin-top: 1rem; }
.copy { padding: .3rem .7rem; font-size: .8rem; }

.scores { display: grid; grid-template-columns: repeat(4, 1fr) 1.1fr; gap: 1rem; align-items: center; text-align: center; }
.gauge-wrap { display: flex; flex-direction: column; align-items: center; gap: .1rem; }
.gauge-wrap .ur { font-size: .8rem; color: var(--muted); }
.gauge { --v: 0; --c: var(--muted); width: 108px; height: 108px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--v) * 1%), #e5e7eb 0); position: relative; font-weight: 900; font-size: 1.7rem; }
.gauge::before { content: ""; position: absolute; inset: 11px; background: #fff; border-radius: 50%; }
.gauge span { position: relative; }
.shot img { max-width: 100%; max-height: 210px; border-radius: 10px; border: 1px solid var(--line); }

.list-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.issue { display: grid; grid-template-columns: 26px 1fr; gap: .2rem .7rem; padding: .85rem 0; border-top: 1px solid var(--line); }
.issue .dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: .8rem; font-weight: 900; margin-top: 2px; }
.issue.fail .dot { background: var(--red); } .issue.warn .dot { background: var(--amber); } .issue.pass .dot { background: var(--green); }
.issue .t { font-weight: 700; }
.issue .t .tag { font-size: .7rem; text-transform: uppercase; letter-spacing: .5px; padding: .1rem .45rem; border-radius: 6px; margin-inline-start: .4rem; vertical-align: middle; }
.tag.critical { background: #fee2e2; color: #991b1b; } .tag.high { background: #ffedd5; color: #9a3412; }
.tag.medium { background: #fef9c3; color: #854d0e; } .tag.low { background: #e0f2fe; color: #075985; }
.tag.area { background: #f1f5f9; color: #334155; }
.issue .fix { grid-column: 2; font-size: .93rem; }
.issue .fix .ur { display: block; color: #334155; font-size: .95rem; }
.issue .detail { grid-column: 2; font-size: .8rem; color: var(--muted); word-break: break-word; }
.hidden-pass .issue.pass { display: none; }

.comp { width: 100%; border-collapse: collapse; font-size: .9rem; margin-bottom: .4rem; }
.comp th, .comp td { border-bottom: 1px solid var(--line); padding: .35rem .4rem; text-align: start; }
.comp input { padding: .35rem .5rem; }

.cta #fixNow { white-space: nowrap; flex-shrink: 0; }
.cta { display: flex; justify-content: space-between; align-items: center; gap: 1rem; background: linear-gradient(120deg, #ecfdf5, #eff6ff); }

.fx { border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1rem; margin: .8rem 0; }
.fx h3 { display: flex; justify-content: space-between; align-items: center; gap: .5rem; font-size: 1.02rem; }
.fx pre, .fx .box { white-space: pre-wrap; word-break: break-word; background: #f8fafc; border: 1px solid var(--line); border-radius: 9px; padding: .7rem .8rem; font-size: .86rem; margin: .3rem 0; }
.fx .box.ur { font-size: 1rem; }
.plan h4 { margin: .7rem 0 .2rem; }
.plan li { margin: .15rem 0; }
#qr svg, #qr img { width: 170px; height: 170px; }

/* ---------------- Report (A4 printable) ---------------- */
.report { background: #fff; max-width: 820px; margin: 1rem auto; padding: 2rem 2.2rem; border-radius: var(--radius); border: 1px solid var(--line); }
.report header { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 3px solid var(--navy); padding-bottom: .8rem; margin-bottom: 1rem; }
.report header h1 { font-size: 1.5rem; margin: 0; color: var(--navy); }
.report .bigscore { display: flex; gap: 1.2rem; align-items: center; margin: 1rem 0; flex-wrap: wrap; }
.report .mini { text-align: center; }
.report .mini .gauge { width: 92px; height: 92px; font-size: 1.4rem; }
.report table.pk { width: 100%; border-collapse: collapse; margin-top: .5rem; }
.report table.pk td, .report table.pk th { border: 1px solid var(--line); padding: .5rem .6rem; text-align: start; vertical-align: top; }
.report table.pk th { background: #f1f5f9; }
.report .prob { padding: .45rem 0; border-bottom: 1px dashed var(--line); }
.report .prob .ur { display: block; color: #334155; }
.report .note { font-size: .8rem; color: var(--muted); margin-top: 1rem; }

.hist { display: flex; justify-content: space-between; align-items: center; padding: .6rem 0; border-top: 1px solid var(--line); gap: .6rem; }
footer { text-align: center; padding: 1rem 1rem 2rem; font-size: .8rem; }
.pkg { display: grid; grid-template-columns: 1.3fr 2fr .7fr; gap: .5rem; margin: .4rem 0; }
.spinner { display: inline-block; width: 15px; height: 15px; border: 2px solid #cbd5e1; border-top-color: var(--green); border-radius: 50%; animation: sp 0.8s linear infinite; vertical-align: -2px; }
@keyframes sp { to { transform: rotate(360deg); } }

@media (max-width: 820px) {
  .row, .grid3, .grid4 { grid-template-columns: 1fr 1fr; }
  .span3 { grid-column: span 2; }
  .scores { grid-template-columns: 1fr 1fr; }
  .cta { flex-direction: column; align-items: stretch; }
  .pkg { grid-template-columns: 1fr; }
}
@media (max-width: 520px) { .row, .grid3, .grid4 { grid-template-columns: 1fr; } .span2, .span3 { grid-column: span 1; } }

@media print {
  body { background: #fff; }
  .no-print, .topbar, footer, .tab:not(#tab-report) { display: none !important; }
  #tab-report { display: block !important; }
  main { margin: 0; max-width: none; padding: 0; }
  .report { border: 0; margin: 0; padding: 0; max-width: none; }
  .gauge { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .report .prob { break-inside: avoid; }
  @page { size: A4; margin: 14mm; }
}

/* ---------------- Live Fix ---------------- */
.urin { font-family: "Noto Nastaliq Urdu", serif; line-height: 2; }
textarea { resize: vertical; }
.bigbtnrow { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-top: .6rem; }
.log { margin: .8rem 0 0; padding-inline-start: 1.3rem; font-size: .95rem; }
.log li { margin: .2rem 0; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .6rem; margin-top: .6rem; }
.thumbs figure { margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; font-size: .78rem; }
.thumbs figure.pending { opacity: .6; }
.thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.thumbs figcaption { padding: .3rem .4rem; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--blue); font-weight: 400; font-size: .78rem; text-decoration: underline; cursor: pointer; }
.live-box { display: flex; justify-content: space-between; gap: 1rem; align-items: center; background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 12px; padding: 1rem; margin-top: 1rem; word-break: break-all; }
#siteQr svg { width: 130px; height: 130px; }
.ba { display: flex; align-items: center; justify-content: center; gap: 1.2rem; margin-top: 1rem; padding: 1rem; border-radius: 14px; background: linear-gradient(120deg, #fef2f2, #ecfdf5); flex-wrap: wrap; }
.ba-col { text-align: center; } .ba-col h4 { margin: 0 0 .4rem; }
.ba-arrow { font-size: 2.4rem; font-weight: 900; color: var(--green); }
.tile { display: inline-flex; flex-direction: column; align-items: center; width: 120px; padding: .6rem; margin: .2rem; border-radius: 12px; background: #fff; border: 3px solid var(--c); }
.tile b { font-size: 2rem; color: var(--c); line-height: 1.1; } .tile span { font-size: .78rem; color: var(--muted); }
.howto { margin: .8rem 0; border: 1px dashed #cbd5e1; border-radius: 12px; padding: .6rem .9rem; }
.howto summary { cursor: pointer; font-weight: 700; }
.inv { display: flex; gap: .6rem; align-items: center; padding: .5rem 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
table.diff { width: 100%; border-collapse: collapse; font-size: .9rem; margin-top: .6rem; }
table.diff th, table.diff td { border-bottom: 1px solid var(--line); padding: .5rem .4rem; text-align: start; vertical-align: top; }
table.diff td.cur { color: #475569; max-width: 280px; }
table.diff tr.skip { opacity: .5; }
.bad { color: var(--red); font-weight: 700; }
.catadd { display: flex; gap: .5rem; margin: .4rem 0; }
.chip { padding: .3rem .7rem; font-size: .82rem; margin: .2rem; }
.review { border-top: 1px solid var(--line); padding: .7rem 0; }
.review.done { opacity: .75; }
.review b { color: #f59e0b; }
.review .reply { background: #f1f5f9; border-radius: 8px; padding: .4rem .6rem; font-size: .9rem; }
.review textarea { margin: .3rem 0; }
.walist { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
.walist .sent { background: #dcfce7; }
[hidden]{display:none!important}.hero.card{background:linear-gradient(135deg,#102b46,#174f65);color:white;border:0;padding:32px}.hero.card input,.hero.card details{color:#152b40;background:white;border-radius:12px}.hero.card .muted{color:#dbeafe}.hero.card .ur{color:inherit}.topbar{box-shadow:0 4px 24px #102b4614}.card{border-radius:16px}.primary{border-radius:10px}.hero.card .biz{padding:12px}.hero.card h1{letter-spacing:-.04em}
