:root {
  --bg: #0f172a;
  --card: #1e293b;
  --line: #334155;
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --ok: #4ade80;
  --warn: #f59e0b;
  --bad: #f87171;
  --info: #a78bfa;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, Roboto, "Noto Sans Arabic", sans-serif;
  line-height: 1.6;
}

a { color: var(--accent); }
code, pre { font-family: ui-monospace, Consolas, "Courier New", monospace; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

.site-header { background: var(--card); border-bottom: 3px solid var(--accent); }
.header-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding-top: 14px; padding-bottom: 14px; }
.brand { color: var(--text); font-weight: 700; font-size: 1.2rem; text-decoration: none; }
nav { display: flex; flex-wrap: wrap; gap: 16px; }
nav a { color: var(--muted); text-decoration: none; }
nav a:hover, nav a.lang { color: var(--accent); }

main.wrap { padding-top: 28px; padding-bottom: 28px; }

.hero { text-align: center; padding: 24px 0 32px; }
.hero h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); margin: 0 0 12px; }
.lead { color: var(--muted); max-width: 760px; margin: 0 auto 24px; }

.scan-form { max-width: 620px; margin: 0 auto; text-align: start; }
.scan-form label { display: block; color: var(--muted); margin-bottom: 6px; }
.scan-row { display: flex; gap: 8px; }
.scan-row input {
  flex: 1; min-width: 0; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font-size: 1rem;
}
button, .button-link {
  display: inline-block; padding: 12px 20px; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--accent); color: var(--bg); font-weight: 700; font-size: 1rem; text-decoration: none;
}
button[disabled] { opacity: .6; cursor: progress; }
.form-error { color: var(--bad); }
.form-busy { color: var(--accent); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px; margin-bottom: 22px; }
.card h2 { margin-top: 0; color: var(--accent); font-size: 1.25rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px; }
.grid-2 > .card { margin-bottom: 0; }
section.grid-2 { margin-bottom: 22px; }

.ticks { padding-inline-start: 0; list-style: none; }
.ticks li { padding-inline-start: 26px; position: relative; margin-bottom: 6px; }
.ticks li::before { content: "✓"; color: var(--ok); position: absolute; inset-inline-start: 0; }

