/* منصة بحثي — واجهة البوابات (تصميم حديث وهادئ) */
:root {
  --bg: #f7f6f2;
  --bg-2: #efede6;
  --surface: #ffffff;
  --surface-2: #fafaf7;
  --glass: rgba(255, 255, 255, .72);
  --ink: #142321;
  --ink-2: #33433f;
  --muted: #677370;
  --line: #e6e3da;
  --line-2: #d8d4c8;
  --primary: #1f6f68;
  --primary-2: #2f8c82;
  --primary-ink: #ffffff;
  --primary-soft: #e3f0ed;
  --primary-deep: #17544f;
  --mint: #9fd3c7;
  --sand: #c9a467;
  --sand-soft: #f6eedf;
  --ok: #2f7a55; --ok-soft: #e3f2e9;
  --warn: #946419; --warn-soft: #f8eedb;
  --bad: #a4463f; --bad-soft: #f8e5e2;
  --shadow: 0 1px 2px rgba(20, 35, 33, .04), 0 6px 24px rgba(20, 35, 33, .06);
  --shadow-lg: 0 2px 8px rgba(20, 35, 33, .05), 0 28px 70px rgba(20, 35, 33, .12);
  --glow: 0 10px 30px color-mix(in srgb, var(--primary) 28%, transparent);
  --r: 22px;
  --r-sm: 14px;
  --font: "IBM Plex Sans Arabic", "Readex Pro", system-ui, sans-serif;
  --font-head: "Alexandria", "IBM Plex Sans Arabic", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1413; --bg-2: #0a0f0e; --surface: #151d1c; --surface-2: #19221f; --glass: rgba(21, 29, 28, .72);
    --ink: #e8eeec; --ink-2: #c8d2cf; --muted: #91a09b; --line: #25302e; --line-2: #33403d;
    --primary: #6fbcae; --primary-2: #8fd0c3; --primary-ink: #0b1615; --primary-soft: #1a2c29; --primary-deep: #a3d9ce; --mint: #3e7f73;
    --sand: #d8b57a; --sand-soft: #2a251b;
    --ok: #86c39d; --ok-soft: #1a2b21; --warn: #e0b56a; --warn-soft: #2c2617; --bad: #e59b92; --bad-soft: #321e1c;
    --shadow: 0 1px 2px rgba(0,0,0,.25), 0 6px 24px rgba(0,0,0,.3);
    --shadow-lg: 0 2px 8px rgba(0,0,0,.3), 0 28px 70px rgba(0,0,0,.45);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 15px; line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh; display: flex; flex-direction: column;
}
html[dir="ltr"] body { font-family: "Readex Pro", var(--font); }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.35; margin: 0; color: var(--ink); font-weight: 700; }
p { margin: 0; }
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; }
.ico { width: 20px; height: 20px; flex: none; }
.ico-sm { width: 16px; height: 16px; flex: none; }
.ltr { direction: ltr; unicode-bidi: embed; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .02em; }
.muted { color: var(--muted); }
.wrap { width: 100%; max-width: 1160px; margin-inline: auto; padding-inline: 24px; }
.wrap-sm { max-width: 760px; }
.wrap-xs { max-width: 500px; }
.wrap-lg { max-width: 1160px; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 2px; border-radius: 10px; }
::selection { background: color-mix(in srgb, var(--primary) 22%, transparent); }

