:root {
  --bg: #f8f6f1; --panel: #ffffff; --ink: #151514; --muted: #5d5b55; --line: #e7e3da;
  --accent: #2463eb; --accent-ink: #ffffff; --soft: #eef3fe;
  --bad: #b3261e; --bad-soft: #fbeceb; --warn: #9a5b00; --warn-soft: #fdf3e1;
  --ok: #1d6b3a; --ok-soft: #e8f4ec; --ink-band: #151514;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131314; --panel: #1e1f20; --ink: #e8eaed; --muted: #a7abb1; --line: #2f3134;
    --accent: #8ab4f8; --accent-ink: #0e0e0f; --soft: #1b2535;
    --bad: #f28b82; --bad-soft: #2c1b1a; --warn: #f2c26b; --warn-soft: #2b2416;
    --ok: #81c995; --ok-soft: #17261c; --ink-band: #0e0e0f;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 Inter, system-ui, "Segoe UI", sans-serif; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
a { color: var(--accent); }
h1 { font-size: clamp(28px, 4.2vw, 46px); line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 16px; font-weight: 700; text-wrap: balance; }
h2 { font-size: 24px; letter-spacing: -0.01em; margin: 0 0 12px; }
h3 { font-size: 16px; margin: 0 0 6px; }
p { margin: 0 0 12px; }

.top { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.bar { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 16px; }
.brand { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.bolt { width: 12px; height: 18px; background: var(--accent); clip-path: polygon(60% 0, 0 58%, 42% 58%, 30% 100%, 100% 38%, 56% 38%); }
.top nav { display: flex; gap: 20px; font-size: 14px; }
.top nav a { color: var(--muted); text-decoration: none; }
.top nav a:hover { color: var(--ink); }
@media (max-width: 640px) { .top nav a:not(:first-child) { display: none; } }

.hero { padding: 48px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 40px; align-items: center; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; gap: 28px; } }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }
.lede { font-size: 18px; color: var(--muted); max-width: 56ch; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 20px 0 12px; }
.fine { font-size: 13px; color: var(--muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; padding: 12px 18px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; border: 1px solid transparent; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn.small { padding: 8px 12px; font-size: 14px; }
.btn.wide { width: 100%; padding: 14px; font-size: 17px; }
.btn:focus-visible, input:focus-visible, select:focus-visible, .chip:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.cliff { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 24px; }
.cliff-row { display: grid; grid-template-columns: 1fr; gap: 6px; margin-bottom: 18px; }
.cliff-label { font-size: 14px; color: var(--muted); }
.cliff-bar { height: 22px; background: var(--bg); border-radius: 6px; overflow: hidden; }
.cliff-bar span { display: block; height: 100%; background: var(--ok); border-radius: 6px; }
.cliff-row.hot .cliff-bar span { background: var(--bad); }
.cliff-amt { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cliff-row.hot .cliff-amt { color: var(--bad); }
.cliff-note { font-size: 13px; color: var(--muted); margin: 0; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 24px; align-items: start; padding-bottom: 48px; }
@media (max-width: 960px) { .layout { grid-template-columns: 1fr; } }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.result { display: grid; gap: 16px; position: sticky; top: 72px; }
@media (max-width: 960px) { .result { position: static; } }

.form fieldset { border: 0; padding: 0; margin: 0 0 22px; display: grid; gap: 12px; min-width: 0; }
.form legend { font-weight: 700; font-size: 17px; padding: 0; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }
.form legend em, label em { font-style: normal; font-weight: 400; font-size: 13px; color: var(--muted); }
.step { width: 26px; height: 26px; border-radius: 50%; background: var(--soft); color: var(--accent); display: inline-grid; place-items: center; font-size: 14px; }
label { display: grid; gap: 6px; font-size: 14px; font-weight: 500; }
label small { font-weight: 400; color: var(--muted); font-size: 13px; }
input:not([type=checkbox]), select { font: inherit; padding: 10px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); width: 100%; min-width: 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 560px) { .grid3, .grid2 { grid-template-columns: 1fr; } }
.checks { display: grid; gap: 8px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; font-size: 15px; }
.check input { margin-top: 4px; width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.check.strong { font-weight: 600; }
.sub { border-left: 3px solid var(--line); padding-left: 14px; display: grid; gap: 8px; }
details summary { cursor: pointer; font-size: 14px; color: var(--accent); margin-bottom: 10px; }
.examples { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.chip { font: inherit; font-size: 13px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer; }
.chip.quiet { border-color: transparent; color: var(--muted); margin-left: auto; }
.error { color: var(--bad); background: var(--bad-soft); padding: 10px 12px; border-radius: 9px; font-size: 14px; }

.placeholder ul { margin: 0; padding-left: 20px; color: var(--muted); }
.placeholder li { margin-bottom: 4px; }

.verdict { border-radius: 16px; padding: 24px; border: 1px solid var(--line); background: var(--panel); }
.verdict.bad { background: var(--bad-soft); border-color: transparent; }
.verdict.warn { background: var(--warn-soft); border-color: transparent; }
.verdict.ok { background: var(--ok-soft); border-color: transparent; }
.verdict .k { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.verdict.bad .k { color: var(--bad); } .verdict.warn .k { color: var(--warn); } .verdict.ok .k { color: var(--ok); }
.verdict .big { font-size: clamp(34px, 5vw, 48px); font-weight: 700; line-height: 1.05; margin: 6px 0; font-variant-numeric: tabular-nums; }
.verdict p { margin: 0; color: var(--ink); }

.compare { width: 100%; border-collapse: collapse; font-size: 15px; }
.compare th, .compare td { text-align: right; padding: 9px 8px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.compare th:first-child, .compare td:first-child { text-align: left; color: var(--muted); font-weight: 500; }
.compare thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.compare tr:last-child td { border-bottom: 0; font-weight: 700; }
.compare td.diff { color: var(--bad); font-weight: 600; }
.scroll { overflow-x: auto; }

.finding { border-left: 4px solid var(--line); padding: 4px 0 4px 14px; margin-bottom: 18px; }
.finding:last-child { margin-bottom: 0; }
.finding.high { border-color: var(--bad); } .finding.medium { border-color: var(--warn); }
.finding h3 { font-size: 16px; margin-bottom: 4px; }
.finding p { color: var(--muted); font-size: 15px; margin-bottom: 6px; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 2px 8px; border-radius: 999px; margin-bottom: 6px; }
.tag.high { background: var(--bad-soft); color: var(--bad); } .tag.medium { background: var(--warn-soft); color: var(--warn); }
.tag.low, .tag.info { background: var(--soft); color: var(--accent); }
.clause { font-size: 13px; font-weight: 600; color: var(--ink); }
.plain { margin: 0; padding-left: 20px; color: var(--muted); font-size: 15px; }
.plain li { margin-bottom: 6px; }

.letter-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg button { font: inherit; font-size: 14px; padding: 7px 14px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed=true] { background: var(--accent); color: var(--accent-ink); }
.letter { white-space: pre-wrap; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 16px; font-size: 14.5px; line-height: 1.6; max-height: 420px; overflow: auto; margin: 0; font-family: inherit; }
.letter[dir=rtl] { font-family: "Noto Nastaliq Urdu", serif; line-height: 2.3; font-size: 16px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.ladder { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.ladder li { counter-increment: s; display: grid; grid-template-columns: 28px 1fr; gap: 10px; font-size: 15px; }
.ladder li::before { content: counter(s); width: 26px; height: 26px; border-radius: 50%; background: var(--soft); color: var(--accent); display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.ladder b { display: block; } .ladder span { color: var(--muted); }

.band { padding: 40px 16px; border-top: 1px solid var(--line); }
.limits p { color: var(--muted); font-size: 15px; }
.sources { padding-left: 20px; } .sources li { margin-bottom: 6px; }
.foot { padding: 24px 16px 40px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }

@media print {
  .top, .hero, .form, .band, .foot, .actions, .seg, .result > :not(.print) { display: none !important; }
  .layout { display: block; } .result { position: static; }
  .letter { max-height: none; border: 0; padding: 0; }
  body { background: #fff; color: #000; }
}
