:root {
  --bg: #0b0b0d; --surface: #131317; --surface-2: #1a1a20; --surface-3: #22222a; --border: #26262e; --border-2: #33333d;
  --text: #ececf1; --muted: #8d8d99; --primary: #f2f2f5; --primary-ink: #0b0b0d; --silver: linear-gradient(135deg, #ffffff, #b9b9c6);
  --ok: #3ecf8e; --err: #ff5d6c; --warn: #f5b544; --info: #6ea8fe; --radius: 12px;
  --font: 'IBM Plex Sans Arabic', Tahoma, 'Segoe UI', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.6; -webkit-text-size-adjust: 100%; }
body { padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); overflow-x: clip; }
body.no-scroll { overflow: hidden; }
.icon { flex-shrink: 0; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.3; }
h1 { font-size: 1.6rem; } h3 { font-size: 1.05rem; }
p { margin: 0; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .8em; }
button { font-family: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.row { display: flex; align-items: center; } .gap { gap: .6rem; } .wrap { flex-wrap: wrap; } .end { justify-content: flex-end; } .between { justify-content: space-between; }
.grid { display: grid; gap: 1rem; } .grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); } .grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 1rem; }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 8px; }

/* ---------- buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 1px solid transparent; border-radius: 10px; padding: .55rem 1.1rem; font-size: .92rem; font-weight: 600; cursor: pointer; transition: .15s; white-space: nowrap; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--primary-ink); } .btn-primary:hover:not(:disabled) { background: #fff; transform: translateY(-1px); }
.btn-ghost { background: var(--surface-2); color: var(--text); border-color: var(--border-2); } .btn-ghost:hover:not(:disabled) { background: var(--surface-3); }
.btn-danger { background: rgba(255,93,108,.12); color: var(--err); border-color: rgba(255,93,108,.35); } .btn-danger:hover:not(:disabled) { background: rgba(255,93,108,.22); }
.btn-sm { padding: .3rem .7rem; font-size: .82rem; border-radius: 8px; }
.icon-btn { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 1.1rem; padding: .3rem .5rem; border-radius: 8px; } .icon-btn:hover { background: var(--surface-3); color: var(--text); }
.input { width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--border-2); border-radius: 10px; padding: .55rem .8rem; font: inherit; font-size: .92rem; outline: none; transition: border-color .15s; }
.input:focus { border-color: #8a8a99; box-shadow: 0 0 0 3px rgba(255,255,255,.06); }
select.input { appearance: none; -webkit-appearance: none; cursor: pointer; padding-inline-start: .8rem; padding-left: 2.5rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23a9a9b6' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left .8rem center; background-size: 18px; }
select.input:hover { border-color: #5a5a68; }
select.input option, select.input optgroup { background: var(--surface-2); color: var(--text); }
textarea.input { resize: vertical; min-height: 70px; }
.input-inline { width: auto; min-width: 140px; flex: 1; }
.form { display: flex; flex-direction: column; gap: 1rem; }
.field { display: flex; flex-direction: column; gap: .35rem; }
.field-inline { flex-direction: row; align-items: center; justify-content: space-between; gap: 1rem; padding: .3rem 0; }
.label { font-weight: 600; font-size: .88rem; } .req { color: var(--err); } .help { color: var(--muted); font-size: .78rem; }
.form-actions { margin-top: .4rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background: var(--surface-3); border: 1px solid var(--border-2); border-radius: 24px; cursor: pointer; transition: .2s; }
.slider::before { content: ''; position: absolute; width: 16px; height: 16px; top: 3px; inset-inline-start: 3px; background: #9a9aa6; border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { background: var(--primary-ink); transform: translateX(-20px); }
.tags { display: flex; flex-wrap: wrap; gap: .4rem; padding: .4rem; border: 1px solid var(--border-2); border-radius: 10px; background: var(--bg); align-items: center; min-height: 42px; }
.tag-input { flex: 1; min-width: 120px; background: none; border: 0; outline: none; color: var(--text); font: inherit; padding: .2rem; }
.tags .input-inline { border: 0; background: var(--surface-2); padding: .25rem .6rem; }
.chip { display: inline-flex; align-items: center; gap: .35rem; background: var(--surface-3); border: 1px solid var(--border-2); border-radius: 999px; padding: .15rem .65rem; font-size: .82rem; }
.chip .chip { border: 0; padding: 0; background: none; }
.chip-x { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0 .1rem; font-size: .75rem; } .chip-x:hover { color: var(--err); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.picker { position: relative; } .picker .chip-user { padding: .3rem .8rem; }
.picker-results { position: absolute; z-index: 50; inset-inline: 0; top: calc(100% + 4px); background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 10px; max-height: 260px; overflow: auto; box-shadow: 0 12px 30px rgba(0,0,0,.5); }
.picker-item { display: flex; align-items: center; gap: .6rem; width: 100%; background: none; border: 0; color: var(--text); padding: .5rem .8rem; cursor: pointer; text-align: start; font: inherit; } .picker-item:hover { background: var(--surface-3); }
.picker-empty { padding: .8rem; color: var(--muted); text-align: center; }

/* ---------- cards & tables */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; padding: .9rem 1.1rem; border-bottom: 1px solid var(--border); }
.card-body { padding: 1.1rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.3rem; }
.page-head .muted { margin-top: .2rem; font-size: .9rem; }
.table-wrap { overflow-x: auto; border-radius: 10px; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: start; color: var(--muted); font-weight: 500; font-size: .78rem; padding: .6rem .8rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: .65rem .8rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; } .table tbody tr:hover { background: rgba(255,255,255,.02); }
.table .actions { text-align: end; white-space: nowrap; } .table .actions .btn { margin-inline-start: .3rem; }
.badge { display: inline-block; padding: .1rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.badge-ok { color: var(--ok); background: rgba(62,207,142,.1); border-color: rgba(62,207,142,.3); }
.badge-off, .badge-err { color: var(--err); background: rgba(255,93,108,.1); border-color: rgba(255,93,108,.3); }
.badge-warn { color: var(--warn); background: rgba(245,181,68,.1); border-color: rgba(245,181,68,.3); }
.badge-info { color: var(--info); background: rgba(110,168,254,.1); border-color: rgba(110,168,254,.3); }
.badge-muted { color: var(--muted); background: var(--surface-2); border-color: var(--border-2); }
.avatar { border-radius: 50%; background: var(--surface-3); object-fit: cover; flex-shrink: 0; vertical-align: middle; }
.user-cell { display: inline-flex; align-items: center; gap: .5rem; } .user-cell .id, .id { color: var(--muted); direction: ltr; }
.id-chip { background: var(--surface-2); border: 1px solid var(--border-2); color: var(--muted); border-radius: 6px; padding: .05rem .5rem; font-family: ui-monospace, Menlo, monospace; font-size: .75rem; cursor: pointer; direction: ltr; } .id-chip:hover { color: var(--text); }
.pager { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-top: 1rem; }
.tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--border); margin-bottom: 1.2rem; overflow-x: auto; }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); padding: .6rem 1rem; cursor: pointer; font: inherit; font-weight: 600; white-space: nowrap; margin-bottom: -1px; } .tab:hover { color: var(--text); } .tab.active { color: var(--text); border-bottom-color: var(--primary); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .9rem; margin-bottom: 1.2rem; }
.stat { display: flex; gap: .9rem; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; }
.stat-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--surface-3); display: grid; place-items: center; font-size: 1.25rem; flex-shrink: 0; }
.stat-value { font-size: 1.35rem; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; } .stat-label { color: var(--muted); font-size: .8rem; } .stat-hint { color: var(--muted); font-size: .72rem; }
.empty { text-align: center; padding: 2.2rem 1rem; color: var(--muted); } .empty-icon { font-size: 2rem; margin-bottom: .4rem; opacity: .7; }
/* ---------- هياكل التحميل (Skeleton/Shimmer): تحلّ محل الدائرة الدوّارة؛ أبعادها مطابقة للمحتوى كي لا تقفز الصفحة */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skel { animation: sk-in .25s ease .12s backwards; } /* لا يظهر قبل 120ms: التحميل السريع لا يومض */
@keyframes sk-in { from { opacity: 0; } }
.sk { position: relative; display: block; overflow: hidden; background: var(--surface-3); border-radius: 8px; }
.sk::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.075), transparent); transform: translateX(-100%); animation: sk-shimmer 1.5s ease-in-out infinite; }
[dir=rtl] .sk::after { transform: translateX(100%); animation-name: sk-shimmer-rtl; }
@keyframes sk-shimmer { to { transform: translateX(100%); } }
@keyframes sk-shimmer-rtl { to { transform: translateX(-100%); } }
.sk-line { height: .85rem; max-width: 100%; }
.sk-w25 { width: 25%; } .sk-w30 { width: 30%; } .sk-w35 { width: 35%; } .sk-w40 { width: 40%; } .sk-w45 { width: 45%; } .sk-w50 { width: 50%; } .sk-w55 { width: 55%; } .sk-w60 { width: 60%; } .sk-w67 { width: 67%; } .sk-w70 { width: 70%; } .sk-w80 { width: 80%; } .sk-w90 { width: 90%; } .sk-w100 { width: 100%; }
.sk-h1 { height: 1.7rem; border-radius: 10px; } .sk-big { height: 1.3rem; }
.sk-icon { width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0; }
.sk-input { width: 100%; height: 40px; border-radius: 10px; } .sk-input-s { width: 150px; flex: none; }
.sk-btn { width: 110px; height: 34px; border-radius: 10px; }
.sk-avatar { width: 68px; height: 68px; border-radius: 20px; flex-shrink: 0; } .sk-avatar-s { width: 56px; height: 56px; border-radius: 16px; }
.sk-image { width: 100%; max-width: 620px; height: 260px; border-radius: 12px; }
.sk-grow { flex: 1; min-width: 0; display: grid; gap: .55rem; align-content: center; }
.sk-stack { display: grid; gap: .95rem; }
.sk-row { display: grid; gap: 1rem; align-items: center; } .sk-cols-3 { grid-template-columns: 2fr 1fr 1fr; } .sk-cols-4 { grid-template-columns: 2fr 1fr 1fr 1fr; }
.sk-thead .sk-line { height: .7rem; opacity: .7; }
.sk-filters { display: flex; gap: .6rem; margin-bottom: 1rem; flex-wrap: wrap; } .sk-filters .sk-input:first-child { max-width: 260px; }
.sk-field { display: grid; gap: .45rem; }
.sk-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 1rem; }
.sk-profile { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.skel-guilds > .sk-h1 { margin-bottom: .7rem; } .skel-guilds > .sk-line + .guild-grid { margin-top: 1.2rem; }
.skel .stat, .skel .card, .skel .guild-card { pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } .sk::after { animation: none; display: none; } }
.toasts { position: fixed; z-index: 200; bottom: 1.2rem; inset-inline-start: 1.2rem; display: flex; flex-direction: column; gap: .5rem; max-width: calc(100vw - 2.4rem); }
.toast { background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 10px; padding: .7rem 1rem; box-shadow: 0 10px 30px rgba(0,0,0,.5); animation: pop .2s ease; transition: opacity .4s; }
.toast-ok { border-inline-start: 3px solid var(--ok); } .toast-err { border-inline-start: 3px solid var(--err); } .toast.out { opacity: 0; }
@keyframes pop { from { transform: translateY(10px); opacity: 0; } }
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.65); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 1rem; overflow-y: auto; }
.modal { background: var(--surface); border: 1px solid var(--border-2); border-radius: 16px; width: 100%; max-width: 520px; max-height: calc(100vh - 2rem); display: flex; flex-direction: column; box-shadow: 0 30px 80px rgba(0,0,0,.6); animation: pop .18s ease; }
.modal-wide { max-width: 760px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: .9rem 1.2rem; border-bottom: 1px solid var(--border); }
.modal-body { padding: 1.2rem; overflow-y: auto; }
.confirm-text { margin-bottom: 1.2rem; line-height: 1.8; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1.2rem; font-size: .9rem; } .kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.preview-img { width: 100%; border-radius: 10px; border: 1px solid var(--border-2); background: var(--surface-2); display: block; }
.notice { background: var(--surface-2); border: 1px solid var(--border-2); border-inline-start: 3px solid var(--warn); border-radius: 10px; padding: .7rem 1rem; font-size: .85rem; color: #d0d0da; margin-bottom: 1rem; }
.notice-info { border-inline-start-color: var(--info); }
.sub-card { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: .9rem 1rem; }
.rule-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .2rem; } .rule-head h3 { font-size: .98rem; }
.clip { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }
.chart { width: 100%; height: 190px; display: block; } .chart text { fill: var(--muted); font-size: 10px; font-family: var(--font); } .chart .bar { fill: #d4d4de; } .chart .bar:hover { fill: #fff; } .chart .grid-line { stroke: var(--border); stroke-width: 1; }
.log-line { display: flex; gap: .7rem; align-items: baseline; padding: .5rem 0; border-bottom: 1px solid var(--border); font-size: .86rem; flex-wrap: wrap; } .log-line:last-child { border: 0; }

/* ---------- landing */
.landing { min-height: 100vh; min-height: 100dvh; width: 100%; display: flex; flex-direction: column; overflow-x: clip; background: radial-gradient(900px 500px at 80% -10%, rgba(255,255,255,.07), transparent), radial-gradient(700px 400px at 0% 100%, rgba(140,140,170,.08), transparent); }
.land-nav { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: calc(1rem + env(safe-area-inset-top, 0px)) clamp(1rem, 5vw, 4rem) 1rem; }
.hero { width: 100%; max-width: 1040px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: clamp(1.5rem, 6vw, 4rem) clamp(1rem, 5vw, 2rem); }
.hero-logo { width: clamp(68px, 18vw, 96px); height: clamp(68px, 18vw, 96px); object-fit: contain; border-radius: 22%; margin-bottom: 1.4rem; filter: drop-shadow(0 12px 30px rgba(255,255,255,.12)); }
.hero h1 { font-size: clamp(1.9rem, 7.5vw, 3.6rem); line-height: 1.25; background: var(--silver); -webkit-background-clip: text; background-clip: text; color: transparent; margin-bottom: 1rem; overflow-wrap: anywhere; }
.hero p { max-width: 560px; margin: 0 auto 2rem; color: var(--muted); font-size: clamp(.98rem, 3.6vw, 1.15rem); }
.hero-cta { display: flex; flex-wrap: wrap; gap: .7rem; justify-content: center; width: 100%; }
.btn-lg { padding: .85rem 2rem; font-size: 1.05rem; border-radius: 12px; }
.alert { max-width: 480px; margin: 0 auto 1.5rem; background: rgba(255,93,108,.1); border: 1px solid rgba(255,93,108,.35); color: #ffb3bb; border-radius: 10px; padding: .7rem 1rem; }
.logo { display: inline-flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.2rem; min-width: 0; }
.logo-img { width: 34px; height: 34px; object-fit: contain; border-radius: 9px; flex-shrink: 0; }
.legal-links { display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; justify-content: center; padding: 1.4rem 1rem calc(2rem + env(safe-area-inset-bottom, 0px)); color: var(--muted); font-size: .85rem; } .legal-links a:hover { color: var(--text); }

/* ---------- servers */
.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 1.5rem clamp(1rem, 4vw, 2rem) 4rem; }
.guild-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 1rem; }
.guild-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 1.2rem; display: flex; flex-direction: column; align-items: center; gap: .7rem; text-align: center; transition: .15s; min-width: 0; }
.guild-card b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guild-card:hover { border-color: #55555f; transform: translateY(-2px); }
.guild-icon { width: 68px; height: 68px; border-radius: 20px; background: var(--surface-3); display: grid; place-items: center; font-size: 1.5rem; font-weight: 700; overflow: hidden; flex-shrink: 0; } .guild-icon img { width: 100%; height: 100%; object-fit: cover; }
.section-title { margin: 2rem 0 1rem; font-size: 1.1rem; color: var(--muted); }

/* ---------- shell */
:root { --topbar-h: calc(58px + env(safe-area-inset-top, 0px)); }
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: var(--topbar-h); padding: calc(.65rem + env(safe-area-inset-top, 0px)) clamp(.8rem, 3vw, 1.5rem) .65rem; background: rgba(11,11,13,.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.top-user { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.top-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
.shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: calc(100vh - var(--topbar-h)); min-height: calc(100dvh - var(--topbar-h)); }
.sidebar { border-inline-end: 1px solid var(--border); padding: 1rem .7rem 2rem; position: sticky; top: var(--topbar-h); align-self: start; height: calc(100vh - var(--topbar-h)); height: calc(100dvh - var(--topbar-h)); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.side-guild { display: flex; align-items: center; gap: .7rem; padding: .6rem; margin-bottom: .8rem; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; } .side-guild b { display: block; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px; }
.nav-item { display: flex; align-items: center; gap: .7rem; padding: .55rem .8rem; border-radius: 10px; color: #b4b4c0; font-weight: 500; font-size: .93rem; cursor: pointer; }
.nav-item:hover { background: var(--surface-2); color: var(--text); } .nav-item.active { background: var(--surface-3); color: #fff; }
.nav-icon { width: 22px; display: grid; place-items: center; flex-shrink: 0; }
.content { padding: 1.6rem clamp(1rem, 3vw, 2rem) 4rem; min-width: 0; }
.burger { display: none; }
.scrim { display: none; position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,.6); backdrop-filter: blur(2px); } .scrim.show { display: block; }

/* ---------- icons & tones */
.btn .icon { margin-inline: -.1rem; }
.chip-x { display: inline-grid; place-items: center; }
.toast { display: flex; align-items: center; gap: .6rem; } .toast-ok .icon { color: var(--ok); } .toast-err .icon { color: var(--err); }
.empty-icon { display: grid; place-items: center; opacity: .55; margin-bottom: .6rem; }
.stat-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.stat-body { min-width: 0; }
.tone-green { background: rgba(62,207,142,.12); color: var(--ok); } .tone-blue { background: rgba(110,168,254,.12); color: var(--info); }
.tone-amber { background: rgba(245,181,68,.12); color: var(--warn); } .tone-violet { background: rgba(167,139,250,.14); color: #a78bfa; } .tone-gray { background: var(--surface-3); color: #cfcfd8; }
.tabs { scrollbar-width: none; } .tabs::-webkit-scrollbar { display: none; }
@keyframes sheet { from { transform: translateY(28px); opacity: 0; } }

/* ---------- responsive */
@media (min-width: 901px) { .scrim { display: none !important; } }
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; z-index: 60; top: 0; inset-inline-start: 0; width: min(280px, 85vw); height: 100vh; height: 100dvh; max-height: 100dvh; background: var(--bg); transform: translateX(100%); transition: transform .2s; padding-top: calc(1rem + env(safe-area-inset-top, 0px)); padding-bottom: calc(6rem + env(safe-area-inset-bottom, 0px)); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
  [dir=ltr] .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none !important; box-shadow: 0 0 60px rgba(0,0,0,.7); }
  .burger { display: inline-grid; place-items: center; }
}
@media (max-width: 700px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border: 1px solid var(--border); border-radius: 10px; margin-bottom: .7rem; padding: .4rem .2rem; background: var(--surface); }
  .table td { display: flex; justify-content: space-between; align-items: center; gap: 1rem; border: 0; padding: .35rem .8rem; text-align: end; }
  .table td::before { content: attr(data-label); color: var(--muted); font-size: .75rem; flex-shrink: 0; }
  .table td.actions { justify-content: flex-end; flex-wrap: wrap; } .table td.actions::before { display: none; }
  .clip { max-width: 55vw; }
}
@media (max-width: 600px) {
  .page-head { flex-direction: column; align-items: stretch; } .page-head h1 { font-size: 1.3rem; } .page-head > .row { width: 100%; }
  .field-inline { align-items: flex-start; }
  .input, select.input, textarea.input, .tag-input { font-size: 16px; }
  .overlay { align-items: end; padding: 0; }
  .modal, .modal-wide { max-width: none; border-radius: 18px 18px 0 0; max-height: 92vh; max-height: 92dvh; animation: sheet .22s ease; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .modal-body { padding: 1rem; }
  .form-actions { flex-direction: column-reverse; align-items: stretch; } .form-actions .btn { width: 100%; }
  .kv { grid-template-columns: 1fr; gap: .1rem; } .kv dd { margin-bottom: .6rem; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .stat { padding: .8rem; gap: .65rem; } .stat-icon { width: 38px; height: 38px; } .stat-value { font-size: 1.05rem; }
  .card-body { padding: .9rem; } .card-head { padding: .8rem .9rem; }
  .panel-box-head { padding: .85rem .9rem; }
  .toasts { inset-inline: .8rem; bottom: calc(.8rem + env(safe-area-inset-bottom, 0px)); }
  .tab { padding: .6rem .8rem; }
  .top-name, .topbar .btn-label, .land-nav .btn-label { display: none; }
  .topbar .btn, .land-nav .btn { padding: .5rem .7rem; }
  .content { padding-top: 1.1rem; }
  .hero-cta .btn { width: 100%; }
  .guild-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; } .guild-card { padding: 1rem .6rem; }
  .guild-icon { width: 56px; height: 56px; border-radius: 16px; }
  .picker-results { max-height: 200px; }
}
@media (max-width: 380px) { .stats, .guild-grid { grid-template-columns: minmax(0, 1fr); } .logo { font-size: 1.05rem; } }
@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) { .hero { padding-block: 1rem; } .hero-logo { display: none; } .modal { max-height: 96vh; } }
@media (pointer: coarse) {
  .btn { min-height: 44px; } .btn-sm { min-height: 38px; padding-inline: .9rem; }
  .nav-item { min-height: 46px; } .tab { min-height: 44px; }
  .icon-btn { min-width: 44px; min-height: 44px; display: inline-grid; place-items: center; }
  .chip-x { min-width: 22px; min-height: 22px; }
}

/* ---------- legal pages (privacy) */
.doc { max-width: 820px; margin: 0 auto; padding: 2rem clamp(1rem, 4vw, 2rem) 5rem; line-height: 1.85; color: #d4d4dc; }
.doc h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); color: var(--text); margin-bottom: .6rem; }
.doc h2 { font-size: 1.2rem; color: var(--text); margin: 2.2rem 0 .7rem; padding-top: 1.4rem; border-top: 1px solid var(--border); }
.doc h3 { font-size: 1rem; color: var(--text); margin: 1.3rem 0 .4rem; }
.doc p { margin: 0 0 .85rem; }
.doc ul { margin: 0 0 1rem; padding-inline-start: 1.4rem; }
.doc li { margin-bottom: .3rem; }
.doc li::marker { color: var(--muted); }
.doc a { color: #fff; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border-2); } .doc a:hover { text-decoration-color: #fff; }
.doc-meta { color: var(--muted); font-size: .9rem; margin-bottom: 1.6rem !important; }
.doc-end { border: 0; border-top: 1px solid var(--border-2); margin: 2.5rem 0 1.2rem; }
.doc-foot { color: var(--muted); font-size: .92rem; } .doc-foot b { color: var(--text); }
.form-section { margin-top: .8rem; padding-top: .9rem; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: .15rem; } .form-section h4 { margin: 0; font-size: .98rem; }
.panel-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 1rem; overflow: hidden; }
.panel-box-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; padding: 1rem 1.1rem; border-bottom: 1px solid var(--border); }
.panel-box-head p { color: var(--muted); font-size: .85rem; margin-top: .2rem; max-width: 640px; overflow-wrap: anywhere; }
.panel-box .card-body { padding: .4rem 1rem 1rem; }

