/* public/styles.css — RED VAULT ULTRA
   هوية بصرية واحدة: قرمزي على فحمي.
   كل لون معرّف في :root حتى لا يتسرّب لون مكتوب يدوياً في مكان ما. */

:root {
  /* --- الأسطح --- */
  --bg:        #0a0507;
  --bg-2:      #10080c;
  --card:      #160c11;
  --card-2:    #1d1016;
  --raise:     #241419;
  --border:    #2e1a22;
  --border-2:  #3d2430;

  /* --- النص --- */
  --text:      #f4eaee;
  --text-2:    #d9c4cc;
  --muted:     #9d7d89;
  --muted-2:   #6f5560;

  /* --- الهوية القرمزية --- */
  --accent:      #ff2d46;
  --accent-hot:  #ff5c3d;
  --accent-deep: #c9122b;
  --accent-glow: rgba(255, 45, 70, .35);
  --accent-soft: rgba(255, 45, 70, .10);
  --accent-line: rgba(255, 45, 70, .30);

  /* --- دلالات --- */
  --ok:   #2ecc71;
  --warn: #ffc857;
  --err:  #ff4d4d;

  --grad:      linear-gradient(135deg, var(--accent) 0%, var(--accent-hot) 100%);
  --grad-soft: linear-gradient(135deg, rgba(255,45,70,.16), rgba(255,92,61,.06));

  --radius:    14px;
  --radius-lg: 20px;
  --shadow:    0 12px 40px rgba(0, 0, 0, .55);
  --shadow-red:0 10px 40px rgba(255, 45, 70, .18);
  --maxw:      1120px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, 'Noto Sans Arabic', sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.65;
}
body {
  min-height: 100vh;
  background-image:
    radial-gradient(1100px 520px at 85% -12%, rgba(255, 45, 70, .13), transparent 62%),
    radial-gradient(760px 420px at 8% 4%, rgba(255, 92, 61, .07), transparent 60%);
  background-attachment: fixed;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ================================================================ الشريط العلوي */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 13px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 5, 7, .82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: sticky; top: 0; z-index: 40;
}
.brand {
  position: relative;
  font-weight: 800; letter-spacing: 1.4px; font-size: 15px;
  display: flex; align-items: center; gap: 9px;
  color: var(--text);
  text-shadow: 0 0 18px rgba(255, 45, 70, .14);
}
.brand::after {
  content: ''; position: absolute; inset: auto 0 -5px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-line), transparent);
  opacity: .8;
}
.brand .red { color: var(--accent); text-shadow: 0 0 16px var(--accent-glow); }
.brand-txt { display: flex; flex-direction: column; line-height: 1.1; white-space: nowrap; }
.brand-est {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 7.5px; font-weight: 500; letter-spacing: 2.4px;
  color: var(--muted-2); margin-top: 2px; text-shadow: none;
  direction: ltr; unicode-bidi: isolate;
}
.brand .vault { color: #f8eef1; }
.brand .ultra {
  background: linear-gradient(135deg, #ff3d55 0%, #d3132f 58%, #9e0b20 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
}
.brand .mark {
  width: 30px; height: 30px; border-radius: 9px;
  color: #ff3d55;
  background:
    radial-gradient(circle at 30% 18%, rgba(255, 61, 85, .20), transparent 58%),
    linear-gradient(145deg, #1b070d 0%, #070203 80%);
  border: 1px solid rgba(255, 45, 70, .38);
  box-shadow: inset 0 0 12px rgba(255, 45, 70, .10), 0 0 16px rgba(255, 45, 70, .16);
  display: grid; place-items: center;
  font-size: 15px;
}
.brand .mark svg { filter: drop-shadow(0 0 5px rgba(255, 45, 70, .55)); }
.brand-inline { letter-spacing: 1.2px; }
.brand-inline .red { color: var(--accent); text-shadow: 0 0 16px var(--accent-glow); }
.brand-inline .vault { color: var(--text); }
.brand-inline .ultra {
  background: linear-gradient(135deg, #ff3d55 0%, #d3132f 58%, #9e0b20 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.topbar-right { display: flex; align-items: center; gap: 8px; }
.badge {
  background: var(--card); border: 1px solid var(--border);
  padding: 4px 11px; border-radius: 999px; font-size: 12px; color: var(--text-2);
}

/* ================================================================ عناصر أساسية */
main#view { padding: 16px; max-width: var(--maxw); margin: 0 auto; padding-bottom: 96px; }
main#view.wide { max-width: none; padding: 0; padding-bottom: 0; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 14px;
}
.card h2 { margin-top: 0; }
/* Sign-in, vault creation and unlock are single-column forms; never stretch
   them to the full content width on desktop. */
.card.auth-card { max-width: 470px; margin: 4vh auto 0; padding: 24px; }

label { display: block; margin: 11px 0; font-size: 14px; color: var(--muted); }
label input, .field {
  display: block; width: 100%; margin-top: 5px; padding: 11px 13px;
  background: var(--bg-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; font-size: 15px; font-family: inherit;
}
label input:focus, .field:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
label textarea {
  display: block; width: 100%; margin-top: 5px; padding: 11px 13px;
  background: var(--bg-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; font-size: 14px; font-family: inherit; resize: vertical;
}

button {
  cursor: pointer; border: 1px solid var(--border);
  background: var(--card-2); color: var(--text);
  padding: 10px 16px; border-radius: 10px; font-size: 14px;
  font-family: inherit; font-weight: 500;
  transition: transform .10s ease, filter .15s ease, border-color .15s ease;
}
button:hover { filter: brightness(1.14); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
button.primary {
  background: var(--grad); border-color: transparent; color: #fff;
  font-weight: 700; box-shadow: var(--shadow-red);
}
button.ghost { background: transparent; }
button.wide { width: 100%; }
button.big { padding: 14px 26px; font-size: 16px; border-radius: 12px; }

.tabs { display: flex; gap: 8px; margin: 13px 0; }
.tab { flex: 1; }
.tab.active { background: var(--grad); border-color: transparent; color: #fff; font-weight: 600; }

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 9px 0; }
.row input { flex: 1; min-width: 120px; padding: 10px 13px; background: var(--bg-2); border: 1px solid var(--border); color: var(--text); border-radius: 10px; }

.list { display: flex; flex-direction: column; gap: 8px; }
.item {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 13px; display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.item-main { flex: 1; min-width: 0; }
.item-name { font-weight: 600; word-break: break-all; }
.item-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.item-actions { display: flex; gap: 6px; }
.item-actions button { padding: 6px 10px; }

.empty { text-align: center; color: var(--muted); padding: 34px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.hidden { display: none !important; }
.center { text-align: center; }

.key { font-family: ui-monospace, monospace; color: var(--accent); }
.val { font-family: ui-monospace, monospace; color: var(--muted); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; display: flex;
  background: rgba(10, 5, 7, .92);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border); padding: 6px; gap: 4px; z-index: 40;
}
.navbtn { flex: 1; font-size: 11px; padding: 8px 4px; border: none; background: transparent; }
.navbtn.active { background: var(--accent-soft); border-radius: 9px; color: var(--accent); }

.toast {
  position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%);
  background: var(--raise); border: 1px solid var(--border-2);
  padding: 11px 18px; border-radius: 11px; z-index: 200;
  box-shadow: var(--shadow); animation: fade .22s; max-width: 90vw; font-size: 14px;
}
.toast.ok  { border-color: var(--ok); }
.toast.err { border-color: var(--err); }
@keyframes fade { from { opacity: 0; transform: translateX(-50%) translateY(10px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ================================================================ الحصة والإحصاءات */
.quota { margin-bottom: 12px; }
.quota-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.quota-track, .meter { height: 8px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.quota-fill, .meter > i { display: block; height: 100%; background: var(--grad); transition: width .3s; }
.meter { margin: 8px 0; }

.words { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 6px; margin: 12px 0; direction: ltr; }
.word {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 9px;
  padding: 6px 8px; font-family: ui-monospace, monospace; font-size: 13px;
  display: flex; gap: 6px; align-items: center;
}
.word b { color: var(--accent); font-size: 11px; min-width: 16px; text-align: right; }

label.check { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; }
label.check input { width: auto; margin: 2px 0 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; margin: 12px 0; }
.stat { background: var(--bg-2); border: 1px solid var(--border); border-radius: 11px; padding: 11px; text-align: center; }
.stat b { display: block; font-size: 17px; }
.stat span { font-size: 11px; color: var(--muted); }

.pill { background: var(--accent); color: #fff; font-size: 10px; padding: 2px 8px; border-radius: 999px; vertical-align: middle; }
.pill.red { background: var(--err); }
.pill.gold { background: var(--warn); color: #241a00; }

.invite-code {
  font-family: ui-monospace, monospace; font-size: 21px; letter-spacing: 2px;
  background: var(--bg-2); border: 1px dashed var(--accent); border-radius: 11px;
  padding: 13px; text-align: center; margin: 10px 0; color: var(--accent);
}

.notice {
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-right: 3px solid var(--accent);
  border-radius: 11px; padding: 13px 15px; font-size: 13px; line-height: 1.75;
}
.notice.ok   { background: rgba(46, 204, 113, .07); border-color: rgba(46, 204, 113, .30); border-right-color: var(--ok); }
.notice.warn { background: rgba(255, 200, 87, .07); border-color: rgba(255, 200, 87, .30); border-right-color: var(--warn); }
.notice b { color: var(--text); }

h3 { margin: 24px 0 8px; font-size: 15px; color: var(--muted); }
hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
code { font-family: ui-monospace, monospace; color: var(--accent); }

/* ================================================================ اللغة */
.lang-switch { position: relative; }
.lang-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 11px; font-size: 13px; border-radius: 10px;
}
.lang-menu {
  position: absolute; top: calc(100% + 8px); inset-inline-end: 0;
  min-width: 208px; max-height: 340px; overflow-y: auto;
  background: var(--card-2); border: 1px solid var(--border-2);
  border-radius: 12px; padding: 6px; z-index: 100;
  box-shadow: var(--shadow);
}
.lang-menu button {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; border: none; background: transparent; text-align: start;
  padding: 9px 11px; border-radius: 8px; font-size: 13.5px;
}
.lang-menu button:hover { background: var(--accent-soft); }
.lang-menu button.on { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.lang-menu .native { font-weight: 600; }
.lang-menu .code { font-size: 10px; color: var(--muted-2); font-family: ui-monospace, monospace; }

/* ================================================================ صفحة الهبوط */
.landing { max-width: var(--maxw); margin: 0 auto; padding: 0 20px 80px; }

/* --- البطل --- */
.hero { padding: 66px 0 46px; text-align: center; position: relative; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  color: var(--accent); font-size: 12.5px; font-weight: 600;
  padding: 6px 15px; border-radius: 999px; margin-bottom: 22px;
}
.hero h1 {
  font-size: clamp(30px, 5.2vw, 54px); line-height: 1.22;
  margin: 0 0 18px; font-weight: 800; letter-spacing: -.6px;
}
.hero h1 .hl {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p.lead {
  font-size: clamp(15px, 1.9vw, 19px); color: var(--text-2);
  max-width: 660px; margin: 0 auto 32px; line-height: 1.85;
}
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 26px; }
.hero-trust { display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.hero-trust span { display: flex; align-items: center; gap: 6px; }

/* --- الأقسام --- */
.section { padding: 56px 0; }
.section-head { text-align: center; margin-bottom: 42px; }
.section-head h2 { font-size: clamp(24px, 3.4vw, 36px); margin: 0 0 12px; font-weight: 800; letter-spacing: -.4px; }
.section-head p { color: var(--muted); max-width: 620px; margin: 0 auto; font-size: 15.5px; line-height: 1.85; }
.kicker {
  color: var(--accent); font-size: 12.5px; font-weight: 700;
  letter-spacing: 1.6px; text-transform: uppercase; margin-bottom: 10px; display: block;
}

.grid { display: grid; gap: 16px; }
.grid.g2 { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.grid.g3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid.g4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

.tile {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 25px;
  transition: border-color .2s ease, transform .2s ease;
}
.tile:hover { border-color: var(--border-2); transform: translateY(-2px); }
.tile .ic {
  width: 46px; height: 46px; border-radius: 13px;
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  display: grid; place-items: center; font-size: 21px; margin-bottom: 15px;
}
.tile h3 { margin: 0 0 9px; font-size: 16.5px; color: var(--text); font-weight: 700; }
.tile p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.8; }

/* --- الخطوات --- */
.steps { counter-reset: step; }
.step {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 25px; position: relative;
}
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: -14px; inset-inline-start: 25px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--grad); color: #fff; font-weight: 800;
  display: grid; place-items: center; font-size: 14px;
  box-shadow: var(--shadow-red);
}
.step h3 { margin: 8px 0 8px; font-size: 16.5px; color: var(--text); }
.step p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.8; }

/* --- قسم الخصوصية الطويل --- */
.privacy-box {
  background: linear-gradient(160deg, var(--card-2), var(--card));
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg); padding: 34px;
  box-shadow: var(--shadow);
}
.privacy-box h3 { color: var(--text); font-size: 17px; margin: 26px 0 10px; }
.privacy-box h3:first-child { margin-top: 0; }
.privacy-box p, .privacy-box li { color: var(--text-2); font-size: 14.5px; line-height: 1.95; }
.privacy-box ul { padding-inline-start: 22px; margin: 10px 0; }
.privacy-box li { margin-bottom: 7px; }
.privacy-box .yes { color: var(--ok); font-weight: 700; }
.privacy-box .no  { color: var(--err); font-weight: 700; }

/* --- دليل التشفير --- */
.enc-teaser {
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
  background: linear-gradient(150deg, var(--card-2), var(--card));
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  padding: 30px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.enc-teaser::after {
  content: ''; position: absolute; inset-inline-end: -70px; top: -70px;
  width: 210px; height: 210px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow), transparent 70%);
  pointer-events: none;
}
.enc-teaser-icon {
  width: 58px; height: 58px; flex: 0 0 58px;
  border-radius: 16px; display: grid; place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  box-shadow: inset 0 0 18px rgba(255, 45, 70, .10);
}
.enc-teaser-copy { flex: 1 1 260px; min-width: 0; position: relative; z-index: 1; }
.enc-teaser-copy h3 { margin: 0 0 8px; font-size: 19px; color: var(--text); }
.enc-teaser-copy p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.85; max-width: 620px; }
.enc-pills { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 14px; }
.enc-pills span {
  font-size: 11px; font-weight: 700; letter-spacing: .3px;
  color: var(--accent); background: var(--accent-soft);
  border: 1px solid var(--accent-line); border-radius: 999px;
  padding: 4px 10px; direction: ltr;
}
.enc-teaser > button { position: relative; z-index: 1; flex-shrink: 0; }

.enc-modal { max-width: 780px; position: relative; }
.enc-modal h2 { padding-inline-end: 30px; }
.enc-x {
  position: absolute; top: 12px; inset-inline-end: 15px;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--card);
  color: var(--muted); font-size: 24px; line-height: 1;
  display: grid; place-items: center; cursor: pointer; z-index: 2;
}
.enc-x:hover { color: var(--accent); border-color: var(--accent-line); filter: none; }
.enc-lead { color: var(--text-2); font-size: 15px; line-height: 1.9; margin: 0 0 18px; }
.enc-body h3 { margin: 24px 0 8px; }
.enc-body h3:first-of-type { margin-top: 10px; }
.enc-body p { margin: 8px 0; }
.enc-body b { color: var(--text); }
.enc-body ul { margin: 10px 0; padding-inline-start: 22px; }
.enc-body li { margin-bottom: 8px; }
.enc-callout {
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.9;
  margin: 16px 0;
}
.enc-callout b { color: var(--accent); }

/* --- الأسعار --- */
.plans { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(268px, 1fr)); align-items: stretch; }
.plan {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
  display: flex; flex-direction: column; position: relative;
  transition: transform .2s ease, border-color .2s ease;
}
.plan:hover { transform: translateY(-3px); }
.plan.featured {
  border-color: var(--accent);
  box-shadow: var(--shadow-red);
  background: linear-gradient(170deg, rgba(255,45,70,.09), var(--card) 45%);
}
.plan .tagx {
  position: absolute; top: -12px; inset-inline-start: 50%; transform: translateX(50%);
  background: var(--grad); color: #fff; font-size: 11px; font-weight: 700;
  padding: 4px 14px; border-radius: 999px; white-space: nowrap;
}
.plan h3 { margin: 0 0 6px; font-size: 19px; color: var(--text); font-weight: 800; }
.plan .sub { color: var(--muted); font-size: 13.5px; margin-bottom: 18px; }
.plan .price { font-size: 38px; font-weight: 800; line-height: 1; margin-bottom: 5px; }
.plan .price .cur { font-size: 19px; font-weight: 600; color: var(--muted); }
.plan .per { color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.plan .free { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.plan ul { list-style: none; padding: 0; margin: 0 0 24px; flex: 1; }
.plan li {
  padding: 8px 0; font-size: 14px; color: var(--text-2);
  display: flex; gap: 9px; align-items: flex-start; line-height: 1.65;
}
.plan li .tick { color: var(--ok); flex-shrink: 0; font-weight: 700; }
.plan li.off { color: var(--muted-2); }
.plan li.off .tick { color: var(--muted-2); }

/* --- المحفظة / الدفع --- */
.wallet {
  background: linear-gradient(150deg, var(--card-2), var(--bg-2));
  border: 1px solid var(--border-2); border-radius: var(--radius-lg);
  padding: 32px; box-shadow: var(--shadow);
}
.wallet-grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(292px, 1fr)); }
.cc {
  background: linear-gradient(135deg, #2a1219, #170b10 60%);
  border: 1px solid var(--border-2); border-radius: 16px;
  padding: 22px; aspect-ratio: 1.62; max-width: 350px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.cc::after {
  content: ''; position: absolute; inset-inline-end: -58px; top: -58px;
  width: 190px; height: 190px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow), transparent 70%);
}
.cc-chip {
  width: 42px; height: 31px; border-radius: 6px;
  background: linear-gradient(135deg, #d9a94a, #a87c22);
  margin-bottom: auto;
}
.cc-num {
  font-family: ui-monospace, monospace; font-size: 18px;
  letter-spacing: 2.2px; color: var(--text); direction: ltr; text-align: left;
}
.cc-bottom { display: flex; justify-content: space-between; align-items: flex-end; font-size: 11px; color: var(--muted); }
.cc-bottom b { display: block; font-size: 13px; color: var(--text-2); font-family: ui-monospace, monospace; letter-spacing: .5px; }

.pay-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pay-opt {
  border: 1px solid var(--border); border-radius: 12px; padding: 14px;
  display: flex; align-items: center; gap: 11px; cursor: pointer;
  background: var(--card); transition: border-color .15s ease;
}
.pay-opt:hover { border-color: var(--border-2); }
.pay-opt.on { border-color: var(--accent); background: var(--accent-soft); }
.pay-opt .ic { font-size: 20px; }
.pay-opt .t { font-size: 13.5px; font-weight: 600; }
.pay-opt .d { font-size: 11px; color: var(--muted); }

.faq { display: flex; flex-direction: column; gap: 10px; }
.faq details {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px 18px;
}
.faq details[open] { border-color: var(--border-2); }
.faq summary { cursor: pointer; font-weight: 600; font-size: 14.5px; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '＋'; float: inline-end; color: var(--accent); font-weight: 700; }
.faq details[open] summary::after { content: '−'; }
.faq p { color: var(--muted); font-size: 14px; margin: 12px 0 0; line-height: 1.85; }

.landing-footer {
  border-top: 1px solid var(--border); margin-top: 60px; padding: 36px 0;
  text-align: center; color: var(--muted); font-size: 13px;
}
.landing-footer .fbrand { font-weight: 800; letter-spacing: 1.2px; margin-bottom: 10px; color: var(--text); }
.landing-footer .fbrand .red { color: var(--accent); text-shadow: 0 0 16px var(--accent-glow); }
.landing-footer .fbrand .ultra {
  background: linear-gradient(135deg, #ff3d55 0%, #d3132f 58%, #9e0b20 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* --- شريط اللغات داخل الهبوط --- */
.lang-strip {
  display: flex; gap: 7px; flex-wrap: wrap; justify-content: center;
  margin-top: 30px;
}
.lang-strip button { font-size: 12px; padding: 6px 12px; border-radius: 999px; }
.lang-strip button.on { background: var(--grad); border-color: transparent; color: #fff; font-weight: 700; }

/* --- نافذة الترحيب --- */
.modal-bg {
  position: fixed; inset: 0; background: rgba(5, 2, 3, .82);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  z-index: 300; display: grid; place-items: center; padding: 18px;
  animation: fade .2s;
}
.modal {
  background: var(--card-2); border: 1px solid var(--border-2);
  border-radius: var(--radius-lg); max-width: 660px; width: 100%;
  max-height: 88vh; overflow-y: auto; padding: 32px;
  box-shadow: var(--shadow);
}
.modal h2 { margin: 0 0 8px; font-size: 23px; }
.modal h3 { color: var(--accent); font-size: 15px; margin: 22px 0 8px; }
.modal p, .modal li { color: var(--text-2); font-size: 14.5px; line-height: 1.9; }
.modal ul { padding-inline-start: 20px; }
.modal li { margin-bottom: 6px; }
.modal-actions { display: flex; gap: 10px; margin-top: 26px; flex-wrap: wrap; }

/* --- شريط الإعلان الصغير --- */
.ribbon {
  background: var(--accent-soft); border-bottom: 1px solid var(--accent-line);
  text-align: center; font-size: 13px; padding: 9px 16px; color: var(--text-2);
}
.ribbon b { color: var(--accent); }

@media (max-width: 560px) {
  .topbar { padding: 10px 12px; gap: 8px; }
  .brand { font-size: 11.5px; letter-spacing: .8px; gap: 6px; }
  .brand .mark { width: 26px; height: 26px; border-radius: 8px; font-size: 13px; }
  .brand-est { font-size: 7px; letter-spacing: 1.5px; margin-top: 1px; color: var(--muted); }
  .topbar-right { gap: 6px; }
  .lang-btn, #navLogin { padding: 7px 11px; font-size: 12px; }
  .item { flex-direction: column; align-items: stretch; }
  .item-actions { justify-content: flex-end; }
  .bottomnav { overflow-x: auto; }
  .navbtn { min-width: 66px; }
  .hero { padding: 42px 0 30px; }
  .section { padding: 40px 0; }
  .privacy-box, .wallet, .modal { padding: 22px; }
  .pay-row { grid-template-columns: 1fr; }
  .landing { padding: 0 15px 60px; }
  .enc-teaser { padding: 22px; gap: 16px; }
  .enc-teaser > button { width: 100%; }
  .enc-x { top: 9px; inset-inline-end: 11px; }
}

/* ================================================================ VAULT INDEX */
.vault-page { animation: vaultPageIn .45s ease both; }
.vault-hero {
  position: relative; overflow: hidden; margin-bottom: 14px; padding: 30px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 22px; align-items: end;
  background:
    radial-gradient(620px 260px at 92% -24%, rgba(255, 45, 70, .20), transparent 68%),
    linear-gradient(145deg, rgba(31, 16, 23, .96), rgba(13, 6, 10, .98));
  border: 1px solid var(--border-2); border-radius: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .38), inset 0 1px 0 rgba(255, 255, 255, .04);
}
.vault-hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .22;
  background-image:
    linear-gradient(rgba(255, 45, 70, .16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 45, 70, .16) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(110deg, transparent 10%, #000 52%, transparent 96%);
  -webkit-mask-image: linear-gradient(110deg, transparent 10%, #000 52%, transparent 96%);
}
.vault-hero::after {
  content: ''; position: absolute; inset: auto 22px 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-line), transparent);
}
.vault-hero > * { position: relative; z-index: 1; }
.vault-eyebrow {
  display: flex; align-items: center; gap: 8px;
  color: var(--accent); font-family: ui-monospace, 'Cascadia Code', monospace;
  font-size: 10px; letter-spacing: 1.8px; text-transform: uppercase; font-weight: 700;
}
.vault-pulse {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 45, 70, .11), 0 0 16px var(--accent);
  animation: vaultPulse 2.4s ease-in-out infinite;
}
.vault-hero h1 {
  margin: 11px 0 8px; font-size: clamp(28px, 4.6vw, 44px); line-height: 1.13;
  letter-spacing: -.8px; color: var(--text); text-wrap: balance;
}
.vault-hero p { margin: 0; max-width: 680px; color: var(--text-2); font-size: 15px; line-height: 1.85; }
.vault-hero .vault-sub { margin-top: 5px; color: var(--muted); font-size: 12.5px; }
.vault-hero-actions { display: flex; flex-direction: column; align-items: stretch; gap: 10px; min-width: 190px; }
.vault-add {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 52px; padding: 13px 22px; border: 1px solid transparent; border-radius: 14px;
  background: var(--grad); color: #fff; font-weight: 800; font-size: 15px;
  box-shadow: 0 12px 34px rgba(255, 45, 70, .24); cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}
.vault-add:hover { transform: translateY(-2px); box-shadow: 0 16px 44px rgba(255, 45, 70, .34); filter: saturate(1.12); }
.vault-add:active { transform: translateY(0); }
.vault-hero-note { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 11px; }

.vault-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.vault-metric {
  position: relative; overflow: hidden; min-height: 118px; padding: 17px 18px;
  display: flex; flex-direction: column; justify-content: center; gap: 3px;
  background: linear-gradient(150deg, rgba(29, 16, 22, .9), rgba(16, 8, 12, .96));
  border: 1px solid var(--border); border-radius: 18px;
}
.vault-metric::after {
  content: ''; position: absolute; inset: auto 0 0; height: 2px;
  background: linear-gradient(90deg, var(--accent-deep), transparent);
  opacity: .7;
}
.vault-metric .vm-label { color: var(--muted); font-size: 11px; letter-spacing: .6px; }
.vault-metric strong { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 25px; line-height: 1.2; letter-spacing: -.4px; }
.vault-metric .vm-sub { color: var(--muted); font-size: 10.5px; line-height: 1.45; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vault-metric-secure strong { color: var(--accent); font-size: 19px; }
.vm-track { display: block; width: 100%; height: 4px; margin-top: 8px; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.vm-track i { display: block; height: 100%; border-radius: inherit; background: var(--grad); box-shadow: 0 0 12px var(--accent-glow); }

.vault-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; align-items: start; }
.vault-files-panel {
  min-width: 0; padding: 20px; border: 1px solid var(--border); border-radius: 20px;
  background: linear-gradient(165deg, rgba(22, 12, 17, .93), rgba(13, 7, 10, .97));
  box-shadow: 0 18px 44px rgba(0, 0, 0, .24);
}
.vault-panel-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.vault-panel-head h2 { margin: 4px 0 0; font-size: 22px; letter-spacing: -.4px; }
.vault-count {
  padding: 5px 11px; border: 1px solid var(--border-2); border-radius: 999px;
  color: var(--text-2); background: var(--bg-2); font-size: 11px; white-space: nowrap;
}
.vault-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(245px, 1fr)); gap: 12px; }
.vault-file {
  position: relative; overflow: hidden; min-width: 0; padding: 16px;
  display: flex; flex-direction: column; gap: 13px;
  background: linear-gradient(150deg, rgba(32, 17, 24, .95), rgba(17, 9, 13, .98));
  border: 1px solid var(--border); border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
  animation: vaultCardIn .48s cubic-bezier(.2, .7, .25, 1) both;
  animation-delay: calc(var(--i, 0) * 45ms);
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.vault-file:hover { transform: translateY(-3px); border-color: var(--accent-line); box-shadow: 0 16px 34px rgba(0, 0, 0, .34), 0 0 0 1px rgba(255, 45, 70, .05); }
.vault-file::before {
  content: ''; position: absolute; inset: 0 0 auto; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent); opacity: .7;
}
.vf-glow {
  position: absolute; width: 150px; height: 150px; top: -90px; inset-inline-end: -70px;
  border-radius: 50%; background: var(--accent); opacity: .10; filter: blur(24px); pointer-events: none;
}
.vf-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.vf-icon {
  display: grid; place-items: center; width: 46px; height: 46px; flex: 0 0 auto;
  color: var(--accent); border: 1px solid rgba(255, 45, 70, .30); border-radius: 14px;
  background: radial-gradient(circle at 32% 18%, rgba(255, 45, 70, .18), transparent 68%), #13080d;
  box-shadow: inset 0 0 18px rgba(255, 45, 70, .08);
}
.vf-seal {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px;
  color: var(--accent); background: var(--accent-soft); border: 1px solid rgba(255, 45, 70, .17);
  border-radius: 999px; font-size: 9px; font-weight: 700; letter-spacing: .4px; white-space: nowrap;
}
.vf-name {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  color: var(--text); font-size: 16px; font-weight: 700; line-height: 1.5;
  overflow-wrap: anywhere; min-height: 48px;
}
.vf-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: 10.5px; line-height: 1.4; }
.vf-type { padding: 2px 6px; border: 1px solid var(--border-2); border-radius: 5px; color: var(--text-2); font-family: ui-monospace, monospace; font-size: 9px; letter-spacing: .5px; }
.vf-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--accent-line); }
.vf-actions { display: flex; align-items: stretch; gap: 6px; margin-top: auto; }
.vf-download {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 43px; padding: 9px 13px; border: 1px solid rgba(255, 45, 70, .26);
  border-radius: 11px; color: #fff; background: linear-gradient(135deg, rgba(255, 45, 70, .88), rgba(201, 18, 43, .92));
  font-size: 12px; font-weight: 800; cursor: pointer;
  box-shadow: 0 8px 22px rgba(255, 45, 70, .14);
  transition: filter .2s ease, transform .2s ease;
}
.vf-download:hover { filter: brightness(1.12); transform: translateY(-1px); }
.vf-download:disabled { opacity: .6; cursor: wait; transform: none; }
.vf-tool {
  width: 38px; min-height: 43px; padding: 0; display: grid; place-items: center;
  color: var(--muted); border: 1px solid var(--border); border-radius: 11px; background: var(--bg-2);
  cursor: pointer; transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.vf-tool:hover { color: var(--text); border-color: var(--border-2); background: var(--card-2); }
.vf-danger:hover { color: var(--err); border-color: rgba(255, 77, 77, .35); }
.vault-empty {
  min-height: 280px; padding: 32px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; text-align: center; color: var(--muted); border: 1px dashed var(--border-2); border-radius: 17px;
  background: radial-gradient(300px 120px at 50% 0%, rgba(255, 45, 70, .08), transparent 70%);
}
.vault-empty svg { color: var(--accent); opacity: .7; filter: drop-shadow(0 0 16px var(--accent-glow)); }
.vault-empty strong { color: var(--text-2); font-weight: 500; font-size: 14px; line-height: 1.8; }

.vault-rail { position: sticky; top: 78px; display: flex; flex-direction: column; gap: 12px; }
.rail-card {
  padding: 17px; border: 1px solid var(--border); border-radius: 17px;
  background: linear-gradient(155deg, rgba(25, 13, 19, .93), rgba(14, 7, 11, .97));
}
.rail-kicker { display: flex; align-items: center; gap: 6px; color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .7px; text-transform: uppercase; }
.rail-card p { margin: 10px 0 14px; color: var(--muted); font-size: 12px; line-height: 1.75; }
.rail-status-row { display: flex; align-items: center; gap: 7px; padding: 10px 0; color: var(--text-2); font-size: 12px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.rail-status-row b { margin-inline-start: auto; color: var(--accent); font-family: ui-monospace, monospace; font-size: 10px; }
.status-dot { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px rgba(46, 204, 113, .09), 0 0 12px rgba(46, 204, 113, .5); }
.rail-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 11px; color: var(--muted); font-size: 11.5px; }
.rail-row > span:first-child { display: flex; align-items: center; gap: 6px; }
.rail-ok { color: var(--ok); display: flex; align-items: center; }
.rail-link {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 7px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 9px;
  color: var(--text-2); background: var(--bg-2); font-size: 11.5px; cursor: pointer;
}
.rail-link:hover { color: var(--accent); border-color: var(--accent-line); }

/* ================================================================ SECURITY */
.security-page { animation: vaultPageIn .45s ease both; }
.sec-loading { min-height: 320px; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); }
.sec-hero {
  position: relative; overflow: hidden; padding: 30px; margin-bottom: 14px;
  border: 1px solid var(--border-2); border-radius: 24px;
  background:
    radial-gradient(520px 220px at 12% -25%, rgba(255, 45, 70, .19), transparent 68%),
    linear-gradient(145deg, rgba(31, 16, 23, .96), rgba(13, 6, 10, .98));
}
.sec-hero::after {
  content: ''; position: absolute; inset: auto 22px 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-line), transparent);
}
.sec-hero > * { position: relative; z-index: 1; }
.sec-hero-mark {
  position: absolute; z-index: 0 !important; inset-inline-end: 38px; top: 50%;
  width: 132px; height: 132px; display: grid; place-items: center; transform: translateY(-50%);
  color: rgba(255, 45, 70, .22); border: 1px solid rgba(255, 45, 70, .14); border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 45, 70, .08), transparent 68%);
  box-shadow: 0 0 0 18px rgba(255, 45, 70, .025), 0 0 0 38px rgba(255, 45, 70, .015);
  pointer-events: none;
}
.sec-hero h1 { margin: 11px 0 8px; font-size: clamp(28px, 4.6vw, 42px); letter-spacing: -.8px; }
.sec-hero p { margin: 0; max-width: 650px; color: var(--text-2); font-size: 14.5px; }
.sec-hero-status {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 18px;
  color: var(--muted); font-family: ui-monospace, monospace; font-size: 10.5px; letter-spacing: .5px;
}
.sec-hero-status b { color: var(--ok); }
.sec-hero-line { width: 32px; height: 1px; background: var(--border-2); }
.sec-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.sec-card {
  position: relative; overflow: hidden; padding: 18px; min-width: 0;
  border: 1px solid var(--border); border-radius: 18px;
  background: linear-gradient(155deg, rgba(27, 14, 20, .94), rgba(14, 7, 11, .98));
}
.sec-card::before {
  content: ''; position: absolute; inset: 0 0 auto; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 45, 70, .55), transparent);
}
.sec-card-wide { grid-column: 1 / -1; }
.sec-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.sec-ic {
  display: grid; place-items: center; width: 40px; height: 40px; color: var(--accent);
  border: 1px solid rgba(255, 45, 70, .24); border-radius: 12px; background: var(--accent-soft);
}
.sec-pill { padding: 4px 8px; border: 1px solid var(--border-2); border-radius: 999px; color: var(--muted); font-size: 9.5px; font-weight: 700; white-space: nowrap; }
.sec-pill.ok { color: var(--ok); border-color: rgba(46, 204, 113, .28); background: rgba(46, 204, 113, .07); }
.sec-pill.warn { color: var(--warn); border-color: rgba(255, 200, 87, .28); background: rgba(255, 200, 87, .07); }
.sec-card h2 { margin: 14px 0 5px; font-size: 17px; letter-spacing: -.2px; }
.sec-card p { margin: 0 0 13px; color: var(--muted); font-size: 12px; line-height: 1.75; }
.sec-meter { height: 4px; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.sec-meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent-deep), var(--accent), var(--warn)); }
.sec-code { display: inline-flex; align-items: center; gap: 6px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; color: var(--accent); font-family: ui-monospace, monospace; font-size: 9px; letter-spacing: .7px; }
.sec-link { display: inline-flex; align-items: center; gap: 7px; margin-top: 2px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; color: var(--text-2); background: var(--bg-2); font-size: 11px; cursor: pointer; }
.sec-link:hover { color: var(--accent); border-color: var(--accent-line); }
.sec-events { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; margin-top: 4px; }
.sec-event { display: flex; align-items: flex-start; gap: 9px; padding: 9px 0; border-top: 1px solid var(--border); }
.sec-event-dot { width: 5px; height: 5px; margin-top: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }
.sec-event-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sec-event-copy b { color: var(--text-2); font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.sec-event-copy small { color: var(--muted); font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }
.sec-empty { padding: 18px 0; color: var(--muted); font-size: 12px; }

/* ================================================================ DOWNLOAD OVERLAY */
.rv-dl-overlay {
  position: fixed; inset: 0; z-index: 300; padding: 16px;
  display: grid; place-items: center;
}
.rv-dl-backdrop {
  position: absolute; inset: 0; background:
    radial-gradient(800px 500px at 50% 38%, rgba(255, 45, 70, .14), transparent 62%),
    rgba(3, 1, 2, .90);
  backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px);
  animation: rvDlFade .28s ease both;
}
.rv-dl-panel {
  position: relative; overflow: hidden; width: min(760px, 100%); max-height: 92vh; overflow-y: auto;
  padding: 24px 28px 20px;
  background:
    radial-gradient(480px 280px at 50% 0%, rgba(255, 45, 70, .12), transparent 70%),
    linear-gradient(155deg, #1b0d14, #0b0407 72%);
  border: 1px solid rgba(255, 45, 70, .36); border-radius: 22px;
  box-shadow: 0 0 0 1px rgba(255, 45, 70, .08), 0 28px 90px rgba(0, 0, 0, .72), 0 0 70px rgba(255, 45, 70, .10);
  animation: rvDlPanelIn .34s cubic-bezier(.2, .8, .2, 1) both;
}
.rv-dl-panel::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .035) 48%, transparent 60%);
  transform: translateX(-100%); animation: rvDlSheen 3.2s ease-in-out infinite;
}
.rv-dl-grid {
  position: absolute; inset: 0; pointer-events: none; opacity: .17;
  background-image:
    linear-gradient(rgba(255, 45, 70, .22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 45, 70, .22) 1px, transparent 1px);
  background-size: 30px 30px;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 0%, transparent 72%);
}
.rv-dl-scan {
  position: absolute; inset: 0; pointer-events: none; z-index: 2; opacity: .55;
  background: linear-gradient(180deg, transparent 0%, rgba(255, 45, 70, .045) 48%, rgba(255, 45, 70, .24) 50%, rgba(255, 45, 70, .045) 52%, transparent 100%);
  height: 26%; animation: rvDlScan 3.4s linear infinite;
}
.rv-dl-corner { position: absolute; width: 23px; height: 23px; border-color: rgba(255, 45, 70, .78); border-style: solid; pointer-events: none; }
.rv-dl-corner-tl { top: 9px; inset-inline-start: 9px; border-width: 1px 0 0 1px; }
.rv-dl-corner-tr { top: 9px; inset-inline-end: 9px; border-width: 1px 1px 0 0; }
.rv-dl-corner-bl { bottom: 9px; inset-inline-start: 9px; border-width: 0 0 1px 1px; }
.rv-dl-corner-br { bottom: 9px; inset-inline-end: 9px; border-width: 0 1px 1px 0; }
.rv-dl-close {
  position: absolute; top: 15px; inset-inline-end: 15px; z-index: 5;
  width: 34px; height: 34px; display: grid; place-items: center; padding: 0;
  color: var(--muted); border: 1px solid var(--border-2); border-radius: 9px; background: rgba(10, 5, 7, .75); cursor: pointer;
}
.rv-dl-close:hover { color: var(--text); border-color: var(--accent-line); }
.rv-dl-head { position: relative; z-index: 3; padding-inline-end: 36px; }
.rv-dl-kicker { display: flex; align-items: center; gap: 8px; color: var(--accent); font-family: ui-monospace, monospace; font-size: 10px; font-weight: 700; letter-spacing: 1.4px; }
.rv-dl-live { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(255, 45, 70, .12), 0 0 14px var(--accent); animation: rvDlBlink 1.1s steps(2, end) infinite; }
.rv-dl-head h2 { margin: 9px 0 5px; font-size: clamp(23px, 4vw, 30px); line-height: 1.2; letter-spacing: -.5px; text-shadow: 0 0 24px rgba(255, 45, 70, .20); }
.rv-dl-panel[data-state="loading"] .rv-dl-head h2 { animation: rvDlTitleGlitch 4.4s steps(1, end) infinite; }
.rv-dl-head p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.rv-dl-core {
  position: relative; z-index: 3; height: 230px; margin: 16px 0 8px; overflow: hidden;
  display: grid; place-items: center; border: 1px solid rgba(255, 45, 70, .16); border-radius: 16px;
  background: radial-gradient(circle at 50% 50%, rgba(255, 45, 70, .09), transparent 58%), rgba(5, 2, 3, .45);
  transition: opacity .4s ease, transform .4s ease;
}
.rv-dl-ring { position: absolute; width: 154px; height: 154px; border: 1px solid rgba(255, 45, 70, .38); border-top-color: transparent; border-radius: 50%; animation: rvDlSpin 7s linear infinite; }
.rv-dl-ring-2 { width: 206px; height: 206px; border-style: dashed; border-color: rgba(255, 92, 61, .24); animation-direction: reverse; animation-duration: 11s; }
.rv-dl-lock {
  position: relative; z-index: 2; width: 76px; height: 76px; display: grid; place-items: center;
  color: var(--accent); border: 1px solid rgba(255, 45, 70, .45); border-radius: 50%;
  background: radial-gradient(circle at 40% 30%, rgba(255, 45, 70, .24), rgba(18, 7, 11, .85) 72%);
  box-shadow: inset 0 0 22px rgba(255, 45, 70, .16), 0 0 35px rgba(255, 45, 70, .20);
  animation: rvDlLockPulse 1.8s ease-in-out infinite;
}
.rv-dl-hex {
  position: absolute; inset: auto 0 9px; z-index: 1; padding: 0 12px; white-space: pre; text-align: center;
  color: rgba(255, 92, 61, .50); font-family: ui-monospace, monospace; font-size: 9px; line-height: 1.55;
  letter-spacing: .6px; animation: rvDlFlicker 2.2s steps(2, end) infinite; pointer-events: none;
}
.rv-dl-progress { position: relative; z-index: 3; height: 5px; margin: 12px 0 9px; overflow: hidden; border-radius: 99px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 45, 70, .12); transition: opacity .3s ease; }
.rv-dl-progress i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent-deep), var(--accent), var(--accent-hot)); box-shadow: 0 0 16px var(--accent-glow); transition: width .3s ease; }
.rv-dl-status { position: relative; z-index: 3; min-height: 20px; color: var(--text-2); font-family: ui-monospace, monospace; font-size: 10.5px; letter-spacing: .3px; text-align: center; }
.rv-dl-ready { position: relative; z-index: 3; min-height: 206px; margin-top: 8px; padding: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; text-align: center; border: 1px solid rgba(46, 204, 113, .22); border-radius: 15px; background: radial-gradient(320px 150px at 50% 0%, rgba(46, 204, 113, .08), transparent 72%); animation: rvDlReadyIn .4s ease both; }
.rv-dl-ready-mark { display: grid; place-items: center; width: 48px; height: 48px; color: var(--ok); border: 1px solid rgba(46, 204, 113, .3); border-radius: 50%; background: rgba(46, 204, 113, .07); box-shadow: 0 0 28px rgba(46, 204, 113, .12); }
.rv-dl-ready-name { max-width: 100%; color: var(--text); font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-dl-ready-meta { color: var(--muted); font-family: ui-monospace, monospace; font-size: 10px; }
.rv-dl-save {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  min-width: 250px; min-height: 50px; margin-top: 9px; padding: 13px 28px;
  color: #fff; border: 1px solid transparent; border-radius: 12px; background: var(--grad);
  font-size: 14px; font-weight: 800; cursor: pointer;
  box-shadow: 0 12px 34px rgba(255, 45, 70, .26), 0 0 0 0 rgba(46, 204, 113, .18);
  animation: rvDlSavePulse 1.9s ease-in-out infinite;
}
.rv-dl-save:hover { filter: brightness(1.1); }
.rv-dl-save:disabled { opacity: .6; cursor: wait; animation: none; }
.rv-dl-error { position: relative; z-index: 3; min-height: 170px; margin-top: 8px; display: flex; align-items: center; justify-content: center; gap: 9px; padding: 22px; color: var(--err); border: 1px solid rgba(255, 77, 77, .25); border-radius: 14px; background: rgba(255, 77, 77, .05); font-size: 13px; text-align: center; }
.rv-dl-foot { position: relative; z-index: 3; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; margin-top: 14px; color: var(--muted-2); font-family: ui-monospace, monospace; font-size: 9px; letter-spacing: .2px; }
.rv-dl-panel[data-state="ready"] .rv-dl-core { opacity: .16; transform: scale(.92); }
.rv-dl-panel[data-state="ready"] .rv-dl-progress { opacity: 0; }
.rv-dl-panel[data-state="ready"] .rv-dl-status { color: var(--ok); }
.rv-dl-panel[data-state="error"] .rv-dl-core { opacity: .25; }
.rv-dl-panel[data-state="error"] .rv-dl-progress { opacity: .3; }

@keyframes vaultPageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes vaultPulse { 0%, 100% { opacity: .65; transform: scale(.92); } 50% { opacity: 1; transform: scale(1.08); } }
@keyframes vaultCardIn { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes rvDlFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rvDlPanelIn { from { opacity: 0; transform: translateY(18px) scale(.975); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes rvDlSpin { to { transform: rotate(360deg); } }
@keyframes rvDlLockPulse { 0%, 100% { box-shadow: inset 0 0 22px rgba(255, 45, 70, .16), 0 0 26px rgba(255, 45, 70, .16); } 50% { box-shadow: inset 0 0 32px rgba(255, 45, 70, .24), 0 0 48px rgba(255, 45, 70, .34); } }
@keyframes rvDlScan { 0% { transform: translateY(-120%); } 100% { transform: translateY(430%); } }
@keyframes rvDlFlicker { 0%, 100% { opacity: .50; } 12% { opacity: .72; } 28% { opacity: .38; } 55% { opacity: .66; } 73% { opacity: .44; } }
@keyframes rvDlTitleGlitch {
  0%, 91%, 100% { transform: none; opacity: 1; }
  92% { transform: translateX(-2px); opacity: .72; }
  93% { transform: translateX(2px); opacity: 1; }
  94% { transform: translateX(-1px); opacity: .86; }
  95% { transform: none; opacity: 1; }
}
@keyframes rvDlBlink { 0%, 45% { opacity: 1; } 46%, 100% { opacity: .35; } }
@keyframes rvDlSheen { 0%, 55% { transform: translateX(-110%); } 80%, 100% { transform: translateX(110%); } }
@keyframes rvDlReadyIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes rvDlSavePulse { 0%, 100% { box-shadow: 0 12px 34px rgba(255, 45, 70, .24), 0 0 0 0 rgba(46, 204, 113, .16); } 50% { box-shadow: 0 14px 40px rgba(255, 45, 70, .34), 0 0 0 5px rgba(46, 204, 113, .04); } }

/* Larger, calmer bottom navigation with a live file count. */
.bottomnav {
  padding: 8px max(8px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  gap: 5px; border-top-color: rgba(255, 45, 70, .18);
  box-shadow: 0 -14px 40px rgba(0, 0, 0, .36);
}
.navbtn {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; min-height: 54px; padding: 7px 5px; border-radius: 12px;
  color: var(--muted); font-size: 10.5px; line-height: 1.2; transition: color .2s ease, background .2s ease;
}
.navbtn .nav-ic { display: grid; place-items: center; width: 25px; height: 25px; }
.navbtn .nav-label { white-space: nowrap; }
.navbtn:hover { color: var(--text-2); }
.navbtn.active {
  color: var(--accent); background: linear-gradient(180deg, rgba(255, 45, 70, .16), rgba(255, 45, 70, .06));
  box-shadow: inset 0 0 0 1px rgba(255, 45, 70, .13), 0 0 24px rgba(255, 45, 70, .06);
}
.navbtn.active .nav-ic { filter: drop-shadow(0 0 7px rgba(255, 45, 70, .45)); }
.nav-badge {
  position: absolute; top: 4px; inset-inline-end: max(8px, 18%); min-width: 16px; height: 16px; padding: 0 4px;
  display: grid; place-items: center; border-radius: 999px; background: var(--accent); color: #fff;
  font-size: 8px; font-weight: 800; line-height: 1; box-shadow: 0 0 12px var(--accent-glow);
}

@media (max-width: 900px) {
  .vault-layout { grid-template-columns: 1fr; }
  .vault-rail { position: static; order: 2; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
  .sec-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .vault-hero { grid-template-columns: 1fr; padding: 21px; border-radius: 20px; }
  .vault-hero-actions { min-width: 0; }
  .vault-add { width: 100%; }
  .vault-metrics { grid-template-columns: 1fr 1fr; }
  .vault-metric { min-height: 104px; padding: 14px; }
  .vault-metric strong { font-size: 21px; }
  .vault-metric-secure { grid-column: 1 / -1; min-height: 88px; }
  .vault-files-panel { padding: 15px; }
  .vault-grid { grid-template-columns: 1fr; }
  .vault-file { padding: 15px; }
  .vf-name { font-size: 15px; min-height: 0; }
  .sec-hero { padding: 21px; border-radius: 20px; }
  .sec-hero-mark { display: none; }
  .sec-grid { grid-template-columns: 1fr; }
  .sec-events { grid-template-columns: 1fr; }
  .rv-dl-overlay { padding: 8px; }
  .rv-dl-panel { padding: 19px 16px 15px; border-radius: 17px; }
  .rv-dl-head { padding-inline-end: 31px; }
  .rv-dl-core { height: 190px; }
  .rv-dl-ring { width: 126px; height: 126px; }
  .rv-dl-ring-2 { width: 172px; height: 172px; }
  .rv-dl-lock { width: 64px; height: 64px; }
  .rv-dl-hex { font-size: 7.5px; }
  .rv-dl-save { width: 100%; min-width: 0; }
  .rv-dl-foot { justify-content: center; text-align: center; }
  .rv-dl-ready { min-height: 190px; }
}

@media (prefers-reduced-motion: reduce) {
  .vault-page, .vault-file, .sec-hero, .sec-card, .rv-dl-panel, .rv-dl-backdrop, .rv-dl-ready { animation: none !important; }
  .vault-pulse, .status-dot, .rv-dl-ring, .rv-dl-lock, .rv-dl-scan, .rv-dl-hex, .rv-dl-live, .rv-dl-save, .rv-dl-panel::after, .rv-dl-head h2 { animation: none !important; }
  .vault-add, .vault-file, .vf-download, .rv-dl-progress i { transition: none !important; }
}

/* Consent checkbox: inline with its text, not a full-width field input. */
.consent-check {
  display: flex; align-items: flex-start; gap: 9px;
  margin: 13px 0 4px; padding: 11px 12px;
  border: 1px solid var(--border); border-radius: 10px;
  background: rgba(255,255,255,.025);
  color: var(--text); font-size: 13px; line-height: 1.55; cursor: pointer;
}
.consent-check input {
  display: inline-block; width: 18px; height: 18px; min-width: 18px;
  margin: 2px 0 0; padding: 0; flex: 0 0 auto; accent-color: #ff2d4f;
}
.consent-check span { min-width: 0; }
.consent-check a { color: #ff8fa0; text-decoration: underline; text-underline-offset: 2px; }
.consent-check a:hover { color: #fff; }
