:root { --bg:#0B1220; --ink:#0F172A; --card:#fff; --muted:#64748B; --line:#E2E8F0; --blue:#2563EB; --blue2:#7C3AED; --soft:#F1F5F9;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px); }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body { font: 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Noto Sans", "Noto Sans Arabic", "Noto Nastaliq Urdu", "Noto Sans CJK SC", Helvetica, Arial, sans-serif;
  color: var(--ink); background: #EEF2F8; -webkit-font-smoothing: antialiased; }
[dir="rtl"] body, body[dir="rtl"] { text-align: right; }
#app { max-width: 560px; margin: 0 auto; min-height: 100vh; padding-bottom: calc(24px + var(--safe-b)); }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; padding: calc(10px + var(--safe-t)) 16px 10px;
  background: rgba(11,18,32,.92); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); color: #fff; }
.brand { display: flex; gap: 10px; align-items: center; } .brand img { border-radius: 9px; }
.brand b { display: block; font-size: 17px; letter-spacing: .2px; } .brand small { display: block; font-size: 11.5px; color: #93C5FD; font-weight: 600; }
.top-actions { display: flex; gap: 6px; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 0; background: rgba(255,255,255,.08); color: #E2E8F0; display: grid; place-items: center; cursor: pointer; font-size: 16px; }
.icon-btn.dark { background: var(--soft); color: var(--ink); }
.view { display: none; padding: 0 16px; animation: fade .25s ease; } .view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.hero { margin: 0 -16px; padding: 22px 20px 26px; color: #fff;
  background: radial-gradient(120% 90% at 0% 0%, #1D4ED8 0%, transparent 55%), radial-gradient(90% 80% at 100% 10%, #7C3AED 0%, transparent 55%), var(--bg); border-radius: 0 0 28px 28px; }
.hero h1 { margin: 6px 0 6px; font-size: 30px; line-height: 1.12; letter-spacing: -.5px; font-weight: 800; }
.hero p { margin: 0 0 16px; color: #CBD5E1; font-size: 15px; }
.glow { background: linear-gradient(90deg, #fff, #BFDBFE 60%, #FDE68A); -webkit-background-clip: text; background-clip: text; color: transparent; }
.search input { width: 100%; height: 54px; border-radius: 16px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.96); color: var(--ink);
  padding: 0 16px; font-size: 16px; outline: none; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.search input:focus { border-color: #93C5FD; box-shadow: 0 0 0 4px rgba(147,197,253,.35); }
.row { display: flex; gap: 10px; margin-top: 10px; } .row > * { flex: 1; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 50px; border-radius: 14px; border: 0; font: inherit; font-weight: 700; font-size: 16px; cursor: pointer; text-decoration: none; padding: 0 16px; }
.btn.primary { background: linear-gradient(135deg, #3B82F6, #2563EB 50%, #7C3AED); color: #fff; box-shadow: 0 8px 22px rgba(37,99,235,.35); }
.btn.primary:active { transform: scale(.98); }
.btn.ghost { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.22); }
.card .btn.ghost, .sheet .btn.ghost { background: var(--soft); color: var(--ink); border: 1px solid var(--line); }
.btn.link { background: none; color: var(--blue); width: 100%; margin-top: 6px; }
.btn.wide { width: 100%; }
.err { background: #FEE2E2; color: #991B1B; border-radius: 12px; padding: 10px 12px; font-size: 14px; margin: 10px 0 0 !important; }
.stores { font-size: 12.5px !important; color: #94A3B8 !important; margin: 14px 0 0 !important; }
.card { background: var(--card); border-radius: 20px; padding: 16px; margin: 14px 0; box-shadow: 0 1px 2px rgba(15,23,42,.05), 0 8px 24px rgba(15,23,42,.06); border: 1px solid #E8EDF5; }
.card h2 { margin: 0 0 6px; font-size: 20px; } .card h3 { margin: 0 0 10px; font-size: 15px; color: #334155; }
.how ol { margin: 0; padding-inline-start: 20px; color: #334155; font-size: 14.5px; } .how li { margin: 4px 0; }
.muted { color: var(--muted); } .small { font-size: 12.5px; }
.recent-item { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid #F1F5F9; cursor: pointer; }
.recent-item:first-child { border-top: 0; }
.mini { width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 16px; }
.recent-item .t { flex: 1; min-width: 0; } .recent-item .t b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-item .t span { font-size: 12.5px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chip-btn { border: 1px solid var(--line); background: var(--soft); border-radius: 999px; padding: 8px 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; color: #1E293B; }
.install-cta { display: flex; align-items: center; gap: 10px; width: 100%; border: 1px dashed #C7D2FE; background: #EEF2FF; color: #3730A3; border-radius: 16px; padding: 12px 14px; font: inherit; font-weight: 700; cursor: pointer; }
.install-cta img { border-radius: 7px; }
.loader { text-align: center; padding: 90px 10px; } .loader p { font-weight: 600; }
.ring-spin { width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 50%; border: 6px solid #DBEAFE; border-top-color: var(--blue); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
/* manual */
#manualForm label { display: block; margin: 12px 0; font-weight: 600; font-size: 14px; color: #334155; }
.money { display: flex; gap: 8px; margin-top: 6px; }
.money input, .money select, .field select, .lic input { height: 50px; border-radius: 12px; border: 1px solid #CBD5E1; padding: 0 12px; font: inherit; font-size: 17px; background: #fff; color: var(--ink); }
.money input { flex: 1; min-width: 0; } .money select { width: 96px; }
.cur-echo { width: 96px; display: grid; place-items: center; background: var(--soft); border-radius: 12px; color: var(--muted); font-weight: 700; }
.ptitle { font-weight: 700; font-size: 14px; margin: 8px 0; }
/* result */
.res-hero { margin: 0 -16px; padding: 18px 18px 22px; color: #fff; border-radius: 0 0 28px 28px; background: var(--bg); position: relative; overflow: hidden; }
.res-hero::before { content: ""; position: absolute; inset: -40% -20% auto auto; width: 320px; height: 320px; border-radius: 50%; background: var(--gc, #2563EB); opacity: .28; filter: blur(50px); }
.res-top { display: flex; gap: 16px; align-items: center; position: relative; }
.res-top .ringbox { flex: none; background: rgba(255,255,255,.96); border-radius: 50%; padding: 6px; box-shadow: 0 10px 30px rgba(0,0,0,.3); }
.res-top .lbl { font-size: 12px; text-transform: uppercase; letter-spacing: .8px; color: #93C5FD; font-weight: 800; }
.res-top .grade { font-size: 24px; font-weight: 800; line-height: 1.15; margin: 2px 0 4px; }
.res-top .note { font-size: 13px; color: #CBD5E1; }
.ptitle-hero { position: relative; margin: 16px 0 8px; font-weight: 600; font-size: 15px; color: #E2E8F0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prices { position: relative; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; direction: ltr; }
[dir="rtl"] .prices { justify-content: flex-end; }
.prices .now { font-size: 30px; font-weight: 800; letter-spacing: -.5px; }
.prices .was { font-size: 17px; color: #FCA5A5; text-decoration: line-through; }
.prices .off { font-size: 13px; font-weight: 800; background: #DC2626; color: #fff; padding: 3px 8px; border-radius: 999px; }
.src { position: relative; font-size: 12px; color: #94A3B8; margin-top: 8px; }
.sec { padding: 0; overflow: hidden; }
.sec summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 15px 16px; cursor: pointer; font-weight: 800; font-size: 16px; }
.sec summary::-webkit-details-marker { display: none; }
.sec summary .t { flex: 1; } .sec summary .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--soft); font-size: 17px; }
.sec .arr { color: #94A3B8; transition: transform .2s; } .sec[open] .arr { transform: rotate(90deg); } [dir="rtl"] .sec .arr { transform: scaleX(-1); } [dir="rtl"] .sec[open] .arr { transform: rotate(90deg); }
.sec .body { padding: 0 16px 16px; }
.sec ul { margin: 0 0 8px; padding-inline-start: 20px; color: #334155; font-size: 14.5px; } .sec li { margin: 5px 0; }
.chip { font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.stat { background: #F8FAFC; border: 1px solid #EEF2F7; border-radius: 12px; padding: 8px 4px; text-align: center; }
.stat b { display: block; font-size: 14px; direction: ltr; } .stat span { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.chart { border: 1px solid #EEF2F7; border-radius: 12px; padding: 6px; background: #FBFDFF; } .chart svg { width: 100%; height: auto; display: block; }
.wasline { font-size: 14px; font-weight: 700; margin: 8px 0; } .wasline.verified { color: #0F7B3F; } .wasline.contradicted { color: #B42318; } .wasline.unknown { color: #8A5300; }
.hist { display: flex; flex-direction: column; gap: 4px; margin: 8px 0 10px; direction: ltr; }
.hist div { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #475569; }
.hist i { flex: 1; height: 8px; border-radius: 99px; background: #EEF2F7; overflow: hidden; } .hist i em { display: block; height: 100%; background: #F59E0B; border-radius: 99px; }
.actions { display: grid; gap: 10px; margin: 16px 0; }
.foot { text-align: center; font-size: 12px; color: var(--muted); margin: 6px 8px 20px; }
/* sheets */
.sheet { position: fixed; inset: 0; z-index: 20; background: rgba(2,6,23,.55); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
.sheet[hidden] { display: none; }
.sheet-card { background: #fff; width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; border-radius: 24px 24px 0 0; padding: 18px 18px calc(22px + var(--safe-b)); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; } .sheet-head h2 { margin: 0; font-size: 20px; }
.how-install { border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; margin: 10px 0; }
.how-install.mine { border-color: #93C5FD; background: #F0F7FF; }
.how-install h3 { margin: 0 0 6px; font-size: 15px; } .how-install ol { margin: 0; padding-inline-start: 20px; font-size: 14px; color: #334155; }
.ok { color: #0F7B3F; font-weight: 700; }
.field { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid #F1F5F9; font-weight: 600; }
.field select { height: 44px; font-size: 15px; }
.lic { margin-top: 12px; } .lic summary { cursor: pointer; font-weight: 600; color: var(--blue); padding: 8px 0; }
.lic input { width: 100%; margin: 6px 0; font-size: 15px; }
#proofImg { width: 100%; border-radius: 12px; border: 1px solid var(--line); margin: 6px 0 12px; }
@media (min-width: 900px) {
  body { background: radial-gradient(60% 50% at 20% 0%, #DBEAFE 0%, transparent 60%), radial-gradient(50% 40% at 90% 10%, #EDE9FE 0%, transparent 60%), #EEF2F8; }
  #app { margin-top: 24px; margin-bottom: 24px; border-radius: 28px; overflow: hidden; background: #EEF2F8; box-shadow: 0 30px 80px rgba(15,23,42,.18); min-height: auto; }
  .sheet { align-items: center; } .sheet-card { border-radius: 24px; }
}

.hint { position: relative; margin-top: 12px; font-size: 13px; line-height: 1.4; color: #FDE68A; background: rgba(253,230,138,.1); border: 1px solid rgba(253,230,138,.25); border-radius: 12px; padding: 9px 11px; }
