/* ==========================================================================
   NEXUS AI platform: chat, wallet, top-ups, platform admin, avatars, i18n/RTL.
   Same tokens and motion language as app.css. Logical properties for RTL.
   ========================================================================== */

/* ---------- Persian / RTL ------------------------------------------------ */
html[lang="fa"] {
  --font: "Vazirmatn", "IRANSans", "IRANSansX", "Segoe UI", Tahoma, system-ui, -apple-system, "Noto Sans Arabic", "Noto Naskh Arabic", sans-serif;
}
html[lang="fa"] body { line-height: 1.6; }
/* letter-spacing breaks Persian letter joining */
html[lang="fa"] *:not(.wordmark):not(.mono):not(code):not(pre) { letter-spacing: 0 !important; }
html[lang="fa"] .sh h1 { font-weight: 800; }
html[lang="fa"] .lock .code { font-family: var(--font); font-size: 12px; }
.tu-wait { overflow: hidden; }
code, pre, .mono, .cmd, .md-code, .md-ic, kbd { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] svg.i.flip { scale: -1 1; }
[dir="rtl"] .toggle[aria-checked="true"]::after { transform: translateX(-20px); }
.stat, .qa, .sess, .opt, .q-opt, .suggest button, .menu-row, .mp { text-align: start; }
.stat .v small { margin-left: 0; margin-inline-start: 1px; }
.segmented button .n { margin-left: 0; margin-inline-start: 5px; }
.seg-ind { left: auto; inset-inline-start: 4px; }
.search svg.i { left: auto; inset-inline-start: 13px; }
.search .clear { right: auto; inset-inline-end: 6px; }
.msg.user .bubble { border-bottom-right-radius: 18px; border-end-end-radius: 6px; }
.msg.assistant .bubble { border-bottom-left-radius: 18px; border-end-start-radius: 6px; }
.working { border-bottom-left-radius: 18px; border-end-start-radius: 6px; }
.review .rv b { text-align: end; }
.appr::before { left: auto; inset-inline-start: 0; border-radius: 0; border-start-end-radius: 3px; border-end-end-radius: 3px; }
.feed-list { padding-left: 0; padding-inline-start: 4px; }
.feed-list::before { left: auto; inset-inline-start: 22px; }
.rep-line .ag { text-align: end; }
.toggle::after { left: auto; inset-inline-start: 3px; }
.tab .badge { left: auto; inset-inline-start: calc(50% + 6px); }
.tab-indicator { left: auto; inset-inline-start: 4px; }
.lock .lk { right: auto; inset-inline-end: -4px; }
.wordmark { padding-left: 0; padding-inline-start: .1em; }
.sess .folder, .rep-line .fd { text-align: start; }

