/* The social sections: publishing, replies and the linked accounts. Built on the studio's own cards, chips and buttons. */
.so-head { align-items: center; }
.so-head > div:first-child { flex: 1 1 260px; min-width: 0; }
.so-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.so-list { display: flex; flex-direction: column; gap: 14px; }
.so-safe { margin: 0; }

/* A platform's mark: a small tile in the platform's own colour. */
.so-mark { flex-shrink: 0; width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font: 700 12px/1 var(--sans); color: var(--ink-2); background: #fff; border: 1px solid var(--line); letter-spacing: 0; }
.so-mark svg { width: 64%; height: 64%; display: block; }

/* Accounts */
.so-account { display: flex; align-items: center; gap: 12px; padding: 14px 16px; flex-wrap: wrap; }
.so-account-main { flex: 1 1 180px; min-width: 0; display: flex; flex-direction: column; }
.so-account-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.so-via.official { background: var(--c50); color: var(--c700); }
.so-via.browser { background: var(--line-2); color: var(--ink-2); }
.so-ok { background: var(--ok-bg); color: var(--ok); }
.so-link, .so-guide { display: flex; flex-direction: column; gap: 14px; }
.so-link p, .so-guide p { margin: 0; }
.so-platforms { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.so-platform { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; font: inherit; font-weight: 600; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease; }
.so-platform:hover { border-color: var(--ink); }
.so-platform[aria-pressed="true"] { border-color: var(--cobalt); box-shadow: 0 0 0 4px rgba(47,75,255,.15); }
.so-ways { display: flex; flex-direction: column; gap: 10px; }
.so-ways:empty { display: none; }
.so-picked { display: flex; align-items: center; gap: 10px; }
.so-way { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; box-shadow: none; }
.so-steps { margin: 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.7; }
.so-redirect { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border: 1px dashed var(--line); border-radius: var(--r-sm); background: var(--paper); }
.so-redirect code { flex: 1 1 240px; min-width: 0; font: 500 13px/1.5 var(--mono); overflow-wrap: anywhere; user-select: all; }

/* Posts */
.so-post { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.so-post p { margin: 0; }
.so-post-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.so-caption { font-size: 14px; color: var(--ink-2); white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.so-targets { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line-2); padding-top: 10px; }
.so-target { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.so-target .so-mark { width: 24px; height: 24px; border-radius: 6px; font-size: 10px; }
.so-target-name { font-weight: 600; font-size: 14px; }
.so-state { background: var(--line-2); color: var(--ink-2); }
.so-state.done, .so-state.sent { background: var(--ok-bg); color: var(--ok); }
.so-state.publishing, .so-state.running, .so-state.approved, .so-state.sending, .so-state.drafting, .so-state.new { background: var(--c50); color: var(--c700); }
.so-state.scheduled, .so-state.queued, .so-state.drafted, .so-state.partial, .so-state.needs_you { background: var(--warn-bg); color: #8A5300; }
.so-state.failed { background: var(--err-bg); color: var(--err); }

/* The new post */
.so-block { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.so-block-title { margin: 0; font-size: 16px; font-weight: 700; }
.so-video-pick { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.so-video-pick .field { align-self: stretch; }
.so-video-pick p { margin: 0; }
.so-montages { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.so-montage { display: flex; flex-direction: column; gap: 6px; padding: 6px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; font: inherit; font-size: 13px; text-align: start; cursor: pointer; transition: border-color .15s ease; }
.so-montage:hover { border-color: var(--cobalt); }
.so-montage img, .so-montage-blank { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 6px; background: var(--line-2); display: flex; align-items: center; justify-content: center; color: var(--mute); }
.so-montage-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.so-montage-still { position: relative; display: block; width: 100%; aspect-ratio: 16 / 10; border-radius: 6px; overflow: hidden; background: var(--line-2); }
.so-montage-still img, .so-montage-still video, .so-montage-still .so-montage-blank { width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; display: flex; pointer-events: none; }
.so-montage-still .dur { position: absolute; bottom: 5px; inset-inline-end: 5px; padding: 1px 6px; border-radius: 4px; background: rgba(17,18,20,.72); color: #fff; font-size: 11px; font-weight: 600; }
/* The three ways to choose the video: a finished montage, a finished timeline, or a file from the device. */
.so-video-ways { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.so-way-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; font: inherit; text-align: start; cursor: pointer; color: var(--ink); transition: border-color .15s ease, box-shadow .15s ease; }
.so-way-btn:hover { border-color: var(--cobalt); box-shadow: 0 0 0 3px var(--c50); }
.so-way-btn svg { color: var(--cobalt); }
.so-way-btn .hint { font-size: 12px; }
@media (max-width: 700px) { .so-video-ways { grid-template-columns: 1fr; } }
/* The window that lists every finished video of one kind. */
.so-picker { display: flex; flex-direction: column; gap: 12px; }
.so-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; max-height: min(60vh, 560px); overflow-y: auto; padding: 2px; }
.so-picker-empty { grid-column: 1 / -1; margin: 12px 0; text-align: center; }
.so-picked-still { width: 72px; flex: 0 0 72px; aspect-ratio: 16 / 10; border-radius: 6px; overflow: hidden; background: var(--line-2); }
.so-picked-still img, .so-picked-still video { width: 100%; height: 100%; object-fit: cover; display: block; }
.so-picked-video { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.so-picked-video b { flex: 1 1 160px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.so-pick-accounts { display: flex; flex-direction: column; gap: 8px; }
.so-pick-account { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); flex-wrap: wrap; transition: border-color .15s ease; }
.so-pick-account.on { border-color: var(--c200); background: var(--c50); }
.so-pick-account.off { opacity: .6; }
.so-pick-main { display: flex; align-items: center; gap: 10px; flex: 1 1 200px; min-width: 0; cursor: pointer; }
.so-pick-account input { width: 18px; height: 18px; accent-color: var(--cobalt); flex-shrink: 0; }
.so-pick-name { display: flex; flex-direction: column; min-width: 0; }
.so-pick-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.so-pick-name .hint { font-size: 12px; }
.so-vis-field { display: flex; flex-direction: column; gap: 4px; min-width: 170px; }
.so-vis-field[hidden], .so-vis-note[hidden] { display: none; }
.so-vis-field .hint { font-size: 12px; }
.so-seg { align-self: flex-start; min-width: 240px; }
.so-when { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; max-width: 520px; }
.so-when-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.so-when-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.so-half { display: flex; width: 100%; }
.so-half button { flex: 1; }
.so-when-say { margin: 0; padding: 10px 12px; border-radius: var(--r-sm); background: var(--c50); color: var(--c700); font-size: 14px; }
.so-when-say.bad { background: var(--err-bg); color: #B42323; }
@media (max-width: 520px) { .so-vis-field { min-width: 0; flex: 1 1 100%; } }
.so-when[hidden], .so-block .field[hidden] { display: none; }

/* Replies */
.so-modes:empty { display: none; }
.so-modes-card { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.so-modes-card > .prow { flex-wrap: wrap; }
.so-mode-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.so-mode-row .so-mark { width: 26px; height: 26px; font-size: 10px; }
.so-mode-name { font-weight: 600; flex: 1 1 120px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.so-mode { min-width: 190px; }
.so-count { font-weight: 700; color: var(--cobalt); }
.so-item { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.so-item p { margin: 0; }
.so-item-who { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.so-item-who .so-mark { width: 26px; height: 26px; font-size: 10px; }
.so-item-text { font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere; padding: 10px 12px; background: var(--paper); border-radius: var(--r-sm); }
.so-needs { color: #8A5300; }

@media (max-width: 860px) {
  .so-actions { width: 100%; }
  .so-actions .btn { flex: 1 1 auto; }
  .so-mode { min-width: 0; flex: 1 1 100%; }
}

/* The small numbers in the side menu: replies waiting (blue), accounts whose link fell (red); a dot on the phone's account tab. */
.so-badge { margin-inline-start: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; line-height: 1; background: var(--cobalt); color: #fff; }
.so-badge.relink { background: var(--err); }
.so-badge[hidden] { display: none; }
.so-badge.dot { position: absolute; top: -2px; inset-inline-end: -4px; min-width: 9px; width: 9px; height: 9px; padding: 0; margin: 0; background: var(--err); border: 2px solid #fff; box-sizing: content-box; }
.tab-ico { position: relative; display: inline-flex; }
.mob-only { display: none; }
@media (max-width: 960px) { .mi.mob-only { display: flex; } }
/* An account whose link fell: red edge, the reason, and the button to link it again. */
.so-account.fell { border-color: var(--err); box-shadow: 0 0 0 3px var(--err-bg); }
.so-relink { background: var(--err-bg); color: #B42323; }
.so-fell-why { font-size: 13px; color: #B42323; margin-top: 2px; }
.so-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; margin-bottom: 16px; border-radius: var(--r); background: var(--err-bg); color: #B42323; font-size: 14px; }
.so-banner > span { flex: 1 1 200px; min-width: 0; }
/* The date, time and visibility lists: one look, with their arrow on the reading end's opposite side. */
.so-when select, select.so-vis { appearance: none; -webkit-appearance: none; width: 100%; min-width: 0; height: 42px; border: 1px solid #CFCFC9; border-radius: var(--r-sm); background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235E6168' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat calc(100% - 12px) center; padding: 0 34px 0 12px; font-size: 15px; cursor: pointer; }
[dir="rtl"] .so-when select, [dir="rtl"] select.so-vis { background-position: 12px center; padding: 0 12px 0 34px; }
.so-when select:focus, select.so-vis:focus { outline: none; border-color: var(--cobalt); box-shadow: 0 0 0 4px rgba(47,75,255,.15); }
.so-half { height: 42px; }
@media (max-width: 520px) { .so-when-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } .so-when-row .so-when-field:last-child { grid-column: 1 / -1; } }
/* Hashtags: small cards with a cross, and the typing place after them. */
.so-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 46px; padding: 6px 8px; border: 1px solid #CFCFC9; border-radius: var(--r-sm); background: #fff; }
.so-tags:focus-within { border-color: var(--cobalt); box-shadow: 0 0 0 4px rgba(47,75,255,.15); }
.so-tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; border-radius: 999px; background: var(--c50); color: var(--c700); font-size: 13px; font-weight: 600; }
[dir="rtl"] .so-tag { padding: 3px 10px 3px 4px; }
.so-tag button { width: 20px; height: 20px; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 15px; line-height: 1; cursor: pointer; }
.so-tag button:hover { background: var(--c100); }
.so-tag-input { flex: 1 1 120px; min-width: 100px; border: 0; outline: none; background: transparent; font-size: 15px; padding: 4px; }
/* Each platform's own words. */
.so-custom { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); }
.so-custom[hidden] { display: none; }
.so-custom-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.so-custom-tabs button { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 6px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font: inherit; font-size: 13px; cursor: pointer; }
.so-custom-tabs button[aria-selected="true"] { border-color: var(--cobalt); background: var(--c50); color: var(--c700); font-weight: 600; }
.so-custom-tabs .so-mark { width: 22px; height: 22px; border-radius: 6px; }
.so-count-line.bad { color: var(--err); font-weight: 700; }
.so-added { margin: 0; font-size: 12px; }
.so-block .field[hidden] { display: none; }
/* The cover. */
.so-video-ways.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 700px) { .so-video-ways.two { grid-template-columns: 1fr; } }
.so-cover-chosen { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.so-cover-img { display: block; border-radius: var(--r-sm); overflow: hidden; background: var(--line-2); border: 1px solid var(--line); }
.so-cover-img.wide { width: 240px; aspect-ratio: 16 / 9; }
.so-cover-img.tall { width: 120px; aspect-ratio: 9 / 16; }
.so-cover-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.so-cover-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; flex: 1 1 200px; }
.so-cover-notes { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.so-cover-notes[hidden] { display: none; }
.so-cover-notes li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--mute); }
.so-cover-notes .so-mark { width: 22px; height: 22px; border-radius: 6px; }
.so-frame { display: flex; flex-direction: column; gap: 10px; }
.so-frame-video { width: 100%; max-height: 52vh; border-radius: var(--r-sm); background: #000; }
.so-frame-range { flex: 1; accent-color: var(--cobalt); }
.so-done-note { color: #8A5300; }
/* How the cover shows on the platforms. */
.so-pv { display: flex; flex-direction: column; gap: 18px; }
.so-pv-label { margin: 0 0 8px; font-weight: 700; font-size: 14px; }
.so-pv-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 12px; border-radius: var(--r); background: #0F0F0F; }
.so-pv-yt { display: flex; flex-direction: column; gap: 6px; }
.so-pv-thumb { display: block; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #272727; }
.so-pv-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.so-pv-lines { display: flex; flex-direction: column; gap: 3px; color: #F1F1F1; font-size: 12px; }
.so-pv-lines b { font-size: 13px; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.so-pv-lines .hint { color: #AAAAAA; font-size: 11px; }
.so-pv-lines i { display: block; height: 9px; border-radius: 4px; background: #3A3A3A; }
.so-pv-lines i.short { width: 55%; }
.so-pv-phones { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.so-pv-phone { width: 150px; aspect-ratio: 9 / 16; border-radius: 18px; overflow: hidden; border: 6px solid #111214; background: #111214; }
.so-pv-phone img { width: 100%; height: 100%; object-fit: cover; display: block; }
.so-pv-grid { display: grid; grid-template-columns: repeat(3, 72px); gap: 3px; }
.so-pv-grid span { aspect-ratio: 3 / 4; overflow: hidden; background: var(--line-2); display: block; }
.so-pv-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 600px) { .so-pv-list { grid-template-columns: 1fr; } .so-pv-list .so-pv-yt:not(.main) { display: none; } }
/* «اكتب لي بالذكاء الاصطناعي»: the price on the button, the balance beside it. */
.so-ai { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: var(--r); background: var(--c50); border: 1px solid var(--c100); }
.so-ai[hidden], .so-ai-status[hidden] { display: none; }
.so-ai-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.so-ai-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border: 0; border-radius: var(--r-sm); background: var(--cobalt); color: #fff; font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; }
.so-ai-btn:disabled { opacity: .6; cursor: progress; }
.so-ai-credits { padding: 2px 9px; border-radius: 999px; background: rgba(255,255,255,.22); font-size: 12px; font-weight: 700; }
.so-ai-credits[hidden] { display: none; }
.so-ai-note { font-size: 12px; }
.so-ai-status { margin: 0; color: var(--c700); font-weight: 600; }
/* The four ways to a cover, and the composer. */
.so-video-ways.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 700px) { .so-video-ways.four { grid-template-columns: 1fr; } }
.so-way-ai { border-color: var(--c200); background: var(--c50); }
.so-ai-credits.dark { background: var(--cobalt); color: #fff; }
.so-comp { display: flex; flex-direction: column; gap: 12px; }
.so-comp-canvas { width: 100%; max-height: 52vh; object-fit: contain; border-radius: var(--r-sm); background: #111214; }
.so-comp-check { margin: 0; color: var(--ok); font-weight: 600; }
.so-comp-check.bad { color: #B42323; }
.so-comp-strip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.so-comp-base { flex: 0 0 auto; width: 88px; aspect-ratio: 16 / 10; padding: 0; border: 2px solid transparent; border-radius: 6px; overflow: hidden; background: var(--line-2); cursor: pointer; }
.so-comp-base.on, .so-comp-base:first-child:not(.so-comp-strip .on ~ *) { border-color: transparent; }
.so-comp-base.on { border-color: var(--cobalt); }
.so-comp-base img { width: 100%; height: 100%; object-fit: cover; display: block; }
.so-comp-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 600px) { .so-comp-row { grid-template-columns: 1fr; } }
.so-comp-seg { display: flex; }
.so-comp-seg button { flex: 1; }
.so-comp-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.so-comp-swatch { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; }
/* The two cover sizes side by side. */
.so-cover-slots { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.so-cover-slot { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.so-cover-slot figcaption { font-size: 12px; display: flex; gap: 6px; align-items: center; }
.so-cover-need { color: #8A5300; font-weight: 600; }

/* «بدون غلاف»: the choice until another way is picked */
.so-cover-ways { display: grid; gap: 10px; }
.so-no-cover { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--cobalt); border-radius: 12px; background: color-mix(in srgb, var(--cobalt) 8%, transparent); }
.so-no-cover > span:last-child { display: grid; gap: 2px; }
.so-no-cover-tick { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--cobalt); color: #fff; font-size: 13px; font-weight: 700; }
.so-cover-or { margin: 2px 0 0; }

/* The cover gallery: the video's covers (one chosen per shape), then the ways to add one, all the same height */
.so-cg { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; margin-top: 10px; }
.so-cg-item { position: relative; height: 150px; border-radius: var(--r-sm); }
.so-cg-item.tall { aspect-ratio: 9 / 16; }
.so-cg-item.square { aspect-ratio: 1 / 1; }
.so-cg-item.wide { aspect-ratio: 16 / 9; }
.so-cg-pick { all: unset; cursor: pointer; display: block; width: 100%; height: 100%; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); background: var(--line-2); box-sizing: border-box; }
.so-cg-pick:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; }
.so-cg-item.on .so-cg-pick { border: 2.5px solid var(--cobalt); }
.so-cg-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.so-cg-check { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.92); border: 1px solid var(--line); display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff; }
.so-cg-item.on .so-cg-check { background: var(--cobalt); border-color: var(--cobalt); }
.so-cg-more { position: absolute; top: 6px; left: 6px; width: 26px; height: 26px; border-radius: 8px; border: 0; background: rgba(255,255,255,.92); display: grid; place-items: center; cursor: pointer; color: #111214; }
.so-cg-add { height: 150px; width: 112px; border: 1.5px dashed var(--line); border-radius: var(--r-sm); background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 8px; text-align: center; cursor: pointer; font: inherit; color: inherit; }
.so-cg-add b { font-size: 12.5px; font-weight: 600; line-height: 1.35; }
.so-cg-add .hint { font-size: 11.5px; }
.so-cg-add:hover { border-color: var(--cobalt); }
.so-cg-add.ai { border-color: color-mix(in srgb, var(--cobalt) 45%, transparent); color: var(--cobalt); }
.so-cg-chosen { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.so-cg-tag { font-size: 12.5px; font-weight: 600; color: var(--cobalt); background: color-mix(in srgb, var(--cobalt) 9%, transparent); border-radius: 999px; padding: 3px 10px; }
@media (max-width: 700px) { .so-cg-item, .so-cg-add { height: 128px; } .so-cg-add { width: 96px; } }

/* The size window before the director */
.so-size { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding-top: 8px; }
.so-size-opt { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 8px 14px; border: 1px solid var(--line); border-radius: 12px; background: transparent; cursor: pointer; font: inherit; color: inherit; }
.so-size-opt[aria-checked="true"] { border: 2px solid var(--cobalt); padding: 17px 7px 13px; background: color-mix(in srgb, var(--cobalt) 5%, transparent); }
.so-size-opt b { font-size: 14px; font-weight: 700; }
.so-size-opt .hint { font-size: 11.5px; text-align: center; line-height: 1.4; }
.so-size-tag { position: absolute; top: -10px; inset-inline-start: 50%; transform: translateX(50%); background: var(--cobalt); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
[dir="ltr"] .so-size-tag { transform: translateX(-50%); }
.so-size-shape { display: block; border: 2px solid currentColor; border-radius: 4px; opacity: .55; height: 44px; }
.so-size-opt[aria-checked="true"] .so-size-shape { opacity: 1; color: var(--cobalt); }
.so-size-shape.s9x16 { width: 25px; }
.so-size-shape.s1x1 { width: 44px; }
.so-size-shape.s16x9 { width: 66px; height: 37px; margin: 3.5px 0; }
@media (max-width: 520px) { .so-size { gap: 6px; } .so-size-opt .hint { display: none; } }

/* «عدّل مع المخرج»: the cover and its versions beside the conversation */
.so-ed { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 18px; align-items: start; }
.so-ed-side { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.so-ed-frame { width: 100%; border-radius: 12px; overflow: hidden; background: var(--line-2); border: 1px solid var(--line); }
.so-ed-frame.tall { aspect-ratio: 9 / 16; max-width: 260px; }
.so-ed-frame.square { aspect-ratio: 1 / 1; max-width: 340px; }
.so-ed-frame.wide { aspect-ratio: 16 / 9; }
.so-ed-pic { width: 100%; height: 100%; object-fit: cover; display: block; }
.so-ed-versions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.so-ed-version { position: relative; height: 52px; padding: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: none; cursor: pointer; }
.so-ed-version.tall { aspect-ratio: 9 / 16; } .so-ed-version.square { aspect-ratio: 1 / 1; } .so-ed-version.wide { aspect-ratio: 16 / 9; }
.so-ed-version.on { border: 2px solid var(--cobalt); }
.so-ed-version img { width: 100%; height: 100%; object-fit: cover; display: block; }
.so-ed-version span { position: absolute; bottom: 2px; inset-inline-start: 3px; font-size: 10.5px; font-weight: 700; color: #fff; text-shadow: 0 0 3px #000; }
.so-ed-chat { display: flex; flex-direction: column; gap: 10px; min-height: 320px; }
.so-ed-log { flex: 1; display: flex; flex-direction: column; gap: 8px; max-height: 46vh; overflow-y: auto; padding: 2px; }
.so-ed-bubble { max-width: 88%; padding: 9px 12px; border-radius: 12px; font-size: 13.5px; line-height: 1.6; display: flex; flex-direction: column; gap: 8px; }
.so-ed-bubble.dir { align-self: flex-start; background: var(--line-2); border: 1px solid var(--line); }
.so-ed-bubble.me { align-self: flex-end; background: color-mix(in srgb, var(--cobalt) 10%, transparent); color: inherit; }
.so-ed-bubble.wait span::after { content: " …"; }
.so-ed-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.so-ed-send { display: flex; gap: 8px; align-items: flex-end; }
.so-ed-input { flex: 1; resize: none; min-height: 44px; }
@media (max-width: 700px) { .so-ed { grid-template-columns: 1fr; } .so-ed-frame.tall { max-width: 180px; } .so-ed-log { max-height: 34vh; } .so-ed-chat { min-height: 0; } }

/* The four ways to add a cover: one row of equal cards (two by two on a phone) */
.so-cg-adds { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.so-cg-adds.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.so-cg-adds .so-cg-add { width: auto; height: auto; min-height: 150px; justify-content: flex-start; padding: 16px 10px 12px; gap: 5px; }
.so-cg-add-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--line-2); margin-bottom: 2px; }
.so-cg-add.ai .so-cg-add-ic { background: color-mix(in srgb, var(--cobalt) 10%, transparent); }
.so-cg-adds .so-cg-add b { font-size: 13px; font-weight: 700; line-height: 1.4; }
.so-cg-add-sub { font-size: 11.5px; line-height: 1.5; color: var(--mute); }
.so-cg-add.ai .so-cg-add-sub { color: inherit; opacity: .8; }
.so-cg-price { margin-top: auto; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--line-2); color: var(--ink, inherit); }
.so-cg-add.ai .so-cg-price { background: color-mix(in srgb, var(--cobalt) 12%, transparent); color: var(--cobalt); }
.so-cg-drop-hint { display: none; font-size: 11px; opacity: .75; }
@media (hover: hover) and (pointer: fine) { .so-cg-drop-hint { display: block; } }
.so-cg-add.drop.over { border-color: var(--cobalt); border-style: solid; background: color-mix(in srgb, var(--cobalt) 7%, transparent); }
.so-cg { margin-bottom: 0; }
@media (max-width: 700px) {
  .so-cg-adds, .so-cg-adds.three { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .so-cg-adds .so-cg-add { height: auto; min-height: 132px; padding: 12px 8px 10px; }
}
/* The choice when a platform would refuse its cover */
.so-refuse-why { margin: 0 0 12px; line-height: 1.7; }
.so-refuse-opts { display: flex; flex-direction: column; gap: 8px; }
.so-refuse-opt { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; background: transparent; cursor: pointer; font: inherit; color: inherit; text-align: start; }
.so-refuse-opt:hover { border-color: var(--cobalt); }
.so-refuse-opt > span { display: flex; flex-direction: column; gap: 1px; }
.so-refuse-opt b { font-size: 13.5px; font-weight: 600; }
.so-refuse-opt.ai { color: var(--cobalt); border-color: color-mix(in srgb, var(--cobalt) 40%, transparent); }
.so-refuse-opt.skip { margin-top: 4px; border-style: dashed; }

/* The four cards keep one height per row; the edit chat's send button stays compact on a phone */
.so-cg-adds { grid-auto-rows: 1fr; }
.so-ed-send .btn { flex: none; }
@media (max-width: 520px) { .so-ed-send .btn { padding-inline: 12px; } }

/* «الردود التلقائية»: conversations (a list of people, one conversation, the person's card). */
.so-replies { max-width: 1400px; width: 100%; margin: 0 auto; }
.so-accts, .so-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.so-accts:empty { display: none; }
.so-acct, .so-filter { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 4px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); font: 500 13px/1.2 var(--sans); }
.so-acct .so-mark { width: 22px; height: 22px; border-radius: 6px; font-size: 9px; }
.so-acct[aria-pressed="true"], .so-filter[aria-pressed="true"] { border-color: var(--cobalt); background: var(--c50); color: var(--c700); font-weight: 600; }
.so-filter { min-height: 32px; padding: 3px 12px; font-size: 12px; }
.so-inbox { display: grid; grid-template-columns: minmax(260px, 320px) minmax(0, 1fr) minmax(220px, 260px); gap: 16px; align-items: start; }
.so-th-col, .so-convo, .so-person { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); }
.so-th-col { display: flex; flex-direction: column; overflow: hidden; }
.so-th-col .so-filters { padding: 12px; border-bottom: 1px solid var(--line-2); }
.so-th-list { display: flex; flex-direction: column; max-height: 70vh; overflow-y: auto; }
.so-th-empty { padding: 20px 16px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.so-th-empty p { margin: 0; }
.so-th { display: flex; flex-direction: column; gap: 6px; width: 100%; text-align: start; border: 0; border-bottom: 1px solid var(--line-2); background: #fff; padding: 12px 14px; color: var(--ink); font: inherit; }
.so-th:hover { background: var(--paper); }
.so-th.on { background: var(--c50); }
.so-th-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.so-th-top .so-mark { width: 24px; height: 24px; border-radius: 6px; font-size: 9px; }
.so-th-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.so-th.unread .so-th-name { font-weight: 700; }
.so-th-time { font-size: 11px; flex-shrink: 0; }
.so-th-pre { margin: 0; font-size: 13px; color: var(--ink-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.so-th-tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.so-th-tags .chip, .so-msg .chip { height: 22px; font-size: 11px; padding: 0 9px; }
.so-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cobalt); margin-inline-start: auto; }
.so-wait { background: var(--c100); color: var(--c700); }
.so-paused { background: var(--warn-bg); color: #7A4A00; }
.so-on { background: var(--ok-bg); color: #0B6B4A; }
.so-tag { background: var(--paper); color: var(--ink-2); border: 1px solid var(--line-2); }
.so-tag.t-buy { background: var(--ok-bg); color: #0B6B4A; border-color: transparent; }
.so-tag.t-complaint, .so-tag.t-abuse { background: var(--err-bg); color: #B52A2A; border-color: transparent; }
.so-tag.t-question { background: var(--c50); color: var(--c700); border-color: transparent; }
.so-convo { display: flex; flex-direction: column; min-height: 520px; }
.so-convo-empty { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 20px; text-align: center; }
.so-convo-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.so-convo-head > .prow { margin-inline-start: auto; flex-wrap: wrap; }
.so-convo-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.so-convo-who > div { display: flex; flex-direction: column; min-width: 0; }
.so-back { display: none; }
.so-flow { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 16px; max-height: 58vh; overflow-y: auto; }
.so-msg { display: flex; }
.so-msg.out { justify-content: flex-end; }
.so-bub { max-width: 78%; display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 14px; background: var(--bg); }
.so-msg.out.bot .so-bub { background: var(--c100); }
.so-msg.out.you .so-bub { background: var(--cobalt); color: #fff; }
.so-msg.out.you .so-meta, .so-msg.out.you .so-who { color: rgba(255,255,255,.85); }
.so-bub p { margin: 0; font-size: 14px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.so-who { font-size: 11px; font-weight: 600; color: var(--mute); }
.so-msg.out.bot .so-who { color: var(--c700); }
.so-meta { font-size: 11px; }
.so-note { margin: 0; align-self: center; text-align: center; font-size: 12px; background: var(--paper); border-radius: 8px; padding: 6px 10px; }
.so-suggest { align-self: flex-end; width: min(78%, 520px); display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px dashed var(--c300); border-radius: 14px; background: #fff; }
.so-compose { border-top: 1px solid var(--line-2); padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; background: var(--paper); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.so-compose .prow { justify-content: space-between; }
.so-person { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.so-person:empty { display: none; }
.so-person p { margin: 0; }
.so-avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--c100); color: var(--c700); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; }
.so-person-row { display: flex; flex-direction: column; gap: 6px; }
.so-person .prow .input { flex: 1; min-width: 0; }
.so-mytag { background: var(--c50); color: var(--c700); padding-inline-end: 4px; }
.so-x { border: 0; background: none; color: inherit; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; cursor: pointer; }
.so-x:hover { background: var(--c100); }
@media (max-width: 1180px) { .so-inbox { grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); } .so-person { grid-column: 2; } }
@media (max-width: 760px) {
  .so-inbox { grid-template-columns: 1fr; }
  .so-person { grid-column: auto; }
  .so-inbox:not(.open) .so-convo, .so-inbox:not(.open) .so-person { display: none; }
  .so-inbox.open .so-th-col { display: none; }
  .so-back { display: inline-flex; }
  .so-th-list { max-height: none; }
  .so-flow { max-height: 60vh; }
  .so-bub, .so-suggest { max-width: 90%; width: auto; }
}
.so-msg.out.failed .so-bub { opacity: .6; }

/* «عقل الحساب» */
.so-brain { display: flex; flex-direction: column; gap: 18px; }
.so-brain-sec { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.so-brain-sec h3 { margin: 0; font-size: 15px; }
.so-brain-sec p { margin: 0; }
.so-brain-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.so-brain .field { display: flex; flex-direction: column; gap: 4px; }
.so-brain-acct { display: flex; align-items: center; gap: 10px; margin: 0; }
.so-brain-help { background: var(--paper); border-radius: var(--r-sm); padding: 8px 10px; }
.so-brain-warn { margin: 0; }
.so-check { display: flex; gap: 10px; align-items: flex-start; }
.so-check input { margin-top: 4px; width: 18px; height: 18px; flex-shrink: 0; }
.so-check > span { display: flex; flex-direction: column; gap: 2px; }
.so-faqs { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.so-faq { width: 100%; display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--paper); }
.so-faq .btn { align-self: flex-start; }
.so-brain .prow .input { flex: 1; min-width: 0; }
.so-try-out { max-height: none; padding: 0; }
.so-try-out:empty { display: none; }
@media (max-width: 600px) { .so-brain-grid { grid-template-columns: 1fr; } }
.so-brain [hidden] { display: none !important; }

/* «القواعد» */
.so-rules { display: flex; flex-direction: column; gap: 10px; }
.so-rule { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.so-rule.off { opacity: .6; }
.so-rule p { margin: 0; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.so-rule-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.so-rule-num { min-width: 26px; height: 26px; border-radius: 8px; background: var(--bg); color: var(--mute); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; }
.so-rule-if { color: var(--c700); }
.so-rule-do { color: #0B6B4A; }
.so-rule .so-check { align-items: center; margin-inline-end: auto; }
.so-rule .so-check input { margin-top: 0; }
.so-rule-price { align-self: flex-start; height: auto; padding: 6px 12px; white-space: normal; }
.so-undo { align-self: flex-start; margin-top: 4px; }
.so-msg.out.you .so-undo { color: var(--ink); }

/* «محتاج رأيك» and «السجل» */
.so-chats { display: flex; flex-direction: column; gap: 16px; }
.so-chats[hidden], .so-decide[hidden], .so-log[hidden] { display: none; }
.so-decide { display: flex; flex-direction: column; gap: 12px; max-width: 860px; }
.so-card { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.so-card p { margin: 0; }
.so-card-bad { border-color: #F0C4C4; }
.so-samples { margin: 0; padding-inline-start: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.so-log { display: flex; flex-direction: column; gap: 0; max-width: 960px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); }
.so-log-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.so-log-row:last-child { border-bottom: 0; }
.so-log-row .so-mark { width: 26px; height: 26px; border-radius: 6px; font-size: 9px; }
.so-log-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.so-log-main p { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.so-bad { background: var(--err-bg); color: #B52A2A; }
.so-tg { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.so-tg p { margin: 0; }
.so-tg [hidden] { display: none !important; }

/* «المدير» */
.so-mgr { display: flex; flex-direction: column; gap: 12px; max-width: 860px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 0 0; }
.so-mgr[hidden] { display: none; }
.so-mgr > .so-brain-help { margin: 0 16px; }
.so-mgr-flow { min-height: 320px; max-height: 60vh; }
.so-mgr-a .so-who { color: var(--c700); }
.so-mgr-prop { align-self: flex-start; max-width: 78%; border-color: var(--c200); }
.so-mgr-prop p { margin: 0; }

/* «التقارير» */
.so-rep { display: flex; flex-direction: column; gap: 14px; max-width: 1000px; }
.so-rep[hidden] { display: none; }
.so-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.so-tile { padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.so-tile b { font-size: 24px; }
.so-rep-sec { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.so-rep-sec h3 { margin: 0; font-size: 16px; }
.so-rep-sec p { margin: 0; }
.so-rep-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.so-rep-row:last-child { border-bottom: 0; }
.so-rep-row .so-mark { width: 24px; height: 24px; border-radius: 6px; font-size: 9px; }
.so-rep-main { flex: 1; min-width: 160px; overflow-wrap: anywhere; font-size: 14px; }
.so-bar-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 40px; align-items: center; gap: 10px; font-size: 13px; }
.so-bar { height: 10px; background: var(--bg); border-radius: 6px; overflow: hidden; display: block; }
.so-bar-fill { display: block; height: 100%; background: var(--cobalt); border-radius: 6px; }
.so-bar-fill.t-complaint, .so-bar-fill.t-abuse { background: var(--err); }
.so-bar-fill.t-buy { background: var(--ok); }
@media (max-width: 760px) { .so-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .so-bar-row { grid-template-columns: 90px minmax(0, 1fr) 36px; } }

/* «الردود التلقائية» v2: the section's own side menu, pages instead of windows, one conversations panel. */
.so-side { display: flex; flex-direction: column; gap: 2px; flex: 1; min-height: 0; overflow-y: auto; }
.so-side .backrow { text-decoration: none; }
.so-side-head { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px 12px; }
.so-side-head b { font-size: 19px; letter-spacing: -.01em; }
.so-side-state { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.so-state-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mute-2); flex-shrink: 0; }
.so-state-dot.on { background: var(--ok); }
.so-side .sect { padding-top: 12px; }
.so-nav { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: 10px; background: none; color: var(--ink); font: 500 14px/1.2 var(--sans); text-align: start; cursor: pointer; }
.so-nav:hover { background: var(--line-2); }
.so-nav.on { background: var(--ink); color: #fff; font-weight: 600; }
.so-nav-label { flex: 1; min-width: 0; }
.so-nav-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; background: var(--c100); color: var(--c700); }
.so-nav-count.alert { background: var(--err); color: #fff; }
.so-nav.on .so-nav-count { background: #fff; color: var(--ink); }
.so-mnav { display: none; }
@media (max-width: 960px) { .so-mnav { display: flex; flex-wrap: nowrap; overflow-x: auto; max-width: 100%; align-self: stretch; scrollbar-width: none; } .so-mnav button { flex-shrink: 0; } }
.so-replies { gap: 16px; }
.so-headwrap .page-title { letter-spacing: -.01em; }
.so-page { display: flex; flex-direction: column; gap: 14px; max-width: 1040px; }
.so-page[hidden] { display: none; }
.so-page-foot { display: flex; gap: 10px; justify-content: flex-start; position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(to top, var(--bg) 70%, transparent); }
.so-page > .so-brain { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 4px 18px 18px; }
.so-page > .so-brain > .so-brain-sec:first-child, .so-page > .so-brain > :first-child { border-top: 0; }
.so-page > .so-brain > .so-brain-help { margin-top: 14px; }
.so-page > .so-brain > .field:first-child, .so-page > .so-brain > .so-brain-acct { margin-top: 14px; }
.so-legend { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.so-legend-item { background: #fff; border: 1px solid var(--line-2); border-radius: var(--r); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.so-legend-item .hint { font-size: 12px; line-height: 1.6; }
.so-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.so-panel-empty { margin: 0; padding: 18px; }
.so-acc-row { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.so-acc-row .so-mark { width: 40px; height: 40px; border-radius: 10px; }
.so-acc-name { flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 2px; }
.so-acc-name b { font-size: 15px; }
.so-seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--bg); border-radius: 10px; flex-wrap: wrap; }
.so-seg-btn { border: 0; background: none; color: var(--mute); min-height: 36px; padding: 0 14px; border-radius: 8px; font: 500 13px/1 var(--sans); cursor: pointer; }
.so-seg-btn.on { background: var(--cobalt); color: #fff; font-weight: 600; }
.so-seg-btn.on.off { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(17,18,20,.1); }
.so-acc-add { display: flex; align-items: center; gap: 10px; padding: 16px 18px; color: var(--c700); font-weight: 600; text-decoration: none; background: var(--paper); }
.so-acc-add:hover { background: var(--line-2); }
@media (max-width: 760px) { .so-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* conversations as one panel */
.so-chats .so-inbox { gap: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; align-items: stretch; min-height: calc(100vh - 250px); box-shadow: var(--shadow); }
.so-chats .so-th-col, .so-chats .so-convo, .so-chats .so-person { border: 0; border-radius: 0; background: none; }
.so-chats .so-th-col { border-inline-end: 1px solid var(--line-2); }
.so-chats .so-person { border-inline-start: 1px solid var(--line-2); }
.so-chats .so-convo { min-height: 0; }
.so-chats .so-flow { background: var(--paper); max-height: none; }
.so-chats .so-compose { background: #fff; border-radius: 0; }
.so-chats .so-th-list { max-height: calc(100vh - 320px); }
.so-th { flex-direction: row; gap: 12px; align-items: flex-start; padding: 14px 16px; }
.so-th-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.so-th-top { justify-content: space-between; }
.so-th-pre { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--mute); font-size: 13px; }
.so-th-wait { font-size: 11px; font-weight: 600; color: var(--c700); }
.so-th-acct { font-size: 11px; }
.so-av { position: relative; flex-shrink: 0; width: 40px; height: 40px; }
.so-av-letter { width: 40px; height: 40px; border-radius: 50%; background: var(--c50); color: var(--c700); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; }
.so-av .so-mark { position: absolute; bottom: -3px; inset-inline-end: -5px; width: 20px; height: 20px; border-radius: 6px; border: 2px solid #fff; font-size: 8px; }
.so-msg.out.you .so-bub { background: var(--ink); }
.so-msg.in .so-bub { background: #fff; border: 1px solid var(--line-2); }
.so-bub { border-radius: 14px; }
.so-msg.in .so-bub { border-end-start-radius: 4px; }
.so-msg.out .so-bub { border-end-end-radius: 4px; }
.so-suggest { border-style: solid; border-color: var(--c200); background: var(--c50); }
@media (max-width: 760px) { .so-chats .so-inbox { min-height: 0; } .so-chats .so-th-col, .so-chats .so-person { border: 0; } }
@media (min-width: 761px) {
  .so-chats .so-inbox { height: calc(100vh - 236px); min-height: 480px; grid-template-rows: minmax(0, 1fr); }
  .so-chats .so-convo, .so-chats .so-th-col, .so-chats .so-person { min-height: 0; overflow: hidden; }
  .so-chats .so-flow { flex: 1; min-height: 0; overflow-y: auto; }
  .so-chats .so-th-list { flex: 1; min-height: 0; max-height: none; overflow-y: auto; }
  .so-chats .so-person { overflow-y: auto; }
}

/* The section's pages in the phone's bottom bar: swiped sideways, «رجوع» stays in place. */
.so-tabbar { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.so-tabbar::-webkit-scrollbar { display: none; }
.so-tabbar a, .so-tabbar button { flex: 0 0 auto; min-width: 76px; padding: 0 12px; white-space: nowrap; position: relative; scroll-snap-align: center; cursor: pointer; }
.so-tabbar .on::before { content: ""; position: absolute; top: 0; inset-inline: 16px; height: 3px; border-radius: 0 0 3px 3px; background: var(--cobalt); }
.so-tabbar .so-tabback { position: sticky; inset-inline-start: 0; z-index: 1; background: #fff; min-width: 64px; color: var(--ink-2); border-inline-end: 1px solid var(--line-2); box-shadow: 0 0 12px rgba(17,18,20,.06); }
.so-tabbar .tab-ico { position: relative; display: inline-flex; }
.so-tabbar .so-nav-count { position: absolute; top: -6px; inset-inline-end: -12px; min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px; }
@media (max-width: 960px) {
  .so-replies { padding: 18px 16px; }
  .so-replies .so-head { gap: 10px; }
  .so-acc-row { gap: 10px; padding: 14px; }
  .so-acc-row .so-seg { order: 3; width: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .so-acc-row .so-seg-btn { padding: 0 4px; min-height: 40px; font-size: 12px; line-height: 1.25; }
  .so-accts { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; }
  .so-accts .so-acct { flex-shrink: 0; }
  .so-page-foot { bottom: calc(58px + env(safe-area-inset-bottom)); }
  .so-page-foot .btn { flex: 1; }
}
.so-tabbar button { flex: 1 0 auto; }
.so-tabbar a { flex: 1 0 auto; }
.so-tabbar .tab-ico .so-badge { position: absolute; top: -6px; inset-inline-end: -12px; margin: 0; min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px; }
.so-kicker { display: none; }
@media (max-width: 960px) { .so-kicker { display: block; font-size: 12px; font-weight: 600; color: var(--c700); margin-bottom: 2px; } }

/* which account a conversation came to */
.so-convo-who { flex-direction: column; align-items: flex-start; gap: 6px; }
.so-convo-name { font-size: 15px; }
.so-origin { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--paper); font-size: 12px; max-width: 100%; }
.so-origin .so-mark { width: 20px; height: 20px; border-radius: 6px; font-size: 8px; }
.so-origin b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.so-th-acct { font-size: 11px; color: var(--ink-2); background: var(--bg); border-radius: 999px; padding: 1px 8px; }
.so-tag.t-objection { background: var(--warn-bg); color: #7A4A00; border-color: transparent; }
.so-bar-fill.t-objection { background: var(--warn); }
.so-sales-body { display: flex; flex-direction: column; gap: 10px; }
.so-sales-body[hidden] { display: none; }

/* private messages and attachments */
.so-att-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.so-att-row:empty { display: none; }
.so-att-btn { cursor: pointer; }
.so-att-btn.rec { background: var(--err-bg); border-color: var(--err); color: #B52A2A; }
.so-att-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border-radius: 999px; background: var(--c50); color: var(--c700); font-size: 12px; max-width: 100%; }
.so-att-chip[hidden] { display: none; }
.so-att-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.so-att-img { max-width: 220px; max-height: 220px; border-radius: 10px; display: block; }
.so-att-audio { max-width: 240px; height: 36px; }
.so-private { background: #fff; color: var(--ink-2); border: 1px solid var(--line); height: 20px; font-size: 10px; align-self: flex-start; }
@media (max-width: 760px) { .so-att-label { display: none; } }

/* Voice and files for the manager; teaching an account from a file, a page or said words. */
.so-att-btn[hidden] { display: none; }
.so-att-btn.busy { opacity: .6; pointer-events: none; }
.so-mgr-file { margin-top: -6px; }
.so-teach-url { gap: 8px; align-items: center; }
.so-teach-url .input { flex: 1; min-width: 0; }
.so-teach-out:empty { display: none; }
.so-teach-card { display: grid; gap: 12px; }
.so-teach-part { display: grid; gap: 8px; justify-items: start; }
.so-teach-part p { margin: 0; white-space: pre-wrap; }
.so-teach-row { align-items: flex-start; }
.so-teach-row b, .so-teach-row .hint { display: block; }
@media (max-width: 760px) { .so-brain .so-att-label, .so-mgr-flow ~ .so-compose .so-att-label { display: inline; } }

/* «المهتمون»: the list of interested people. */
.so-leads { display: grid; gap: 12px; max-width: 960px; }
.so-leads[hidden] { display: none; }
.so-lead-head { gap: 10px; align-items: center; }
.so-lead-acct { max-width: 260px; }
.so-lead-acct[hidden] { display: none; }
.so-lead-tools { gap: 8px; margin-top: 6px; flex-wrap: wrap; justify-content: flex-start; }
.so-lead-status { width: auto; min-width: 150px; }
.so-lead-note { flex: 1; min-width: 180px; }
.so-lead-chip { font-size: 11px; }
.so-lead-chip.s-new { background: var(--c50); color: var(--c700); }
.so-lead-chip.s-contacted { background: #FFF4D6; color: #7A5200; }
.so-lead-chip.s-won { background: #DDF5E6; color: #17663A; }
.so-lead-chip.s-lost { background: var(--line-2); color: var(--muted, #667); }
@media (max-width: 760px) { .so-lead .so-log-main { flex: 1 1 calc(100% - 44px); } .so-lead > .prow { width: 100%; justify-content: flex-start; } }

/* A conversation a teammate took. */
.so-claim { background: #FFF4D6; color: #7A5200; }
.empty.blocked[hidden] { display: none; }