/* ---------- upload & misc (v2) */
.upload { display: flex; flex-direction: column; gap: .6rem; align-items: flex-start; } .upload .input { width: 100%; }
.upload-preview { max-width: 100%; max-height: 180px; border-radius: 10px; border: 1px solid var(--border-2); object-fit: contain; background: var(--surface-2); }
.panel-thumb { width: 100%; max-width: 360px; max-height: 120px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border-2); margin-top: .6rem; display: block; }
.result-line { display: flex; gap: .7rem; align-items: flex-start; padding: .6rem 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; } .result-line:last-child { border: 0; }
.result-line small { flex-basis: 100%; color: var(--muted); }

/* ---------- landing v2: showcase marquee, features, steps */
.landing > main { flex: 1; width: 100%; }
.showcase { width: 100%; max-width: 1400px; margin: 0 auto; padding: 0 0 1rem; display: flex; flex-direction: column; gap: 1.6rem; }
.showcase-label { display: flex; align-items: center; gap: .55rem; justify-content: center; color: #b9b9c6; font-weight: 600; font-size: .92rem; margin-bottom: .9rem; }
.showcase-label .icon { color: #f5b544; }
.marquee { position: relative; overflow: hidden; direction: ltr; -webkit-mask-image: linear-gradient(to right, transparent, #000 9%, #000 91%, transparent); mask-image: linear-gradient(to right, transparent, #000 9%, #000 91%, transparent); }
.marquee-track { display: flex; width: max-content; will-change: transform; animation-timing-function: linear; animation-iteration-count: infinite; }
.marquee-track.run-left { animation-name: marquee-left; } .marquee-track.run-right { animation-name: marquee-right; }
.marquee:hover .marquee-track, .marquee:focus-within .marquee-track { animation-play-state: paused; }
.marquee.static { -webkit-mask-image: none; mask-image: none; } .marquee.static .marquee-track { width: 100%; justify-content: center; }
.marquee-group { display: flex; flex-shrink: 0; direction: rtl; }
@keyframes marquee-left { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes marquee-right { from { transform: translateX(-50%); } to { transform: translateX(0); } }
.srv { display: flex; align-items: center; gap: .9rem; padding: .35rem 2rem .35rem 0; flex-shrink: 0; }
.srv-icon { width: 58px; height: 58px; border-radius: 17px; overflow: hidden; flex-shrink: 0; background: var(--surface-3); display: grid; place-items: center; font-weight: 700; font-size: 1.4rem; color: #d8d8e2; border: 1px solid var(--border-2); }
.srv-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.srv-body { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.srv-name { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: 1.12rem; white-space: nowrap; }
.partner-badge { width: 22px; height: 22px; object-fit: contain; flex-shrink: 0; }
.srv-count { color: var(--muted); font-size: .95rem; font-weight: 500; direction: rtl; }
.join-btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; align-self: flex-start; background: #22c55e; color: #04230f; font-weight: 700; font-size: .85rem; border-radius: 9px; padding: .3rem .95rem; transition: .15s; box-shadow: 0 6px 18px rgba(34,197,94,.22); } .join-btn:hover, .join-btn:focus-visible { background: #4ade80; transform: translateY(-1px); outline: none; }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none !important; } .marquee { overflow-x: auto; -webkit-mask-image: none; mask-image: none; } .marquee-group[aria-hidden=true] { display: none; } }

.section { width: 100%; max-width: 1180px; margin: 0 auto; padding: clamp(2.2rem, 6vw, 4rem) clamp(1rem, 4vw, 2rem) 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto clamp(1.4rem, 4vw, 2.4rem); }
.section-head h2 { font-size: clamp(1.5rem, 5vw, 2.2rem); margin: .5rem 0; line-height: 1.3; } .section-head p { color: var(--muted); }
.eyebrow { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .02em; color: #cfcfd8; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 999px; padding: .15rem .9rem; }
.fgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.fcard { display: flex; flex-direction: column; gap: .55rem; background: linear-gradient(180deg, rgba(26,26,32,.85), rgba(19,19,23,.85)); border: 1px solid var(--border); border-radius: 16px; padding: 1.25rem; min-width: 0; transition: .2s; }
.fcard:hover { border-color: #4a4a56; transform: translateY(-3px); }
.fcard-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; margin-bottom: .2rem; }
.fcard h3 { font-size: 1.05rem; } .fcard-text { color: var(--muted); font-size: .88rem; line-height: 1.6; }
.fcard ul { list-style: none; margin: .5rem 0 0; padding: .8rem 0 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: .5rem; }
.fcard li { display: flex; gap: .55rem; align-items: flex-start; font-size: .85rem; color: #d0d0da; line-height: 1.55; } .fcard li .icon { color: var(--ok); margin-top: .2rem; }
.tone-red { background: rgba(255,93,108,.12); color: var(--err); }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.step { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 1.4rem 1.2rem; text-align: center; display: flex; flex-direction: column; align-items: center; gap: .5rem; }
.step p { color: var(--muted); font-size: .88rem; } .step-icon { width: 46px; height: 46px; border-radius: 14px; background: var(--surface-3); display: grid; place-items: center; color: #e6e6ee; }
.step-num { position: absolute; top: .8rem; inset-inline-start: .9rem; width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: var(--primary-ink); font-weight: 800; font-size: .8rem; display: grid; place-items: center; }
.cta-band { width: calc(100% - 2 * clamp(1rem, 4vw, 2rem)); max-width: 1000px; margin: clamp(2.2rem, 6vw, 4rem) auto 0; text-align: center; padding: clamp(1.6rem, 5vw, 3rem) 1.2rem; border-radius: 22px; border: 1px solid var(--border-2); background: radial-gradient(600px 220px at 50% 0%, rgba(255,255,255,.08), transparent), var(--surface); }
.cta-band h2 { font-size: clamp(1.3rem, 4.5vw, 1.9rem); margin-bottom: .4rem; } .cta-band p { color: var(--muted); margin-bottom: 1.4rem; }

/* ---------- admin */
.admin-card { display: flex; align-items: center; gap: 1rem; background: linear-gradient(135deg, rgba(245,181,68,.10), rgba(19,19,23,.9)); border: 1px solid rgba(245,181,68,.35); border-radius: 14px; padding: 1rem 1.2rem; margin-bottom: 1.6rem; } .admin-card > div:nth-child(2) { flex: 1; min-width: 0; } .admin-card b { display: block; } .admin-card .muted { font-size: .85rem; }
.admin-card-icon { width: 46px; height: 46px; border-radius: 13px; background: rgba(245,181,68,.14); color: var(--warn); display: grid; place-items: center; flex-shrink: 0; }
.badge-preview { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 1rem; margin-bottom: 1.2rem; } .badge-preview > img { object-fit: contain; }
.mini-letter { width: 36px; height: 36px; border-radius: 10px; background: var(--surface-3); display: inline-grid; place-items: center; font-weight: 700; }
.link-ltr { direction: ltr; unicode-bidi: isolate; color: #cfcfd8; text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }

@media (max-width: 1100px) { .fgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .steps { grid-template-columns: minmax(0, 1fr); } .srv { gap: .7rem; padding-inline-end: 1.4rem; } .srv-icon { width: 48px; height: 48px; border-radius: 14px; font-size: 1.15rem; } .srv-name { font-size: 1rem; } .srv-count { font-size: .85rem; } .admin-card { flex-wrap: wrap; } }
@media (max-width: 600px) { .fgrid { grid-template-columns: minmax(0, 1fr); gap: .8rem; } .showcase-label { font-size: .85rem; } .cta-band .btn { width: 100%; } }

/* ---------- v3: feedback, pro, bot profile, subscriptions */
.stars { display: inline-flex; gap: 2px; color: #f5b544; vertical-align: middle; } .stars .icon { fill: currentColor; } .stars .off { color: var(--border-2); }
.rating-bars { display: flex; flex-direction: column; gap: .5rem; flex: 1; min-width: 200px; } .rating-bar { display: flex; align-items: center; gap: .6rem; font-size: .85rem; } .rating-bar .track { flex: 1; height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; } .rating-bar .fill { height: 100%; background: linear-gradient(90deg, #f5b544, #fcd34d); border-radius: 99px; }
.fb-summary { display: flex; gap: 1.6rem; align-items: center; flex-wrap: wrap; margin-bottom: 1.2rem; } .fb-big { font-size: 2.6rem; font-weight: 800; line-height: 1; } .fb-big small { display: block; font-size: .8rem; font-weight: 500; color: var(--muted); margin-top: .35rem; }
.fb-text { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 420px; }
.fb-preview { background: #1e1f22; border-radius: 12px; border-inline-start: 4px solid var(--fb-color, #8b8b96); padding: 1rem; display: flex; flex-direction: column; gap: .6rem; } .fb-preview-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .8rem; } .fb-preview h4 { margin: 0; font-size: 1.15rem; } .fb-preview small { color: var(--muted); } .fb-preview blockquote { margin: 0; padding-inline-start: .7rem; border-inline-start: 3px solid #4e5058; color: #dbdee1; } .fb-preview .thumb { width: 56px; height: 56px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; flex-shrink: 0; color: var(--muted); }
.pro-chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .68rem; font-weight: 800; letter-spacing: .03em; color: #1b1203; background: linear-gradient(135deg, #fcd34d, #f59e0b); border-radius: 99px; padding: .05rem .5rem; vertical-align: middle; } .pro-chip .icon { width: 11px; height: 11px; }
.soon-chip { font-size: .66rem; font-weight: 700; color: var(--muted); background: var(--surface-3); border: 1px solid var(--border-2); border-radius: 99px; padding: 0 .45rem; margin-inline-start: auto; }
.nav-item .pro-chip, .nav-item .soon-chip { margin-inline-start: auto; }
.lock-banner { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; background: linear-gradient(135deg, rgba(245,181,68,.12), rgba(19,19,23,.9)); border: 1px solid rgba(245,181,68,.4); border-radius: 14px; padding: 1rem 1.2rem; margin-bottom: 1.2rem; } .lock-banner > .icon-wrap { width: 44px; height: 44px; border-radius: 12px; background: rgba(245,181,68,.15); color: var(--warn); display: grid; place-items: center; flex-shrink: 0; } .lock-banner > div:nth-child(2) { flex: 1; min-width: 200px; } .lock-banner p { color: var(--muted); font-size: .88rem; }
.bp-preview { border-radius: 14px; overflow: hidden; background: #111214; border: 1px solid var(--border-2); max-width: 340px; width: 100%; } .bp-banner { height: 110px; background: linear-gradient(135deg, #3b3b46, #1c1c22) center/cover no-repeat; } .bp-body { padding: 0 1rem 1rem; position: relative; } .bp-avatar { width: 84px; height: 84px; border-radius: 50%; border: 6px solid #111214; background: var(--surface-3); margin-top: -42px; object-fit: cover; display: block; } .bp-name { font-size: 1.2rem; font-weight: 800; margin-top: .4rem; display: flex; align-items: center; gap: .45rem; } .bot-tag { font-size: .62rem; font-weight: 800; background: #5865f2; color: #fff; border-radius: 4px; padding: 0 .35rem; } .bp-bio { margin-top: .6rem; color: #dbdee1; font-size: .88rem; white-space: pre-wrap; overflow-wrap: anywhere; } .bp-sub { color: var(--muted); font-size: .8rem; }
.bp-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.2rem; align-items: start; } @media (max-width: 900px) { .bp-layout { grid-template-columns: minmax(0, 1fr); } }
.soon-hero { text-align: center; padding: clamp(2rem, 7vw, 4rem) 1rem; display: flex; flex-direction: column; align-items: center; gap: .9rem; } .soon-hero h2 { font-size: clamp(1.6rem, 6vw, 2.6rem); } .soon-hero p { color: var(--muted); max-width: 520px; } .soon-icon { width: 76px; height: 76px; border-radius: 22px; display: grid; place-items: center; background: linear-gradient(135deg, rgba(252,211,77,.2), rgba(245,158,11,.08)); color: #fcd34d; border: 1px solid rgba(245,181,68,.35); }
.perk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; } .perk-list li { display: flex; gap: .6rem; align-items: flex-start; } .perk-list .icon { color: var(--ok); margin-top: .2rem; } .perk-soon { color: var(--muted); }
.plan-card { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; } .plan-card .grow { flex: 1; min-width: 180px; }

/* ---------- v4: colour picker, stats order, overview, feed, checklist, automod layout */
.color-picker { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
.color-swatch { position: relative; width: 64px; height: 44px; border-radius: 12px; border: 2px solid #7a7a88; cursor: pointer; overflow: hidden; display: block; flex-shrink: 0; transition: border-color .15s; } .color-swatch:hover, .color-swatch:focus-within { border-color: #fff; }
.color-fill { position: absolute; inset: 0; } .color-fill.auto { background: repeating-linear-gradient(45deg, #2a2a33 0 6px, #1d1d24 6px 12px); }
.color-native { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.color-dots { display: flex; gap: .45rem; flex-wrap: wrap; }
.color-dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #55555f; cursor: pointer; padding: 0; transition: transform .12s; } .color-dot:hover { transform: scale(1.12); } .color-dot.on { border-color: #fff; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px #fff; }

.small { font-size: .8rem; }
.stat { align-items: center; }
.stat-label { color: var(--muted); font-size: .82rem; margin-bottom: .2rem; } .stat-value { font-size: 1.45rem; font-weight: 800; line-height: 1.15; }
.empty-action { margin-top: 1rem; display: flex; justify-content: center; gap: .6rem; flex-wrap: wrap; }
.mini-title { font-size: .9rem; margin: 0 0 .7rem; color: #cfcfd8; }

.ov-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.period-picker { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; min-width: 0; max-width: 100%; }
.card-head > .row { flex-wrap: wrap; min-width: 0; max-width: 100%; } /* النصوص الإنجليزية أطول: تلتف بدل أن تتجاوز العرض */
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--border-2); border-radius: 10px; padding: 3px; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; } .seg::-webkit-scrollbar { display: none; }
.seg-btn { background: none; border: 0; color: var(--muted); font: inherit; font-size: .8rem; font-weight: 600; padding: .3rem .7rem; border-radius: 8px; cursor: pointer; white-space: nowrap; } .seg-btn:hover { color: var(--text); } .seg-btn.on { background: var(--surface-3); color: #fff; }
.period-custom { display: flex; align-items: center; gap: .4rem; } .period-input { width: 84px; padding: .3rem .6rem; font-size: .85rem; border-radius: 8px; }
.rev-summary { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 1rem; padding-bottom: 1rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border); }
.rev-big { font-size: 2rem; font-weight: 800; line-height: 1.1; } .rev-mid { font-size: 1.4rem; font-weight: 700; }
.delta { font-weight: 700; font-size: .85rem; display: inline-flex; gap: .3rem; align-items: baseline; } .delta.up { color: var(--ok); } .delta.down { color: var(--err); }
.chart-box { display: flex; flex-direction: column; gap: .5rem; direction: ltr; }
.chart-readout { direction: rtl; min-height: 1.4rem; font-size: .85rem; font-weight: 600; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 170px; padding-bottom: 2px; border-bottom: 1px solid var(--border); background: repeating-linear-gradient(to top, transparent 0 41px, var(--border) 41px 42px); }
.bar-col { flex: 1; height: 100%; display: flex; align-items: flex-end; min-width: 3px; cursor: default; outline: none; } .bar-fill { width: 100%; background: linear-gradient(180deg, #e8e8f0, #8f8fa0); border-radius: 4px 4px 0 0; transition: filter .12s; } .bar-col:hover .bar-fill, .bar-col:focus .bar-fill { filter: brightness(1.25); background: linear-gradient(180deg, #fff, #b5b5c5); }
.bar-labels { display: flex; gap: 3px; font-size: .7rem; color: var(--muted); } .bar-labels span { flex: 1; min-width: 3px; overflow: visible; white-space: nowrap; text-align: center; }
.rank-list { display: flex; flex-direction: column; gap: .75rem; } .rank-top { display: flex; justify-content: space-between; gap: .6rem; font-size: .85rem; margin-bottom: .3rem; } .rank-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.track { height: 7px; border-radius: 99px; background: var(--surface-3); overflow: hidden; } .track .fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #6ea8fe, #a78bfa); }
.feed-scroll { max-height: 440px; overflow-y: auto; overscroll-behavior: contain; margin-inline: -.3rem; padding-inline: .3rem; }
.feed-row { display: flex; gap: .75rem; align-items: center; padding: .6rem 0; border-bottom: 1px solid var(--border); } .feed-row:last-child { border: 0; }
.feed-icon { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; } .feed-body { min-width: 0; } .feed-title { font-weight: 600; font-size: .9rem; }
.feed-more { display: block; text-align: center; padding: .8rem 0 .1rem; font-size: .85rem; color: #cfcfd8; text-decoration: underline; text-underline-offset: 3px; }
.setup-progress { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1rem; font-size: .88rem; font-weight: 600; } .setup-progress .track .fill { background: linear-gradient(90deg, #22c55e, #4ade80); }
.setup-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: .7rem; }
.setup-step { display: flex; gap: .7rem; align-items: flex-start; background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: .8rem .9rem; transition: .15s; } a.setup-step:hover { border-color: #5a5a68; transform: translateY(-2px); } .setup-step.is-done { opacity: .55; }
.setup-check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #5a5a68; display: grid; place-items: center; flex-shrink: 0; margin-top: .1rem; } .setup-check.done { background: var(--ok); border-color: var(--ok); color: #04230f; }

/* AutoMod: عمود المخالفات ثابت، ونموذج القواعد يتمرّر داخليًا */
.am-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.am-rules { display: flex; flex-direction: column; max-height: max(440px, calc(100dvh - var(--topbar-h) - 15.6rem)); overflow: hidden; } .am-rules .card-body { overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.am-rules .form-actions { position: sticky; bottom: -1.1rem; background: var(--surface); margin-bottom: -1.1rem; padding: .9rem 0 1.1rem; z-index: 2; }
.am-side { position: sticky; top: calc(var(--topbar-h) + 1rem); display: flex; flex-direction: column; gap: 1rem; max-height: max(440px, calc(100dvh - var(--topbar-h) - 15.6rem)); }
.am-side > .card { display: flex; flex-direction: column; min-height: 0; } .am-side .card-body { overflow: auto; min-height: 0; overscroll-behavior: contain; } .am-side .am-violations { flex: 1; }

/* قنوات اللوجات */
.log-group { margin-bottom: 1rem; } .log-group-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; margin-bottom: .6rem; } .log-group-head h4 { margin: 0; }
.log-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) auto; gap: .6rem; align-items: center; padding: .5rem 0; border-bottom: 1px solid var(--border); } .log-row:last-child { border: 0; } .log-row .ev { font-weight: 600; font-size: .9rem; }
@media (max-width: 900px) { .ov-grid, .am-layout { grid-template-columns: minmax(0, 1fr); } .am-rules { max-height: none; overflow: visible; } .am-rules .card-body { overflow: visible; } .am-rules .form-actions { position: static; margin: 0; padding: .9rem 0 0; } .am-side { position: static; max-height: none; } }
@media (max-width: 700px) { .rev-summary { grid-template-columns: 1fr 1fr; } .rev-summary > div:first-child { grid-column: 1 / -1; } .log-row { grid-template-columns: minmax(0, 1fr); } .setup-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- /say: المحرر والمعاينة */
.say-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 460px); gap: 1.1rem; align-items: start; margin-bottom: 1.2rem; }
.say-side { position: sticky; top: 1rem; }
@media (max-width: 1100px) { .say-layout { grid-template-columns: minmax(0, 1fr); } .say-side { position: static; order: -1; } }
.say-item { background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 12px; padding: .9rem; display: flex; flex-direction: column; gap: .8rem; }
.say-sub { border-inline-start: 2px solid var(--border-2); padding-inline-start: .8rem; }
.say-adv > summary { cursor: pointer; color: var(--muted); font-size: .85rem; font-weight: 600; }
.say-adv > summary:hover { color: var(--text); }
.say-counter { align-self: flex-end; }
.say-item .row.between { gap: .6rem; }

/* معاينة بنمط Discord الداكن (تقريبية: الشكل النهائي يحدده Discord) */
.dc { background: #313338; border-radius: 12px; padding: 1rem; color: #dbdee1; font-family: 'gg sans', 'Noto Sans', var(--font); font-size: .95rem; line-height: 1.45; overflow: hidden; }
.dc-msg { display: flex; gap: .75rem; align-items: flex-start; }
.dc-avatar { width: 40px; height: 40px; border-radius: 50%; background: #5865f2; color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.dc-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: .3rem; }
.dc-head { display: flex; align-items: center; gap: .4rem; }
.dc-head b { color: #f2f3f5; font-weight: 600; }
.dc-tag { background: #5865f2; color: #fff; font-size: .62rem; font-weight: 700; padding: 0 .3rem; border-radius: 4px; line-height: 1.5; }
.dc-time { color: #949ba4; font-size: .72rem; }
.dc-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.dc-code { background: #2b2d31; border-radius: 4px; padding: .05rem .3rem; font-size: .85em; }
.dc-pre { background: #2b2d31; border: 1px solid #1e1f22; border-radius: 6px; padding: .5rem .6rem; margin: .25rem 0; white-space: pre-wrap; overflow-wrap: anywhere; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .82rem; text-align: left; }
.dc-mention { direction: ltr; unicode-bidi: isolate; background: rgba(88,101,242,.3); color: #c9cdfb; border-radius: 4px; padding: 0 .2rem; font-weight: 500; }
.dc-link { color: #00a8fc; }
.dc-emoji { width: 22px; height: 22px; vertical-align: -5px; }
.dc-empty { color: #949ba4; font-style: italic; }
.dc-embed { --dc-color: #1e1f22; position: relative; background: #2b2d31; border: 1px solid #1e1f22; border-inline-start: 4px solid var(--dc-color); border-radius: 4px; padding: .6rem .8rem .8rem; max-width: 100%; display: flex; flex-direction: column; gap: .4rem; }
.dc-embed-grid { display: flex; gap: .8rem; justify-content: space-between; align-items: flex-start; }
.dc-embed-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: .35rem; }
.dc-author { display: flex; align-items: center; gap: .4rem; font-size: .82rem; font-weight: 600; color: #f2f3f5; }
.dc-author-icon, .dc-footer-icon { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.dc-title { font-weight: 700; color: #f2f3f5; overflow-wrap: anywhere; } .dc-title-link { color: #00a8fc; }
.dc-desc { font-size: .88rem; }
.dc-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.dc-field { grid-column: 1 / -1; min-width: 0; } .dc-field.inline { grid-column: auto; }
.dc-field-name { font-weight: 700; font-size: .82rem; color: #f2f3f5; overflow-wrap: anywhere; }
.dc-field-value { font-size: .85rem; }
.dc-thumb { width: 80px; height: 80px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.dc-image { width: 100%; max-height: 300px; object-fit: cover; border-radius: 6px; display: block; }
.dc-img-ph { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem; background: #1e1f22; color: #949ba4; font-size: .72rem; text-align: center; padding: .5rem; border: 1px dashed #4e5058; }
.dc-thumb.dc-img-ph { width: 80px; height: 80px; } .dc-thumb.dc-img-ph span { display: none; }
.dc-image.dc-img-ph { min-height: 110px; }
.dc-author-icon.dc-img-ph, .dc-footer-icon.dc-img-ph { width: 22px; height: 22px; padding: 0; border-radius: 50%; } .dc-author-icon.dc-img-ph span, .dc-footer-icon.dc-img-ph span, .dc-author-icon.dc-img-ph svg, .dc-footer-icon.dc-img-ph svg { display: none; }
.dc-footer { display: flex; align-items: center; gap: .4rem; font-size: .72rem; color: #949ba4; }
.dc-buttons { display: flex; flex-direction: column; gap: .4rem; margin-top: .3rem; }
.dc-btn-row { display: flex; flex-wrap: wrap; gap: .4rem; }
.dc-btn { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .9rem; min-height: 32px; border-radius: 4px; font-size: .85rem; font-weight: 500; color: #fff; user-select: none; }
.dc-btn-primary { background: #5865f2; } .dc-btn-secondary { background: #4e5058; } .dc-btn-success { background: #248046; } .dc-btn-danger { background: #da373c; }
.dc-btn.off { opacity: .5; }
.dc-btn-ph { opacity: .7; }
.dc-btn .dc-emoji { width: 18px; height: 18px; vertical-align: middle; }

/* ---------- إرسال رسالة: الحصة ووضع التعديل */
.say-quota { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .65rem .95rem; margin-bottom: 1rem; font-size: .85rem; }
.say-quota .help { flex-basis: 100%; margin: 0; }
.say-editing { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; background: rgba(110,168,254,.08); border: 1px solid rgba(110,168,254,.35); border-radius: 12px; padding: .7rem 1rem; font-size: .88rem; }
.say-editing .row { min-width: 0; flex: 1; }

/* ---------- التذاكر المفتوحة (تحكم من الداشبورد) */
.tk-toolbar { margin-bottom: .9rem; }
.tk-list { display: grid; gap: .9rem; }
.tk-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .75rem; transition: opacity .15s; }
.tk-card.is-busy { opacity: .6; pointer-events: none; }
.tk-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; }
.tk-who { min-width: 0; font-weight: 600; }
.tk-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; font-size: .88rem; }
.tk-channel { direction: ltr; unicode-bidi: plaintext; color: var(--text); background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 6px; padding: .05rem .5rem; font-family: ui-monospace, Menlo, monospace; font-size: .8rem; }
.tk-people { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.tk-answers { background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 10px; padding: .55rem .8rem; font-size: .88rem; }
.tk-answers summary { cursor: pointer; color: var(--muted); }
.tk-qa { margin-top: .6rem; } .tk-qa p { margin: .15rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.tk-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; padding-top: .75rem; border-top: 1px solid var(--border); }
.tk-spacer { flex: 1 1 0; min-width: .5rem; }
@media (max-width: 720px) { .tk-card { padding: .85rem; } .tk-actions .btn { flex: 1 1 calc(50% - .45rem); justify-content: center; } .tk-spacer { display: none; } }

/* ---------- التذاكر: بحث وفلترة وأرقام وإحصائيات */
.tk-top { margin-bottom: .6rem; }
.tk-filters { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.tk-filters .input-inline { flex: 0 1 190px; min-width: 150px; }
.tk-filters .tk-search { flex: 1 1 260px; min-width: 200px; width: auto; }
.tk-num { display: inline-block; margin-inline-end: .55rem; padding: .05rem .5rem; border-radius: 6px; background: var(--surface-3); border: 1px solid var(--border-2); font-weight: 800; font-size: .85rem; letter-spacing: .02em; direction: ltr; unicode-bidi: isolate; }
.tk-who { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem; }
.tk-claim { display: inline-flex; align-items: center; gap: .35rem; }
.link-btn { background: none; border: 0; padding: 0 .2rem; color: var(--info); font: inherit; font-size: .82rem; cursor: pointer; text-decoration: underline; }
.link-btn:hover { color: var(--text); }
.tk-health { display: flex; align-items: center; gap: .3rem; margin-top: .25rem; font-size: .78rem; color: var(--err); }
.tk-count { margin: 0 0 .6rem; font-size: .85rem; }
.tk-note { max-width: 260px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bar-col .bar-fill { flex: 1; min-width: 0; }
.bar-fill-2 { background: linear-gradient(180deg, #5fe3a8, #1f8f63); }
.bar-col:hover .bar-fill-2, .bar-col:focus .bar-fill-2 { background: linear-gradient(180deg, #8bf0c6, #2fae7c); }
.chart-legend { display: flex; gap: 1rem; margin-top: .6rem; font-size: .8rem; color: var(--muted); }
.chart-legend .lg { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: .35rem; vertical-align: -1px; }
.chart-legend .lg-1 { background: #c9c9d6; } .chart-legend .lg-2 { background: #3ecf8e; }
.rank-simple { display: flex; flex-direction: column; gap: .55rem; }
.rank-simple .row { padding: .15rem 0; border-bottom: 1px dashed var(--border); }
@media (max-width: 720px) { .tk-filters .input-inline, .tk-filters .tk-search { flex: 1 1 100%; } }

.tk-stamp { white-space: nowrap; direction: ltr; unicode-bidi: isolate; text-align: start; }
.tk-hist .user-cell { flex-wrap: wrap; row-gap: 0; } .tk-hist .user-cell .id { flex-basis: 100%; font-size: .7rem; }
@media (min-width: 900px) { .tk-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) { .tk-stamp { text-align: end; } .tk-hist .user-cell .id { flex-basis: auto; } }

/* ---------------------------------------------------------- نظام الإشراف + تحسينات الهاتف */
.notice { display: flex; align-items: center; gap: .5rem; }
.chips { display: inline-flex; flex-wrap: wrap; gap: .3rem; max-width: 100%; }
.chips .chip, .mcmd .chip { max-width: 100%; overflow-wrap: anywhere; }
.small { font-size: .8rem; }
.user-cell { min-width: 0; max-width: 100%; flex-wrap: wrap; row-gap: .1rem; }
.user-cell .user-name { min-width: 0; overflow-wrap: anywhere; }
.user-cell .id { overflow-wrap: anywhere; font-size: .72rem; }

/* تباعد رأسي موحّد بين بطاقات صفحات الإشراف */
.mod-stack { display: flex; flex-direction: column; gap: 1rem; }
.mod-stack > .card { margin: 0; }

/* فقرات الشرح داخل البطاقات */
.card-body > p.muted { font-size: .88rem; line-height: 1.75; margin: 0 0 1rem; }

/* قائمة الأوامر: بطاقات مدمجة قابلة للضغط */
.mcmd-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: .7rem; }
.mcmd { display: flex; flex-direction: column; gap: .55rem; padding: .8rem .9rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s; min-width: 0; }
.mcmd:hover, .mcmd:focus-visible { border-color: var(--border-2); background: var(--surface-3); outline: none; }
.mcmd.is-off { opacity: .62; }
.mcmd-head { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem .5rem; }
.mcmd-name { font-weight: 700; font-size: .95rem; direction: ltr; unicode-bidi: embed; }
.mcmd-prefix { font-size: .85rem; direction: rtl; unicode-bidi: plaintext; padding: .1rem .5rem; border-radius: 6px; background: var(--surface-2, rgba(127,127,127,.15)); }
.mcmd-label { color: var(--muted); font-size: .8rem; flex: 1 1 auto; min-width: 0; }
.mcmd-access .badge { white-space: normal; text-align: start; max-width: 100%; line-height: 1.5; }
.mcmd-foot { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.mcmd-meta { color: var(--muted); font-size: .78rem; flex: 1 1 140px; min-width: 0; line-height: 1.6; }

/* الفلاتر: شبكة بعناوين، مطويّة على الهاتف */
.filters-wrap { margin-bottom: 1rem; }
.filters { border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.filters > summary { list-style: none; cursor: pointer; padding: .7rem .9rem; font-weight: 600; font-size: .9rem; display: flex; align-items: center; gap: .5rem; min-height: 44px; }
.filters > summary::-webkit-details-marker { display: none; }
.filters > summary::after { content: '▾'; margin-inline-start: auto; color: var(--muted); transition: transform .2s; }
.filters[open] > summary::after { transform: rotate(180deg); }
.f-badge { background: var(--primary); color: var(--primary-ink); border-radius: 99px; font-size: .7rem; min-width: 20px; height: 20px; display: inline-grid; place-items: center; padding: 0 .35rem; }
.filters-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem .7rem; padding: 0 .9rem .9rem; }
.f-field { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.f-label { font-size: .74rem; color: var(--muted); }
.f-field .input { width: 100%; min-width: 0; }
.f-count { margin-top: .55rem; }
@media (max-width: 380px) { .filters-grid { grid-template-columns: minmax(0, 1fr); } }

/* قواعد Liro Pro ولوحة الإحصاء */
.rule-matrix { display: grid; gap: .5rem; margin-top: .5rem; }
.rule-row { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(130px, 170px) minmax(220px, 1.4fr); gap: .6rem; align-items: center; padding: .55rem .7rem; border: 1px solid var(--border); border-radius: 12px; }
.rule-limit { flex-wrap: nowrap; align-items: center; }
.rule-limit .input { max-width: 76px; min-width: 0; padding-inline: .45rem; text-align: center; }
.rule-limit .muted { white-space: nowrap; }
.var-list { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1rem; }
.var-chip { font-size: .78rem; padding: .25rem .6rem; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); overflow-wrap: anywhere; }
.var-chip code { color: var(--text); direction: ltr; unicode-bidi: embed; }
.bar-list { display: grid; gap: .55rem; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 44px; gap: .6rem; align-items: center; font-size: .88rem; }
.bar-track { height: 9px; border-radius: 999px; background: rgba(255,255,255,.07); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: #d4d4de; }
.mod-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 900px) { .mod-grid-2 { grid-template-columns: minmax(0, 1fr); } }

/* تاريخ/وقت لا يلتف على الشاشات الواسعة */
.table td.c-nowrap { white-space: nowrap; }

/* الجداول المدمجة (الهاتف + التابلت العمودي + الهاتف الأفقي ≤ 820px): رأس البطاقة (c-head) في سطر واحد، وبقية الحقول (c-block) كل منها في سطر بعنوانه */
@media (max-width: 820px) {
  .table-compact thead { display: none; }
  .table-compact, .table-compact tbody, .table-compact tr, .table-compact td { display: block; width: 100%; }
  .table-compact tbody tr { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .65rem; padding: .75rem .85rem; margin-bottom: .6rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
  .table-compact td { display: inline-flex; width: auto; padding: 0; border: 0; gap: .4rem; min-width: 0; max-width: 100%; text-align: start; justify-content: flex-start; align-items: center; }
  .table-compact td::before { display: none; }
  .table-compact td.c-head { order: 0; } .table-compact td.c-block { order: 1; } .table-compact td.actions { order: 2; }
  .table-compact td.c-grow { flex: 1 1 0; min-width: 0; }
  .table-compact td.c-end { margin-inline-start: auto; }
  .table-compact td.c-nowrap { white-space: nowrap; color: var(--muted); font-size: .8rem; }
  .table-compact td.c-block { flex: 1 1 100%; display: flex; align-items: baseline; font-size: .88rem; }
  .table-compact td.c-block::before { display: inline; content: attr(data-label); color: var(--muted); font-size: .72rem; flex: 0 0 auto; min-width: 3.4em; margin-inline-end: .2rem; }
  .table-compact td.c-block:has(> .na) { display: none; }
  .table-compact td.actions { flex: 1 1 100%; justify-content: flex-start; padding-top: .15rem; }
  .table-compact td.actions .btn { margin-inline-start: 0; margin-inline-end: .4rem; }
  .table-compact .user-cell .id { display: none; }
  .table-compact .clip { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; white-space: normal; max-width: 100%; overflow-wrap: anywhere; }
}
@media (max-width: 700px) {
  .rule-row { grid-template-columns: minmax(0, 1fr); }
  .bar-row { grid-template-columns: 84px 1fr 34px; }
  .mcmd-list { grid-template-columns: minmax(0, 1fr); }
  .stats > .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (pointer: coarse) { .mcmd { min-height: 56px; } }

/* ---------- إصلاح: النوافذ المنبثقة لا تتجاوز عرض الشاشة أبدًا
   .overlay شبكة بعمود تلقائي: كان العمود يتمدد لأوسع عنصر (قائمة رتب بأسماء طويلة) فيصير عرض النافذة أكبر من الهاتف ويُقصّ جانبها. */
.overlay { grid-template-columns: minmax(0, 1fr); }
.modal, .modal-head, .modal-body, .modal .form, .modal .field { min-width: 0; max-width: 100%; }
.modal .modal-head h3, .modal .modal-head .modal-title { min-width: 0; overflow-wrap: anywhere; }
select.input, select.input-inline { max-width: 100%; min-width: 0; text-overflow: ellipsis; }
.tag-box, .tags-box, .multi { min-width: 0; max-width: 100%; }

/* قائمة خانات اختيار متعددة (ربط قسم التذاكر بالمنتجات) */
.checks { display: flex; flex-direction: column; gap: .35rem; max-height: 14rem; overflow-y: auto; padding: .5rem .65rem; border: 1px solid var(--border, rgba(127,127,127,.3)); border-radius: 8px; }
.check-row { display: flex; align-items: center; gap: .5rem; cursor: pointer; }
.check-row input { flex: none; }

/* ---------- LTR (الإنجليزية): كل ما كان مثبّتًا على اتجاه عربي يتبع اتجاه المستند */
[dir=ltr] .marquee-group, [dir=ltr] .srv-count, [dir=ltr] .chart-readout, [dir=ltr] .mcmd-prefix { direction: ltr; }
[dir=ltr] select.input { padding-left: .8rem; padding-right: 2.5rem; background-position: right .8rem center; }
[dir=ltr] .switch input:checked + .slider::before { transform: translateX(20px); }

/* ================================================================ Send Message: محرر Components V2 والثريد */
.say-side { max-height: calc(100vh - 2rem); overflow-y: auto; scrollbar-width: thin; display: flex; flex-direction: column; gap: 1rem; }
.notice-warn { border-inline-start-color: var(--warn); }
.notice-err { border-inline-start-color: var(--err); color: #ffc9ce; }
.hidden-input { display: none; }
input.hidden { display: none; }

/* --- المحرر */
.v2-builder { gap: 1rem; }
.v2-tabs { display: flex; flex-wrap: wrap; gap: .4rem; }
.v2-tab { display: inline-flex; align-items: center; gap: .3rem; background: var(--surface-2); border: 1px solid var(--border-2); color: var(--muted); border-radius: 8px; padding: .3rem .8rem; font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; }
.v2-tab:hover { color: var(--text); } .v2-tab.on { background: var(--surface-3); color: #fff; border-color: #6a6a78; } .v2-tab.add { border-style: dashed; }
.v2-list { display: flex; flex-direction: column; gap: .55rem; position: relative; }
.v2-item { background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 10px; transition: border-color .15s, opacity .15s; }
.v2-item .v2-item { background: var(--surface); }
.v2-item.dragging { opacity: .4; }
.v2-head { display: flex; align-items: center; gap: .5rem; padding: .4rem .6rem; cursor: pointer; min-width: 0; }
.v2-drag { cursor: grab; color: var(--muted); display: grid; place-items: center; padding: .25rem; border-radius: 6px; touch-action: none; }
.v2-drag:hover { background: var(--surface-3); color: var(--text); } .v2-drag:active { cursor: grabbing; }
.v2-ico { color: var(--muted); display: grid; place-items: center; }
.v2-title { font-size: .88rem; white-space: nowrap; }
.v2-sum { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; }
.v2-acts { display: flex; align-items: center; gap: .05rem; margin-inline-start: auto; flex-shrink: 0; }
.v2-acts .icon-btn { padding: .25rem .35rem; display: grid; place-items: center; } .v2-acts .icon-btn:disabled { opacity: .3; cursor: not-allowed; }
.v2-chev { color: var(--muted); display: grid; place-items: center; transition: transform .15s; padding: .25rem; }
.v2-item.open > .v2-head .v2-chev { transform: rotate(180deg); }
.v2-body { display: none; padding: .9rem .9rem 1rem; border-top: 1px solid var(--border); }
.v2-item.open > .v2-body { display: block; }
.v2-drop-mark { height: 4px; border-radius: 4px; background: var(--info); margin: -2px 0; box-shadow: 0 0 0 1px rgba(110,168,254,.25); }
.v2-addbar { display: flex; flex-wrap: wrap; gap: .4rem; }
.v2-add { display: inline-flex; align-items: center; gap: .35rem; background: transparent; border: 1px dashed var(--border-2); color: var(--muted); border-radius: 8px; padding: .3rem .75rem; font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; }
.v2-add:hover { color: var(--text); border-color: #6a6a78; background: var(--surface-2); }
.v2-empty { text-align: center; padding: .8rem; border: 1px dashed var(--border-2); border-radius: 10px; font-size: .85rem; }
.v2-sub { margin: .3rem 0 0; font-size: .8rem; color: var(--muted); font-weight: 700; }
.v2-limits { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }
.v2-chip { display: inline-flex; align-items: baseline; gap: .4rem; padding: .1rem .6rem; border-radius: 999px; border: 1px solid var(--border-2); background: var(--surface-2); font-size: .78rem; font-weight: 700; }
.v2-chip small { font-weight: 400; color: var(--muted); } .v2-chip.warn { color: var(--warn); border-color: rgba(245,181,68,.4); } .v2-chip.err { color: var(--err); border-color: rgba(255,93,108,.5); } .v2-chip.ok { color: var(--ok); }
.v2-checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .4rem; }
.v2-check { display: flex; align-items: center; gap: .45rem; font-size: .82rem; cursor: pointer; }
.v2-valid { display: flex; align-items: center; gap: .4rem; color: var(--ok); font-size: .82rem; }
.v2-no { background: var(--surface-3); border-radius: 6px; padding: 0 .45rem; font-size: .75rem; font-weight: 700; color: var(--muted); }
.v2-tmsg.on { border-color: #6a6a78; }
.v2-tmsg-editor { border-top: 1px dashed var(--border-2); padding-top: 1rem; }
.v2-thread-status .v2p-steps { margin-top: .2rem; }
.v2-templates .help { margin-top: .2rem; }
.v2-forms { border-top: 1px dashed var(--border-2); padding-top: 1rem; }
.v2-screen-bar { align-items: center; }

/* --- المعاينة (Discord Components V2) */
.v2p-text { color: #dbdee1; font-size: .92rem; line-height: 1.4; min-width: 0; word-break: break-word; }
.v2p-h { font-weight: 700; line-height: 1.25; margin: .25rem 0 .1rem; color: #f2f3f5; } .v2p-h1 { font-size: 1.5rem; } .v2p-h2 { font-size: 1.25rem; } .v2p-h3 { font-size: 1.05rem; }
.v2p-sub { font-size: .75rem; color: #949ba4; line-height: 1.3; }
.v2p-li { display: flex; gap: .45rem; padding-inline-start: .6rem; } .v2p-bullet { color: #b5bac1; }
.v2p-quote { border-inline-start: 4px solid #4e5058; padding-inline-start: .6rem; }
.v2p-gap { height: .45rem; }
.v2p-container { position: relative; background: #2b2d31; border: 1px solid #1e1f22; border-radius: 8px; padding: .8rem .9rem .8rem 1.1rem; overflow: hidden; max-width: 100%; }
.v2p-container::before { content: ''; position: absolute; inset-block: 0; inset-inline-start: 0; width: 4px; background: var(--v2-accent, transparent); }
.v2p-container.no-accent::before { display: none; }
.v2p-container-body { display: flex; flex-direction: column; gap: .5rem; min-width: 0; }
.v2p-section { display: flex; gap: .8rem; align-items: flex-start; justify-content: space-between; }
.v2p-section-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.v2p-section-side { flex-shrink: 0; } .v2p-section-side.is-button { align-self: center; }
.v2p-thumb { width: 84px; height: 84px; border-radius: 8px; object-fit: cover; display: block; background: #1e1f22; }
.v2p-sep { height: 0; } .v2p-sep.sm { margin: .25rem 0; } .v2p-sep.lg { margin: .75rem 0; } .v2p-sep.line { border-top: 1px solid #4e5058; }
.v2p-gallery { display: grid; gap: 4px; border-radius: 8px; overflow: hidden; max-width: 460px; }
.v2p-gal-item { position: relative; min-width: 0; background: #1e1f22; overflow: hidden; }
.v2p-gal-img { width: 100%; height: 100%; min-height: 70px; object-fit: cover; display: block; aspect-ratio: 1; }
.v2p-gallery.g1 { grid-template-columns: 1fr; } .g1 .v2p-gal-img { aspect-ratio: 16 / 10; }
.v2p-gallery.g2 { grid-template-columns: 1fr 1fr; }
.v2p-gallery.g3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; } .g3 .i1 { grid-row: span 2; } .g3 .i1 .v2p-gal-img { aspect-ratio: auto; }
.v2p-gallery.g4 { grid-template-columns: 1fr 1fr; }
.v2p-gallery.g5, .v2p-gallery.g7, .v2p-gallery.g8, .v2p-gallery.g10 { grid-template-columns: repeat(6, 1fr); }
.v2p-gallery.g6, .v2p-gallery.g9 { grid-template-columns: repeat(3, 1fr); }
.g5 .i1, .g5 .i2, .g8 .i1, .g8 .i2 { grid-column: span 3; } .g5 .i3, .g5 .i4, .g5 .i5, .g8 .i3, .g8 .i4, .g8 .i5, .g8 .i6, .g8 .i7, .g8 .i8 { grid-column: span 2; }
.g7 .i1, .g10 .i1 { grid-column: span 6; } .g7 .i2, .g7 .i3, .g7 .i4, .g7 .i5, .g7 .i6, .g7 .i7, .g10 .i2, .g10 .i3, .g10 .i4, .g10 .i5, .g10 .i6, .g10 .i7, .g10 .i8, .g10 .i9, .g10 .i10 { grid-column: span 2; }
.v2p-file { display: flex; align-items: center; gap: .7rem; background: #1e1f22; border: 1px solid #3f4147; border-radius: 8px; padding: .6rem .8rem; max-width: 360px; }
.v2p-file-ico { color: #b5bac1; display: grid; place-items: center; } .v2p-file-meta { display: flex; flex-direction: column; min-width: 0; } .v2p-file-meta b { color: #00a8fc; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; } .v2p-file-meta small { color: #949ba4; }
.v2p-row { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.v2p-select { display: flex; align-items: center; justify-content: space-between; gap: .6rem; width: 100%; max-width: 420px; min-height: 40px; padding: .4rem .75rem; background: #1e1f22; border: 1px solid #3f4147; border-radius: 4px; color: #dbdee1; font-size: .88rem; }
.v2p-select-label.ph { color: #949ba4; } .v2p-select.off { opacity: .5; }
.v2p-spoiler { position: relative; cursor: pointer; border-radius: 8px; overflow: hidden; }
.v2p-spoiler > :first-child { filter: blur(22px); pointer-events: none; }
.v2p-spoiler-tag { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; font-size: .72rem; letter-spacing: .08em; color: #fff; background: rgba(0,0,0,.45); }
.v2p-spoiler.open > :first-child { filter: none; pointer-events: auto; } .v2p-spoiler.open .v2p-spoiler-tag { display: none; }

/* --- معاينة الثريد */
.v2p-thread { display: flex; flex-direction: column; gap: .9rem; }
.v2p-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; font-size: .82rem; }
.v2p-steps li { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.v2p-step-n { width: 20px; height: 20px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; font-size: .7rem; font-weight: 700; flex-shrink: 0; }
.v2p-thread-panel { background: #313338; border: 1px solid #1e1f22; border-radius: 8px; padding: .7rem; display: flex; flex-direction: column; gap: .8rem; }
.v2p-thread-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; color: #f2f3f5; }
.v2p-thread-origin { font-size: .75rem; }
.v2p-thread-msg { display: flex; flex-direction: column; gap: .3rem; padding-top: .6rem; border-top: 1px solid #3f4147; }
.v2p-thread-no { display: flex; gap: .5rem; align-items: center; font-size: .75rem; font-weight: 700; color: #949ba4; }
.v2p-state { font-size: .7rem; padding: .05rem .55rem; border-radius: 999px; background: var(--surface-3); font-weight: 600; }
.v2p-state.sent, .v2p-state.done { color: var(--ok); } .v2p-state.failed { color: var(--err); } .v2p-state.skipped, .v2p-state.pending, .v2p-state.partial { color: var(--warn); }

@media (max-width: 700px) {
  .v2-head { flex-wrap: wrap; } .v2-sum { order: 5; flex-basis: 100%; }
  .say-side { max-height: none; }
}

/* ---------- صفحات ثنائية اللغة (الخصوصية): يظهر المطابق لـ <html lang> فقط؛ بلا JavaScript تبقى الإنجليزية */
[data-l] { display: none; }
html[lang="en"] [data-l="en"], html[lang="ar"] [data-l="ar"] { display: revert; }
html[lang="en"] main[data-l="en"], html[lang="ar"] main[data-l="ar"] { display: block; }
#lang-toggle[hidden] { display: none; }


/* ---------- حركة وانتقالات: خفيفة (CSS فقط)، وتُلغى كلها مع تفضيل «تقليل الحركة» */
:root { --ease: cubic-bezier(.22, .61, .36, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes pop-out { to { opacity: 0; transform: translateY(6px) scale(.98); } }
@keyframes sheet-out { to { opacity: 0; transform: translateY(28px); } }
.enter { animation: rise .26s var(--ease) backwards; }                       /* محتوى يحل محل الهيكل (انظر clear في ui.js) */
.overlay { animation: fade .18s ease; }                                       /* النوافذ: دخول وخروج */
.modal { animation: pop-in .22s var(--ease); }
.overlay.closing { animation: fade-out .16s ease forwards; pointer-events: none; }
.overlay.closing .modal { animation: pop-out .16s ease forwards; }
@media (max-width: 600px) { .modal, .modal-wide { animation-name: sheet; } .overlay.closing .modal { animation-name: sheet-out; } }
.scrim.show { animation: fade .2s ease; }                                     /* القائمة الجانبية على الجوال */
.btn { transition: background-color .15s ease, border-color .15s ease, color .15s ease, opacity .15s ease, box-shadow .15s ease, transform .12s var(--ease); }
.btn:active:not(:disabled) { transform: scale(.97); }                         /* الضغط على الأزرار */
.icon-btn { transition: background-color .15s ease, color .15s ease, transform .12s var(--ease); } .icon-btn:active { transform: scale(.92); }
.tab { transition: color .15s ease, border-color .2s ease, background-color .15s ease; }
.nav-item { transition: background-color .15s ease, color .15s ease; }
.guild-card, .fcard, .tk-card, .mcmd, .stat { transition: border-color .18s ease, transform .18s var(--ease), box-shadow .18s ease; }
.guild-card:hover, .fcard:hover { box-shadow: 0 10px 28px rgba(0,0,0,.35); }
.guild-card:active, .fcard:active { transform: scale(.985); }
.input, select.input, textarea.input { transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease; }
/* انتقال بين صفحات كاملة (الخصوصية ↔ الداشبورد…) في المتصفحات التي تدعم View Transitions؛ تتجاهلها البقية */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }
}
/* تفضيل «تقليل الحركة»: لا حركة إطلاقًا (تبقى الألوان والحالات كما هي) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
  .btn:active:not(:disabled), .icon-btn:active, .guild-card:active, .fcard:active { transform: none; }
}

/* ---------- صفحة المزايا: مجموعات + بطاقات قابلة للنقر + نافذة تفاصيل بأسلوب Discord */
.features-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; max-width: 900px; margin: 0 auto clamp(1.6rem, 4vw, 2.4rem); }
.fchip-btn { display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .95rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border-2); color: var(--text); font: inherit; font-size: .88rem; cursor: pointer; transition: background-color .15s ease, border-color .15s ease, transform .12s var(--ease); }
.fchip-btn:hover { background: var(--surface-3); border-color: #5a5a68; } .fchip-btn:active { transform: scale(.97); } .fchip-btn .icon { color: var(--muted); }
.fgroup { scroll-margin-top: 1rem; margin-top: clamp(1.8rem, 4vw, 2.8rem); } .fgroup:first-of-type { margin-top: 0; }
.fgroup-head { display: flex; align-items: center; gap: .85rem; margin-bottom: 1rem; min-width: 0; }
.fgroup-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.fgroup-text { min-width: 0; flex: 1; } .fgroup-head h3 { font-size: 1.2rem; line-height: 1.35; } .fgroup-head p { color: var(--muted); font-size: .88rem; }
.fgroup-count { flex: none; color: var(--muted); font-size: .8rem; white-space: nowrap; }
.fcard-btn { appearance: none; -webkit-appearance: none; text-align: start; font: inherit; color: inherit; cursor: pointer; width: 100%; }
.fcard-btn:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }
.fcard-top { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.fcard-btn h4 { font-size: 1.02rem; line-height: 1.4; overflow-wrap: anywhere; }
.fcard-btn .fcard-text { flex: 1; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.fcard-more { display: inline-flex; align-items: center; gap: .35rem; margin-top: .3rem; color: var(--muted); font-size: .82rem; font-weight: 600; transition: color .15s ease; }
.fcard-more .icon { transition: transform .18s var(--ease); }
[dir=ltr] .fcard-more .icon, [dir=ltr] .fm-next .icon, [dir=rtl] .fm-prev .icon { transform: scaleX(-1); }
.fcard-btn:hover .fcard-more, .fcard-btn:focus-visible .fcard-more { color: var(--text); }
.fcard-btn:hover .fcard-more .icon { transform: translateX(-3px); } [dir=ltr] .fcard-btn:hover .fcard-more .icon { transform: scaleX(-1) translateX(-3px); }
.pro-chip-soft { color: #f5b544; background: rgba(245,181,68,.1); box-shadow: inset 0 0 0 1px rgba(245,181,68,.45); }

.modal-feature { max-width: 660px; max-height: min(88vh, 780px); }
.modal-feature .modal-head h3 { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; font-size: 1.15rem; min-width: 0; }
.modal-feature .modal-body { display: flex; flex-direction: column; gap: 1rem; padding: 1.2rem 1.3rem 1.4rem; overscroll-behavior: contain; }
.fm-hero { display: flex; align-items: center; gap: .95rem; padding: 1rem; border-radius: 14px; border: 1px solid var(--border); background: linear-gradient(135deg, var(--surface-2), var(--surface)); }
.fm-hero-icon { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; flex: none; }
.fm-hero-text { min-width: 0; } .fm-group { font-size: .76rem; font-weight: 700; color: var(--muted); margin-bottom: .15rem; } .fm-tag { font-weight: 600; line-height: 1.55; overflow-wrap: anywhere; }
.fm-label { font-size: .74rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: .4rem; }
[dir=rtl] .fm-label { letter-spacing: 0; font-size: .8rem; }
.fm-block p, .fm-card p, .fm-example p { line-height: 1.75; color: #d6d6e0; overflow-wrap: anywhere; }
.fm-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.fm-card { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: .85rem 1rem; min-width: 0; }
.fm-problem { border-inline-start: 3px solid var(--err); } .fm-benefit { border-inline-start: 3px solid var(--ok); }
.fm-example { background: rgba(110,168,254,.07); border: 1px solid rgba(110,168,254,.25); border-radius: 12px; padding: .85rem 1rem; }
.fm-example .fm-label { color: var(--info); }
.fm-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .55rem; }
.fm-list li { display: flex; gap: .55rem; align-items: flex-start; line-height: 1.6; color: #d6d6e0; } .fm-list li .icon { color: var(--ok); margin-top: .25rem; flex: none; }
.fm-where { display: flex; flex-wrap: wrap; gap: .45rem; }
.fm-chip { display: inline-flex; align-items: center; gap: .4rem; background: var(--surface-3); border: 1px solid var(--border-2); border-radius: 8px; padding: .25rem .65rem; font-size: .82rem; max-width: 100%; overflow-wrap: anywhere; }
.fm-chip .icon { color: var(--muted); flex: none; } .fm-cmd { font-family: ui-monospace, Menlo, Consolas, monospace; color: #e6e6ee; unicode-bidi: isolate; }
.fm-pro { display: flex; gap: .65rem; align-items: flex-start; background: rgba(245,181,68,.08); border: 1px solid rgba(245,181,68,.3); border-radius: 12px; padding: .75rem .9rem; font-size: .88rem; line-height: 1.6; } .fm-pro .icon { color: var(--warn); flex: none; margin-top: .15rem; }
.fm-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .7rem; padding: .8rem 1.2rem; border-top: 1px solid var(--border); background: var(--surface); border-radius: 0 0 16px 16px; }
.fm-nav { display: flex; align-items: center; gap: .4rem; } .fm-count { color: var(--muted); font-size: .82rem; min-width: 4.5rem; text-align: center; }
@media (max-width: 700px) { .fgroup-head { flex-wrap: wrap; } .fgroup-count { display: none; } }
@media (max-width: 600px) {
  .fm-cols { grid-template-columns: minmax(0, 1fr); }
  .modal-feature { max-height: 90vh; max-height: 90dvh; }
  .modal-feature .modal-body { padding: 1rem; }
  .fm-foot { padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom, 0px)); border-radius: 0; } .fm-foot .fm-cta { flex: 1; justify-content: center; }
}
.fcard-btn h4, .fcard-btn .fcard-text { margin: 0; }
@media (max-width: 600px) { /* بطاقات مدمجة على الجوال: الأيقونة بجانب النص لتقصير الصفحة */
  .fcard-btn { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: .9rem; row-gap: .15rem; align-items: start; padding: 1rem; }
  .fcard-top { display: block; grid-column: 1; grid-row: 1 / span 3; } .fcard-top .fcard-icon { width: 44px; height: 44px; margin: 0; }
  .fcard-top .pro-chip { position: absolute; top: .7rem; inset-inline-end: .75rem; }
  .fcard-btn h4, .fcard-btn .fcard-text, .fcard-btn .fcard-more { grid-column: 2; } .fcard-btn:has(.pro-chip) h4 { padding-inline-end: 3.4rem; }
  .fcard-btn .fcard-more { margin-top: .15rem; }
}

/* ===== قفل الميزات المدفوعة + صفحة الاشتراكات (المرحلة 4) ===== */
.pro-lock { position: relative; min-height: 380px; max-height: 640px; border-radius: 16px; overflow: hidden; isolation: isolate; border: 1px solid var(--border); }
.pro-ghost { filter: blur(7px) saturate(.7); opacity: .72; pointer-events: none; user-select: none; transform: scale(1.015); } /* التمويه على الهيكل الوهمي فقط: لا backdrop-filter ثقيل */
.pro-ghost .sk::after { display: none; } /* الهيكل ثابت هنا: لا لمعان */
.pro-lock-veil { position: absolute; inset: 0; display: grid; place-items: center; padding: 1rem; background: radial-gradient(ellipse at center, rgba(11,11,13,.6), rgba(11,11,13,.28)); }
.pro-lock-card { width: min(100%, 440px); text-align: center; display: grid; justify-items: center; gap: .65rem; padding: 1.6rem 1.4rem; background: var(--surface-2); border: 1px solid rgba(245,181,68,.42); border-radius: 18px; box-shadow: 0 24px 60px rgba(0,0,0,.55); }
.pro-lock-card h3 { margin: 0; font-size: 1.3rem; } .pro-lock-card p { margin: 0 0 .35rem; color: var(--muted); font-size: .92rem; overflow-wrap: anywhere; }
.pro-lock-icon { width: 60px; height: 60px; border-radius: 18px; }
@media (prefers-reduced-motion: no-preference) { .pro-lock-card { animation: lock-in .28s ease both; } @keyframes lock-in { from { opacity: 0; transform: translateY(8px) scale(.98); } } }
.pro-link { display: inline-flex; align-items: center; gap: .3rem; color: #f5b544; font-size: .82rem; font-weight: 700; text-decoration: none; } .pro-link:hover { text-decoration: underline; }
.pro-link .icon { width: 13px; height: 13px; }
.lock-saved { margin-bottom: 1rem; }
.bp-applied { margin-bottom: 1rem; }

.sub-stack { display: grid; gap: 1.1rem; }
.sub-hero { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; } .sub-hero .grow { flex: 1; min-width: 200px; } .sub-hero h3 { margin: 0 0 .2rem; } .sub-hero p { margin: 0; }
.sub-hero .soon-icon { width: 56px; height: 56px; border-radius: 16px; }
.sub-plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; } @media (max-width: 720px) { .sub-plans { grid-template-columns: minmax(0, 1fr); } }
.sub-plan { display: grid; gap: .7rem; align-content: start; padding: 1.2rem 1.3rem; } .sub-plan.is-current { border-color: rgba(245,181,68,.5); box-shadow: 0 0 0 1px rgba(245,181,68,.18); }
.sub-plan-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; } .sub-plan-head h3 { margin: 0; font-size: 1.2rem; }
.sub-plan p { margin: 0; color: var(--muted); font-size: .92rem; }
.sub-price { display: flex; justify-content: space-between; gap: .8rem; align-items: baseline; border-top: 1px solid var(--border); padding-top: .7rem; font-size: .88rem; } .sub-price span:first-child { color: var(--muted); } .sub-price b { text-align: end; }
.cmp { display: grid; }
.cmp-head, .cmp-row { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr) minmax(0, 1.35fr) auto; gap: 1rem; align-items: start; padding: .85rem .2rem; }
.cmp-head { color: var(--muted); font-size: .78rem; font-weight: 700; padding-top: 0; border-bottom: 1px solid var(--border-2); }
.cmp-row { border-bottom: 1px solid var(--border); } .cmp-row:last-child { border-bottom: 0; }
.cmp-name { display: flex; align-items: center; gap: .6rem; font-weight: 700; min-width: 0; } .cmp-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; background: rgba(245,181,68,.12); color: #f5b544; } .cmp-name b { overflow-wrap: anywhere; }
.cmp-cell { font-size: .88rem; color: var(--muted); overflow-wrap: anywhere; } .cmp-cell.is-pro { color: var(--text); }
.cmp-cell.yes { color: var(--text); display: flex; align-items: flex-start; gap: .4rem; } .cmp-cell.yes .icon { color: var(--ok); margin-top: .12rem; flex-shrink: 0; }
.cmp-act { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 860px) {
  .cmp-head { display: none; }
  .cmp-row { grid-template-columns: minmax(0, 1fr); gap: .5rem; padding: 1rem .2rem; }
  .cmp-cell::before { content: attr(data-label); display: block; font-size: .7rem; font-weight: 800; letter-spacing: .03em; color: var(--muted); margin-bottom: .1rem; }
  .cmp-cell.yes::before { display: none; }
  .cmp-act { justify-content: flex-start; }
}
.how-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; counter-reset: how; }
.how-step { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .8rem; align-items: start; } .how-step::before { counter-increment: how; content: counter(how); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .85rem; background: var(--surface-3); border: 1px solid var(--border-2); }
.how-step b { display: block; } .how-step p { margin: .15rem 0 0; color: var(--muted); font-size: .88rem; }
.id-box { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: .5rem; } .id-box code { direction: ltr; unicode-bidi: plaintext; background: var(--surface-3); border: 1px solid var(--border-2); border-radius: 10px; padding: .4rem .7rem; font-size: .88rem; overflow-wrap: anywhere; }
.how-cta { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-top: 1rem; } .how-cta small { color: var(--muted); }
.end-list { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; gap: .55rem; } .end-list li { display: flex; gap: .6rem; align-items: flex-start; color: var(--muted); font-size: .9rem; } .end-list .icon { color: #f5b544; margin-top: .22rem; flex-shrink: 0; }
.pro-lock.is-compact { min-height: 300px; max-height: none; } .pro-lock.is-compact .pro-lock-card { padding: 1.1rem 1rem; gap: .5rem; } .pro-lock.is-compact .pro-lock-icon { width: 46px; height: 46px; border-radius: 14px; } .pro-lock.is-compact .pro-lock-card h3 { font-size: 1.1rem; }

/* ---------- محرر تصميم صورة التقييم (Liro Pro): fbd-* ---------- */
.notice-ok { border-inline-start-color: var(--ok); }
.tab-pro { display: inline-flex; align-items: center; gap: .45rem; }
.fbd { display: flex; flex-direction: column; gap: .8rem; outline: none; min-width: 0; }
.fbd-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .7rem; padding: .5rem .7rem; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; position: sticky; top: .4rem; z-index: 5; }
.fbd-group { display: flex; align-items: center; gap: .15rem; padding-inline-end: .7rem; border-inline-end: 1px solid var(--border); }
.fbd-group:last-child, .fbd-actions { border-inline-end: 0; padding-inline-end: 0; }
.fbd-actions { margin-inline-start: auto; gap: .4rem; flex-wrap: wrap; }
.fbd-tb { padding: .35rem .5rem; min-width: 34px; } .fbd-tb.has-text { padding-inline: .7rem; }
.fbd-tb[aria-pressed="true"] { background: var(--surface-3); border-color: #8a8a99; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.fbd-select { width: auto; min-width: 118px; padding-block: .3rem; font-size: .82rem; }
.fbd-sample { gap: .4rem; }
.fbd-zoomlabel { min-width: 54px; background: none; border: 0; color: var(--text); font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; border-radius: 8px; padding: .25rem; direction: ltr; } .fbd-zoomlabel:hover { background: var(--surface-3); }
.fbd-banner:empty { display: none; } .fbd-banner .notice { margin-bottom: 0; } .fbd-bannerbox { justify-content: space-between; flex-wrap: wrap; }

.fbd-main { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: .8rem; align-items: start; }
.fbd-side { display: flex; flex-direction: column; gap: .8rem; min-width: 0; }
.fbd-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .8rem; min-width: 0; }
.fbd-layers-panel, .fbd-props { overflow-wrap: anywhere; } .fbd-props-body { min-width: 0; }
.fbd-panel-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .6rem; color: var(--muted); }
.fbd-panel-head b { color: var(--text); font-size: .9rem; }
.fbd-center { min-width: 0; }
.fbd-scroll { direction: ltr; overflow: auto; display: flex; padding: 48px 28px 32px; min-height: 300px; max-height: calc(100vh - 230px); border: 1px solid var(--border); border-radius: 12px; background: conic-gradient(#1a1a20 25%, #131317 0 50%, #1a1a20 0 75%, #131317 0) 0 0 / 22px 22px; overscroll-behavior: contain; }
.fbd-stage { position: relative; margin: auto; flex: none; box-shadow: 0 10px 40px rgba(0,0,0,.55); user-select: none; -webkit-user-select: none; }
.fbd-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.fbd-gridlayer { position: absolute; inset: 0; pointer-events: none; display: none; background-image: linear-gradient(to right, rgba(255,255,255,.22) 1px, transparent 1px), linear-gradient(to bottom, rgba(255,255,255,.22) 1px, transparent 1px); }
.fbd-gridlayer.on { display: block; }
.fbd-overlay { position: absolute; inset: 0; }
.fbd-box { position: absolute; transform-origin: 50% 50%; cursor: move; touch-action: none; }
.fbd-box:hover { outline: 1px dashed rgba(110,168,254,.85); }
.fbd-box.is-locked { cursor: pointer; }
.fbd-sel { position: absolute; transform-origin: 50% 50%; pointer-events: none; outline: 2px solid var(--info); outline-offset: 0; }
.fbd-sel.is-locked { outline-style: dashed; outline-color: var(--warn); }
.fbd-handle { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; background: #fff; border: 2px solid var(--info); border-radius: 3px; pointer-events: auto; touch-action: none; }
.fbd-handle::after, .fbd-rot::after { content: ""; position: absolute; inset: -7px; }
.fbd-handle.h-nw { left: 0; top: 0; } .fbd-handle.h-n { left: 50%; top: 0; } .fbd-handle.h-ne { left: 100%; top: 0; }
.fbd-handle.h-w { left: 0; top: 50%; } .fbd-handle.h-e { left: 100%; top: 50%; }
.fbd-handle.h-sw { left: 0; top: 100%; } .fbd-handle.h-s { left: 50%; top: 100%; } .fbd-handle.h-se { left: 100%; top: 100%; }
.fbd-stem { position: absolute; left: 50%; top: -26px; width: 2px; height: 26px; margin-left: -1px; background: var(--info); pointer-events: none; }
.fbd-rot { position: absolute; left: 50%; top: -48px; width: 22px; height: 22px; margin-left: -11px; border-radius: 50%; background: var(--info); color: #0b0b0d; display: grid; place-items: center; pointer-events: auto; touch-action: none; box-shadow: 0 2px 8px rgba(0,0,0,.5); }
.fbd-rot:active { cursor: grabbing !important; }
.fbd-lockmark { position: absolute; top: -10px; right: -10px; width: 20px; height: 20px; border-radius: 50%; background: var(--warn); color: #1b1203; display: grid; place-items: center; }
.fbd-guide { position: absolute; background: #ff4fa3; pointer-events: none; box-shadow: 0 0 0 1px rgba(255,79,163,.25); }
.fbd-guide.g-x { top: 0; bottom: 0; width: 1px; } .fbd-guide.g-y { left: 0; right: 0; height: 1px; }
.fbd-bottom { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; margin-top: .55rem; font-size: .82rem; }
.fbd-info { flex: 1; min-width: 160px; }
.fbd-status { display: inline-flex; align-items: center; gap: .35rem; font: inherit; font-size: .78rem; font-weight: 600; padding: .2rem .7rem; border-radius: 99px; border: 1px solid var(--border-2); background: var(--surface-2); color: var(--muted); cursor: default; }
.fbd-status.is-saved { color: var(--ok); border-color: rgba(62,207,142,.3); background: rgba(62,207,142,.08); }
.fbd-status.is-dirty, .fbd-status.is-saving { color: var(--warn); border-color: rgba(245,181,68,.3); background: rgba(245,181,68,.08); }
.fbd-status.is-error { color: var(--err); border-color: rgba(255,93,108,.4); background: rgba(255,93,108,.1); cursor: pointer; }

.fbd-layers { display: flex; flex-direction: column; gap: .2rem; }
.fbd-layer { display: flex; align-items: center; gap: .1rem; padding: .25rem .3rem; border-radius: 9px; border: 1px solid transparent; cursor: pointer; }
.fbd-layer:hover { background: var(--surface-2); } .fbd-layer:focus-visible { outline: 2px solid var(--info); outline-offset: 1px; }
.fbd-layer.is-sel { background: var(--surface-3); border-color: var(--border-2); }
.fbd-layer.is-off .fbd-layer-name, .fbd-layer.is-off .fbd-layer-ico { opacity: .45; }
.fbd-layer .icon-btn { padding: .22rem .3rem; }
.fbd-layer-ico { display: grid; place-items: center; width: 26px; color: var(--muted); flex: none; }
.fbd-layer-name { flex: 1; min-width: 0; font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-inline: .2rem; }
.fbd-add { margin-top: .8rem; display: flex; flex-direction: column; gap: .4rem; }
.fbd-hint { display: flex; flex-direction: column; align-items: center; gap: .5rem; text-align: center; color: var(--muted); padding: .8rem .4rem; font-size: .85rem; }

.fbd-props-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.fbd-props-head .row { margin-inline-start: auto; gap: 0; }
.fbd-props-head .icon-btn:disabled { opacity: .35; cursor: not-allowed; } .icon-btn.danger:hover:not(:disabled) { color: var(--err); }
.fbd-note { font-size: .78rem; padding: .5rem .7rem; margin-bottom: .6rem; }
.fbd-section h4 { margin: .7rem 0 .45rem; font-size: .8rem; color: var(--muted); text-transform: none; font-weight: 700; }
.fbd-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .1rem .6rem; }
.fbd-field { display: flex; flex-direction: column; gap: .2rem; margin-bottom: .55rem; min-width: 0; }
.fbd-field.fbd-inline { flex-direction: row; align-items: center; justify-content: space-between; gap: .6rem; }
.fbd-label { display: flex; justify-content: space-between; gap: .4rem; font-size: .76rem; color: var(--muted); } .fbd-label i { font-style: normal; opacity: .65; direction: ltr; }
.fbd-num { padding: .3rem .5rem; font-size: .85rem; direction: ltr; text-align: start; }
.fbd-num.is-clamped { border-color: var(--warn); box-shadow: 0 0 0 3px rgba(245,181,68,.15); }
.fbd-colorrow { display: flex; align-items: center; gap: .5rem; }
.fbd-color { width: 38px; height: 30px; padding: 0; border: 1px solid var(--border-2); border-radius: 8px; background: none; cursor: pointer; flex: none; }
.fbd-range { flex: 1; min-width: 0; accent-color: #b9b9c6; }
.fbd-hex { direction: ltr; color: var(--muted); font-size: .72rem; flex: none; }
.fbd-colorrow .fbd-num { width: 64px; flex: none; }
.fbd-seg { display: flex; border: 1px solid var(--border-2); border-radius: 10px; overflow: hidden; }
.fbd-seg button { flex: 1; background: var(--bg); color: var(--muted); border: 0; border-inline-end: 1px solid var(--border); padding: .35rem .3rem; font: inherit; font-size: .78rem; cursor: pointer; } .fbd-seg button:last-child { border-inline-end: 0; }
.fbd-seg button:hover { color: var(--text); } .fbd-seg button.on { background: var(--surface-3); color: var(--text); font-weight: 700; }
.fbd-alignrow { display: flex; flex-wrap: wrap; gap: .2rem; margin-top: .25rem; }
.fbd-shortcuts { text-align: start; width: 100%; margin-top: .6rem; display: flex; flex-direction: column; gap: .35rem; font-size: .78rem; }
.fbd-shortcut { display: flex; justify-content: space-between; align-items: center; gap: .6rem; }
.fbd-keys { display: inline-flex; gap: .2rem; align-items: center; flex: none; }
.fbd-shortcuts kbd { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .72rem; background: var(--surface-3); border: 1px solid var(--border-2); border-bottom-width: 2px; border-radius: 6px; padding: .02rem .4rem; color: var(--text); }

.fbd-drop { display: flex; flex-direction: column; align-items: center; gap: .6rem; text-align: center; padding: 2.6rem 1.2rem; border: 2px dashed var(--border-2); border-radius: 16px; background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; }
.fbd-drop:hover, .fbd-drop:focus-visible, .fbd-drop.is-over { border-color: #b9b9c6; background: var(--surface-2); outline: none; }
.fbd-drop.is-busy { opacity: .6; pointer-events: none; }
.fbd-drop p { max-width: 520px; }
.fbd-modal { max-width: min(980px, 96vw); }
.fbd-previewbox { min-height: 160px; display: flex; justify-content: center; align-items: center; padding: .7rem; border-radius: 12px; border: 1px solid var(--border); margin-top: .8rem; background: conic-gradient(#1a1a20 25%, #131317 0 50%, #1a1a20 0 75%, #131317 0) 0 0 / 22px 22px; }
.fbd-previewimg { display: block; max-width: 100%; max-height: 70vh; height: auto; border-radius: 6px; }
.fbd-previewmeta { margin-top: .5rem; direction: ltr; text-align: center; font-size: .8rem; }

.fbd-styles { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .8rem; }
.fbd-style { text-align: start; display: flex; flex-direction: column; gap: .4rem; padding: .9rem 1rem; background: var(--bg); color: var(--text); font: inherit; border: 1px solid var(--border-2); border-radius: 12px; cursor: pointer; transition: border-color .15s, background .15s; }
.fbd-style:hover:not(:disabled) { background: var(--surface-2); border-color: #5a5a68; }
.fbd-style.on { border-color: #b9b9c6; box-shadow: inset 0 0 0 1px #b9b9c6; background: var(--surface-2); }
.fbd-style:disabled { cursor: not-allowed; opacity: .7; }
.fbd-style-title { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-weight: 700; }
.fbd-style .muted { font-size: .85rem; line-height: 1.6; }
.fbd-style-note { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--warn); }

@media (max-width: 1000px) {
  .fbd-main { grid-template-columns: minmax(0, 1fr); }
  .fbd-side { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .fbd-scroll { max-height: 70vh; }
}
@media (max-width: 700px) {
  .fbd-side { grid-template-columns: minmax(0, 1fr); }
  .fbd-toolbar { position: static; }
  .fbd-group { border-inline-end: 0; padding-inline-end: 0; }
  .fbd-actions { margin-inline-start: 0; width: 100%; }
  .fbd-actions .btn { flex: 1; }
  .fbd-scroll { padding: 40px 14px 24px; }
  .fbd-bottom { justify-content: space-between; }
}
@media (pointer: coarse) {
  .fbd-handle { width: 18px; height: 18px; margin: -9px 0 0 -9px; }
  .fbd-handle::after, .fbd-rot::after { inset: -10px; }
  .fbd-rot { width: 28px; height: 28px; margin-left: -14px; top: -56px; } .fbd-stem { top: -30px; height: 30px; }
}
@media (prefers-reduced-motion: reduce) { .fbd-drop, .fbd-style { transition: none; } }
