/* Weeh — هوية زرقاء ملكية زجاجية بلمعة سيراميك حريرية، نهاري وليلي */
:root {
  --pri: #1E3A8A; --pri2: #2F5BEA; --pri3: #3B6EF0; --acc: #38BDF8; --ok: #16A34A; --bad: #DC2626; --warn: #B45309;
  --bg: #E9EEF9; --bg2: #F5F7FD; --panel: rgba(255, 255, 255, .82); --solid: #FFFFFF; --text: #0F172A; --mut: #5B6B86;
  --line: rgba(30, 58, 138, .12); --hover: rgba(47, 91, 234, .07); --sel: rgba(47, 91, 234, .12);
  --me: linear-gradient(180deg, #E3ECFF, #CFDDFF); --me-line: rgba(47, 91, 234, .22); --them: #FFFFFF; --tick: #2F5BEA;
  --glass: linear-gradient(160deg, #3463EE 0%, #1E3A8A 58%, #14286E 100%);
  --sheen: linear-gradient(180deg, rgba(255, 255, 255, .34) 0%, rgba(255, 255, 255, .08) 42%, rgba(255, 255, 255, 0) 60%);
  --shadow: 0 10px 30px rgba(15, 31, 102, .14); --r: 16px;
  --font: 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  --wall-img: none; --fs: 15px;
}
[data-theme=dark] {
  --bg: #060A18; --bg2: #0A1024; --panel: rgba(14, 21, 46, .86); --solid: #0E1530; --text: #E6ECFA; --mut: #93A3C0;
  --line: rgba(148, 163, 184, .14); --hover: rgba(99, 140, 255, .08); --sel: rgba(99, 140, 255, .16);
  --me: linear-gradient(180deg, #2A4BB8, #1E3A8A); --me-line: rgba(147, 180, 255, .25); --them: #131C3C; --tick: #7DD3FC;
  --glass: linear-gradient(160deg, #1F3C9C 0%, #13245E 60%, #0B1640 100%);
  --sheen: linear-gradient(180deg, rgba(255, 255, 255, .18) 0%, rgba(255, 255, 255, .04) 45%, rgba(255, 255, 255, 0) 60%);
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
}
[data-fs=s] { --fs: 14px } [data-fs=m] { --fs: 15px } [data-fs=l] { --fs: 17px } [data-fs=xl] { --fs: 19px }
* { box-sizing: border-box }
html, body { height: 100%; margin: 0 }
body { font-family: var(--font); font-size: var(--fs); color: var(--text); background: var(--bg); -webkit-tap-highlight-color: transparent; overflow: hidden }
button, input, textarea, select { font: inherit; color: inherit }
button { cursor: pointer; background: none; border: 0 }
a { color: var(--pri2) } [data-theme=dark] a { color: #93C5FD }
.hidden { display: none !important }
.grow { flex: 1 }
.small, small { font-size: .82em }
.w-muted { color: var(--mut) }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px }

/* زجاج ولمعة سيراميك */
.glass { position: relative; background: var(--glass); color: #fff; isolation: isolate }
.glass::after { content: ""; position: absolute; inset: 0; background: var(--sheen); pointer-events: none; z-index: -1; border-radius: inherit }
.w-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .62rem 1.1rem; border-radius: 999px;
  background: var(--glass); color: #fff; font-weight: 600; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -2px 6px rgba(0, 0, 0, .22), 0 6px 16px rgba(30, 58, 138, .28); overflow: hidden; text-decoration: none }
.w-btn::after { content: ""; position: absolute; inset: 0 0 50% 0; background: linear-gradient(180deg, rgba(255, 255, 255, .38), rgba(255, 255, 255, 0)); border-radius: inherit; pointer-events: none }
.w-btn:hover { filter: brightness(1.08) } .w-btn:active { transform: translateY(1px) } .w-btn:disabled { opacity: .55; cursor: default }
.w-btn.ghost { background: var(--hover); color: var(--pri2); box-shadow: inset 0 0 0 1px var(--line) } .w-btn.ghost::after { display: none }
[data-theme=dark] .w-btn.ghost { color: #BFD3FF }
.w-btn.danger { background: linear-gradient(160deg, #EF4444, #B91C1C) }
.w-btn.sm { padding: .42rem .8rem; font-size: .88em } .w-btn.block { width: 100%; margin-top: 1rem; padding: .8rem }
.w-ib { width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 1.15em; flex: none; cursor: pointer }
.w-ib:hover { background: rgba(255, 255, 255, .14) } .w-chat .w-compose .w-ib:hover, .w-sv .w-ib:hover { background: var(--hover) }
.w-link { color: var(--pri2); text-decoration: underline; padding: .3rem 0 }
input, textarea, select { width: 100%; padding: .7rem .85rem; border-radius: 12px; border: 1px solid var(--line); background: var(--solid); outline: none; transition: border .15s, box-shadow .15s }
input:focus, textarea:focus { border-color: var(--pri3); box-shadow: 0 0 0 3px rgba(59, 110, 240, .18) }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--pri2) }
.w-lbl { display: block; font-weight: 600; font-size: .9em; margin: .9rem 0 .35rem }
.w-hint { display: block; color: var(--mut); margin-top: .3rem } .w-hint.ok { color: var(--ok) } .w-hint.bad { color: var(--bad) }
.w-row { display: flex; gap: .5rem; align-items: center; margin-top: .8rem } .w-row.end { justify-content: flex-end } .w-row.center { justify-content: center }
.w-row input { flex: 1 }

/* الإقلاع */
.w-boot { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 1.2rem; background: radial-gradient(circle at 50% 30%, #2F5BEA, #0F1F66 70%) }
.w-boot img { filter: drop-shadow(0 12px 24px rgba(0, 0, 0, .35)) }
.w-boot-err { color: #fff; max-width: 280px; text-align: center }
.w-spin { width: 30px; height: 30px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .25); border-top-color: #fff; animation: spin 0.9s linear infinite; margin: 1rem auto }
.w-panel-body .w-spin, .w-sv .w-spin { border-color: var(--line); border-top-color: var(--pri2) }
@keyframes spin { to { transform: rotate(360deg) } }

/* شاشة الدخول */
.w-auth { position: fixed; inset: 0; overflow: auto; display: grid; place-items: center; padding: 1.2rem;
  background: radial-gradient(1200px 600px at 80% -10%, #3B6EF0 0%, transparent 60%), radial-gradient(900px 600px at 0% 110%, #38BDF8 0%, transparent 55%), linear-gradient(160deg, #1E3A8A, #0B1640) }
.w-auth-card { width: min(420px, 100%); padding: 1.6rem 1.4rem; border-radius: 26px; background: rgba(255, 255, 255, .9); color: var(--text);
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); box-shadow: 0 30px 60px rgba(4, 12, 45, .45), inset 0 1px 0 rgba(255, 255, 255, .8) }
[data-theme=dark] .w-auth-card { background: rgba(14, 21, 46, .88) }
.w-auth-card.glass { background: rgba(255, 255, 255, .9) } [data-theme=dark] .w-auth-card.glass { background: rgba(14, 21, 46, .88) }
.w-auth-card.glass::after { display: none }
.w-brand { text-align: center; margin-bottom: 1rem }
.w-brand img { filter: drop-shadow(0 10px 18px rgba(30, 58, 138, .35)) }
.w-brand h1 { margin: .4rem 0 .1rem; font-size: 2rem; letter-spacing: .5px; background: linear-gradient(180deg, #3B6EF0, #1E3A8A); -webkit-background-clip: text; background-clip: text; color: transparent; font-family: 'Segoe UI', var(--font) }
[data-theme=dark] .w-brand h1 { background: linear-gradient(180deg, #BFD3FF, #6B93FF); -webkit-background-clip: text; background-clip: text }
.w-brand p { margin: 0; color: var(--mut) }
.w-seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--hover); border-radius: 999px; padding: 4px; margin: .6rem 0 .4rem }
.w-seg button { padding: .55rem; border-radius: 999px; font-weight: 600; color: var(--mut) }
.w-seg button.on { background: var(--solid); color: var(--pri2); box-shadow: 0 2px 8px rgba(30, 58, 138, .15) }
.w-phone { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--solid) }
.w-phone span { display: grid; place-items: center; padding: 0 .75rem; background: var(--hover); font-weight: 600; white-space: nowrap; border-inline-end: 1px solid var(--line) }
.w-phone input { border: 0; border-radius: 0; letter-spacing: 1px } .w-phone input:focus { box-shadow: none }
.w-phone:focus-within { border-color: var(--pri3); box-shadow: 0 0 0 3px rgba(59, 110, 240, .18) }
.w-pass { position: relative } .w-pass button { position: absolute; inset-inline-end: .4rem; top: 50%; transform: translateY(-50%); opacity: .6 }
.w-check { display: flex; gap: .55rem; align-items: flex-start; margin-top: 1rem; font-size: .88em; line-height: 1.6 } .w-check input { margin-top: .3rem }

/* القفل */
.w-lock { position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; color: #fff; background: linear-gradient(160deg, #1E3A8A, #0B1640) }
.w-lock h2 { margin: .5rem 0 0 } .w-lock p { margin: 0; opacity: .8 }
.w-dots { display: flex; gap: .7rem; margin: 1.2rem 0 } .w-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff } .w-dots i.on { background: #fff }
.w-keypad { display: grid; grid-template-columns: repeat(3, 72px); gap: .9rem }
.w-keypad button { height: 72px; border-radius: 50%; font-size: 1.6rem; color: #fff; background: rgba(255, 255, 255, .12); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25) }
.w-keypad button:active { background: rgba(255, 255, 255, .28) }
.w-lock .w-link { color: #BFD3FF; margin-top: 1rem }
.shake { animation: shake .4s } @keyframes shake { 25% { transform: translateX(-10px) } 75% { transform: translateX(10px) } }

/* التخطيط */
.w-app { position: fixed; inset: 0; display: grid; grid-template-columns: minmax(330px, 400px) 1fr; grid-template-rows: minmax(0, 1fr); background: var(--bg) }
.w-side { position: relative; display: flex; flex-direction: column; min-height: 0; background: var(--bg2); border-inline-end: 1px solid var(--line) }
.w-top { display: flex; align-items: center; gap: .4rem; min-height: 60px; padding: .5rem .7rem; padding-top: max(.5rem, env(safe-area-inset-top)); box-shadow: 0 4px 18px rgba(15, 31, 102, .18); z-index: 2 }
.w-top h1, .w-top h2 { margin: 0; font-size: 1.3em; font-weight: 700; flex: 1; letter-spacing: .3px }
.w-top-act { display: flex; gap: .1rem }
.w-panes { flex: 1; min-height: 0; position: relative }
.w-pane { position: absolute; inset: 0; overflow-y: auto; padding-bottom: 90px; display: none } .w-pane.on { display: block }
.w-tabs { display: grid; grid-template-columns: repeat(4, 1fr); padding: .3rem .3rem max(.3rem, env(safe-area-inset-bottom)); box-shadow: 0 -4px 18px rgba(15, 31, 102, .16) }
.w-tabs button { position: relative; display: flex; flex-direction: column; align-items: center; gap: .1rem; padding: .35rem 0; color: rgba(255, 255, 255, .72); font-size: .78em; font-weight: 600; border-radius: 14px }
.w-tabs button i { font-style: normal; font-size: 1.35em; width: 54px; height: 30px; display: grid; place-items: center; border-radius: 999px; transition: background .2s }
.w-tabs button.on { color: #fff } .w-tabs button.on i { background: rgba(255, 255, 255, .2); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35) }
.w-tabs .w-badge { position: absolute; top: .1rem; inset-inline-start: calc(50% + 8px) }
.w-dot { position: absolute; top: .35rem; inset-inline-start: calc(50% + 12px); width: 9px; height: 9px; border-radius: 50%; background: var(--acc); box-shadow: 0 0 0 2px #1E3A8A }
.w-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: linear-gradient(180deg, #3B6EF0, #1E3A8A); color: #fff; font-size: .72rem; display: inline-grid; place-items: center; font-weight: 700; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4) }
.w-tabs .w-badge { background: #fff; color: var(--pri) }
.w-fab { position: absolute; inset-inline-start: 1rem; bottom: 82px; width: 56px; height: 56px; border-radius: 18px; font-size: 1.4rem; color: #fff; z-index: 3;
  background: var(--glass); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), inset 0 -3px 8px rgba(0, 0, 0, .25), 0 10px 24px rgba(30, 58, 138, .45); overflow: hidden }
.w-fab::after { content: ""; position: absolute; inset: 0 0 52% 0; background: linear-gradient(180deg, rgba(255, 255, 255, .45), rgba(255, 255, 255, 0)) }

/* القوائم */
.w-search { padding: .6rem .7rem 0 } .w-search input { border-radius: 999px; background: var(--solid) }
.w-chips { display: flex; gap: .4rem; padding: .6rem .7rem; overflow-x: auto; scrollbar-width: none } .w-chips.wrap { flex-wrap: wrap; padding: .5rem 0 }
.w-chips button { padding: .35rem .85rem; border-radius: 999px; background: var(--hover); color: var(--mut); font-weight: 600; font-size: .88em; white-space: nowrap; border: 1px solid transparent }
.w-chips button.on { background: var(--sel); color: var(--pri2); border-color: var(--me-line) } [data-theme=dark] .w-chips button.on { color: #BFD3FF }
.w-arch { display: flex; width: 100%; gap: .6rem; padding: .7rem 1.1rem; color: var(--mut); font-weight: 600 } .w-arch b { margin-inline-start: auto; color: var(--pri2) }
.w-list { list-style: none; margin: 0; padding: 0 } .w-list.sm { max-height: 50vh; overflow: auto; margin-top: .6rem }
.w-item { display: flex; align-items: center; gap: .75rem; width: 100%; padding: .62rem .9rem; text-align: start; border-radius: 0; transition: background .12s; cursor: pointer }
.w-item:hover { background: var(--hover) } .w-item.on { background: var(--sel) }
.w-item .meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem; border-bottom: 1px solid var(--line); padding-bottom: .55rem }
.w-item .top { display: flex; justify-content: space-between; align-items: center; gap: .5rem }
.w-item .top b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600 }
.w-item time { font-size: .75em; color: var(--mut); white-space: nowrap } .w-item.unread time { color: var(--pri2); font-weight: 700 }
.w-item .prev { display: flex; justify-content: space-between; align-items: center; gap: .4rem; color: var(--mut); font-size: .9em }
.w-item .prev > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.w-item .ic { display: flex; align-items: center; gap: .25rem; flex: none; font-size: .9em }
.w-item.unread .prev > span:first-child { color: var(--text); font-weight: 500 }
.w-item .chev { color: var(--mut); font-size: 1.4em }
.w-item.add .w-av { background: var(--glass); color: #fff }
.w-none { padding: 2rem 1rem; color: var(--mut); text-align: center; line-height: 1.9 }
.w-tag { font-style: normal; font-size: .7em; padding: .1rem .45rem; border-radius: 999px; background: var(--sel); color: var(--pri2); font-weight: 700 }
.w-sec { margin: 1rem .9rem .35rem; color: var(--pri2); font-size: .85em; font-weight: 700 } [data-theme=dark] .w-sec { color: #93C5FD }
.w-panel-body .w-sec { margin-inline: 0 }

/* الصورة الرمزية */
.w-av { position: relative; flex: none; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; overflow: visible;
  background: linear-gradient(160deg, hsl(var(--h) 75% 58%), hsl(var(--h) 70% 36%)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -2px 6px rgba(0, 0, 0, .18) }
.w-av img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover }
.w-on { position: absolute; bottom: 1px; inset-inline-end: 1px; width: 13px; height: 13px; border-radius: 50%; background: #22C55E; border: 2px solid var(--bg2) }

/* المحادثة */
.w-chat { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--bg) }
.w-empty { margin: auto; text-align: center; max-width: 420px; padding: 2rem; color: var(--mut) }
.w-empty h2 { color: var(--text); margin: .6rem 0 .3rem } .w-empty img { filter: drop-shadow(0 14px 28px rgba(30, 58, 138, .3)) }
.w-conv { flex: 1; min-height: 0; display: flex; flex-direction: column }
.w-chead { flex: 1; min-width: 0; display: flex; align-items: center; gap: .6rem; text-align: start; color: #fff }
.w-chead .t { display: flex; flex-direction: column; min-width: 0 } .w-chead b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.w-chead small { opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .78em } .w-chead small.typing { color: #A5F3FC; font-weight: 600; opacity: 1 }
#back { display: none }
.w-csearch { padding: .5rem .8rem; background: var(--bg2); border-bottom: 1px solid var(--line) }
.w-msgs { flex: 1; min-height: 0; overflow-y: auto; padding: .8rem 4% 1rem; background-color: var(--bg); background-image: var(--wall); background-size: var(--wall-size, auto); background-attachment: local }
:root { --wall: radial-gradient(circle at 20px 20px, rgba(47, 91, 234, .07) 2px, transparent 3px), radial-gradient(circle at 60px 60px, rgba(56, 189, 248, .07) 2px, transparent 3px); --wall-size: 80px 80px }
[data-wall=silk] { --wall: linear-gradient(160deg, rgba(59, 110, 240, .18), rgba(56, 189, 248, .10) 50%, rgba(30, 58, 138, .2)); --wall-size: cover }
[data-wall=night] { --wall: radial-gradient(circle at 30% 20%, rgba(59, 110, 240, .35), transparent 50%), linear-gradient(180deg, #0B1640, #060A18); --wall-size: cover }
[data-wall=sand] { --wall: linear-gradient(180deg, #F6EBD9, #EAD8BC); --wall-size: cover }
[data-wall=mint] { --wall: linear-gradient(180deg, #DDF4EE, #C3E9DF); --wall-size: cover }
[data-wall=plain] { --wall: none }
[data-wall=custom] { --wall: var(--wall-img); --wall-size: cover }
[data-theme=dark][data-wall=sand] .w-msgs, [data-theme=dark][data-wall=mint] .w-msgs { filter: brightness(.9) }
.w-day { display: flex; justify-content: center; margin: .8rem 0 .5rem; position: sticky; top: .3rem; z-index: 1 }
.w-day span { padding: .25rem .8rem; border-radius: 10px; background: var(--panel); backdrop-filter: blur(8px); font-size: .75em; color: var(--mut); box-shadow: 0 1px 4px rgba(0, 0, 0, .08) }
.w-sys { margin: .6rem auto; max-width: 85%; width: fit-content; padding: .35rem .8rem; border-radius: 10px; background: rgba(250, 204, 21, .16); color: var(--text); font-size: .8em; text-align: center }
.w-older { display: block; margin: .3rem auto .8rem; padding: .35rem 1rem; border-radius: 999px; background: var(--panel); color: var(--pri2); font-size: .85em; box-shadow: 0 1px 4px rgba(0, 0, 0, .08) }
.w-msg { display: flex; margin-top: .45rem } .w-msg.cont { margin-top: .12rem }
.w-msg.me { justify-content: flex-end } .w-msg.them { justify-content: flex-start }
.bub { position: relative; max-width: min(78%, 560px); padding: .45rem .65rem .3rem; border-radius: 16px; box-shadow: 0 1px 2px rgba(15, 31, 102, .12); line-height: 1.55; word-wrap: break-word; overflow-wrap: anywhere }
.w-msg.me .bub { background: var(--me); border: 1px solid var(--me-line); border-start-end-radius: 4px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 1px 2px rgba(15, 31, 102, .12) }
[data-theme=dark] .w-msg.me .bub { color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 1px 2px rgba(0, 0, 0, .3) }
.w-msg.them .bub { background: var(--them); border-start-start-radius: 4px }
.w-msg.cont.me .bub { border-start-end-radius: 16px } .w-msg.cont.them .bub { border-start-start-radius: 16px }
.bub .who { display: block; font-size: .8em; margin-bottom: .1rem }
.bub .txt { white-space: normal } .bub .cap { margin-top: .3rem }
.bub .ft { display: flex; justify-content: flex-end; align-items: center; gap: .25rem; font-size: .68em; color: var(--mut); margin-top: .1rem; float: left; margin-inline-start: .8rem; position: relative; top: .3rem }
[data-theme=dark] .w-msg.me .ft { color: #C7D6FF }
.bub::after { content: ""; display: block; clear: both }
.tk { font-style: normal; letter-spacing: -3px; padding-inline-end: 3px } .tk.read { color: var(--tick); font-weight: 700 }
.w-more { position: absolute; top: .15rem; inset-inline-end: .2rem; width: 26px; height: 22px; border-radius: 8px; background: inherit; opacity: 0; color: var(--mut); transition: opacity .12s }
.w-msg:hover .w-more, .w-more:focus { opacity: 1 }
.w-gone { color: var(--mut); font-size: .92em }
.w-quote { display: flex; flex-direction: column; padding: .3rem .55rem; margin-bottom: .3rem; border-radius: 10px; background: rgba(30, 58, 138, .08); border-inline-start: 3px solid var(--pri2); font-size: .85em; cursor: pointer }
[data-theme=dark] .w-quote { background: rgba(255, 255, 255, .08) }
.w-quote span { color: var(--mut); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px }
.w-msg.flash .bub { animation: flash 1.2s } @keyframes flash { 30% { box-shadow: 0 0 0 4px var(--acc) } }
.w-media { display: block; margin: -.1rem -.35rem .1rem; border-radius: 12px; overflow: hidden; background: rgba(0, 0, 0, .06); min-width: 200px; min-height: 120px }
.w-media img, .w-media video { display: block; width: 100%; max-width: 360px; max-height: 420px; object-fit: cover; background: #000 }
.w-media.img img:not([src]) { height: 180px; background: linear-gradient(90deg, rgba(0, 0, 0, .05), rgba(0, 0, 0, .1), rgba(0, 0, 0, .05)); background-size: 200%; animation: shimmer 1.2s infinite }
@keyframes shimmer { to { background-position: -200% 0 } }
.w-voice { display: flex; align-items: center; gap: .4rem; min-width: 240px } .w-voice audio { height: 38px; flex: 1; min-width: 200px }
.w-doc { display: flex; align-items: center; gap: .6rem; padding: .5rem; border-radius: 12px; background: rgba(30, 58, 138, .07); min-width: 240px; margin-bottom: .2rem }
[data-theme=dark] .w-doc { background: rgba(255, 255, 255, .07) }
.w-doc .ic { width: 42px; height: 48px; border-radius: 8px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: .7em; flex: none; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4) }
.w-doc .ic.pdf { background: linear-gradient(180deg, #EF4444, #B91C1C) } .w-doc .ic.doc { background: linear-gradient(180deg, #3B82F6, #1D4ED8) }
.w-doc .nm { flex: 1; min-width: 0; display: flex; flex-direction: column } .w-doc .nm b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9em }
.w-doc .nm small { color: var(--mut) } .w-doc .act { display: flex; gap: .3rem }
.w-doc .act button { padding: .3rem .6rem; border-radius: 999px; background: var(--solid); color: var(--pri2); font-weight: 600; font-size: .82em; box-shadow: inset 0 0 0 1px var(--line) }
.w-miss { padding: .6rem; color: var(--mut); font-size: .85em }
.w-bar { padding: .8rem; text-align: center; color: var(--mut); background: var(--bg2); border-top: 1px solid var(--line); font-size: .9em }
.w-reply { display: flex; align-items: center; gap: .5rem; padding: .45rem .8rem; background: var(--bg2); border-top: 1px solid var(--line) }
.w-reply > div { flex: 1; min-width: 0; display: flex; flex-direction: column; border-inline-start: 3px solid var(--pri2); padding-inline-start: .6rem }
.w-reply b { color: var(--pri2); font-size: .85em } .w-reply span { color: var(--mut); font-size: .85em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.w-compose, .w-rec { display: flex; align-items: flex-end; gap: .4rem; padding: .5rem .6rem; padding-bottom: max(.5rem, env(safe-area-inset-bottom)); background: var(--bg2); border-top: 1px solid var(--line) }
.w-compose textarea { flex: 1; resize: none; border-radius: 22px; padding: .62rem 1rem; max-height: 140px; line-height: 1.45; background: var(--solid) }
.w-compose label.w-ib { color: var(--mut) }
.w-send { width: 46px; height: 46px; border-radius: 50%; flex: none; color: #fff; font-size: 1.15rem; display: grid; place-items: center; position: relative; overflow: hidden;
  background: var(--glass); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), inset 0 -2px 6px rgba(0, 0, 0, .25), 0 6px 14px rgba(30, 58, 138, .35) }
.w-send::after { content: ""; position: absolute; inset: 0 0 52% 0; background: linear-gradient(180deg, rgba(255, 255, 255, .42), rgba(255, 255, 255, 0)) }
#btnSend { transform: scaleX(-1) }
.w-rec { align-items: center } .w-rec b { font-variant-numeric: tabular-nums } .w-rec .grow { color: var(--mut) }
.w-recdot { width: 12px; height: 12px; border-radius: 50%; background: var(--bad); animation: pulse 1s infinite } @keyframes pulse { 50% { opacity: .3 } }

/* الحالات */
.my-status { padding-inline-end: .5rem } .my-status .meta { border: 0 }
.w-stat-me { display: flex; align-items: center; gap: .75rem; flex: 1; text-align: start; min-width: 0 }
.w-stat-act { display: flex; gap: .2rem } .w-stat-act .w-ib { background: var(--hover); color: var(--pri2) }
.w-ring { position: relative; padding: 3px; border-radius: 50%; background: conic-gradient(var(--mut) 0 360deg); flex: none }
.w-ring.new { background: conic-gradient(from 200deg, #38BDF8, #2F5BEA, #1E3A8A, #38BDF8) }
.w-ring > .w-av { border: 2px solid var(--bg2) }
.w-ring.add { background: none; padding: 0 } .w-ring.add i { position: absolute; bottom: -2px; inset-inline-end: -2px; width: 22px; height: 22px; border-radius: 50%; background: var(--pri2); color: #fff; display: grid; place-items: center; font-style: normal; border: 2px solid var(--bg2); font-size: .85rem }
#pane-updates > div > p { padding: 0 .9rem }
.w-st-compose { border-radius: 18px; min-height: 260px; display: grid; place-items: center; padding: 1.4rem; transition: background .2s }
.w-st-compose textarea { background: transparent; border: 0; color: #fff; text-align: center; font-size: 1.4rem; font-weight: 600; min-height: 200px; resize: none }
.w-st-compose textarea::placeholder { color: rgba(255, 255, 255, .7) } .w-st-compose textarea:focus { box-shadow: none }
.w-colors { display: flex; gap: .5rem; justify-content: center; margin-top: .8rem } .w-colors button { width: 30px; height: 30px; border-radius: 50%; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 0 0 2px var(--solid), 0 0 0 3px var(--line) }
.w-st-prev img, .w-st-prev video { width: 100%; max-height: 60vh; object-fit: contain; border-radius: 14px; background: #000; margin-bottom: .6rem }
.w-sv { position: fixed; inset: 0; z-index: 70; background: #000; color: #fff; display: flex; flex-direction: column }
.w-sv-bars { display: flex; gap: 4px; padding: max(.6rem, env(safe-area-inset-top)) .7rem .3rem; z-index: 3 }
.w-sv-bars i { flex: 1; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .3); overflow: hidden } .w-sv-bars i.done b { width: 100% }
.w-sv-bars b { display: block; height: 100%; width: 0; background: #fff }
.w-sv-top { display: flex; align-items: center; gap: .6rem; padding: .3rem .7rem; z-index: 3 } .w-sv-top span { display: flex; flex-direction: column } .w-sv-top small { opacity: .75 }
.w-sv-body { flex: 1; min-height: 0; display: grid; place-items: center; position: relative; touch-action: manipulation }
.w-sv-body img, .w-sv-body video { max-width: 100%; max-height: 100%; object-fit: contain }
.w-sv-text { width: 100%; height: 100%; display: grid; place-items: center; padding: 2rem; text-align: center; font-size: 1.7rem; font-weight: 600; white-space: pre-wrap; overflow-wrap: anywhere }
.w-sv-cap { text-align: center; padding: .6rem 1rem; background: rgba(0, 0, 0, .45) }
.w-sv-foot { display: flex; justify-content: center; gap: .6rem; padding: .7rem; padding-bottom: max(.7rem, env(safe-area-inset-bottom)); z-index: 3 }
.w-sv-foot .w-btn.ghost { color: #fff; background: rgba(255, 255, 255, .14) }
.w-sv-reply { display: flex; gap: .5rem; width: min(560px, 100%) } .w-sv-reply input { border-radius: 999px; background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .25) }
.w-sv-nav { position: absolute; top: 18%; bottom: 18%; width: 28%; z-index: 2 } .w-sv-nav.prev { right: 0 } .w-sv-nav.next { left: 0 }
.w-sv .w-ib:hover { background: rgba(255, 255, 255, .15) }

/* الصفحات الفرعية والإعدادات */
.w-panel { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; background: var(--bg2); animation: slidein .18s ease-out }
@keyframes slidein { from { transform: translateX(-24px); opacity: .4 } }
.w-panel-body { flex: 1; overflow-y: auto; padding: 1rem 1rem 2rem }
#panelBack { color: #fff }
.w-item.me { padding: 1rem } .w-item.me .meta { border: 0 } .w-item.me b { font-size: 1.15em }
.w-menu { display: flex; flex-direction: column; margin: .3rem 0 } .w-menu button { display: flex; align-items: center; gap: 1rem; padding: .8rem 1.1rem; text-align: start }
.w-menu button:hover { background: var(--hover) } .w-menu i { font-style: normal; font-size: 1.3em; width: 28px; text-align: center }
.w-menu span { display: flex; flex-direction: column; border-bottom: 1px solid var(--line); padding-bottom: .6rem; flex: 1 } .w-menu small { color: var(--mut) }
.w-menu .danger b, .w-list-btns .danger { color: var(--bad) }
.w-foot { text-align: center; color: var(--mut); font-size: .8em; margin: 1.5rem 0 }
.w-profile { display: flex; flex-direction: column; align-items: center; gap: .5rem; padding: .5rem 0 1rem; text-align: center } .w-profile h3 { margin: .3rem 0 0 }
.w-card { padding: .8rem .9rem; border-radius: var(--r); background: var(--solid); box-shadow: 0 1px 3px rgba(15, 31, 102, .08); margin: .5rem 0 } .w-card p { margin: .3rem 0 }
.w-radios { display: flex; flex-direction: column; gap: .15rem; margin-top: .4rem } .w-radios label { display: flex; align-items: center; gap: .6rem; padding: .35rem 0; cursor: pointer }
.w-switch { display: flex; align-items: center; gap: 1rem; padding: .8rem .9rem; margin: .5rem 0; border-radius: var(--r); background: var(--solid); cursor: pointer; box-shadow: 0 1px 3px rgba(15, 31, 102, .08) }
.w-switch > span { flex: 1; display: flex; flex-direction: column } .w-switch small { color: var(--mut) }
.w-switch input { position: absolute; opacity: 0; pointer-events: none }
.w-switch i { width: 46px; height: 28px; border-radius: 999px; background: rgba(100, 116, 139, .35); position: relative; transition: background .2s; flex: none }
.w-switch i::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .25); transition: inset-inline-start .2s }
.w-switch input:checked + i { background: var(--glass) } .w-switch input:checked + i::after { inset-inline-start: 21px }
.w-switch input:disabled + i { opacity: .4 } .w-switch input:focus-visible + i { outline: 2px solid var(--acc) }
.w-list-btns { display: flex; flex-direction: column; margin: 1rem 0; border-radius: var(--r); overflow: hidden; background: var(--solid) }
.w-list-btns button { padding: .85rem 1rem; text-align: start; border-bottom: 1px solid var(--line) } .w-list-btns button:hover { background: var(--hover) }
.w-walls { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: .6rem }
.w-walls button { height: 120px; border-radius: 14px; display: flex; align-items: flex-end; justify-content: center; padding: .4rem; font-size: .78em; font-weight: 600; box-shadow: inset 0 0 0 1px var(--line); background: var(--bg) }
.w-walls button span { background: var(--panel); padding: .1rem .5rem; border-radius: 999px }
.w-walls button.on { box-shadow: 0 0 0 3px var(--pri2) }
.wall-default { background-image: radial-gradient(circle at 10px 10px, rgba(47, 91, 234, .15) 2px, transparent 3px) !important; background-size: 22px 22px !important }
.wall-silk { background: linear-gradient(160deg, rgba(59, 110, 240, .4), rgba(56, 189, 248, .25), rgba(30, 58, 138, .45)) !important }
.wall-night { background: linear-gradient(180deg, #1E3A8A, #060A18) !important } .wall-sand { background: linear-gradient(180deg, #F6EBD9, #EAD8BC) !important }
.wall-mint { background: linear-gradient(180deg, #DDF4EE, #C3E9DF) !important } .wall-plain { background: var(--bg) !important }
.wall-custom { background: repeating-linear-gradient(45deg, var(--hover) 0 10px, transparent 10px 20px) !important }
.w-stack { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--hover); margin: .7rem 0 }
.w-legend { display: flex; flex-wrap: wrap; gap: .4rem .9rem; font-size: .82em; margin-bottom: .4rem } .w-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: .3rem }
.w-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px } .w-grid button { position: relative; aspect-ratio: 1; background: var(--hover); border-radius: 6px; overflow: hidden }
.w-grid img, .w-grid video { width: 100%; height: 100%; object-fit: cover } .w-grid .ph { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 1.6rem; text-shadow: 0 2px 6px #000 }
.w-table { width: 100%; border-collapse: collapse; font-size: .88em } .w-table th, .w-table td { padding: .45rem; border-bottom: 1px solid var(--line); text-align: start }
.w-terms { max-height: 60vh; overflow: auto; line-height: 1.85; font-size: .92em }
.w-avpick { width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; font-size: 1.8rem; background: var(--hover) center/cover; box-shadow: inset 0 0 0 2px var(--line); cursor: pointer }

/* النوافذ والقوائم المنبثقة */
.w-modal-bg { position: fixed; inset: 0; z-index: 80; background: rgba(6, 12, 40, .5); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 1rem; animation: fade .15s }
.w-modal-bg.out { opacity: 0; transition: opacity .15s } @keyframes fade { from { opacity: 0 } }
.w-modal { width: min(440px, 100%); max-height: 90vh; overflow: auto; padding: 1.2rem; border-radius: 22px; background: var(--solid); box-shadow: var(--shadow); animation: pop .18s ease-out }
.w-modal.wide { width: min(640px, 100%) } .w-modal h3 { margin: 0 0 .5rem }
@keyframes pop { from { transform: scale(.96); opacity: 0 } }
.w-modal.sheet { align-self: end; width: min(480px, 100%); padding: .5rem 0 max(.5rem, env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; animation: up .2s ease-out }
@media (min-width: 900px) { .w-modal.sheet { align-self: center; border-radius: 22px } }
@keyframes up { from { transform: translateY(30px); opacity: 0 } }
.w-sheet-t { padding: .6rem 1.2rem .4rem; color: var(--mut); font-size: .85em; font-weight: 600 }
.w-sheet-i { display: flex; width: 100%; align-items: center; gap: .9rem; padding: .8rem 1.3rem; text-align: start } .w-sheet-i:hover { background: var(--hover) }
.w-sheet-i span { width: 24px; text-align: center } .w-sheet-i.danger { color: var(--bad) } .w-sheet-i.cancel { justify-content: center; color: var(--mut); border-top: 1px solid var(--line); margin-top: .3rem }
.w-modal hr { border: 0; border-top: 1px solid var(--line) }
.w-confirm { line-height: 1.8; margin: .2rem 0 1rem }
.w-lightbox { width: 100%; max-height: 72vh; object-fit: contain; border-radius: 12px; background: #000 }
.w-toasts { position: fixed; bottom: 96px; left: 50%; transform: translateX(-50%); z-index: 99; display: flex; flex-direction: column; gap: .4rem; align-items: center; pointer-events: none; width: min(92vw, 460px) }
.w-toast { padding: .6rem 1rem; border-radius: 14px; background: rgba(15, 23, 42, .92); color: #fff; font-size: .9em; box-shadow: var(--shadow); animation: up .2s; text-align: center; pointer-events: auto }
.w-toast.bad { background: rgba(185, 28, 28, .95) }

/* الجوال: لوحة واحدة */
@media (max-width: 899px) {
  .w-app { grid-template-columns: 1fr }
  .w-chat { position: fixed; inset: 0; z-index: 20; transform: translateX(-100%); transition: transform .22s ease-out; visibility: hidden }
  .w-app.in-chat .w-chat { transform: none; visibility: visible }
  #back { display: grid; color: #fff }
  .w-empty { display: none }
  .w-more { opacity: .55 }
  .bub { max-width: 86% }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important } }

/* ===== v4.1: الدخول، الدعم، لوحة المجموعة، إدارة Weeh ===== */
.w-pass .w-eye { font-size: 1.15rem; min-width: 40px; min-height: 40px; border-radius: 10px; opacity: .75 }
.w-pass .w-eye:hover, .w-pass .w-eye.on { opacity: 1; background: color-mix(in srgb, var(--pri2) 12%, transparent) }
.w-pass input { padding-inline-end: 3rem }
.w-forgot { text-align: start; margin: .2rem 0 .4rem }
.w-note { background: color-mix(in srgb, var(--pri2) 10%, transparent); border-radius: 12px; padding: .6rem .8rem; font-size: .9rem; margin: .6rem 0 }
.w-support { display: block; width: 100%; margin-top: .9rem; padding: .7rem; border-radius: 14px; border: 1px dashed color-mix(in srgb, var(--pri2) 45%, transparent);
  color: var(--pri2); font-weight: 600; background: transparent }
.w-support:hover { background: color-mix(in srgb, var(--pri2) 8%, transparent) }
.w-ctl { border: 1px solid color-mix(in srgb, var(--pri2) 25%, transparent); border-radius: 16px; padding: .6rem .8rem; margin: .8rem 0 }
.w-ctl h4 { margin: .2rem 0 .4rem; font-size: .95rem } .w-ctl small { display: block; color: var(--mut); margin: -.2rem 0 .3rem }
.w-bar .w-btn { margin-inline-start: .6rem; padding: .35rem .8rem; font-size: .85rem }
.w-av.official { background: linear-gradient(160deg, #3463EE, #1E3A8A) } .w-av.official img { padding: 6px; object-fit: contain }
.w-ann { background: var(--card, rgba(255,255,255,.85)); border-radius: 16px; padding: .8rem 1rem; margin: .6rem 0; box-shadow: 0 1px 3px rgba(0,0,0,.08) }
[data-theme=dark] .w-ann { background: rgba(255,255,255,.06) }
.w-ann b { display: block; margin-bottom: .3rem } .w-ann p { margin: 0; white-space: pre-wrap; line-height: 1.7 } .w-ann time { display: block; color: var(--mut); font-size: .8rem; margin-top: .4rem }
.w-scan { color: var(--mut); font-size: .85rem }
.w-seg .off { opacity: .55 }
