:root {
  --bg: #f3f1ff;
  --ink: #25244a;
  --text: #3a3961;
  --muted: #6e6d92;
  --line: #e6e4f6;
  --soft: #efeefc;
  --accent: #5b52e8;
  --accent-2: #8b5cf6;
  --green: #1fa971;
  --green-btn: #22c55e;
  --mid: #d99a1f;
  --low: #d9534f;
  --serif: "Merriweather", Georgia, "Noto Naskh Arabic", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", "Noto Sans Arabic", Tahoma, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  color: var(--text);
  line-height: 1.6;
  background: linear-gradient(180deg, #efecff 0, #f8f7ff 460px, #fff 900px) no-repeat, #fff;
  min-height: 100vh;
}
[dir="rtl"] body { font-family: "Noto Sans Arabic", var(--sans); }

[hidden] { display: none !important; }
h1, h2, h3, p, ul { margin: 0; }

/* ---------- header ---------- */
.top { padding: 14px 20px; }
.top-in { max-width: 1040px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--serif); font-weight: 900; font-size: 1.15rem; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  background: #fff; color: var(--accent); border: 1px solid var(--line);
  padding: 7px 16px; border-radius: 999px; font: inherit; font-weight: 600; font-size: .9rem;
}
.chip:hover { background: var(--soft); }

main { max-width: 1040px; margin: 0 auto; padding: 0 16px 20px; }

