@font-face { font-family: 'Kufi'; src: url('/fonts/reem-kufi-arabic-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --bg: #ffffff;
  --raised: #efefef;
  --hover: #f5f5f5;
  --line: #dbdbdb;
  --line-soft: #efefef;
  --ink: #000000;
  --muted: #737373;
  --faint: #a8a8a8;
  --accent: #0095f6;
  --accent-hover: #1877f2;
  --accent-soft: #e0f1ff;
  --ok: #12a150;
  --bad: #ed4956;
  --story: linear-gradient(45deg, #feda75 0%, #fa7e1e 25%, #d62976 50%, #962fbf 75%, #4f5bd5 100%);
  --scrim: rgba(0, 0, 0, .55);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: system-ui, -apple-system, 'SF Arabic', 'Segoe UI', Roboto, 'Noto Sans Arabic', Tahoma, sans-serif;
  color-scheme: light;
}
:root[data-theme='dark'] {
  --bg: #000000;
  --raised: #262626;
  --hover: #121212;
  --line: #363636;
  --line-soft: #262626;
  --ink: #f5f5f5;
  --muted: #a8a8a8;
  --faint: #737373;
  --accent-soft: #0b2a42;
  --ok: #2fcf7a;
  --bad: #ff5a68;
  --scrim: rgba(0, 0, 0, .7);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-family: var(--font); font-size: 14px; line-height: 1.45; min-height: 100dvh; -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
svg.i { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
svg.i.sm { width: 18px; height: 18px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.err { color: var(--bad); font-size: 13px; min-height: 1.2em; }
.note { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* أزرار */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 16px; border-radius: 8px; font-weight: 600; font-size: 14px; background: var(--raised); color: var(--ink); white-space: nowrap; transition: opacity .15s, background .15s; }
.btn:active { opacity: .7; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.wide { width: 100%; }
.btn.lg { height: 44px; font-size: 15px; border-radius: 10px; }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: .35; pointer-events: none; }
.tbtn { color: var(--accent); font-weight: 600; font-size: 14px; }
.tbtn:disabled { opacity: .35; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; }
.icon-btn:active { background: var(--hover); }

input, textarea { width: 100%; font: inherit; font-size: 14px; color: var(--ink); background: var(--raised); border: 1px solid transparent; border-radius: 8px; padding: 10px 12px; outline: none; }
input:focus, textarea:focus { border-color: var(--line); background: var(--bg); }
input::placeholder, textarea::placeholder { color: var(--faint); }
textarea { resize: none; line-height: 1.55; }
input[type='datetime-local'], input[type='time'], input[type='date'] { direction: ltr; text-align: right; }
input[type='range'] { padding: 0; background: none; accent-color: var(--accent); }
label.lbl { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 14px 0 6px; }

.seg { display: inline-flex; background: var(--raised); border-radius: 9px; padding: 2px; }
.seg button { padding: 6px 12px; border-radius: 7px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.seg button.on { background: var(--bg); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.12); }

.switch { position: relative; width: 44px; height: 26px; flex-shrink: 0; display: inline-block; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line); transition: .2s; cursor: pointer; }
.switch span::after { content: ''; position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { right: 21px; }

/* المنصات */
.pt { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 4px; font-size: 7px; font-weight: 700; color: #fff; flex-shrink: 0; direction: ltr; letter-spacing: .02em; }
.pt.facebook { background: #1877f2; }
.pt.instagram { background: linear-gradient(45deg, #fa7e1e, #d62976, #962fbf); }
.pt.youtube { background: #ff0033; }
.pt.tiktok { background: #000; box-shadow: inset 1px 1px 0 #25f4ee, inset -1px -1px 0 #fe2c55; }
:root[data-theme='dark'] .pt.tiktok { background: #1a1a1a; }
.pt.lg { width: 28px; height: 28px; border-radius: 8px; font-size: 10px; }

/* الأفاتار */
.av { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; display: inline-grid; place-items: center; background: var(--raised); color: #fff; font-weight: 600; font-size: 13px; line-height: 1; }
.story { position: relative; display: inline-grid; place-items: center; border-radius: 50%; padding: 2.5px; background: var(--line); flex-shrink: 0; }
.story.on { background: var(--story); }
.story > .av { border: 2.5px solid var(--bg); box-sizing: content-box; }
.story .pt { position: absolute; bottom: 0; left: 0; border: 2px solid var(--bg); box-sizing: content-box; }

/* الدخول */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 32px; }
.login-box { width: 100%; max-width: 340px; text-align: center; }
.wordmark { font-family: 'Kufi', var(--font); font-weight: 700; }
.login .wordmark { font-size: 56px; line-height: 1.2; display: block; }
.login p { color: var(--muted); margin-top: 6px; }
.login form { margin-top: 34px; display: grid; gap: 10px; }

/* الهيكل */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: calc(var(--safe-t) + 6px) 12px 6px 6px; background: var(--bg); }
.topbar .wordmark { font-size: 27px; padding-inline-start: 4px; }
.topbar h1 { font-size: 20px; font-weight: 700; padding-inline-start: 4px; }
.topbar .acts { display: flex; gap: 2px; }
.page { max-width: 640px; margin: 0 auto; padding-bottom: calc(70px + var(--safe-b)); }
.pad { padding: 0 16px; }

.tabbar { position: fixed; z-index: 30; bottom: 0; left: 0; right: 0; height: calc(52px + var(--safe-b)); padding-bottom: var(--safe-b); display: grid; grid-template-columns: repeat(5, 1fr); background: var(--bg); border-top: 1px solid var(--line-soft); }
.tabbar a, .tabbar button { display: grid; place-items: center; color: var(--ink); }
.tabbar svg.i { width: 26px; height: 26px; stroke-width: 1.7; }
.tabbar .on svg.i { stroke-width: 2.6; }
.tabbar .new svg.i { width: 28px; height: 28px; }

/* صف الستوري */
.stories { display: flex; gap: 14px; overflow-x: auto; padding: 8px 16px 12px; scrollbar-width: none; border-bottom: 1px solid var(--line-soft); }
.stories::-webkit-scrollbar { display: none; }
.st { display: grid; justify-items: center; gap: 5px; width: 70px; flex-shrink: 0; }
.st .av { width: 60px; height: 60px; font-size: 22px; }
.st .pt { width: 18px; height: 18px; font-size: 7.5px; }
.st span.nm { font-size: 12px; max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st .add { width: 65px; height: 65px; border-radius: 50%; display: grid; place-items: center; border: 1.5px dashed var(--faint); color: var(--muted); }

/* ملخص وتبويبات */
.summary { display: flex; padding: 14px 16px 10px; }
.summary div { flex: 1; text-align: center; }
.summary b { display: block; font-size: 17px; font-weight: 700; }
.summary span { font-size: 13px; color: var(--muted); }
.tabs { display: flex; border-top: 1px solid var(--line-soft); }
.tabs button { flex: 1; height: 44px; display: grid; place-items: center; color: var(--faint); border-bottom: 1px solid transparent; margin-bottom: -1px; position: relative; }
.tabs button.on { color: var(--ink); border-bottom: 1.5px solid var(--ink); }
.tabs button em { position: absolute; top: 6px; left: calc(50% - 22px); font-style: normal; font-size: 10px; font-weight: 700; color: #fff; background: var(--bad); border-radius: 99px; min-width: 16px; height: 16px; padding: 0 4px; display: grid; place-items: center; }

/* الشبكة */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.gi { position: relative; aspect-ratio: 9 / 16; background: var(--raised); overflow: hidden; display: block; width: 100%; }
.gi video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gi .shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.28) 0%, transparent 24%, transparent 62%, rgba(0,0,0,.55) 100%); }
.gi .plats { position: absolute; top: 6px; right: 6px; display: flex; gap: 2px; }
.gi .when { position: absolute; bottom: 6px; right: 7px; left: 7px; display: flex; align-items: center; gap: 4px; color: #fff; font-size: 12px; font-weight: 600; text-shadow: 0 1px 2px rgba(0,0,0,.5); white-space: nowrap; overflow: hidden; }
.gi .when svg.i { width: 15px; height: 15px; stroke-width: 2.2; }
.gi .flag { position: absolute; top: 6px; left: 6px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.gi .flag svg.i { width: 14px; height: 14px; stroke-width: 2.6; }
.gi .flag.failed, .gi .flag.partial { background: var(--bad); }
.gi .flag.publishing { background: var(--accent); }
.gi .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.3); }
.gi .bar i { display: block; height: 100%; background: #fff; }
.gi.paused video { filter: grayscale(1) brightness(.8); }

.empty { text-align: center; padding: 48px 32px; }
.empty .ring { width: 62px; height: 62px; border-radius: 50%; border: 2px solid var(--ink); display: grid; place-items: center; margin: 0 auto 14px; }
.empty .ring svg.i { width: 30px; height: 30px; stroke-width: 1.5; }
.empty h3 { font-size: 20px; font-weight: 800; }
.empty p { color: var(--muted); margin-top: 6px; }
.empty .btn, .empty .tbtn { margin-top: 14px; }

.alert { margin: 10px 16px 0; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--raised); font-size: 13px; width: calc(100% - 32px); text-align: start; }
.alert .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); flex-shrink: 0; }
.alert.ok .dot { background: var(--ok); }

/* القوائم */
.list-h { font-size: 16px; font-weight: 700; padding: 18px 16px 6px; display: flex; justify-content: space-between; align-items: baseline; }
.list-h small { font-size: 13px; font-weight: 400; color: var(--muted); }
.cell { display: flex; align-items: center; gap: 12px; padding: 10px 16px; min-height: 52px; width: 100%; text-align: start; }
button.cell:active, a.cell:active { background: var(--hover); }
.cell .t { font-size: 14px; }
.cell .s { font-size: 12.5px; color: var(--muted); }
.cell .chev { color: var(--faint); transform: scaleX(-1); width: 18px; height: 18px; }
.cell .val { color: var(--muted); font-size: 14px; white-space: nowrap; }
.cell.red { color: var(--bad); }
.sep { height: 8px; }
.hr { height: 1px; background: var(--line-soft); margin: 4px 0; }

.thumb { position: relative; width: 40px; height: 64px; border-radius: 6px; overflow: hidden; background: var(--raised); flex-shrink: 0; }
.thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.status { font-size: 12px; font-weight: 600; white-space: nowrap; color: var(--muted); }
.status.done { color: var(--ok); } .status.failed, .status.partial { color: var(--bad); } .status.publishing { color: var(--accent); }

/* التقويم */
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 10px; }
.cal-head h2 { font-size: 16px; font-weight: 700; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); padding: 0 8px; row-gap: 4px; }
.cal-grid .wd { text-align: center; font-size: 11px; color: var(--faint); padding-bottom: 6px; }
.cal-day { aspect-ratio: 1 / 1.1; display: grid; justify-items: center; align-content: center; gap: 4px; border-radius: 50%; }
.cal-day .num { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; }
.cal-day.out { color: var(--faint); }
.cal-day.today .num { color: var(--accent); font-weight: 700; }
.cal-day.sel .num { background: var(--ink); color: var(--bg); font-weight: 700; }
.cal-day .ticks { display: flex; gap: 2px; height: 5px; }
.cal-day .ticks i { width: 5px; height: 5px; border-radius: 50%; background: var(--faint); }
.cal-day .ticks i.done { background: var(--ok); } .cal-day .ticks i.failed, .cal-day .ticks i.partial { background: var(--bad); } .cal-day .ticks i.scheduled, .cal-day .ticks i.publishing { background: var(--accent); }

/* الأوراق */
.scrim { position: fixed; inset: 0; z-index: 40; background: var(--scrim); animation: fade .2s; }
.sheet { position: fixed; z-index: 41; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 640px; max-height: calc(100dvh - var(--safe-t) - 40px); display: flex; flex-direction: column; background: var(--bg); border-radius: 14px 14px 0 0; animation: up .3s cubic-bezier(.2, .9, .25, 1); }
.sheet.full { height: 100dvh; max-height: 100dvh; border-radius: 0; padding-top: var(--safe-t); animation: slide .28s cubic-bezier(.2, .9, .25, 1); }
.sheet.closing { animation: down .2s ease-in forwards; }
.sheet.full.closing { animation: slideout .2s ease-in forwards; }
.scrim.closing { animation: fade .2s reverse forwards; }
@keyframes up { from { transform: translateY(100%); } }
@keyframes down { to { transform: translateY(100%); } }
@keyframes slide { from { transform: translateY(24px); opacity: 0; } }
@keyframes slideout { to { transform: translateY(24px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.sheet-grip { width: 36px; height: 4px; border-radius: 4px; background: var(--line); margin: 8px auto 0; flex-shrink: 0; }
.sheet.full .sheet-grip { display: none; }
.sheet-head { display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; height: 48px; padding: 0 4px; flex-shrink: 0; border-bottom: 1px solid var(--line-soft); }
.sheet-head h2 { font-size: 16px; font-weight: 700; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-head .end { justify-self: end; padding-inline-end: 12px; }
.sheet-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 16px; }
.sheet-foot { flex-shrink: 0; padding: 10px 16px calc(10px + var(--safe-b)); border-top: 1px solid var(--line-soft); background: var(--bg); }

/* المحرر */
.compose-top { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
.media-box { position: relative; width: 92px; aspect-ratio: 9 / 16; border-radius: 6px; overflow: hidden; background: var(--raised); flex-shrink: 0; display: grid; place-items: center; color: var(--muted); }
.media-box video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.media-box .pick { display: grid; justify-items: center; gap: 4px; font-size: 12px; font-weight: 600; }
.media-box .ovl { position: absolute; inset: auto 0 0 0; padding: 6px; font-size: 11px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.65)); text-align: center; }
.media-box .prog { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.4); color: #fff; font-weight: 700; font-size: 15px; }
.media-box .prog svg { position: absolute; width: 54px; height: 54px; transform: rotate(-90deg); }
.cap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cap textarea { flex: 1; background: none; border: 0; padding: 4px 0; min-height: 120px; font-size: 15px; }
.cap textarea:focus, .cap textarea:focus-visible { background: none; border: 0; outline: none; }
.cap-tools { display: flex; gap: 14px; align-items: center; font-size: 13px; font-weight: 600; }
.cap-tools button { color: var(--accent); }
.cap-tools .n { margin-inline-start: auto; color: var(--faint); font-weight: 400; font-size: 12px; }

.acc { border-bottom: 1px solid var(--line-soft); }
.acc > .cell { min-height: 54px; }
.acc > .cell .chev { transition: transform .2s; }
.acc.open > .cell .chev { transform: scaleX(-1) rotate(90deg); }
.acc-body { padding: 0 16px 16px; }
.stack { display: flex; align-items: center; }
.stack .av { width: 24px; height: 24px; font-size: 10px; border: 2px solid var(--bg); box-sizing: content-box; margin-inline-start: -8px; }
.stack > :first-child { margin-inline-start: 0; }
.stack b { font-size: 13px; color: var(--muted); font-weight: 400; margin-inline-start: 6px; }

.groups { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.groups button { height: 32px; padding: 0 14px; border-radius: 8px; background: var(--raised); font-size: 13px; font-weight: 600; white-space: nowrap; }
.groups button.on { background: var(--ink); color: var(--bg); }
.plat-head { display: flex; align-items: center; justify-content: space-between; margin: 16px 0 8px; font-size: 13px; font-weight: 700; }
.plat-head .row { gap: 8px; }
.pick-accs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 6px; }
.pa { display: grid; justify-items: center; gap: 5px; }
.pa .av { width: 54px; height: 54px; font-size: 20px; }
.pa .nm { font-size: 11.5px; max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.pa.on .nm { color: var(--ink); font-weight: 600; }
.pa .story { padding: 2.5px; }
.pa .check { position: absolute; bottom: -1px; left: -1px; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; border: 2px solid var(--bg); }
.pa .check svg.i { width: 11px; height: 11px; stroke-width: 3.5; }

.opts { display: grid; gap: 14px; }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; }
.warn { margin: 12px 16px 0; padding: 10px 12px; border-radius: 10px; background: var(--raised); font-size: 13px; line-height: 1.5; }

/* الرفع الجماعي */
.bulk-row { display: flex; align-items: center; gap: 12px; padding: 8px 16px; }
.bulk-row input { background: none; border: 0; border-bottom: 1px solid var(--line-soft); border-radius: 0; padding: 6px 0; font-weight: 600; }
.bulk-row .meta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.mini { width: 54px; height: 3px; border-radius: 3px; background: var(--raised); overflow: hidden; }
.mini i { display: block; height: 100%; background: var(--accent); }
.mini.done i { background: var(--ok); }

/* التفاصيل */
.detail-top { display: flex; gap: 14px; padding: 16px; }
.detail-top .media-box { width: 104px; }
.detail-cap { white-space: pre-wrap; font-size: 14px; line-height: 1.6; max-height: 140px; overflow-y: auto; }
.trow { display: flex; align-items: center; gap: 12px; padding: 9px 16px; }
.trow .msg { font-size: 12.5px; color: var(--muted); word-break: break-word; }
.trow .msg.bad { color: var(--bad); }

/* الإعدادات */
.set-sec { font-size: 13px; font-weight: 600; color: var(--muted); padding: 18px 16px 4px; }
.set-ic { width: 24px; display: grid; place-items: center; }

.slot { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.slot input[type='time'] { width: 108px; font-size: 16px; font-weight: 700; padding: 6px 8px; }
.days { display: flex; gap: 4px; flex: 1 1 210px; }
.days button { width: 30px; height: 30px; border-radius: 50%; font-size: 12px; color: var(--muted); background: var(--raised); }
.days button.on { background: var(--ink); color: var(--bg); font-weight: 700; }

.steps { list-style: none; margin: 0; padding: 0 16px; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding: 0 34px 14px 0; line-height: 1.6; }
.steps li::before { content: counter(s); position: absolute; right: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--ink); display: grid; place-items: center; font-size: 12px; font-weight: 700; }

.pick-list .cell { align-items: flex-start; border-bottom: 1px solid var(--line-soft); }
.pick-list .s { white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.toast { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); bottom: calc(66px + var(--safe-b)); background: #262626; color: #fff; padding: 11px 16px; border-radius: 10px; font-size: 14px; animation: toast .25s ease-out; max-width: calc(100vw - 32px); text-align: center; }
@keyframes toast { from { opacity: 0; transform: translate(-50%, 8px); } }

/* لحظة النشر */
.sending { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: var(--bg); animation: fade .2s; }
.sending .box { display: grid; justify-items: center; gap: 18px; text-align: center; }
.sending .loader { width: 64px; height: 64px; border-radius: 50%; padding: 3px; background: var(--story); animation: spin 1s linear infinite; -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px)); mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px)); }
@keyframes spin { to { transform: rotate(360deg); } }
.sending .done { width: 96px; height: 96px; border-radius: 50%; padding: 4px; background: var(--story); animation: pop .5s cubic-bezier(.2, 1.4, .4, 1); }
.sending .done span { width: 100%; height: 100%; border-radius: 50%; background: var(--bg); display: grid; place-items: center; }
.sending .done svg.i { width: 44px; height: 44px; stroke-width: 2.4; animation: draw .5s .15s ease-out both; stroke-dasharray: 30; }
@keyframes draw { from { stroke-dashoffset: 30; } }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
.sending h2 { font-size: 22px; font-weight: 800; }
.sending p { color: var(--muted); }
.sending .fan { display: flex; gap: 6px; }
.sending .fan .pt { animation: pop .4s cubic-bezier(.2, 1.4, .4, 1) both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (min-width: 700px) {
  .sheet { bottom: 24px; border-radius: 14px; }
  .sheet.full { height: calc(100dvh - 48px); max-height: none; top: 24px; border-radius: 14px; }
}

/* أنواع المنشورات */
.kinds { display: flex; justify-content: center; gap: 6px; padding: 8px 16px; border-bottom: 1px solid var(--line-soft); flex-shrink: 0; }
.kinds button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: 99px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.kinds button.on { background: var(--ink); color: var(--bg); }
.img-strip { display: flex; gap: 6px; overflow-x: auto; padding: 12px 16px 0; scrollbar-width: none; }
.img-strip::-webkit-scrollbar { display: none; }
.img-tile, .img-add { position: relative; flex: 0 0 84px; aspect-ratio: 4 / 5; border-radius: 6px; overflow: hidden; background: var(--raised); }
.img-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-tile .n { position: absolute; top: 5px; right: 5px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.img-tile .up { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.45); color: #fff; font-weight: 700; font-size: 13px; }
.img-tile .up.bad { background: rgba(237,73,86,.7); }
.img-tile .rm { position: absolute; top: 4px; left: 4px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; }
.img-tile .rm svg.i { width: 12px; height: 12px; stroke-width: 2.8; }
.img-add { display: grid; place-content: center; justify-items: center; gap: 4px; color: var(--muted); font-size: 12px; font-weight: 600; border: 1.5px dashed var(--line); background: none; }
.media-col { display: grid; gap: 6px; justify-items: center; flex-shrink: 0; }
.lib-link { color: var(--accent); font-size: 12.5px; font-weight: 600; }
.link-row { display: flex; align-items: center; gap: 8px; margin: 0 16px 12px; padding: 0 12px; background: var(--raised); border-radius: 8px; color: var(--muted); }
.link-row input { background: none; border: 0; padding: 10px 0; text-align: left; }
.link-row input:focus, .link-row input:focus-visible { background: none; border: 0; outline: none; }
.text-tile { position: absolute; inset: 0; display: grid; place-items: center; padding: 10px; color: #fff; text-align: center; }
.text-tile span { font-size: 13px; font-weight: 700; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.thumb .text-tile span { font-size: 6px; -webkit-line-clamp: 4; }
.gi img, .thumb img, .media-box img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb { position: relative; }
.thumb video { position: absolute; inset: 0; }
.gi .flag.kind { background: none; left: auto; right: auto; top: auto; }
.gi .flag.kind { position: absolute; top: 6px; left: 4px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.gi .flag.kind svg.i { width: 18px; height: 18px; fill: none; stroke-width: 2.2; }
.gi.draft video, .gi.draft img { opacity: .75; }
.gi.lib.chosen::after { content: ''; position: absolute; inset: 0; border: 3px solid var(--accent); }
.gi .pick-n { position: absolute; top: 6px; left: 6px; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; font-size: 12px; display: grid; place-items: center; border: 2px solid #fff; }
.gi .del { position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(0,0,0,.45); }
.gi .del svg.i { width: 16px; height: 16px; }
.filters-row { display: flex; gap: 6px; padding: 4px 16px 12px; }
.filters-row button { height: 32px; padding: 0 14px; border-radius: 8px; background: var(--raised); font-size: 13px; font-weight: 600; }
.filters-row button.on { background: var(--ink); color: var(--bg); }

.copy-box { display: flex; align-items: center; gap: 8px; background: var(--raised); border-radius: 8px; padding: 6px 6px 6px 10px; }
.copy-box code { flex: 1; min-width: 0; font-size: 12px; overflow-x: auto; white-space: nowrap; padding: 4px 6px; scrollbar-width: none; }
.steps code { background: var(--raised); padding: 2px 6px; border-radius: 4px; font-size: 12.5px; }

.moved-bar { display: flex; align-items: center; gap: 12px; margin: 8px 16px 4px; padding: 12px 14px; border-radius: 14px; background: #fff7e6; border: 1px solid #ffe0a3; }
.moved-bar > div { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.moved-bar span { color: var(--muted); font-size: 12px; line-height: 1.45; }
.btn.sm { padding: 7px 12px; font-size: 13px; white-space: nowrap; }