/* ===== Header ===== */
.topbar { position: sticky; top: 0; z-index: 40; background: var(--glass); backdrop-filter: saturate(160%) blur(16px); -webkit-backdrop-filter: saturate(160%) blur(16px); border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 70px; }
.brand { display: flex; align-items: center; gap: 12px; background: none; border: 0; padding: 0; text-align: start; }
.brand img { width: 42px; height: 42px; border-radius: 13px; box-shadow: var(--glow); }
.brand strong { display: block; font-family: var(--font-head); font-size: 18px; font-weight: 700; line-height: 1.2; }
.brand small { display: block; font-size: 11px; color: var(--muted); letter-spacing: .05em; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.chip-user { white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; box-shadow: var(--shadow); }
html[dir="rtl"] .chip-user { padding: 5px 5px 5px 12px; }
.chip-user .av { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: var(--primary-ink); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.chip-user b { font-weight: 600; }
.chip-user .cr { color: var(--primary); font-weight: 700; }

/* ===== Buttons ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 24px; border-radius: 999px; border: 1px solid transparent; font-weight: 600; font-size: 15px; transition: background .2s, border-color .2s, transform .15s, box-shadow .2s, color .2s; white-space: nowrap; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: var(--primary-ink); box-shadow: var(--glow); }
.btn-primary:hover:not(:disabled) { box-shadow: 0 14px 36px color-mix(in srgb, var(--primary) 38%, transparent); transform: translateY(-1px); }
.btn-soft { background: var(--primary-soft); color: var(--primary); }
.btn-soft:hover:not(:disabled) { background: color-mix(in srgb, var(--primary-soft) 70%, var(--primary) 14%); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { border-color: var(--line-2); background: var(--surface-2); }
.btn-wa { background: #25a165; color: #fff; box-shadow: 0 10px 26px rgba(37, 161, 101, .28); }
.btn-wa:hover { background: #1f8d58; }
.btn-danger { background: var(--bad-soft); color: var(--bad); }
.btn-sm { height: 38px; padding: 0 16px; font-size: 13px; }
.btn-xs { height: 32px; padding: 0 12px; font-size: 12px; gap: 5px; }
.btn-block { width: 100%; }
.icon-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); transition: border-color .2s, color .2s; }
.icon-btn:hover:not(:disabled) { border-color: var(--line-2); color: var(--ink); }
.icon-btn:disabled { opacity: .4; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 0; color: var(--primary); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 4px; }
html[dir="rtl"] .flip { transform: scaleX(-1); }

/* ===== Animations ===== */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes float { 50% { transform: translateY(-8px); } }
@keyframes drift { 50% { transform: translate(30px, -20px) scale(1.06); } }
.reveal { animation: fadeUp .6s cubic-bezier(.2, .7, .2, 1) both; }
.d1 { animation-delay: .08s; } .d2 { animation-delay: .16s; } .d3 { animation-delay: .24s; } .d4 { animation-delay: .32s; } .d5 { animation-delay: .4s; } .d6 { animation-delay: .48s; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ===== Hero ===== */
.hero { position: relative; overflow: hidden; padding: 72px 0 64px; isolation: isolate; }
.hero-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.hero-bg::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(color-mix(in srgb, var(--ink) 9%, transparent) 1px, transparent 1px); background-size: 22px 22px; mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%); -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%); }
.blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; animation: drift 16s ease-in-out infinite; }
.blob.b1 { width: 460px; height: 460px; background: var(--mint); top: -140px; inset-inline-start: -80px; }
.blob.b2 { width: 380px; height: 380px; background: var(--sand-soft); top: 60px; inset-inline-end: -60px; animation-delay: -5s; opacity: .9; }
.blob.b3 { width: 300px; height: 300px; background: var(--primary-soft); bottom: -120px; left: 40%; animation-delay: -9s; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); color: var(--ink-2); font-size: 13px; font-weight: 600; backdrop-filter: blur(8px); box-shadow: var(--shadow); }
html[dir="rtl"] .eyebrow { padding: 6px 6px 6px 14px; }
.eyebrow .ico-sm { width: 26px; height: 26px; padding: 5px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); }
.hero h1 { margin-top: 22px; font-size: clamp(34px, 5.4vw, 62px); font-weight: 800; line-height: 1.22; letter-spacing: -.015em; text-wrap: balance; }
.grad { background: linear-gradient(120deg, var(--primary) 10%, var(--primary-2) 50%, var(--sand) 95%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { margin-top: 20px; font-size: 17.5px; color: var(--ink-2); max-width: 54ch; }
.hero-cta { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; }
.hero-cta .btn { height: 54px; padding: 0 28px; font-size: 16px; }
.trust { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 10px 22px; color: var(--muted); font-size: 13.5px; }
.trust span { display: inline-flex; align-items: center; gap: 7px; }
.trust .ico-sm { color: var(--primary); }

/* preview card */
.preview { position: relative; padding: 24px 10px; }
.pv-card { position: relative; background: var(--glass); border: 1px solid color-mix(in srgb, var(--line) 80%, transparent); border-radius: 28px; padding: 24px; box-shadow: var(--shadow-lg); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.pv-head { display: flex; align-items: center; gap: 12px; }
.pv-file { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: var(--primary-ink); flex: none; }
.pv-head .t { flex: 1; min-width: 0; }
.pv-head b { display: block; font-size: 14.5px; }
.pv-head small { color: var(--muted); font-size: 12px; }
.pv-rings { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 22px; }
.pv-ring { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.ring { --p: 20; width: 64px; height: 64px; border-radius: 50%; flex: none; display: grid; place-items: center; background: conic-gradient(var(--c, var(--primary)) calc(var(--p) * 1%), var(--bg-2) 0); }
.ring::before { content: attr(data-v); width: 50px; height: 50px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; font-size: 15px; color: var(--ink); direction: ltr; }
.pv-ring b { display: block; font-size: 14px; }
.pv-ring span { font-size: 12px; color: var(--muted); }
.pv-lines { margin-top: 18px; display: grid; gap: 8px; }
.pv-lines i { display: block; height: 8px; border-radius: 99px; background: var(--bg-2); }
.pv-lines i:nth-child(1) { width: 92%; } .pv-lines i:nth-child(2) { width: 76%; } .pv-lines i:nth-child(3) { width: 58%; background: color-mix(in srgb, var(--sand) 35%, var(--bg-2)); }
.pv-float { position: absolute; display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); font-size: 13px; font-weight: 600; animation: float 6s ease-in-out infinite; }
.pv-float .ico-sm { color: var(--primary); }
.pv-f1 { top: -4px; inset-inline-end: -6px; }
.pv-f2 { bottom: -2px; inset-inline-start: -10px; animation-delay: -3s; }

/* ===== Sections ===== */
.section { padding: 34px 0 70px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.kicker { display: inline-block; font-size: 12.5px; font-weight: 700; color: var(--primary); letter-spacing: .06em; margin-bottom: 6px; }
.section-head h2 { font-size: clamp(24px, 3vw, 32px); font-weight: 800; }
.section-head p { color: var(--muted); font-size: 15px; margin-top: 4px; }

/* bento gates */
.bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.gate-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; width: 100%; min-height: 230px; padding: 24px; text-align: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); transition: transform .25s cubic-bezier(.2,.7,.2,1), box-shadow .25s, border-color .25s; overflow: hidden; }
.gate-card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(400px circle at 100% 0%, color-mix(in srgb, var(--primary) 9%, transparent), transparent 60%); opacity: 0; transition: opacity .25s; pointer-events: none; }
.gate-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--primary) 35%, var(--line)); }
.gate-card:hover::before { opacity: 1; }
.gate-ic { width: 54px; height: 54px; border-radius: 17px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.gate-ic .ico { width: 24px; height: 24px; }
.gate-top { display: flex; align-items: flex-start; justify-content: space-between; width: 100%; }
.gate-idx { font-family: var(--font-head); font-weight: 800; font-size: 34px; line-height: 1; color: color-mix(in srgb, var(--ink) 7%, transparent); }
.gate-body { flex: 1; min-width: 0; }
.gate-body h3 { font-size: 18px; }
.gate-body p { font-size: 14px; color: var(--muted); margin-top: 6px; }
.gate-foot { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 10px; }
.gate-badge { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--sand-soft); color: var(--warn); }
.gate-badge.ok { background: var(--ok-soft); color: var(--ok); }
.gate-go { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-2); color: var(--ink-2); transition: background .2s, color .2s, transform .2s; margin-inline-start: auto; }
.gate-card:hover .gate-go { background: var(--primary); color: var(--primary-ink); }
.gate-card.featured { background: linear-gradient(150deg, var(--primary-deep), var(--primary) 55%, var(--primary-2)); border-color: transparent; color: #fff; }
.gate-card.featured h3, .gate-card.featured .gate-idx { color: #fff; }
.gate-card.featured .gate-idx { opacity: .18; }
.gate-card.featured p { color: rgba(255, 255, 255, .82); }
.gate-card.featured .gate-ic { background: rgba(255, 255, 255, .16); color: #fff; }
.gate-card.featured .gate-go { background: rgba(255, 255, 255, .16); color: #fff; }
.gate-card.featured .gate-badge { background: rgba(255, 255, 255, .18); color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .gate-card.featured { background: linear-gradient(150deg, #154a45, #1f6f68 55%, #2b8479); } }

/* how it works */
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: hw; }
.how-card { position: relative; padding: 24px; border-radius: var(--r); background: var(--glass); border: 1px solid var(--line); }
.how-card .num { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--sand-soft); color: var(--warn); font-family: var(--font-head); font-weight: 800; margin-bottom: 14px; }
.how-card h3 { font-size: 16.5px; }
.how-card p { color: var(--muted); font-size: 14px; margin-top: 4px; }

/* ===== Gate page ===== */
.gate-tabs-wrap { position: sticky; top: 70px; z-index: 30; background: var(--glass); backdrop-filter: saturate(160%) blur(16px); -webkit-backdrop-filter: saturate(160%) blur(16px); border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.gate-tabs { display: flex; gap: 6px; overflow-x: auto; padding-block: 10px; scrollbar-width: none; }
.gate-tabs::-webkit-scrollbar { display: none; }
.gate-tab { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid transparent; background: transparent; color: var(--muted); font-weight: 600; font-size: 14px; transition: background .2s, color .2s, border-color .2s; }
.gate-tab:hover { color: var(--ink); background: var(--surface); border-color: var(--line); }
.gate-tab.on { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: var(--primary-ink); box-shadow: var(--glow); }
.gate-tab.home { padding: 0 12px; }
.gate-page { padding: 30px 0 72px; flex: 1; }
.gate-page > .wrap > * { animation: fadeUp .45s cubic-bezier(.2,.7,.2,1) both; }
.gate-title { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.gate-title .gate-ic { width: 56px; height: 56px; background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: var(--primary-ink); box-shadow: var(--glow); }
.gate-title small { display: block; font-size: 12.5px; color: var(--muted); font-weight: 600; letter-spacing: .03em; }
.gate-title h1 { font-size: clamp(23px, 3vw, 30px); font-weight: 800; }
.other-gates { margin-top: 40px; }
.other-gates h3 { font-size: 16px; margin-bottom: 14px; color: var(--ink-2); }
.other-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.mini-gate { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); text-align: start; transition: transform .2s, box-shadow .2s, border-color .2s; }
.mini-gate:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--primary) 35%, var(--line)); }
.mini-gate .gate-ic { width: 42px; height: 42px; border-radius: 13px; flex: none; }
.mini-gate .gate-ic .ico { width: 20px; height: 20px; }
.mini-gate b { display: block; font-size: 14px; line-height: 1.4; }
.mini-gate small { display: block; font-size: 12px; color: var(--muted); line-height: 1.5; margin-top: 2px; }

/* ===== Cards & forms ===== */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 28px; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.card-head h2, .card-head h3 { font-size: 18px; }
.stack > * + * { margin-top: 16px; }
.field label, .lbl { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 7px; }
.input, .select, .textarea { width: 100%; height: 50px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink); font-size: 15px; transition: border-color .2s, box-shadow .2s, background .2s; }
.textarea { height: auto; padding: 12px 16px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 15%, transparent); }
.input::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
.pw { position: relative; }
.pw .input { padding-inline-end: 50px; }
.pw button { position: absolute; inset-inline-end: 7px; top: 7px; width: 36px; height: 36px; border: 0; background: none; color: var(--muted); display: grid; place-items: center; border-radius: 10px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 5px; background: var(--bg-2); border-radius: 999px; margin-bottom: 22px; }
.seg button { height: 42px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-weight: 600; font-size: 14px; transition: background .2s, color .2s; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; font-size: 13.5px; line-height: 1.7; }
.note .ico { margin-top: 2px; }
.note-info { background: var(--primary-soft); color: var(--primary-deep); }
.note-warn { background: var(--warn-soft); color: var(--warn); }
.note-bad { background: var(--bad-soft); color: var(--bad); }
.note-ok { background: var(--ok-soft); color: var(--ok); }
.note b { display: block; font-weight: 700; }
.center { text-align: center; }
.icon-hero { width: 64px; height: 64px; border-radius: 20px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; margin: 0 auto 14px; }
.icon-hero .ico { width: 28px; height: 28px; }

/* profile */
.profile { display: flex; align-items: center; gap: 14px; }
.profile .av { width: 58px; height: 58px; border-radius: 18px; background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: var(--primary-ink); display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; font-size: 22px; box-shadow: var(--glow); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat { padding: 18px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--line); }
.stat span { display: block; font-size: 12.5px; color: var(--muted); }
.stat strong { display: block; font-family: var(--font-head); font-size: 23px; margin-top: 2px; }
.stat strong.pri { color: var(--primary); }
.stat small { font-size: 11.5px; color: var(--muted); }
.id-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > .btn { flex: 1 1 220px; }

/* upload */
.step-block { display: grid; grid-template-columns: 36px 1fr; gap: 14px; }
.step-block + .step-block { margin-top: 24px; }
.step-dot { width: 32px; height: 32px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-weight: 700; font-family: var(--font-head); display: grid; place-items: center; font-size: 14px; }
.step-block h3 { font-size: 15.5px; margin: 4px 0 12px; }
.drop { border: 2px dashed var(--line-2); border-radius: 20px; padding: 34px 18px; text-align: center; background: var(--surface-2); transition: border-color .2s, background .2s; cursor: pointer; }
.drop:hover, .drop.over { border-color: var(--primary); background: var(--primary-soft); }
.drop.off { cursor: not-allowed; opacity: .7; }
.drop .icon-hero { margin-bottom: 10px; }
.drop h4 { font-size: 15px; font-weight: 700; font-family: var(--font); }
.drop p { font-size: 13px; color: var(--muted); margin-top: 4px; }
.file-pill { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 18px; border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--line)); background: var(--primary-soft); }
.file-pill .meta { flex: 1; min-width: 0; }
.file-pill b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-pill span { font-size: 12.5px; color: var(--muted); }
.file-pill .gate-num, .file-pill .gate-ic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--surface); color: var(--primary); flex: none; }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); font-size: 13.5px; cursor: pointer; user-select: none; transition: border-color .2s; }
.check:hover { border-color: var(--line-2); }
.check-wide { grid-column: 1 / -1; }
.check input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); flex: none; margin: 0; }
.check .num { width: 60px; height: 34px; padding: 0 6px; text-align: center; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); }
.progress { padding: 18px; border-radius: 16px; background: var(--primary-soft); color: var(--primary-deep); }
.progress-top { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; }
.bar { margin-top: 12px; height: 6px; border-radius: 999px; background: color-mix(in srgb, var(--primary) 18%, transparent); overflow: hidden; }
.bar i { display: block; height: 100%; width: 40%; border-radius: inherit; background: var(--primary); animation: slide 1.4s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-120%); } 100% { transform: translateX(320%); } }
html[dir="rtl"] .bar i { animation-name: slideR; }
@keyframes slideR { 0% { transform: translateX(120%); } 100% { transform: translateX(-320%); } }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* history */
.sub-list { display: grid; gap: 12px; }
.sub { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); flex-wrap: wrap; }
.sub .fi { width: 46px; height: 46px; border-radius: 14px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex: none; }
.sub .meta { flex: 1 1 200px; min-width: 0; }
.sub .meta b { display: block; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub .meta span { font-size: 12.5px; color: var(--muted); }
.scores { display: flex; gap: 8px; }
.score { display: flex; flex-direction: column; align-items: center; min-width: 76px; padding: 6px 10px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.score b { font-family: var(--font-head); font-size: 17px; color: var(--primary); line-height: 1.3; }
.score span { font-size: 11px; color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-run { background: var(--primary-soft); color: var(--primary); }
.pill-run::before { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.pill-wait { background: var(--warn-soft); color: var(--warn); }
.pill-bad { background: var(--bad-soft); color: var(--bad); }
.sub-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.empty { text-align: center; padding: 46px 20px; }
.empty p { color: var(--muted); font-size: 14px; margin: 6px auto 18px; max-width: 44ch; }

/* credits */
.how { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: how; }
.how li { counter-increment: how; display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; color: var(--ink-2); }
.how li::before { content: counter(how); flex: none; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--sand-soft); color: var(--warn); font-weight: 700; font-size: 13px; font-family: var(--font-head); }

/* samples */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); text-align: start; transition: border-color .2s, background .2s; }
.tab b { display: block; font-size: 13.5px; }
.tab span { font-size: 12px; color: var(--muted); }
.tab .gate-ic { width: 38px; height: 38px; border-radius: 12px; }
.tab.on { border-color: var(--primary); background: var(--primary-soft); }
.viewer { margin-top: 16px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.viewer-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.viewer-stage { background: var(--bg-2); padding: 20px; display: grid; place-items: center; min-height: 360px; }
.viewer-stage img { max-width: 100%; max-height: 72vh; width: auto; height: auto; background: #fff; box-shadow: var(--shadow-lg); border-radius: 6px; }
.viewer-nav { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 12px; border-top: 1px solid var(--line); }
.viewer-nav span { min-width: 110px; text-align: center; font-weight: 600; font-size: 14px; }

/* admin */
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.grant-form { display: grid; grid-template-columns: 2fr 1fr 1.2fr auto; gap: 12px; align-items: end; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 24px 0 12px; }
.toolbar .search { position: relative; flex: 0 1 320px; }
.toolbar .search .input { height: 42px; padding-inline-start: 40px; font-size: 14px; border-radius: 999px; }
.toolbar .search .ico-sm { position: absolute; inset-inline-start: 14px; top: 13px; color: var(--muted); }
.seg-inline { display: inline-flex; gap: 4px; padding: 4px; background: var(--bg-2); border-radius: 999px; }
.seg-inline button { height: 36px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-weight: 600; font-size: 13px; }
.seg-inline button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: start; font-weight: 600; color: var(--muted); font-size: 12.5px; padding: 13px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
td .sub-t { display: block; font-size: 11.5px; color: var(--muted); }
.tag { display: inline-block; padding: 2px 9px; border-radius: 8px; font-size: 11.5px; font-weight: 600; background: var(--bg-2); color: var(--ink-2); }
.tag-bad { background: var(--bad-soft); color: var(--bad); }
.tag-pri { background: var(--primary-soft); color: var(--primary); }
.td-actions { display: inline-flex; gap: 6px; }
.td-actions .icon-btn { width: 32px; height: 32px; border-radius: 10px; }
.td-actions .icon-btn.danger:hover { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }

/* modal & toast */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(14, 22, 21, .45); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } }
.modal-box { width: 100%; max-width: 440px; background: var(--surface); border-radius: 24px; padding: 26px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); max-height: calc(100vh - 32px); overflow: auto; animation: fadeUp .25s ease; }
.modal-box h3 { font-size: 17px; margin-bottom: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.viewer-modal { position: fixed; inset: 0; z-index: 70; background: var(--bg); display: flex; flex-direction: column; }
.viewer-modal header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.viewer-modal header b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-modal header .gate-ic { width: 38px; height: 38px; border-radius: 12px; }
.viewer-modal iframe { flex: 1; border: 0; background: #fff; width: 100%; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg); max-width: calc(100vw - 32px); animation: fadeUp .25s ease; }

/* floating whatsapp */
.fab-wa { position: fixed; bottom: 22px; inset-inline-end: 22px; z-index: 45; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: #25a165; color: #fff; box-shadow: 0 12px 30px rgba(37, 161, 101, .38); transition: transform .2s; }
.fab-wa:hover { transform: scale(1.06); }
.fab-wa .ico { width: 26px; height: 26px; }

/* footer */
.foot { border-top: 1px solid var(--line); padding: 34px 0; font-size: 13px; color: var(--muted); background: var(--surface-2); }
.foot .wrap { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.foot-brand { display: flex; align-items: center; gap: 10px; }
.foot-brand img { width: 32px; height: 32px; border-radius: 10px; }
.foot-links { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.foot-links a, .foot-links button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; color: var(--muted); background: none; border: 0; font-size: 13px; transition: background .2s, color .2s; }
.foot-links a:hover, .foot-links button:hover { color: var(--primary); background: var(--primary-soft); }

.boot { flex: 1; display: grid; place-items: center; color: var(--muted); padding: 80px 0; }

/* responsive */
@media (max-width: 960px) {
  .bento, .how-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .hero { padding: 40px 0 36px; }
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .preview { max-width: 460px; width: 100%; margin-inline: auto; }
  .grant-form { grid-template-columns: 1fr 1fr; }
  .grant-form .btn { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  body { font-size: 14.5px; }
  .wrap { padding-inline: 16px; }
  .topbar .wrap { height: 62px; }
  .gate-tabs-wrap { top: 62px; }
  .brand img { width: 38px; height: 38px; }
  .brand small { display: none; }
  .brand strong { font-size: 16px; white-space: nowrap; }
  .brand { gap: 9px; }
  .top-actions { gap: 6px; }
  .top-actions .lang-btn { width: 38px; padding: 0; }
  .top-actions .lang-btn .lang-txt { display: none; }
  .chip-user b { display: none; }
  .chip-user { padding-inline: 4px 10px; }
  .card { padding: 22px 16px; }
  .bento, .how-grid { grid-template-columns: 1fr; gap: 12px; }
  .gate-card { min-height: 0; padding: 20px; flex-direction: row; align-items: center; flex-wrap: wrap; }
  .gate-card .gate-body { flex: 1 1 calc(100% - 80px); padding-inline-end: 40px; }
  .gate-card .gate-foot { display: contents; }
  .gate-card .gate-go { position: absolute; top: 20px; inset-inline-end: 18px; }
  .gate-card .gate-badge { margin-inline-start: 68px; }
  .gate-idx { display: none; }
  .gate-top { width: auto; }
  .checks { grid-template-columns: 1fr; }
  .step-block { grid-template-columns: 30px 1fr; gap: 10px; }
  .step-dot { width: 28px; height: 28px; font-size: 13px; }
  .grant-form { grid-template-columns: 1fr; }
  .hero-cta .btn { flex: 1 1 100%; }
  .pv-rings { grid-template-columns: 1fr; }
  .pv-f1 { inset-inline-end: 4px; }
  .pv-f2 { inset-inline-start: 4px; }
  .sub { padding: 14px; }
  .scores { width: 100%; }
  .score { flex: 1; }
  .fab-wa { width: 52px; height: 52px; bottom: 16px; inset-inline-end: 16px; }
  .other-grid { grid-template-columns: 1fr 1fr; }
  .mini-gate { flex-direction: column; align-items: flex-start; gap: 8px; }
  .mini-gate small { display: none; }
}
@media print { .topbar, .foot, .gate-tabs-wrap, .other-gates, .fab-wa { display: none; } }
.card-head .gate-ic { width: 44px; height: 44px; border-radius: 13px; flex: none; }
.card-head .gate-ic .ico-sm { width: 20px; height: 20px; }

/* submissions under the scan form */
.hist-block { margin-top: 34px; }
.hist-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.hist-head h2 { font-size: 20px; }
.hist-head p { font-size: 13.5px; margin-top: 2px; }
.sub-new { border-color: color-mix(in srgb, var(--primary) 40%, var(--line)); background: var(--primary-soft); animation: fadeUp .35s ease both; }
.sub-new .fi { background: var(--surface); }