/* ---------- Tab bar: any number of tabs, AI accent ----------------------- */
.tabbar { grid-template-columns: repeat(var(--tabs, 5), 1fr); }
.tab-indicator { width: calc((100% - 8px) / var(--tabs, 5)); }
.tab-accent svg.i { color: #cbbcff; filter: drop-shadow(0 0 6px rgba(157,123,255,.55)); }
.tab-accent[aria-current="page"] svg.i { color: var(--gold-hi); filter: drop-shadow(0 0 8px rgba(212,175,55,.6)); }

/* ---------- Topbar balance pill ------------------------------------------ */
.bal-pill { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px 0 9px; border-radius: 99px; font-size: 13px; font-weight: 700;
  color: var(--gold-hi); background: linear-gradient(135deg, rgba(212,175,55,.2), rgba(20,25,46,.7)); border: 1px solid rgba(212,175,55,.4);
  box-shadow: 0 0 16px rgba(212,175,55,.15); font-variant-numeric: tabular-nums; }
.bal-pill svg.i { width: 16px; height: 16px; }
.bal-pill .bp-u { font-size: 11px; color: rgba(243,217,133,.7); }
.bal-pill.low { color: #ffb4bf; border-color: rgba(255,93,115,.45); background: linear-gradient(135deg, rgba(255,93,115,.16), rgba(20,25,46,.7)); }
.bal-pill.tick-down { animation: tickDown .9s var(--ease); }
.bal-pill.tick-up { animation: tickUp 1.1s var(--ease); }
@keyframes tickDown { 0% { transform: scale(1); } 25% { transform: scale(.94); box-shadow: 0 0 0 rgba(212,175,55,0); } 100% { transform: scale(1); } }
@keyframes tickUp { 0% { transform: scale(1); } 30% { transform: scale(1.08); box-shadow: 0 0 26px rgba(61,220,151,.5); } 100% { transform: scale(1); } }

/* ---------- Language switch ---------------------------------------------- */
.lang-switch { display: inline-grid; grid-auto-flow: column; gap: 2px; padding: 3px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid var(--line); flex: none; }
.lang-switch button { height: 30px; padding: 0 12px; border-radius: 9px; font-size: 13px; font-weight: 650; color: var(--text-2); }
.lang-switch button[lang="fa"] { font-family: "Vazirmatn", "IRANSans", "Segoe UI", Tahoma, sans-serif; }
.lang-switch button[aria-checked="true"] { color: #1a1405; background: linear-gradient(135deg, var(--gold-hi), var(--gold)); }
.lock .lang-switch { margin-top: 22px; }

/* ---------- Full-screen states: soon / blocked / phone / goodbye ---------- */
.lock.soon, .lock.phone { background: radial-gradient(120% 80% at 50% 0%, #1a1446, #05060d 65%); }
.soon-kicker { display: inline-block; margin-bottom: 8px; padding: 4px 10px; border-radius: 99px; font-size: 11px; font-weight: 800; letter-spacing: .2em;
  color: var(--gold-hi); background: var(--gold-soft); border: 1px solid rgba(212,175,55,.3); }
.lock.soon .av img, .lock.phone .av img { filter: none; }
.soon-orbit { position: absolute; inset: -22px; animation: spin 9s linear infinite; pointer-events: none; }
.soon-orbit i { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--gold-hi); box-shadow: 0 0 10px var(--gold); }
.soon-orbit i:nth-child(1) { top: 0; left: 50%; }
.soon-orbit i:nth-child(2) { bottom: 14%; left: 6%; background: var(--teal); box-shadow: 0 0 10px var(--teal); }
.soon-orbit i:nth-child(3) { bottom: 14%; right: 6%; background: var(--violet); box-shadow: 0 0 10px var(--violet); }
.lock .av.scanning .core-ring { animation-duration: 1.6s; }
.lock .lk.ph { background: linear-gradient(135deg, #8ff3e6, var(--teal)); color: #052a28; box-shadow: 0 0 0 4px var(--bg0), 0 0 24px rgba(55,226,207,.5); }
.ph-wait { display: flex; gap: 8px; justify-content: center; margin: 4px 0 8px; }
.ph-wait i { width: 9px; height: 9px; border-radius: 50%; background: var(--teal); animation: typing 1.1s ease-in-out infinite; }
.ph-wait i:nth-child(2) { animation-delay: .15s; background: var(--violet); }
.ph-wait i:nth-child(3) { animation-delay: .3s; background: var(--gold-hi); }
.ph-note { display: flex; gap: 10px; align-items: flex-start; text-align: start; margin: -8px 0 18px; padding: 12px 14px; border-radius: 14px; font-size: 13.5px; color: #d9e8ff;
  background: rgba(103,168,255,.1); border: 1px solid rgba(103,168,255,.3); }
.ph-note svg.i { width: 18px; height: 18px; color: var(--info); margin-top: 2px; }
.lock.bye .lk.bye-ic { background: linear-gradient(135deg, #ffb3c6, #ff6f91); color: #fff; }
.boot-err { padding: 40px 16px; }

/* ---------- Avatars (chat icons) ------------------------------------------ */
.fav { --sz: 44px; position: relative; display: inline-block; flex: none; width: var(--sz); height: var(--sz); border-radius: 32%; overflow: hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.12); isolation: isolate; }
.fav-svg { display: block; width: 100%; height: 100%; }
.fav::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); pointer-events: none; }
.fav .av-eyes, .fav .av-sway, .fav .av-bob, .fav .av-glint, .fav .av-bg, .fav .av-tw { transform-box: fill-box; }
.fav .av-eyes { transform-origin: center; }
.fav .av-sway { transform-origin: 50% 0; }
.fav .av-sway.tail { transform-origin: 0 0; }
.fav .av-bob { transform-origin: 50% 100%; }
.fav .av-glint, .fav .av-tw { transform-origin: center; opacity: .9; }
.fav.on .av-eyes { animation: avBlink var(--blink, 6s) ease-in-out infinite; animation-delay: var(--d, 0s); }
.fav.on .av-sway { animation: avSway 5.5s ease-in-out infinite alternate; animation-delay: var(--d, 0s); }
.fav.on .av-bob { animation: avBob 4.6s ease-in-out infinite alternate; animation-delay: var(--d, 0s); }
.fav.on .av-glint { animation: avGlint 3.8s ease-in-out infinite; animation-delay: var(--d, 0s); }
.fav.on .av-bg { animation: avLight 9s ease-in-out infinite alternate; animation-delay: var(--d, 0s); }
.fav.on .av-tw { animation: avTwinkle 4.2s ease-in-out infinite; animation-delay: var(--d, 0s); }
@keyframes avBlink { 0%, 90%, 100% { transform: scaleY(1); } 93%, 95% { transform: scaleY(.08); } }
@keyframes avSway { from { transform: rotate(-2.2deg); } to { transform: rotate(2.2deg); } }
@keyframes avBob { from { transform: translateY(.6px); } to { transform: translateY(-.8px); } }
@keyframes avGlint { 0%, 70%, 100% { opacity: .75; transform: scale(1); } 80% { opacity: 1; transform: scale(1.5); } }
@keyframes avLight { from { transform: translate(0, 0) scale(1); opacity: .9; } to { transform: translate(18px, 10px) scale(1.25); opacity: .55; } }
@keyframes avTwinkle { 0%, 60%, 100% { opacity: 0; transform: scale(.4) rotate(0); } 75% { opacity: 1; transform: scale(1) rotate(45deg); } }

/* ---------- Chat list ----------------------------------------------------- */
.gold-ic { color: var(--gold-hi); border-color: rgba(212,175,55,.4); background: var(--gold-soft); }
.tm-banner { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 12px; padding: 12px 14px; border-radius: 16px; font-size: 13px; color: #e6dcff;
  background: linear-gradient(135deg, rgba(157,123,255,.18), rgba(212,175,55,.08)); border: 1px solid rgba(157,123,255,.35); }
.tm-banner svg.i { color: #cbbcff; margin-top: 1px; }
.tm-banner b { display: block; font-size: 13.5px; color: #fff; }
.cl-list { gap: 10px; padding-bottom: 72px; }
.cl-row { position: relative; border-radius: 20px; overflow: hidden; }
.cl-acts { position: absolute; inset-block: 0; inset-inline-end: 0; width: 152px; display: grid; grid-template-columns: 1fr 1fr; }
.cl-act { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; font-size: 12px; font-weight: 700; color: #fff; }
.cl-act svg.i { width: 20px; height: 20px; }
.cl-act.ren { background: linear-gradient(160deg, #7b5cff, #4b32b8); }
.cl-act.del { background: linear-gradient(160deg, #ff6b81, #c22a47); }
.cl-card { position: relative; z-index: 1; display: flex; gap: 13px; align-items: flex-start; width: 100%; padding: 13px 14px; text-align: start; border-radius: 20px;
  background: linear-gradient(150deg, #151a33, #0f1328); border: 1px solid var(--line); touch-action: pan-y; }
.cl-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; padding-inline-end: 22px; }
.cl-top { display: flex; align-items: baseline; gap: 8px; }
.cl-title { flex: 1; min-width: 0; font-size: 15.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-time { font-size: 11.5px; color: var(--text-3); flex: none; }
.cl-prev { font-size: 13px; color: var(--text-2); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cl-main .chips { margin-top: 5px; }
.cl-more { position: absolute; z-index: 2; inset-block-end: 10px; inset-inline-end: 8px; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center;
  color: var(--text-3); transition: opacity .2s; }
.cl-more:hover { color: var(--text); background: rgba(255,255,255,.06); }
.cl-more svg.i { width: 18px; height: 18px; }
.fab { position: absolute; z-index: 15; inset-inline-end: 18px; bottom: calc(var(--tabbar-h) + 24px + var(--safe-bottom)); display: inline-flex; align-items: center; gap: 8px;
  height: 48px; padding: 0 18px 0 16px; border-radius: 16px; font-weight: 750; font-size: 14.5px; color: #1a1405;
  background: linear-gradient(135deg, #f6dc8a, var(--gold) 55%, #b8901f); box-shadow: 0 12px 30px rgba(212,175,55,.35), inset 0 1px 0 rgba(255,255,255,.5); }
.fab svg.i { width: 18px; height: 18px; }

.ai-empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 18px 4px 10px; }
.ai-empty h2 { margin: 14px 0 4px; font-size: 21px; font-weight: 750; }
.ai-empty > p { margin: 0 0 16px; color: var(--text-2); font-size: 13.5px; max-width: 320px; }
.ai-empty > .btn { margin-bottom: 18px; }
.ai-orb { position: relative; width: 88px; height: 88px; }
.ai-orb img { position: relative; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 2px solid var(--bg0); }
.ai-orb .core-ring { inset: -6px; }
.ai-orb .core-glow { inset: -28px; }
.ai-orb.av-orb .fav { position: relative; border-radius: 30%; }
.ex-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.ex { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; padding: 13px; border-radius: 16px; text-align: start; min-height: 108px; }
.ex svg.i { width: 18px; height: 18px; color: var(--gold-hi); margin-bottom: 2px; }
.ex b { font-size: 13.5px; font-weight: 700; }
.ex small { font-size: 12px; color: var(--text-3); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ex:disabled { opacity: .45; filter: saturate(.6); }

/* ---------- Chat screen ---------------------------------------------------- */
.ai-screen { display: flex; flex-direction: column; }
.ch-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 6px 14px 10px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(5,6,13,.4), rgba(5,6,13,0)); }
.ch-av { flex: none; display: grid; }
.ch-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.ch-title-btn { max-width: 100%; text-align: start; }
.ch-title { display: block; font-size: 16.5px; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.ch-model { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 8px 0 7px; border-radius: 9px; font-size: 12px; font-weight: 700; color: #d3c6ff;
  background: var(--violet-soft); border: 1px solid rgba(157,123,255,.38); }
.ch-model svg.i { width: 13px; height: 13px; }
.ai-scroll { padding-top: 8px; padding-bottom: 18px !important; }
.ai-thread { display: flex; flex-direction: column; gap: 14px; }
.am { display: flex; flex-direction: column; max-width: 100%; }
.am.user { align-self: flex-end; align-items: flex-end; max-width: 86%; }
.am.user .bubble { border-radius: 18px; border-end-end-radius: 6px; color: #fff6dc; background: linear-gradient(145deg, rgba(212,175,55,.3), rgba(160,120,30,.18)); border: 1px solid rgba(212,175,55,.38); }
.am.user.pending .bubble { opacity: .75; }
.am.user.err .bubble { opacity: .6; border-style: dashed; }
.am .ts { font-size: 10.5px; color: var(--text-3); margin: 4px 6px 0; }
.am.bot { flex-direction: row; align-items: flex-start; gap: 10px; }
.am-av { flex: none; width: 28px; height: 28px; border-radius: 50%; overflow: hidden; margin-top: 2px; box-shadow: 0 0 0 1.5px rgba(212,175,55,.45); }
.am-av img { width: 100%; height: 100%; object-fit: cover; }
.am-av.live { box-shadow: 0 0 0 1.5px var(--gold), 0 0 14px rgba(212,175,55,.55); animation: glow 1.8s ease-in-out infinite; }
.am-body { flex: 1; min-width: 0; padding: 12px 14px; border-radius: 18px; border-start-start-radius: 6px;
  background: linear-gradient(150deg, rgba(30,36,68,.85), rgba(16,20,40,.85)); border: 1px solid rgba(157,123,255,.2); }
.am.bot.err .am-body { background: rgba(255,93,115,.06); border-color: rgba(255,93,115,.3); border-style: dashed; }
.am-errtxt { color: #ffc2cb; font-size: 14px; }
.am-retry { margin-top: 10px; }
.am-retry.solo { align-self: flex-end; }
.am-thinking { display: flex; align-items: center; gap: 10px; color: var(--gold-hi); font-size: 13.5px; font-weight: 600; }
.am-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.am-charge { color: var(--gold-hi); font-weight: 700; }
.am-copy { margin-inline-start: auto; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: var(--text-3); }
.am-copy:hover { color: var(--text); background: rgba(255,255,255,.06); }
.am-copy svg.i { width: 15px; height: 15px; }
.am-files { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin-bottom: 6px; max-width: 100%; }
.am-img { width: 150px; height: 150px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line-2); display: grid; place-items: center; background: rgba(255,255,255,.04); }
.am-img img { width: 100%; height: 100%; object-fit: cover; }
.am-img.broken { gap: 4px; color: var(--text-3); font-size: 11px; }
.am-file { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 14px; background: rgba(255,255,255,.05); border: 1px solid var(--line-2); max-width: 240px; text-align: start; }
.caret { display: inline-block; width: .55em; height: 1.05em; margin-inline-start: 2px; vertical-align: -0.15em; border-radius: 2px; background: var(--gold-hi); box-shadow: 0 0 8px var(--gold); animation: caret 1s steps(2, start) infinite; }
@keyframes caret { to { opacity: 0; } }

/* Markdown */
.md { font-size: 14.5px; line-height: 1.62; overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 10px; }
.md .md-h { margin: 14px 0 6px; font-weight: 750; line-height: 1.3; }
.md .md-h1 { font-size: 19px; } .md .md-h2 { font-size: 17.5px; } .md .md-h3 { font-size: 16px; color: var(--gold-hi); } .md .md-h4, .md .md-h5, .md .md-h6 { font-size: 14.5px; }
.md strong { color: #fff; font-weight: 720; }
.md em { color: #e3dcff; }
.md del { opacity: .6; }
.md .md-a { color: var(--teal); text-decoration: underline; text-decoration-color: rgba(55,226,207,.4); text-underline-offset: 2px; }
.md .md-ic { padding: .1em .38em; border-radius: 6px; font-family: var(--mono); font-size: .86em; color: #f3d985; background: rgba(212,175,55,.1); border: 1px solid rgba(212,175,55,.18); }
.md .md-l { margin: 4px 0 10px; padding-inline-start: 22px; }
.md .md-l li { margin: 3px 0; }
.md .md-l li::marker { color: var(--gold); }
.md .md-li-task { list-style: none; margin-inline-start: -20px; display: flex; gap: 8px; align-items: baseline; }
.md .md-task { flex: none; width: 13px; height: 13px; border-radius: 4px; border: 1.5px solid var(--text-3); transform: translateY(2px); }
.md .md-task.on { background: var(--teal); border-color: var(--teal); }
.md .md-q { margin: 8px 0; padding: 6px 12px; border-inline-start: 3px solid var(--violet); background: rgba(157,123,255,.08); border-radius: 0 10px 10px 0; color: #ddd5ff; }
.md .md-q p { margin: 4px 0; }
.md .md-hr { border: 0; height: 1px; background: var(--line-2); margin: 14px 0; }
.md .md-tw { margin: 8px 0 12px; overflow-x: auto; border-radius: 12px; border: 1px solid var(--line-2); }
.md .md-t { width: 100%; border-collapse: collapse; font-size: 13px; }
.md .md-t th, .md .md-t td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: start; white-space: nowrap; }
.md .md-t th { background: rgba(255,255,255,.05); color: var(--gold-hi); font-weight: 700; }
.md .md-t tr:last-child td { border-bottom: 0; }
.md-code { margin: 8px 0 12px; border-radius: 14px; overflow: hidden; background: #070914; border: 1px solid rgba(157,123,255,.22); }
.md-code-h { display: flex; align-items: center; justify-content: space-between; height: 34px; padding: 0 6px 0 12px; background: rgba(255,255,255,.04); border-bottom: 1px solid var(--line); }
.md-lang { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); text-transform: lowercase; }
.md-copy { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px; border-radius: 8px; font-size: 12px; font-weight: 650; color: var(--text-2); font-family: var(--font); }
.md-copy svg.i { width: 14px; height: 14px; }
.md-copy:hover { color: var(--text); background: rgba(255,255,255,.07); }
.md-copy.done { color: var(--ok); }
.md-code pre { margin: 0; padding: 12px 14px; overflow-x: auto; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; color: #e2e6ff; tab-size: 4; }
.md-code.open { border-color: rgba(212,175,55,.4); }
.md-code pre code { font-family: inherit; }

.jump-pill { position: absolute; z-index: 6; left: 50%; bottom: 96px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px;
  border-radius: 99px; font-size: 12.5px; font-weight: 700; color: var(--text); background: rgba(22,27,52,.92); border: 1px solid var(--line-2); box-shadow: 0 8px 26px rgba(0,0,0,.45);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); animation: fadeUp .3s var(--ease); }
.jump-pill svg.i { width: 15px; height: 15px; color: var(--gold-hi); }

/* Composer with attachments */
.ai-composer .composer-in { padding-inline-start: 6px; }
.cp-clip { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; color: var(--text-2); }
.cp-clip:hover:not(:disabled) { color: var(--gold-hi); background: rgba(255,255,255,.05); }
.cp-clip:disabled { opacity: .35; }
.cp-clip svg.i { width: 20px; height: 20px; }
.ai-composer textarea:disabled { opacity: .6; }
.att-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; }
.att-row::-webkit-scrollbar { display: none; }
.att { position: relative; flex: none; animation: popIn .35s var(--spring) both; }
.att-img { width: 62px; height: 62px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line-2); }
.att-img img { width: 100%; height: 100%; object-fit: cover; }
.att-img.uploading img { filter: brightness(.55); }
.att-file { display: flex; align-items: center; gap: 9px; height: 62px; padding: 0 34px 0 10px; padding-inline: 10px 34px; border-radius: 14px; max-width: 220px; background: rgba(255,255,255,.05); border: 1px solid var(--line-2); }
.att.error { border-color: rgba(255,93,115,.5); }
.att-fi { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; color: #cbbcff; background: var(--violet-soft); }
.att-fi svg.i { width: 17px; height: 17px; }
.att-meta { min-width: 0; display: flex; flex-direction: column; }
.att-meta b { font-size: 12.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-meta small { font-size: 11px; color: var(--text-3); }
.att-x { position: absolute; top: 4px; inset-inline-end: 4px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(5,6,13,.75); }
.att-x svg.i { width: 12px; height: 12px; stroke-width: 2.4; }
.att-prog { --p: 0; position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%;
  background: conic-gradient(var(--gold-hi) calc(var(--p) * 1%), rgba(255,255,255,.18) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3.5px), #000 calc(100% - 3px)); mask: radial-gradient(farthest-side, transparent calc(100% - 3.5px), #000 calc(100% - 3px)); }
.att-file .att-prog { position: static; margin: 0; width: 22px; height: 22px; flex: none; }
.att-err { position: absolute; inset: 0; display: grid; place-items: center; color: var(--err); background: rgba(5,6,13,.55); }
.ai-lock-slot:empty { display: none; }
.ai-lock { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 20px; text-align: start;
  background: linear-gradient(135deg, rgba(212,175,55,.2), rgba(157,123,255,.12) 60%, rgba(20,25,46,.85)); border: 1px solid rgba(212,175,55,.42);
  box-shadow: 0 10px 30px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.08); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); position: relative; overflow: hidden; }
.ai-lock::after { content: ""; position: absolute; inset: 0; transform: translateX(-110%); background: linear-gradient(105deg, transparent 30%, rgba(243,217,133,.14) 50%, transparent 70%); animation: sweep 4s ease-in-out infinite; }
.ai-lock-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; color: #1a1405; background: linear-gradient(135deg, var(--gold-hi), var(--gold)); box-shadow: 0 0 18px rgba(212,175,55,.5); }
.ai-lock b { display: block; font-size: 14px; font-weight: 720; color: #fff3cf; }
.ai-lock small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--text-2); }
.cl-list + .ai-lock, .tm-banner + .ai-lock { margin-top: 0; }
#view .screen > .scroll > div > .ai-lock { margin-bottom: 12px; }
.viewer { display: grid; place-items: center; margin-top: 6px; }
.viewer img { max-width: 100%; max-height: 66vh; border-radius: 14px; }

/* ---------- Sheets: shared bits ------------------------------------------ */
.sheet .center { text-align: center; }
.sheet .opt-list { margin-top: 4px; }
.opt .ot small.price { font-family: var(--mono); font-size: 11px; color: var(--gold-hi); opacity: .85; margin-top: 3px; }
html[lang="fa"] .opt .ot small.price { font-family: var(--font); }
.sheet-menu { margin-top: 8px; border-radius: 18px; overflow: hidden; }
.menu-row:disabled { opacity: .4; }
.lb-hero { display: grid; place-items: center; margin: 6px 0 12px; }
.lb-coin { width: 74px; height: 74px; border-radius: 24px; display: grid; place-items: center; color: #1a1405; background: linear-gradient(135deg, var(--gold-hi), var(--gold));
  box-shadow: 0 0 0 10px rgba(212,175,55,.1), 0 0 44px rgba(212,175,55,.45); animation: popIn .5s var(--spring) both; }
.lb-coin svg.i { width: 36px; height: 36px; }
.lb-coin.del { color: #fff; background: linear-gradient(135deg, #ff8aa0, var(--err)); box-shadow: 0 0 0 10px rgba(255,93,115,.1), 0 0 40px rgba(255,93,115,.4); }
.lb-bal { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.04); border: 1px solid var(--line); font-size: 14px; color: var(--text-2); }
.lb-bal b { color: var(--gold-hi); font-size: 16px; }
.del-list { list-style: none; margin: 6px 0 4px; padding: 0; display: grid; gap: 8px; }
.del-list li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; font-size: 13.5px; background: rgba(255,93,115,.06); border: 1px solid rgba(255,93,115,.18); }
.del-list li svg.i { width: 17px; height: 17px; color: #ff8a9a; }
.del-list li.kept { background: rgba(61,220,151,.06); border-color: rgba(61,220,151,.22); color: var(--text-2); }
.del-list li.kept svg.i { color: var(--ok); }

/* ---------- Wallet --------------------------------------------------------- */
.wl-card { position: relative; overflow: hidden; padding: 20px 20px 18px; border-radius: 26px; min-height: 178px; display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(135deg, #2a2210 0%, #6b5418 32%, #b8901f 64%, #f3d985 100%); border: 1px solid rgba(243,217,133,.6);
  box-shadow: 0 24px 50px rgba(0,0,0,.5), 0 0 40px rgba(212,175,55,.18), inset 0 1px 0 rgba(255,255,255,.35); color: #fff8e2; }
.wl-card > * { position: relative; z-index: 1; }
.wl-sheen { position: absolute !important; z-index: 0 !important; inset: 0; transform: translateX(-120%); background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.28) 50%, transparent 65%); animation: sweep 5s ease-in-out infinite; }
.wl-orb { position: absolute !important; z-index: 0 !important; border-radius: 50%; filter: blur(2px); }
.wl-orb.a { width: 180px; height: 180px; inset-inline-end: -50px; top: -70px; background: radial-gradient(closest-side, rgba(157,123,255,.55), transparent); animation: drift2 14s ease-in-out infinite alternate; }
.wl-orb.b { width: 140px; height: 140px; inset-inline-start: -40px; bottom: -60px; background: radial-gradient(closest-side, rgba(55,226,207,.35), transparent); animation: drift3 16s ease-in-out infinite alternate; }
.wl-top { display: flex; justify-content: space-between; align-items: center; }
.wl-lbl { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 650; color: rgba(255,248,226,.85); }
.wl-lbl svg.i { width: 17px; height: 17px; }
.wl-brand { font-size: 11px; font-weight: 800; letter-spacing: .24em; color: rgba(26,20,5,.6); }
.wl-big { display: flex; align-items: baseline; gap: 8px; margin-top: 10px; }
.wl-amt { font-size: 40px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; text-shadow: 0 2px 14px rgba(0,0,0,.35); }
.wl-cur { font-size: 15px; font-weight: 700; color: rgba(255,248,226,.8); }
.wl-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; font-size: 12.5px; color: rgba(255,248,226,.8); }
.wl-foot b { color: #fff; }
.wl-min { color: rgba(26,20,5,.65); font-weight: 650; }
.tu-card { padding: 14px; border-radius: 20px; }
.preset-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.preset { padding: 11px 6px; border-radius: 14px; text-align: center; background: rgba(255,255,255,.04); border: 1px solid var(--line); }
.preset b { display: block; font-size: 15px; font-weight: 750; font-variant-numeric: tabular-nums; }
.preset small { font-size: 11px; color: var(--text-3); }
.preset[aria-checked="true"] { border-color: rgba(212,175,55,.65); background: linear-gradient(135deg, rgba(212,175,55,.2), rgba(20,25,46,.6)); box-shadow: 0 0 18px rgba(212,175,55,.15); }
.preset[aria-checked="true"] b { color: var(--gold-hi); }
.preset:disabled { opacity: .35; }
.tu-custom { margin: 12px 0; }
.tu-in { position: relative; display: block; }
.tu-in input { width: 100%; padding: 13px 14px; padding-inline-end: 48px; border-radius: 14px; font-size: 16px; font-weight: 650; font-variant-numeric: tabular-nums;
  background: rgba(255,255,255,.04); border: 1px solid var(--line-2); }
.tu-in input:focus { border-color: rgba(212,175,55,.6); box-shadow: 0 0 0 4px rgba(212,175,55,.08); }
.tu-suf { position: absolute; inset-inline-end: 14px; top: 50%; transform: translateY(-50%); font-size: 13px; font-weight: 700; color: var(--text-3); pointer-events: none; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: 20px; }
.notice .mi { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.notice b { display: block; font-size: 15px; }
.notice p { margin: 4px 0 0; font-size: 13px; color: var(--text-2); }
.tl-mini { border-radius: 18px; overflow: hidden; }
.tl-row { display: grid; grid-template-columns: auto 1fr auto auto; gap: 10px; align-items: center; padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
.tl-row:last-child { border-bottom: 0; }
.tl-row .mono { font-size: 12px; color: var(--text-2); }
.tl-row b { font-variant-numeric: tabular-nums; }
.chip.st-ok { color: var(--ok); background: rgba(61,220,151,.1); border-color: rgba(61,220,151,.3); }
.chip.st-info { color: var(--info); background: rgba(103,168,255,.1); border-color: rgba(103,168,255,.3); }
.chip.st-red { color: #ff98a6; background: rgba(255,93,115,.1); border-color: rgba(255,93,115,.32); }
.chip.st-dim { color: var(--text-3); }
.chip.st-plain { color: var(--gold-hi); background: var(--gold-soft); border-color: rgba(212,175,55,.3); }
.lg-group { border-radius: 18px; overflow: hidden; }
.lg-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.lg-row:last-child { border-bottom: 0; }
.lg-ic { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; flex: none; color: var(--text-2); background: rgba(255,255,255,.05); }
.lg-ic svg.i { width: 17px; height: 17px; }
.lg-ic.ok { color: var(--ok); background: rgba(61,220,151,.12); }
.lg-ic.violet { color: #cbbcff; background: var(--violet-soft); }
.lg-ic.teal { color: var(--teal); background: var(--teal-soft); }
.lg-main { flex: 1; min-width: 0; }
.lg-main b { display: block; font-size: 14px; font-weight: 650; }
.lg-main small { display: block; font-size: 11.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-amt { text-align: end; flex: none; }
.lg-amt b { display: block; font-size: 14.5px; font-weight: 750; font-variant-numeric: tabular-nums; }
.lg-amt b.pos { color: var(--ok); }
.lg-amt small { font-size: 11px; color: var(--text-3); }
.danger-link { display: flex; justify-content: center; margin: 26px 0 4px; }
.link-btn { font-size: 12.5px; color: var(--text-3); text-decoration: underline; text-decoration-color: rgba(255,255,255,.15); text-underline-offset: 3px; padding: 8px 10px; border-radius: 8px; }
.link-btn:hover { color: #ff98a6; }

/* Top-up sheet */
.tu-sheet { display: flex; flex-direction: column; gap: 12px; }
.tu-sheet h3 { margin: 0; }
.tu-amount { display: flex; align-items: baseline; justify-content: center; gap: 8px; margin: 4px 0 0; }
.tu-amount b { font-size: 38px; font-weight: 800; color: var(--gold-hi); font-variant-numeric: tabular-nums; }
.tu-amount span { color: var(--text-2); font-weight: 650; }
.tu-code { align-self: center; display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 10px; background: rgba(255,255,255,.05); border: 1px dashed var(--line-2); color: var(--text-2); }
.tu-code .mono { font-size: 14px; color: var(--text); letter-spacing: .12em; }
.tu-code svg.i { width: 15px; height: 15px; }
.bale-btn { height: 54px; font-size: 16px; }
.tu-sheet .sub { margin: 0; }
.tu-wait { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 16px; background: rgba(55,226,207,.06); border: 1px solid rgba(55,226,207,.25); }
.tu-radar { position: relative; width: 44px; height: 44px; flex: none; display: grid; place-items: center; color: var(--teal); }
.tu-radar svg.i { width: 20px; height: 20px; position: relative; }
.tu-radar i { position: absolute; inset: 4px; border-radius: 50%; border: 1.5px solid var(--teal); opacity: 0; animation: tuRing 2.4s var(--ease) infinite; }
@keyframes tuRing { from { transform: scale(.6); opacity: .9; } to { transform: scale(1.45); opacity: 0; } }
.tu-radar i:nth-child(2) { animation-delay: .8s; } .tu-radar i:nth-child(3) { animation-delay: 1.6s; }
.tu-wtxt { display: flex; flex-direction: column; font-size: 13.5px; font-weight: 600; }
.tu-elapsed { font-size: 11.5px; color: var(--text-3); font-weight: 500; font-variant-numeric: tabular-nums; }
.tu-success { position: relative; display: grid; place-items: center; height: 120px; }
.tu-success .ring { width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center; color: #1a1405; background: linear-gradient(135deg, var(--gold-hi), var(--gold));
  box-shadow: 0 0 0 10px rgba(212,175,55,.12), 0 0 60px rgba(212,175,55,.5); animation: popIn .6s var(--spring) both; }
.tu-success .ring svg.i { width: 40px; height: 40px; stroke-width: 2.6; }
.tu-burst { position: absolute; left: 50%; top: 50%; }
.tu-burst i { position: absolute; width: 7px; height: 7px; margin: -3.5px; border-radius: 2px; background: var(--gold-hi); }
.tu-burst i:nth-child(3n) { background: var(--teal); border-radius: 50%; }
.tu-burst i:nth-child(3n+1) { background: var(--violet); }
.tu-fail { display: grid; place-items: center; width: 74px; height: 74px; margin: 6px auto 0; border-radius: 24px; color: var(--err); background: rgba(255,93,115,.1); border: 1px solid rgba(255,93,115,.3); }
.tu-fail.expired { color: var(--text-2); background: rgba(255,255,255,.05); border-color: var(--line-2); }
.tu-fail svg.i { width: 34px; height: 34px; }

/* ---------- Platform admin ------------------------------------------------ */
.pf-seg { margin-bottom: 14px; }
.pf-seg button { font-size: 12.5px; }
.pf-stage { position: relative; }
.pf-panel { display: block; }
.pf-chips { margin-bottom: 10px; }
.stat.pf-rev { border-color: rgba(212,175,55,.45); background: linear-gradient(135deg, rgba(212,175,55,.18), rgba(20,25,46,.7)); }
.stat.pf-rev .v { color: var(--gold-hi); }
.stat.pf-profit .v { color: var(--ok); }
.stat.pf-profit.neg .v { color: var(--err); }
.pf-bars { padding: 16px; border-radius: 20px; display: grid; gap: 14px; }
.pf-bl { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.pf-bl b { color: var(--text); font-variant-numeric: tabular-nums; }
.pf-track { height: 12px; border-radius: 8px; background: rgba(255,255,255,.06); overflow: hidden; }
.pf-fill { display: block; height: 100%; transform: scaleX(0); transform-origin: left; transition: transform 1.2s var(--ease); border-radius: 8px; }
[dir="rtl"] .pf-fill { transform-origin: right; }
.pf-fill.rev { background: linear-gradient(90deg, var(--gold), var(--gold-hi)); box-shadow: 0 0 12px rgba(212,175,55,.5); }
.pf-fill.cost { background: linear-gradient(90deg, #6d4fe0, var(--violet)); }
.pf-note { font-size: 12px; color: var(--text-3); }
.pf-form { display: grid; gap: 12px; }
.pf-card { border-radius: 20px; overflow: hidden; }
.pf-body { padding: 12px 14px 14px; display: grid; gap: 12px; }
.pf-field { display: grid; gap: 6px; min-width: 0; }
.pf-lbl { font-size: 12px; font-weight: 700; color: var(--text-2); }
.pf-hint { font-size: 11.5px; color: var(--text-3); }
.pf-g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pf-form input[type="url"], .pf-form input[type="password"], .pf-form .key-set + *, .pf-form textarea, .pf-select, .me-f input {
  width: 100%; padding: 11px 12px; border-radius: 12px; font-size: 14.5px; background: rgba(255,255,255,.04); border: 1px solid var(--line-2); }
.pf-form .tu-in input { padding: 11px 12px; padding-inline-end: 42px; font-size: 15px; }
.pf-form input:focus, .pf-form textarea:focus, .pf-select:focus { border-color: rgba(212,175,55,.6); }
.pf-form textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.pf-select { appearance: none; -webkit-appearance: none; color: var(--text); background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.pf-select option { background: #111630; }
.pf-preview { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 14px; border-radius: 14px; font-size: 13px; color: var(--text-2);
  background: linear-gradient(135deg, rgba(212,175,55,.12), rgba(20,25,46,.5)); border: 1px solid rgba(212,175,55,.3); }
.pf-preview svg.i { width: 15px; height: 15px; color: var(--gold); }
.pf-preview b { color: var(--gold-hi); font-size: 14.5px; }
.pf-preview small { margin-inline-start: auto; color: var(--ok); font-weight: 650; }
.pf-oa { display: grid; gap: 12px; transition: opacity .3s; }
.pf-oa.dim-box { opacity: .55; }
.key-set { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; font-size: 13.5px; background: rgba(61,220,151,.06); border: 1px solid rgba(61,220,151,.25); }
.key-set svg.i { color: var(--ok); }
.key-set span { flex: 1; }
.me-list { display: grid; gap: 10px; }
.me-row { position: relative; display: grid; gap: 8px; padding: 12px; padding-inline-end: 52px; border-radius: 14px; background: rgba(255,255,255,.03); border: 1px solid var(--line); }
.me-g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.me-g3 { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; }
.me-f { display: grid; gap: 4px; min-width: 0; }
.me-f span { font-size: 11px; color: var(--text-3); font-weight: 650; }
.me-f input { padding: 9px 10px; font-size: 13.5px; }
.me-en { display: grid; gap: 4px; justify-items: center; font-size: 11px; color: var(--text-3); font-weight: 650; }
.me-del { position: absolute; top: 12px; inset-inline-end: 10px; width: 34px; height: 34px; color: #ff8a9a; }
.me-foot { display: flex; }
.pf-warn { display: flex; gap: 10px; align-items: flex-start; margin: 0 14px 14px; padding: 12px 14px; border-radius: 14px; font-size: 13px; color: #ffe2b3;
  background: rgba(255,181,71,.1); border: 1px solid rgba(255,181,71,.38); }
.pf-warn svg.i { color: var(--warn); width: 18px; height: 18px; margin-top: 1px; }
.save-bar { position: absolute; z-index: 25; left: 12px; right: 12px; bottom: calc(12px + var(--safe-bottom)); display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 16px;
  padding-inline: 16px 10px; border-radius: 18px; background: rgba(18,22,44,.94); border: 1px solid rgba(212,175,55,.4); box-shadow: 0 16px 40px rgba(0,0,0,.55);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); animation: fadeUp .35s var(--ease); }
.sb-txt { flex: 1; display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 650; }
.sb-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold-hi); box-shadow: 0 0 10px var(--gold); animation: breathe 1.6s ease-in-out infinite; }
.mono-av { --hue: 260; display: inline-grid; place-items: center; flex: none; border-radius: 32%; font-weight: 800; font-size: 18px; color: #fff;
  background: linear-gradient(135deg, hsl(var(--hue) 70% 62%), hsl(calc(var(--hue) + 50) 60% 38%)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }
.pu { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 18px; text-align: start; }
.pu.blocked { opacity: .7; }
.pu-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pu-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pu-top b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pu-main small.mono { font-size: 11.5px; color: var(--text-3); text-align: start; }
.pu-main .chips { margin-top: 4px; }
.pu-bal { text-align: end; flex: none; }
.pu-bal b { display: block; font-size: 15px; color: var(--gold-hi); font-variant-numeric: tabular-nums; }
.pu-bal small { font-size: 11px; color: var(--text-3); }
.us-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.us-head h3 { margin: 0; }
.us-head .sub { margin: 2px 0 0; }
.us-kv b { font-size: 15px; }
.sgn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.sgn { display: flex; align-items: center; justify-content: center; gap: 8px; height: 42px; border-radius: 12px; font-weight: 650; color: var(--text-2); background: rgba(255,255,255,.04); border: 1px solid var(--line); }
.sgn b { font-size: 18px; }
.sgn.on { color: var(--gold-hi); border-color: rgba(212,175,55,.55); background: var(--gold-soft); }
.tp-list { border-radius: 18px; overflow: hidden; }
.tp-row { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.tp-row:last-child { border-bottom: 0; }
.tp-main b { display: block; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.tp-main small, .tp-mid small { display: block; font-size: 11.5px; color: var(--text-3); }
.tp-mid { text-align: end; }
.tp-mid .mono { font-size: 12px; color: var(--text-2); }

/* ---------- Reduced motion ------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .fav .av-eyes, .fav .av-sway, .fav .av-bob, .fav .av-glint, .fav .av-bg, .fav .av-tw { animation: none !important; }
  .fav .av-tw { opacity: 0; }
  .soon-orbit, .wl-sheen, .ai-lock::after, .caret { animation: none !important; }
  .pf-fill { transition: none; }
}

/* ==========================================================================
   v3 — brand mark, language flags, consumer-grade AI area, wallet with cards
   (later rules intentionally override earlier ones)
   ========================================================================== */

/* ---------- Brand mark (replaces the photo everywhere) -------------------- */
.nexus-mark { position: relative; display: block; width: 100%; height: 100%; border-radius: 50%; overflow: hidden;
  background: radial-gradient(circle at 50% 42%, #1d2150 0%, #0a0c1c 62%, #05060d 100%); }
.nexus-mark.plain { background: none; border-radius: 0; overflow: visible; }
.nexus-mark svg, .nexus-mark img { display: block; width: 100%; height: 100%; }
.nx-svg .nx-orbit, .nx-svg .nx-hub { transform-box: view-box; transform-origin: 0 0; }
.nx-svg .nx-orbit.a { animation: spin 40s linear infinite; }
.nx-svg .nx-orbit.b { animation: spin 26s linear infinite reverse; }
.nx-svg .nx-hub { animation: nxHub 4s ease-in-out infinite; }
.nx-svg .nx-pulse { opacity: 0; animation: nxPulse 3.3s cubic-bezier(.4,0,.2,1) infinite; animation-delay: calc(var(--i) * .55s); }
.nx-svg .nx-sat { animation: nxTw 2.4s ease-in-out infinite alternate; animation-delay: calc(var(--i) * .4s); }
.nx-svg .nx-halo { animation: nxTw 2s ease-in-out infinite alternate; animation-delay: calc(var(--i) * .5s); }
@keyframes nxHub { 0%, 100% { transform: scale(.9); opacity: .7; } 50% { transform: scale(1.08); opacity: 1; } }
@keyframes nxPulse { 0% { transform: translate(var(--dx), var(--dy)); opacity: 0; } 15% { opacity: 1; } 80% { opacity: 1; } 100% { transform: translate(0, 0); opacity: 0; } }
@keyframes nxTw { from { opacity: .45; } to { opacity: 1; } }
.hero.busy .nx-svg .nx-pulse { animation-duration: 1.9s; }
.hero.busy .nx-svg .nx-orbit.a { animation-duration: 18s; }
/* containers that used to hold the photo */
.brand-avatar { width: 34px; height: 34px; padding: 0; background: none; }
.brand-avatar .nexus-mark { box-shadow: 0 0 0 1px rgba(212,175,55,.35), 0 0 16px rgba(157,123,255,.35); }
.core .nexus-mark { position: relative; box-shadow: 0 0 0 1px rgba(212,175,55,.35), 0 12px 40px rgba(0,0,0,.6); }
.lock .av .nexus-mark, .chat-intro .av .nexus-mark, .profile .av .nexus-mark, .about .av .nexus-mark { position: relative; border: 2px solid var(--bg0); box-sizing: border-box; }
.thinking .orb .nexus-mark { width: 34px; height: 34px; }
.msg .who .nexus-mark { width: 20px; height: 20px; }
.radar .core-av { display: block; overflow: hidden; }
.radar .core-av .nexus-mark { border-radius: 50%; }
.ai-orb .nexus-mark { position: relative; }

/* ---------- Language flags ------------------------------------------------- */
.flags-slot { display: contents; }
.flags { display: inline-flex; align-items: center; margin-inline-end: -8px; }
.flag { width: 36px; height: 44px; display: grid; place-items: center; border-radius: 12px; opacity: .45; filter: saturate(.6); transition: opacity .25s, filter .25s, transform .25s var(--spring); }
.flag-in { width: 23px; height: 23px; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 1px rgba(255,255,255,.25), 0 2px 8px rgba(0,0,0,.4); }
.flag-in svg { display: block; width: 100%; height: 100%; }
.flag[aria-checked="true"] { opacity: 1; filter: none; }
.flag[aria-checked="true"] .flag-in { box-shadow: 0 0 0 2px var(--gold), 0 0 12px rgba(212,175,55,.6); }
.flag:hover { opacity: .85; }
.flag:active { transform: scale(.9); }
.flags.floating { position: absolute; z-index: 3; top: calc(8px + var(--safe-top)); inset-inline-end: 18px; }
.topbar-right { gap: 10px; }
.topbar .pill-demo { height: 20px; padding: 0 7px; font-size: 9.5px; }
@media (max-width: 440px) { .topbar.with-pill .wordmark { display: none; } }
@media (max-width: 370px) { .topbar .pill-demo { display: none; } }

/* ---------- AI home: chat list (clean, borderless, consumer-grade) -------- */
.icon-btn.round { border-radius: 50%; width: 44px; height: 44px; }
.ai-home .sh h1 { font-size: 32px; }
.cl-banners:empty { display: none; }
.cl-banners { display: grid; gap: 10px; margin-bottom: 12px; }
.search.soft input { height: 44px; border-radius: 22px; background: rgba(255,255,255,.05); border-color: transparent; }
.search.soft input:focus { background: rgba(255,255,255,.07); border-color: rgba(212,175,55,.4); }
.cl-list { display: flex; flex-direction: column; gap: 2px; margin: 12px -8px 0; padding-bottom: 12px; }
.cl-row { position: relative; border-radius: 18px; overflow: hidden; }
.cl-row + .cl-row::before { content: ""; position: absolute; z-index: 2; top: 0; inset-inline: 72px 12px; height: 1px; background: var(--line); pointer-events: none; }
.cl-row:not(.open) .cl-acts { visibility: hidden; }
.cl-acts { width: 204px; grid-template-columns: repeat(3, 1fr); border-radius: 18px; overflow: hidden; }
.cl-act.mdl { background: linear-gradient(160deg, #c99a2e, #8a6516); }
.cl-card { display: flex; align-items: center; gap: 14px; padding: 12px 10px; border: 0; border-radius: 18px; background: transparent; box-shadow: none;
  transition: background-color .2s, transform .34s var(--ease); }
.cl-card:hover { background: rgba(255,255,255,.03); }
.cl-card:active { background: rgba(255,255,255,.05); }
.cl-row.open .cl-card { background: #0a0d1c; box-shadow: 0 0 0 1px var(--line); }
.cl-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding-inline-end: 34px; }
.cl-top { display: flex; align-items: baseline; gap: 10px; }
.cl-title { flex: 1; min-width: 0; font-size: 16px; font-weight: 680; letter-spacing: -.005em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-time { font-size: 12px; color: var(--text-3); flex: none; font-variant-numeric: tabular-nums; }
.cl-sub { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.cl-model { flex: none; font-size: 11.5px; font-weight: 700; color: #cbbcff; }
.cl-model::after { content: "·"; margin-inline-start: 8px; color: var(--text-3); }
.cl-prev { flex: 1; min-width: 0; font-size: 13.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; -webkit-line-clamp: unset; }
.cl-prev.dim { color: var(--text-3); }
.cl-more { position: absolute; z-index: 3; top: 50%; bottom: auto; inset-inline-end: 6px; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%; color: var(--text-3); opacity: .85; }
.cl-more:hover { background: rgba(255,255,255,.07); color: var(--text); }
.cl-row.open .cl-more { opacity: 0; pointer-events: none; }
.cl-sk { display: flex; align-items: center; gap: 14px; padding: 12px 10px; }
.cl-sk > i.sk { width: 50px; height: 50px; border-radius: 32%; flex: none; }
.cl-sk > span { flex: 1; display: grid; gap: 8px; }
.cl-sk > span > i.sk { height: 12px; border-radius: 6px; }
.cl-sk > span > i.sk:first-child { width: 55%; }
.fab { display: none; }
.sheet-head { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.sheet-head h3 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.sheet-head .sub { margin: 2px 0 0; }
.ai-empty { padding-top: 26px; }
.ai-empty h2 { font-size: 24px; }
.ai-orb { width: 96px; height: 96px; }
.ex { background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.05); }
.ex:hover:not(:disabled) { background: rgba(255,255,255,.06); }

/* ---------- Chat screen: calmer, unboxed assistant replies ---------------- */
.ch-head { gap: 12px; padding: 8px 14px 12px; border-bottom: 1px solid rgba(255,255,255,.05); background: linear-gradient(180deg, rgba(5,6,13,.55), rgba(5,6,13,.15)); }
.ch-head .icon-btn { border-radius: 50%; width: 40px; height: 40px; background: transparent; border-color: transparent; }
.ch-head .icon-btn:hover { background: rgba(255,255,255,.06); }
.ch-head .back-btn { border-radius: 50%; background: transparent; border-color: transparent; }
.ch-title { font-size: 16px; }
.ch-model { height: 24px; font-size: 11.5px; border-radius: 99px; padding: 0 9px 0 8px; }
.ai-scroll { padding-inline: 18px; }
.ai-thread { gap: 22px; padding-top: 8px; }
.am.user { max-width: 84%; }
.am.user .bubble { border: 0; background: linear-gradient(145deg, rgba(212,175,55,.26), rgba(150,110,30,.16)); box-shadow: inset 0 0 0 1px rgba(212,175,55,.22); padding: 11px 15px; font-size: 15px; }
.am.bot { flex-direction: column; align-items: stretch; gap: 8px; }
.am-who { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.am-who b { font-weight: 750; color: var(--gold-hi); letter-spacing: .02em; }
.am-mdl { color: var(--text-3); font-weight: 600; }
.am-mdl::before { content: "·"; margin-inline-end: 8px; }
.am-av { width: 24px; height: 24px; margin: 0; box-shadow: none; }
.am-av.live { box-shadow: 0 0 12px rgba(212,175,55,.55); }
.am-body { padding: 0; background: none; border: 0; border-radius: 0; }
.md { font-size: 15.5px; line-height: 1.7; color: #e9ebf6; }
.am-meta { border-top: 0; padding-top: 0; margin-top: 8px; font-size: 11.5px; color: var(--text-3); opacity: .85; }
.am.bot.err .am-body { padding: 12px 14px; border-radius: 16px; background: rgba(255,93,115,.06); border: 1px dashed rgba(255,93,115,.3); }
.ai-composer { padding: 8px 12px calc(12px + var(--safe-bottom)); }
.ai-composer .composer-in { border-radius: 26px; padding: 5px 5px 5px 6px; background: rgba(24,29,56,.88); border-color: rgba(255,255,255,.1); box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.ai-composer textarea { font-size: 16px; padding: 9px 4px; }

/* ---------- Wallet --------------------------------------------------------- */
.wallet-screen .sh h1 { font-size: 32px; }
.wl-hero { position: relative; overflow: hidden; padding: 22px 22px 20px; border-radius: 28px; color: #fff8e2;
  background: radial-gradient(120% 140% at 0% 0%, rgba(243,217,133,.35), transparent 55%), linear-gradient(140deg, #1f1a0c 0%, #5a4514 38%, #a17c1c 72%, #e4c062 100%);
  box-shadow: 0 26px 50px rgba(0,0,0,.5), 0 0 50px rgba(212,175,55,.16), inset 0 1px 0 rgba(255,255,255,.3); }
.wl-hero > * { position: relative; z-index: 1; }
.wl-hero .wl-lbl { font-size: 13px; font-weight: 650; color: rgba(255,248,226,.8); }
.wl-hero .wl-big { margin-top: 6px; }
.wl-hero .wl-amt { font-size: 46px; }
.wl-hero .wl-foot { margin-top: 12px; }
.wl-section { margin-top: 30px; }
.wl-section:empty { display: none; }
.wl-h { margin: 0 2px 14px; font-size: 20px; font-weight: 760; letter-spacing: -.01em; }
.wl-methods { margin-bottom: 18px; }
.wl-methods button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.wl-methods button svg.i { width: 16px; height: 16px; }
.wl-step { display: flex; align-items: center; gap: 10px; margin: 4px 2px 12px; font-size: 14px; color: var(--text-2); }
.wl-step b { font-weight: 650; }
.wl-n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 12px; font-weight: 800; color: #1a1405; background: linear-gradient(135deg, var(--gold-hi), var(--gold)); }
.preset-row { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; }
.preset-row::-webkit-scrollbar { display: none; }
.preset-row .preset { flex: none; height: 44px; padding: 0 16px; border-radius: 22px; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; background: rgba(255,255,255,.05); border: 1px solid transparent; }
.preset-row .preset[aria-checked="true"] { color: #1a1405; background: linear-gradient(135deg, var(--gold-hi), var(--gold)); box-shadow: 0 6px 18px rgba(212,175,55,.3); }
.wl-amount { margin-bottom: 18px; }
.wl-amount .tu-custom { margin: 10px 0 0; }
.wl-instr { margin: 12px 2px 14px; font-size: 13.5px; color: var(--text-2); line-height: 1.55; }
.wl-go { height: 52px; font-size: 16px; border-radius: 16px; }
.wl-list { display: grid; gap: 2px; }
.wl-day { margin: 16px 2px 6px; font-size: 12.5px; font-weight: 700; color: var(--text-3); }
.wl-empty { margin: 0 2px; color: var(--text-3); font-size: 13.5px; }
.wallet-screen .lg-row { border-bottom: 0; padding: 10px 2px; }
.wallet-screen .lg-ic { border-radius: 50%; }
.wl-prog { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 18px; text-align: start; background: rgba(103,168,255,.06); border: 1px solid rgba(103,168,255,.2); }
.wl-prog-ic { position: relative; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; color: var(--info); background: rgba(103,168,255,.12); }
.wl-prog-ic i { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid var(--info); animation: tuRing 2.4s var(--ease) infinite; }
.wl-prog-ic svg.i { width: 18px; height: 18px; position: relative; }

/* Premium bank card */
.bank-card { position: relative; overflow: hidden; aspect-ratio: 1.586; width: 100%; max-width: 420px; margin: 0 auto; padding: 20px 22px; border-radius: 22px; display: flex; flex-direction: column; justify-content: space-between;
  color: #f6ecd0; background: radial-gradient(120% 90% at 100% 0%, rgba(212,175,55,.28), transparent 55%), radial-gradient(90% 80% at 0% 100%, rgba(157,123,255,.22), transparent 60%), linear-gradient(135deg, #17130a 0%, #0c0d14 45%, #050509 100%);
  border: 1px solid rgba(243,217,133,.35); box-shadow: 0 24px 50px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.12); isolation: isolate; }
.bank-card > * { position: relative; z-index: 1; }
.bank-card .bc-shine { position: absolute !important; z-index: 0 !important; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255,240,190,.14) 46%, transparent 60%); transform: translateX(-100%); animation: sweep 6s ease-in-out infinite; }
.bank-card .bc-grain { position: absolute !important; z-index: 0 !important; inset: 0; opacity: .35; background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.025) 0 2px, transparent 2px 5px); }
.bc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bc-bank { font-size: 16px; font-weight: 750; letter-spacing: .02em; color: var(--gold-hi); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bc-mark { width: 34px; height: 34px; flex: none; }
.bc-mid { display: flex; align-items: center; gap: 12px; }
.bc-chip { position: relative; width: 44px; height: 34px; border-radius: 7px; background: linear-gradient(135deg, #f7dd8e, #c9a03a 45%, #f1d27a 70%, #a8862a); box-shadow: inset 0 0 0 1px rgba(80,60,10,.45); overflow: hidden; }
.bc-chip i { position: absolute; background: rgba(80,60,10,.45); }
.bc-chip i:nth-child(1) { left: 0; right: 0; top: 50%; height: 1px; }
.bc-chip i:nth-child(2) { top: 0; bottom: 0; left: 35%; width: 1px; }
.bc-chip i:nth-child(3) { top: 0; bottom: 0; left: 65%; width: 1px; }
.bc-wave { color: rgba(246,236,208,.7); }
.bc-wave svg.i { width: 22px; height: 22px; }
.bc-num { direction: ltr; unicode-bidi: isolate; text-align: left; font-family: var(--mono); font-size: clamp(17px, 5.6vw, 23px); font-weight: 600; letter-spacing: .1em; color: #fff6dc; text-shadow: 0 1px 0 rgba(0,0,0,.5), 0 0 12px rgba(212,175,55,.25); white-space: nowrap; }
.bc-bottom { display: flex; flex-direction: column; gap: 2px; }
.bc-lbl { font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: rgba(246,236,208,.55); }
.bc-holder { font-size: 15px; font-weight: 650; letter-spacing: .03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bank-card.ghost { background: rgba(255,255,255,.02); border: 1.5px dashed rgba(243,217,133,.35); box-shadow: none; color: var(--text-3); }
.bank-card.ghost .bc-shine, .bank-card.ghost .bc-grain { display: none; }
.bank-card.ghost .bc-chip { background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); }
.bank-card.ghost .bc-chip i { background: rgba(255,255,255,.08); }
.bank-card.ghost .bc-num, .bank-card.ghost .bc-bank, .bank-card.ghost .bc-holder { color: var(--text-3); text-shadow: none; opacity: .6; }
.bank-card.ghost .bc-mark { opacity: .5; }
.bc-soon { position: absolute !important; inset: 0; display: grid; place-items: center; }
.bc-soon span { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 99px; color: var(--gold-hi); background: rgba(8,10,22,.85); border: 1px solid rgba(212,175,55,.35); box-shadow: 0 10px 26px rgba(0,0,0,.4); }
.bc-soon svg.i { width: 16px; height: 16px; }
.bc-soon b { font-size: 13.5px; font-weight: 700; }
.bank-card.compact { max-width: 340px; padding: 16px 18px; border-radius: 18px; }
.bank-card.compact .bc-num { font-size: 18px; }
.bc-copy { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 12px auto 0; height: 40px; padding: 0 16px; border-radius: 20px; font-size: 13.5px; font-weight: 650; color: var(--gold-hi); background: var(--gold-soft); border: 1px solid rgba(212,175,55,.3); }
.bc-copy svg.i { width: 16px; height: 16px; }
.dp-sum { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; padding: 12px 14px; margin: 4px 0 12px; border-radius: 14px; background: rgba(255,255,255,.04); font-size: 13.5px; color: var(--text-2); }
.dp-sum b { text-align: end; color: var(--text); }
.tu-sheet .field input { width: 100%; padding: 14px; border-radius: 14px; font-size: 18px; letter-spacing: .08em; background: rgba(255,255,255,.04); border: 1px solid var(--line-2); text-align: center; }
.rv-anim { position: relative; width: 92px; height: 92px; margin: 6px auto 4px; display: grid; place-items: center; }
.rv-anim i { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid var(--info); opacity: 0; animation: tuRing 2.6s var(--ease) infinite; }
.rv-anim i:nth-child(2) { animation-delay: .85s; } .rv-anim i:nth-child(3) { animation-delay: 1.7s; }
.rv-anim span { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; color: #d9e8ff; background: radial-gradient(circle, rgba(103,168,255,.35), rgba(20,25,46,.9)); box-shadow: 0 0 30px rgba(103,168,255,.35); animation: glow 2.6s ease-in-out infinite; }
.rv-anim span svg.i { width: 24px; height: 24px; }
.tu-elapsed { text-align: center; }
.pf-cardprev { display: grid; place-items: center; padding: 4px 0 6px; }
.tp-row { grid-template-columns: 1fr auto auto; }
.tp-acts { grid-column: 1 / -1; display: flex; gap: 8px; }
.tp-acts .btn { flex: 1; }

@media (prefers-reduced-motion: reduce) {
  .nx-svg .nx-orbit, .nx-svg .nx-hub, .nx-svg .nx-pulse, .nx-svg .nx-sat, .nx-svg .nx-halo, .bank-card .bc-shine, .rv-anim i, .wl-prog-ic i { animation: none !important; }
  .nx-svg .nx-pulse { opacity: 0; }
}
.nexus-mark.small { background: none; }
.nexus-mark img { object-fit: cover; transform: scale(1.04); }
/* the official emblem is a complete frame: no circular crop, no extra rings around it */
.nexus-mark:not(.small):not(.plain) { border-radius: 0; background: none; overflow: visible; }
.nexus-mark:not(.small):not(.plain) img { transform: scale(1.12); filter: drop-shadow(0 10px 26px rgba(0,0,0,.5)); }
.core { width: 128px; height: 128px; }
.core .core-ring, .lock .av .core-ring, .lock .av .soon-orbit, .chat-intro .av .core-ring, .ai-orb .core-ring, .about .av .core-ring, .profile .av .core-ring { display: none; }
.core .nexus-mark, .lock .av .nexus-mark, .chat-intro .av .nexus-mark, .about .av .nexus-mark, .profile .av .nexus-mark { box-shadow: none; border: 0; }
.radar .core-av { border: 0; box-shadow: none; background: none; overflow: visible; }
@media (max-width: 380px) { .appr-btns .btn { padding: 0 6px; gap: 5px; font-size: 14px; } .appr-btns .btn svg.i { display: none; } }