/* ---------- hero ---------- */
.hero { text-align: center; padding: 34px 0 26px; }
.hero-sm { padding: 18px 0 14px; }
h1 { font-family: var(--serif); font-weight: 900; color: var(--ink); font-size: clamp(1.9rem, 5.2vw, 3.1rem); line-height: 1.2; max-width: 760px; margin: 0 auto 18px; }
.accent { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { max-width: 680px; margin: 0 auto; color: var(--muted); font-size: 1.05rem; }
.lead.small { font-size: .9rem; max-width: 560px; }
.badges { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: center; color: var(--muted); font-size: .88rem; }
.badges b { color: var(--accent); }

/* ---------- upload panel ---------- */
.panel {
  max-width: 640px; margin: 0 auto; background: #fff; border-radius: 22px; padding: 18px;
  box-shadow: 0 18px 60px rgba(91, 82, 232, .13); border: 1px solid #ece9fb;
}
.drop { border: 2px dashed #cdc8f4; border-radius: 16px; padding: 30px 18px 26px; text-align: center; background: #fcfbff; transition: .15s; }
.drop.over { background: var(--soft); border-color: var(--accent); }
.drop-ico { font-size: 2.6rem; line-height: 1; margin-bottom: 8px; }
.drop-title { font-weight: 700; font-size: 1.2rem; color: var(--ink); }
.drop-hint { color: #8d8cae; font-size: .85rem; margin: 8px auto 18px; max-width: 360px; }
.btn-main {
  display: block; width: 100%; cursor: pointer; user-select: none; text-align: center;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 700; font-size: 1.05rem;
  padding: 15px; border-radius: 12px; box-shadow: 0 10px 24px rgba(91, 82, 232, .32);
}
.btn-main:hover { filter: brightness(1.05); }
.error { color: var(--low); margin-top: 14px; font-size: .92rem; }

.examples { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.ex { border-radius: 14px; padding: 10px 10px 12px; text-align: center; border: 1px solid; }
.ex-good { background: #effcf4; border-color: #b9ebcb; }
.ex-bad { background: #fff2f2; border-color: #f5c2c2; }
.ex-label { font-size: .7rem; font-weight: 800; letter-spacing: .12em; margin-bottom: 8px; }
.ex-good .ex-label { color: #1b7a4b; } .ex-bad .ex-label { color: #b02a2a; }
.ex-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ex-row svg { width: 100%; aspect-ratio: 1; border-radius: 10px; border: 2px solid; display: block; }
.ex-good svg { border-color: #7bd8a0; } .ex-bad svg { border-color: #ee9a9a; }

.rules { list-style: none; padding: 14px 16px; margin-top: 14px; background: #f8f7fe; border: 1px solid #ece9fb; border-radius: 14px; display: grid; gap: 8px; font-size: .92rem; }
.rules li { display: flex; gap: 10px; align-items: center; }
.privacy { color: var(--muted); font-size: .82rem; margin: 14px 4px 2px; text-align: center; }

/* ---------- analyzing ---------- */
.load-title { font-family: var(--serif); color: var(--ink); font-size: 1.5rem; margin-bottom: 6px; }
.load-card { max-width: 380px; padding: 20px 22px; }
.thumb { position: relative; width: 84px; height: 84px; margin: 0 auto 16px; border-radius: 12px; overflow: hidden; background: #ddd; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan { position: absolute; inset-inline: 0; height: 3px; top: 0; background: linear-gradient(90deg, transparent, var(--accent-2), transparent); box-shadow: 0 0 10px var(--accent-2); animation: scan 1.4s ease-in-out infinite alternate; }
@keyframes scan { from { top: 2px; } to { top: calc(100% - 5px); } }
.prog-row { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); margin-bottom: 6px; }
.prog-row #progPct { color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }
.prog { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin-bottom: 16px; }
.prog i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 99px; }
.steps-list { list-style: none; padding: 0; display: grid; gap: 10px; font-size: .85rem; }
.steps-list li { display: flex; align-items: center; gap: 10px; color: #a9a8c4; transition: color .2s; }
.steps-list .dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #dedcf0; flex: none; display: grid; place-items: center; font-size: 10px; color: #fff; line-height: 1; }
.steps-list li.cur { color: var(--accent); font-weight: 600; }
.steps-list li.cur .dot { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3px #fff; }
.steps-list li.done { color: var(--text); }
.steps-list li.done .dot { background: var(--green-btn); border-color: var(--green-btn); }
.steps-list li.done .dot::after { content: "✓"; }

/* ---------- result ---------- */
.rep-title { font-family: var(--serif); color: var(--ink); font-size: 1.7rem; margin-bottom: 8px; }
.green { color: var(--green); }
.chips { display: flex; gap: 10px; justify-content: center; margin-top: 14px; }

.rep { max-width: 560px; margin: 0 auto; }
.avatar-wrap { position: relative; width: 170px; height: 170px; margin: 18px auto -28px; z-index: 2; }
#resCanvas { width: 100%; height: 100%; border-radius: 50%; display: block; background: #ddd; }
.ring { position: absolute; inset: -6px; border-radius: 50%; pointer-events: none;
  background: conic-gradient(var(--accent) calc(var(--p, 0) * 1%), #ddd9f7 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px)); }
.pill { position: absolute; inset-inline: 0; bottom: -18px; margin: auto; width: max-content; background: var(--accent); color: #fff; border-radius: 999px; padding: 5px 18px; border: 3px solid #fff; font-weight: 700; box-shadow: 0 6px 16px rgba(91,82,232,.35); }
.pill b { font-size: 1.15rem; } .pill span { opacity: .85; font-size: .9rem; }

.stats { background: #fff; border-radius: 22px; padding: 38px 18px 18px; box-shadow: 0 14px 44px rgba(91, 82, 232, .12); border: 1px solid #ece9fb; }
.stats-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 6px; }
.stats b { display: block; font-family: var(--serif); color: var(--accent); line-height: 1.1; }
.stats small { display: block; letter-spacing: .14em; font-size: .62rem; font-weight: 700; color: #a58a3a; margin-top: 4px; }
.s-left b, .s-right b { font-size: 1.35rem; text-transform: uppercase; }
.s-right { text-align: end; }
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; margin-top: 18px; }
.stats-row b { font-size: 1.25rem; }
.stats-row small { color: #8d8cae; }

.warnings { list-style: none; padding: 0; margin: 12px 0 0; color: var(--mid); font-size: .88rem; text-align: center; }

.mesh-card { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 14px; background: linear-gradient(135deg, #f3f0ff, #e9e5ff); border: 1px solid #e0dcfa; border-radius: 22px; padding: 14px; }
.mesh-box { position: relative; border-radius: 14px; overflow: hidden; background: #111; aspect-ratio: 3 / 4; }
.mesh-box canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.hud { position: absolute; font-size: .56rem; font-weight: 700; letter-spacing: .04em; white-space: nowrap; color: #fff; background: rgba(15,15,30,.72); border-radius: 999px; padding: 3px 7px; display: inline-flex; gap: 4px; align-items: center; }
.hud i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); }
.hud-tl { top: 8px; inset-inline-start: 8px; } .hud-tr { top: 8px; inset-inline-end: 8px; font-variant-numeric: tabular-nums; }
.hud-bl { bottom: 0; inset-inline: 0; border-radius: 0; background: linear-gradient(0deg, rgba(10,10,20,.85), transparent); display: block; padding: 18px 10px 8px; font-size: .75rem; letter-spacing: 0; }
.hud-bl small { display: block; color: #b7a7ff; letter-spacing: .12em; font-size: .6rem; }
.mesh-info { display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.eyebrow { color: var(--accent); font-weight: 800; letter-spacing: .14em; font-size: .68rem; }
.mesh-info h3 { font-family: var(--serif); color: var(--ink); font-size: 1.4rem; line-height: 1.2; }
.mesh-info p { color: var(--muted); font-size: .86rem; }
.btn-green { display: block; text-align: center; text-decoration: none; background: var(--green-btn); color: #fff; font-weight: 700; padding: 13px 14px; border-radius: 999px; margin-top: 6px; box-shadow: 0 8px 20px rgba(34,197,94,.3); }

.box { background: #fff; border: 1px solid #ece9fb; border-radius: 18px; padding: 18px; margin-top: 14px; }
.box h2 { font-family: var(--serif); color: var(--ink); font-size: 1.15rem; margin-bottom: 14px; }
.metrics { display: grid; gap: 10px; }
.metric { background: #f8f7fe; border-radius: 12px; padding: 12px 14px; }
.m-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.m-name { font-weight: 600; color: var(--ink); }
.m-val { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .88rem; }
.bar { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 8px 0 6px; }
.bar > i { display: block; height: 100%; border-radius: 99px; }
.m-foot { display: flex; justify-content: space-between; font-size: .78rem; color: var(--muted); gap: 10px; }
.lvl-high { color: var(--green); } .lvl-mid { color: var(--mid); } .lvl-low { color: var(--low); }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: .92rem; }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--accent); flex: none; }
.row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.btn { flex: 1 1 140px; cursor: pointer; text-align: center; background: var(--accent); color: #fff; border: 1px solid var(--accent); padding: 12px 18px; border-radius: 12px; font: inherit; font-weight: 600; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }

/* ---------- info sections ---------- */
.info { padding-top: 54px; }
.sec-title { font-family: var(--serif); color: var(--ink); text-align: center; font-size: clamp(1.5rem, 3.6vw, 2.1rem); margin: 56px 0 12px; }
.info > .sec-title:first-child { margin-top: 0; }
.sec-sub { text-align: center; color: var(--muted); max-width: 640px; margin: 0 auto 28px; font-size: .95rem; }

.how { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 14px; align-items: stretch; margin-top: 44px; }
.how-card { position: relative; background: var(--soft); border-radius: 18px; padding: 38px 20px 22px; text-align: center; }
.how-card i { position: absolute; top: -22px; inset-inline: 0; margin: auto; width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: #fff; font-style: normal; font-weight: 700; display: grid; place-items: center; font-size: 1.15rem; }
.how-card h3 { font-family: var(--serif); color: var(--ink); font-size: 1.05rem; margin-bottom: 8px; }
.how-card p { color: var(--muted); font-size: .88rem; }
.arrow { align-self: center; color: var(--accent); font-size: 1.5rem; }
[dir="rtl"] .arrow { transform: scaleX(-1); }

.meas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.meas-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.mi { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: #f4f2ff; font-size: 1.3rem; margin-bottom: 12px; }
.meas-card h3 { color: var(--ink); font-size: 1rem; margin-bottom: 6px; }
.meas-card p { color: var(--muted); font-size: .85rem; }

.scale { max-width: 560px; margin: 0 auto; display: grid; gap: 8px; }
.scale-head, .scale-row { display: grid; grid-template-columns: 1fr 70px 70px; gap: 10px; align-items: center; padding: 0 14px; }
.scale-head { font-size: .68rem; font-weight: 700; letter-spacing: .1em; color: var(--muted); text-align: center; }
.scale-row { background: #fff; border: 1px solid var(--line); border-inline-start: 4px solid; border-radius: 10px; padding-block: 12px; font-weight: 600; color: var(--ink); }
.scale-row b { text-align: center; font-variant-numeric: tabular-nums; font-size: .92rem; }
.c-below { border-inline-start-color: #d9534f; } .c-avg { border-inline-start-color: #d9a21f; }
.c-above { border-inline-start-color: #5b52e8; } .c-very { border-inline-start-color: #f06a2b; } .c-model { border-inline-start-color: #1fa971; }
.scale-row.on { background: var(--soft); box-shadow: 0 0 0 2px var(--accent); }

.notice { max-width: 640px; margin: 44px auto 0; background: #fffbe9; border: 1px solid #f5ecc2; border-radius: 14px; padding: 18px 20px; display: flex; gap: 14px; }
.n-ico { font-size: 1.6rem; line-height: 1.2; }
.notice h3 { color: var(--ink); font-size: 1rem; margin-bottom: 6px; }
.notice p { color: #6b6a55; font-size: .85rem; }

/* ---------- footer ---------- */
.foot { margin-top: 60px; background: var(--accent); color: #fff; padding: 36px 20px 40px; }
.foot-in { max-width: 1040px; margin: 0 auto; }
.foot-brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-weight: 900; font-size: 1.2rem; margin-bottom: 8px; }
.foot-brand img { filter: none; }
.foot p { opacity: .9; margin-bottom: 14px; }
.foot small { opacity: .75; }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  .how { grid-template-columns: 1fr; gap: 34px; }
  .arrow { display: none; }
  .meas { grid-template-columns: 1fr; }
  .mesh-card { grid-template-columns: 1fr; }
  .mesh-box { aspect-ratio: 1 / 1; }
}

/* ---------- language dropdown ---------- */
.lang { position: relative; }
.chip svg { flex: none; }
.caret { font-size: .7rem; }
.lang-list {
  position: absolute; inset-inline-end: 0; top: calc(100% + 8px); z-index: 30; margin: 0; padding: 6px; list-style: none;
  min-width: 200px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 50px rgba(37, 36, 74, .18);
}
.lang-list a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 9px; color: var(--ink); text-decoration: none; font-weight: 600; }
.lang-list a:hover { background: var(--soft); }
.lang-list a[aria-current="true"] { background: var(--soft); color: var(--accent); }
.lang-list b { width: 24px; font-size: .68rem; letter-spacing: .06em; color: var(--muted); }

/* ---------- FAQ ---------- */
.faq { max-width: 720px; margin: 0 auto; display: grid; gap: 10px; }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 0 18px; }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 0; font-weight: 600; color: var(--ink); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 1.4rem; line-height: 1; flex: none; }
.faq details[open] summary::after { content: "–"; }
.faq p { color: var(--muted); font-size: .92rem; padding: 0 0 16px; }

/* ---------- improvement tips ---------- */
.box .muted { margin: 0 0 12px; font-size: .9rem; }
.tips-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.tips-list li { background: #f8f7fe; border-radius: 12px; padding: 12px 14px; font-size: .9rem; color: var(--muted); }
.tips-list b { display: block; color: var(--ink); margin-bottom: 2px; }

/* ---------- footer languages, Hindi font ---------- */
.foot-langs { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .25); }
.foot-langs a { color: #fff; opacity: .85; text-decoration: none; font-size: .88rem; }
.foot-langs a:hover { opacity: 1; text-decoration: underline; }
html:lang(hi) { --serif: "Noto Sans Devanagari", system-ui, sans-serif; }
html:lang(hi) body { font-family: "Noto Sans Devanagari", var(--sans); }