.price-box { border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.price-box.highlight { border-color: var(--accent); }
.price-box h3 { margin-top: 0; }
.tag { background: var(--bg); color: var(--ok); border-radius: 8px; padding: 2px 10px; font-size: .95rem; }

.result-head { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.result-head > div:not(.grade) { flex: 1; min-width: 220px; }
.domain { margin: 0; font-size: 1.6rem; word-break: break-all; }
.grade {
  flex: 0 0 96px; width: 96px; height: 96px; border-radius: 18px; display: grid; place-items: center;
  font-size: 3rem; font-weight: 800; color: var(--bg);
}
.grade-A { background: var(--ok); }
.grade-B { background: var(--accent); }
.grade-C { background: var(--warn); }
.grade-F { background: var(--bad); }
.grade-text { font-weight: 600; margin: 4px 0; }
.grade-chip { display: inline-block; min-width: 28px; text-align: center; border-radius: 6px; color: var(--bg); font-weight: 700; }

.muted { color: var(--muted); }
.small { font-size: .9rem; }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.notice { background: var(--bg); border-radius: 10px; padding: 12px 14px; }

table { width: 100%; border-collapse: collapse; }
.kv th, .kv td, .data th, .data td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
.kv th { color: var(--muted); font-weight: 600; width: 36%; }
.data th { background: var(--line); }
.data { display: block; overflow-x: auto; }

.finding { border-inline-start: 4px solid var(--line); padding: 4px 14px; margin-bottom: 16px; }
.finding h3 { margin: 0 0 6px; font-size: 1.05rem; }
.finding p { margin: 0; color: #cbd5e1; }
.badge { font-size: .8rem; border-radius: 6px; padding: 2px 8px; margin-inline-end: 6px; color: var(--bg); }
.status-ok { border-color: var(--ok); } .status-ok .badge { background: var(--ok); }
.status-info { border-color: var(--info); } .status-info .badge { background: var(--info); }
.status-warning { border-color: var(--warn); } .status-warning .badge { background: var(--warn); }
.status-critical { border-color: var(--bad); } .status-critical .badge { background: var(--bad); }

pre { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 14px; overflow-x: auto; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 22px; }
.stat h3 { margin: 0; color: var(--muted); font-size: .9rem; }
.stat .value { font-size: 2rem; font-weight: 800; color: var(--accent); margin: 8px 0 0; }

.bars { display: grid; gap: 6px; }
.bar-row { display: grid; grid-template-columns: 48px 1fr 56px; gap: 10px; align-items: center; }
.bar { background: var(--bg); border-radius: 6px; height: 14px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); }
.bar-value { text-align: end; color: var(--muted); }
.bars.weeks .bar-row { grid-template-columns: 84px 1fr 56px; }
.pq-on { color: var(--ok); }
.pq-off { color: var(--warn); }
.stat .value.pq-on { color: var(--ok); }
.stat .value.pq-off { color: var(--warn); }

.site-footer { color: var(--muted); font-size: .9rem; padding-bottom: 32px; }

@media (max-width: 560px) {
  .scan-row { flex-direction: column; }
  .kv th { width: 44%; }
}

@media print {
  body { background: #fff; color: #000; }
  .site-header, .site-footer, .no-print { display: none !important; }
  .card { border-color: #ccc; background: #fff; }
  .card h2 { color: #000; }
  .finding p { color: #000; }
}

.prose h2 { margin-top: 1.6em; }
.prose li { margin-bottom: 6px; }
details summary { cursor: pointer; }
.grade-chip.grade-A, .grade-chip.grade-B, .grade-chip.grade-C, .grade-chip.grade-F { padding: 0 6px; }

.textarea { width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font-size: 1rem; font-family: inherit; }
.link-button { background: none; color: var(--muted); padding: 4px 6px; font-weight: 400; text-decoration: underline; }
.link-button.danger { color: var(--bad); }
.paypal-sub { margin-top: 12px; min-height: 40px; }

mark.placeholder { background: var(--warn); color: var(--bg); border-radius: 4px; padding: 0 4px; }
.legal-links a { color: var(--muted); }

.consent { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.consent label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.consent input { margin-top: 5px; flex: 0 0 auto; width: 18px; height: 18px; }

/* أكواد التضمين وأزرار النسخ */
.snippet { margin: .75rem 0; }
.snippet-head { display: flex; justify-content: space-between; align-items: center;
  font-size: .85rem; color: var(--muted, #64748b); margin-bottom: .25rem; }
.copy-btn { font-size: .8rem; padding: .2rem .6rem; cursor: pointer; }
/* المقارنة */
.compare-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.compare-form input { flex: 1 1 12rem; }
.compare-form .vs { color: var(--muted, #64748b); }
.compare-cards .grade { margin-inline-end: .75rem; }

/* سُلّم القيمة في الصفحة الرئيسية */
.ladder .steps { list-style: none; counter-reset: step; padding: 0; margin: 1rem 0; }
.ladder .steps li { counter-increment: step; position: relative; padding: .75rem 0 .75rem 2.5rem;
  border-top: 1px solid var(--border, #e2e8f0); }
.ladder .steps li:first-child { border-top: 0; }
.ladder .steps li::before { content: counter(step); position: absolute; inset-inline-start: 0; top: .75rem;
  width: 1.6rem; height: 1.6rem; border-radius: 50%; background: #1e293b; color: #fff;
  display: grid; place-items: center; font-size: .9rem; font-weight: 700; }
.ladder .steps li.primary { background: color-mix(in srgb, #16a34a 8%, transparent); border-radius: 8px; }
.ladder .steps li.primary::before { background: #16a34a; }
html[dir="rtl"] .ladder .steps li { padding: .75rem 2.5rem .75rem 0; }

/* الأسئلة الشائعة */
.faq details { border-top: 1px solid var(--border, #e2e8f0); padding: .6rem 0; }
.faq details:first-of-type { border-top: 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: .5rem 0 0; color: var(--muted, #475569); }

/* أمثلة قابلة للنقر + شريط الثقة */
.try-label { margin: .9rem 0 .4rem; font-size: .9rem; color: var(--muted, #94a3b8); }
.examples { display: flex; flex-wrap: wrap; gap: 8px; }
.example-chip { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 44px;
  padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--text, #e2e8f0);
  font: inherit; font-size: .9rem; cursor: pointer; text-align: start; }
.example-chip:hover, .example-chip:focus-visible { border-color: var(--accent); }
.example-chip .ex-domain { font-weight: 600; }
.example-chip .ex-result { font-size: .8rem; color: var(--muted, #94a3b8); }
.example-chip.ok .ex-result { color: var(--ok); }
.example-chip.bad .ex-result { color: var(--bad); }
.no-site { margin: .7rem 0 0; font-size: .9rem; color: var(--muted, #94a3b8); }
.trustbar { margin-top: 1rem; font-size: .85rem; color: var(--muted, #64748b); text-align: center; }
.verdict { font-size: 1.05rem; line-height: 1.6; }
.related { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 16px; }
.related li { overflow-wrap: anywhere; }
.timeline { padding-inline-start: 1.2rem; }
.timeline li { margin-bottom: .7rem; line-height: 1.6; }
.findings-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.findings-list li { padding: 8px 0 8px 0; border-bottom: 1px solid var(--line); }
.findings-list li::before { content: "• "; color: var(--muted); }
.findings-list li.st-ok::before { content: "✓ "; color: var(--ok); }
.findings-list li.st-warning::before, .findings-list li.st-warn::before { content: "! "; color: var(--warn); font-weight: 700; }
.findings-list li.st-critical::before, .findings-list li.st-bad::before { content: "✗ "; color: var(--bad); font-weight: 700; }
.findings-list li.st-info::before { content: "i "; color: var(--info); font-weight: 700; }
.one-time { color: var(--muted); margin-top: -.4rem; }
