/* =====================================================================
   UGC ARABIA — Community module (feed, composer, post, comments)
   Logical properties only (RTL + LTR). Prefix: cm-
   ===================================================================== */

.cm-container { max-width: 1100px; }
.cm-page { padding-block: 18px 40px; }
@media (min-width: 768px) { .cm-page { padding-block: 24px 56px; } }

/* ---------------- hero ---------------- */
.cm-hero {
  position: relative; overflow: hidden; display: grid; gap: 16px; align-items: center;
  padding: 22px 18px; margin-bottom: 18px; border-radius: 22px; background: #0D0D0E; color: #fff;
  box-shadow: 0 18px 40px -28px rgba(17, 17, 17, .6);
}
.cm-hero::before {
  content: ""; position: absolute; width: 440px; height: 440px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(196, 149, 90, .32), transparent 65%); top: -230px; inset-inline-end: -120px;
}
.cm-hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, .03) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .03) 1px, transparent 1px);
  background-size: 40px 40px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 60%); mask-image: linear-gradient(90deg, transparent, #000 60%);
}
html[dir="rtl"] .cm-hero::after { -webkit-mask-image: linear-gradient(270deg, transparent, #000 60%); mask-image: linear-gradient(270deg, transparent, #000 60%); }
.cm-hero > * { position: relative; z-index: 1; }
.cm-hero .eyebrow { color: var(--gold-2); margin-bottom: 8px; }
.cm-hero h1 { color: #fff; font-size: clamp(21px, 2.7vw, 29px); line-height: 1.4; margin: 0 0 8px; font-weight: 900; text-wrap: balance; }
.cm-hero p { color: #bdb6aa; margin: 0; font-size: 14.5px; line-height: 1.8; max-width: 560px; }
.cm-search { position: relative; display: flex; gap: 6px; padding: 6px; border-radius: 16px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .13); }
.cm-search .input { flex: 1; min-width: 0; height: 46px; border-color: transparent; background: #fff; padding-inline-start: 40px; }
.cm-search-ico { position: absolute; top: 50%; transform: translateY(-50%); inset-inline-start: 19px; color: var(--muted-2); z-index: 1; display: flex; pointer-events: none; }
.cm-search .btn { height: 46px; flex: none; }
@media (min-width: 900px) {
  .cm-hero { grid-template-columns: minmax(0, 1fr) minmax(300px, 390px); padding: 28px 30px; gap: 28px; margin-bottom: 22px; }
}
@media (max-width: 560px) {
  .cm-hero { padding: 18px 16px 16px; gap: 14px; margin-bottom: 14px; border-radius: 20px; }
  .cm-hero .eyebrow { margin-bottom: 6px; font-size: 12px; }
  .cm-hero h1 { font-size: 20px; margin-bottom: 0; }
  .cm-hero p { display: none; }
  .cm-search .input, .cm-search .btn { height: 42px; }
}

/* ---------------- layout ---------------- */
.cm-layout { display: grid; gap: 22px; align-items: start; }
.cm-main { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.cm-side { display: none; }
@media (min-width: 1000px) {
  .cm-layout { grid-template-columns: minmax(0, 1fr) 316px; gap: 24px; }
  .cm-side { display: flex; flex-direction: column; gap: 16px; }
}
.cm-side-post { display: flex; flex-direction: column; gap: 16px; }

/* ---------------- toolbar: tabs + sort ---------------- */
.cm-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.cm-feed-title { font-size: 18px; margin: 0; }
.cm-tabs { display: flex; gap: 3px; padding: 4px; max-width: 100%; overflow-x: auto; scrollbar-width: none; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.cm-tabs::-webkit-scrollbar { display: none; }
.cm-tab { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 10px; font-weight: 700; font-size: 14px; color: var(--muted); white-space: nowrap; transition: background .15s, color .15s; }
.cm-tab .i { width: 16px; height: 16px; }
.cm-tab:hover { color: var(--ink); background: var(--surface-2); }
.cm-tab.is-active { background: var(--ink); color: #fff; }
.cm-tab.is-active .i { color: var(--gold-2); }
.cm-sort { display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--surface-3); flex: none; }
.cm-sort a { display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; border-radius: 9px; font-size: 13px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.cm-sort a .i { width: 15px; height: 15px; }
.cm-sort a:hover { color: var(--ink); }
.cm-sort a.is-active { background: #fff; color: var(--ink); box-shadow: var(--shadow-xs); }
.cm-sort a.is-active .i { color: var(--gold-3); }
@media (max-width: 560px) {
  .cm-tabs { flex: 1 1 100%; }
  .cm-tab { flex: 1 0 auto; justify-content: center; padding-inline: 9px; font-size: 13.5px; }
  .cm-tab .i { display: none; }
}

/* section chips (mobile / tablet) */
.cm-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding: 2px 16px; scroll-padding-inline: 16px; }
.cm-chips::-webkit-scrollbar { display: none; }
.cm-chip { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; font-weight: 700; font-size: 13.5px; color: #4a4640; white-space: nowrap; transition: border-color .15s, background .15s; }
.cm-chip .i { width: 15px; height: 15px; color: var(--gold-3); }
.cm-chip:hover { border-color: #cbbfa9; color: var(--ink); }
.cm-chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.cm-chip.is-active .i { color: var(--gold-2); }
@media (min-width: 768px) { .cm-chips { margin-inline: 0; padding-inline: 0; flex-wrap: wrap; overflow: visible; } }
@media (min-width: 1000px) { .cm-chips { display: none; } }

.cm-searchnote { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: 14px; background: var(--gold-soft); border: 1px solid var(--gold-line); font-size: 14px; color: #4b3a22; }
.cm-searchnote > span { display: inline-flex; align-items: center; gap: 6px; }
.cm-searchnote .link { display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; }

/* ---------------- composer ---------------- */
.cm-composer { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 14px; box-shadow: var(--shadow-xs); transition: box-shadow .2s, border-color .2s; }
.cm-composer.is-open { border-color: var(--gold-line); box-shadow: var(--shadow-sm); }
@media (min-width: 640px) { .cm-composer { padding: 16px 18px; } }
.cm-comp-head { display: flex; align-items: flex-start; gap: 12px; }
.cm-comp-head > .avatar { margin-top: 1px; }
.cm-comp-prompt {
  flex: 1; min-width: 0; height: 46px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line-2); background: #FBF9F6;
  color: var(--muted); font-weight: 600; font-size: 14.5px; text-align: start; cursor: text; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; transition: border-color .2s, background .2s;
}
.cm-comp-prompt:hover { border-color: #cfc5b5; background: #fff; }
.cm-comp-editor, .cm-comp-full, .cm-comp-actions { display: none; }
.cm-composer.is-open .cm-comp-prompt { display: none; }
.cm-composer.is-open .cm-comp-editor { display: block; flex: 1; min-width: 0; }
.cm-composer.is-open .cm-comp-full { display: block; }
.cm-composer.is-open .cm-comp-actions { display: flex; }
.cm-comp-text {
  display: block; width: 100%; min-height: 78px; max-height: 420px; padding: 9px 2px; border: 0; outline: none; resize: none; background: transparent;
  font-size: 16px; line-height: 1.8; color: var(--text);
}
.cm-comp-text::placeholder { color: #aaa49b; }
.cm-comp-editor .counter { margin-top: 0; }
html[dir="rtl"] .cm-comp-editor .counter { direction: ltr; text-align: left; }
.cm-comp-editor .field-error { margin-top: 2px; }
.cm-comp-full { padding-inline-start: 56px; }
@media (max-width: 480px) { .cm-comp-full { padding-inline-start: 0; } }

.cm-previews { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.cm-prev { position: relative; aspect-ratio: 1 / 1; border-radius: 12px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.cm-prev img { width: 100%; height: 100%; object-fit: cover; }
.cm-prev-x { position: absolute; top: 6px; inset-inline-end: 6px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(17, 17, 17, .72); color: #fff; display: grid; place-items: center; cursor: pointer; font-size: 16px; line-height: 1; }
.cm-prev-x:hover { background: var(--red); }
.cm-prev-add { display: grid; place-items: center; cursor: pointer; border: 1.5px dashed var(--line-2); background: #FDFCFA; color: var(--muted); }
.cm-prev-add:hover { border-color: var(--gold); color: var(--gold-3); }
.cm-prev-add .i { width: 26px; height: 26px; }
.cm-prev-video { grid-column: 1 / -1; aspect-ratio: auto; background: #0c0c0d; }
.cm-prev-video video { width: 100%; max-height: 300px; display: block; background: #000; }
.cm-prev-meta { display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: 13px; color: #d9d3c9; background: #151516; }
.cm-prev-meta .i { color: var(--gold-2); width: 16px; height: 16px; }
.cm-prev-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cm-comp-link { margin-top: 10px; }
.cm-comp-link .input-group .input { height: 44px; }
.cm-link-clear { border: 0; background: transparent; color: var(--muted); padding: 0 12px; cursor: pointer; display: grid; place-items: center; }
.cm-link-clear:hover { color: var(--red); }
.cm-link-hint { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--muted); min-height: 0; }
.cm-link-hint:empty { display: none; }
.cm-link-hint.is-ok { color: var(--green); }
.cm-link-hint.is-bad { color: var(--red); }
.cm-link-hint img { width: 64px; height: 36px; object-fit: cover; border-radius: 6px; flex: none; }
.cm-link-hint .i { width: 16px; height: 16px; }

.cm-comp-opts { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 12px; }
.cm-comp-opt { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; color: var(--muted); min-width: 0; max-width: 100%; }
.cm-comp-opt > .i { color: var(--gold-3); width: 16px; height: 16px; }
.cm-comp-opt .select { width: auto; min-width: 140px; max-width: 100%; height: 38px; font-size: 14px; font-weight: 600; color: var(--text); }
.cm-comp-job { flex: 1 1 100%; }
.cm-comp-job .select { flex: 1; min-width: 0; max-width: none; }
.cm-comp-nojobs { font-weight: 600; }
.cm-comp-err { margin-top: 10px; padding: 9px 12px; border-radius: 12px; background: var(--red-soft); color: #a52a23; font-size: 13.5px; font-weight: 700; }
.cm-progress { height: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 12px; }
.cm-progress i { display: block; height: 100%; width: 0; background: var(--gold-grad); border-radius: 99px; transition: width .2s linear; }

.cm-comp-bar { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.cm-tool {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 11px; border-radius: 10px; border: 0; background: transparent;
  font-weight: 700; font-size: 14px; color: #4a4640; cursor: pointer; user-select: none; transition: background .15s, color .15s, opacity .15s;
}
.cm-tool .i { width: 20px; height: 20px; color: var(--gold-3); }
.cm-tool:hover { background: var(--surface-2); color: var(--ink); }
.cm-tool.is-active { background: var(--gold-soft); color: var(--gold-4); }
.cm-tool.is-disabled { opacity: .38; pointer-events: none; }
.cm-file { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; opacity: 0; }
.cm-comp-actions { margin-inline-start: auto; align-items: center; gap: 6px; }
.cm-comp-submit { min-width: 96px; }
html[dir="rtl"] .cm-send-ico { transform: scaleX(-1); }
@media (max-width: 420px) {
  .cm-tool { padding: 0 9px; gap: 5px; font-size: 13.5px; }
  .cm-composer.is-open .cm-comp-actions { width: 100%; justify-content: flex-end; margin-top: 4px; }
}

/* guest / unverified call to action */
.cm-join { position: relative; overflow: hidden; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 18px; border-radius: 20px; background: linear-gradient(135deg, #FFFBF4 0%, #F7EFE3 100%); border: 1px solid var(--gold-line); }
.cm-join-ico { width: 48px; height: 48px; border-radius: 14px; background: var(--ink); color: var(--gold-2); display: grid; place-items: center; flex: none; }
.cm-join-text { flex: 1 1 260px; min-width: 0; }
.cm-join-text b { display: block; font-size: 16.5px; color: var(--ink); line-height: 1.5; }
.cm-join-text p { margin: 2px 0 0; color: #6b5a41; font-size: 14px; line-height: 1.7; }
.cm-join-cta { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 560px) { .cm-join-cta { width: 100%; } .cm-join-cta .btn { flex: 1; } }

/* ---------------- feed ---------------- */
.cm-feed { display: flex; flex-direction: column; gap: 14px; }
.cm-more-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.cm-loadmore { max-width: 360px; }
.cm-end { margin: 4px 0 0; text-align: center; color: var(--muted-2); font-size: 13.5px; font-weight: 700; }

/* ---------------- post card ---------------- */
.cm-post {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 16px;
  box-shadow: var(--shadow-xs); transition: border-color .2s, box-shadow .2s; scroll-margin-top: calc(var(--header-h) + 16px);
}
@media (min-width: 640px) { .cm-post { padding: 18px 20px; } }
.cm-post:hover { border-color: #e4d8c6; box-shadow: var(--shadow-sm); }
.cm-post.is-pinned { border-color: var(--gold-line); background: linear-gradient(180deg, #FFFCF6 0, #fff 140px); }
.cm-post.is-pinned::before { content: ""; position: absolute; top: -1px; inset-inline: 24px; height: 3px; border-radius: 0 0 4px 4px; background: var(--gold-grad); }
.cm-post.is-hidden-post { border-style: dashed; border-color: #e7c98d; }
.cm-post:target, .cm-post.is-flash { box-shadow: 0 0 0 3px rgba(196, 149, 90, .35), var(--shadow-sm); }
.cm-post.is-new { animation: cmIn .35s var(--ease); }
.cm-post.is-removing { opacity: 0; transition: opacity .25s; }
@keyframes cmIn { from { opacity: 0; } to { opacity: 1; } }

.cm-post-head { display: flex; align-items: center; gap: 11px; }
.cm-post-av { flex: none; display: inline-flex; }
.cm-post-who { flex: 1; min-width: 0; }
.cm-post-name { display: flex; align-items: center; gap: 6px; min-width: 0; line-height: 1.45; }
.cm-post-author { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; font-size: 15.5px; color: var(--ink); }
a.cm-post-author:hover { color: var(--gold-3); }
.cm-post-name .tick { flex: none; }
.cm-role { flex: none; display: inline-flex; align-items: center; padding: 0 8px; border-radius: 999px; background: var(--surface-2); color: #5b564e; font-size: 11.5px; font-weight: 800; line-height: 20px; }
.cm-role-brand { background: var(--gold-soft); color: var(--gold-4); }
.cm-role-admin { background: var(--ink); color: var(--gold-2); }
.cm-post-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 7px; font-size: 13px; color: var(--muted); margin-top: 1px; }
.cm-post-time:hover { color: var(--gold-3); }
.cm-dot { color: #cfc8bd; }
.cm-sec-chip { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--gold-4); }
.cm-sec-chip .i { width: 14px; height: 14px; color: var(--gold-3); }
.cm-sec-chip:hover { color: var(--ink); }
.cm-pin { display: inline-flex; align-items: center; gap: 3px; padding: 0 8px; border-radius: 999px; background: var(--gold-soft); color: var(--gold-4); font-weight: 800; font-size: 11.5px; line-height: 20px; }
.cm-pin .i { width: 13px; height: 13px; }
.cm-follow { flex: none; align-self: flex-start; margin-top: 3px; }
.cm-follow .i { width: 15px; height: 15px; }
.cm-follow.is-following .i { display: none; }

.cm-post-body { margin-top: 12px; font-size: 15.5px; line-height: 1.9; color: #25231f; word-break: break-word; overflow-wrap: anywhere; }
.cm-post-body a { color: var(--gold-3); font-weight: 600; text-decoration: underline; text-decoration-color: var(--gold-line); text-underline-offset: 3px; word-break: break-all; }
.cm-post-body a:hover { text-decoration-color: currentColor; }
.cm-post-body.is-clamped { display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; overflow: hidden; }
.cm-post.is-full .cm-post-body { font-size: 16.5px; }
.cm-more { margin-top: 4px; padding: 0; border: 0; background: none; color: var(--gold-3); font-weight: 800; font-size: 14px; cursor: pointer; }
.cm-more:hover { text-decoration: underline; }

/* images */
.cm-gallery { margin-top: 12px; display: grid; gap: 3px; border-radius: 16px; overflow: hidden; background: var(--surface-2); }
.cm-gimg { position: relative; display: block; width: 100%; height: 100%; min-height: 0; padding: 0; border: 0; background: #ece6dc; cursor: zoom-in; overflow: hidden; }
.cm-gimg img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s var(--ease), filter .2s; }
.cm-gimg:hover img { transform: scale(1.025); }
.cm-gimg:focus-visible { outline-offset: -3px; }
.cm-g1 .cm-gimg { height: auto; }
.cm-g1 .cm-gimg img { height: auto; max-height: min(640px, 78vh); min-height: 180px; }
.cm-g2 { grid-template-columns: 1fr 1fr; aspect-ratio: 16 / 10; }
.cm-g3 { grid-template-columns: 3fr 2fr; grid-template-rows: 1fr 1fr; aspect-ratio: 16 / 10; }
.cm-g3 .cm-gimg:first-child { grid-row: 1 / span 2; }
.cm-g4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 4 / 3; }

/* uploaded video */
.cm-video { margin-top: 12px; border-radius: 16px; overflow: hidden; background: #0c0c0d; }
.cm-video video { width: 100%; max-height: 560px; display: block; background: #000; }

/* linked video card */
.cm-link { margin-top: 12px; display: block; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: #fff; color: var(--text); transition: border-color .2s, box-shadow .2s; }
.cm-link:hover { border-color: #dccbb1; box-shadow: var(--shadow-sm); color: var(--text); }
.cm-link-media { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: linear-gradient(145deg, #1b1b1d, #4a3b28); }
.cm-link-vertical .cm-link-media, .cm-link-square .cm-link-media { aspect-ratio: 16 / 10; }
.cm-link:not(.has-thumb) .cm-link-media { aspect-ratio: auto; height: 190px; }
.cm-link-blur { position: absolute; inset: -24px; width: calc(100% + 48px); max-width: none; height: calc(100% + 48px); object-fit: cover; filter: blur(22px) brightness(.55) saturate(1.2); }
.cm-link-img { position: relative; width: 100%; height: 100%; object-fit: cover; }
.cm-link-vertical .cm-link-img { width: auto; height: 100%; aspect-ratio: 9 / 16; margin-inline: auto; box-shadow: 0 10px 40px rgba(0, 0, 0, .45); }
.cm-link-square .cm-link-img { width: auto; height: 100%; aspect-ratio: 4 / 5; margin-inline: auto; box-shadow: 0 10px 40px rgba(0, 0, 0, .45); }
.cm-link-logo { position: absolute; top: 14px; inset-inline-start: 14px; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: rgba(255, 255, 255, .14); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.cm-link-play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .5);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: transform .2s var(--ease), background .2s, border-color .2s;
}
.cm-link-play .i { width: 24px; height: 24px; }
.cm-link-play .i path:only-child { fill: #fff; }
.cm-link:hover .cm-link-play { background: var(--gold); border-color: var(--gold); transform: translate(-50%, -50%) scale(1.07); }
.cm-link-bar { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-top: 1px solid var(--line); }
.cm-link-plat { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: #555; flex: none; }
.cm-link-text { flex: 1; min-width: 0; line-height: 1.45; }
.cm-link-text b { display: block; font-size: 14px; }
.cm-link-text small { display: block; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-link-go { color: var(--muted-2); display: flex; }
.cm-plat-youtube .cm-link-plat { background: #FF0000; }
.cm-plat-tiktok .cm-link-plat { background: #111; }
.cm-plat-instagram .cm-link-plat { background: linear-gradient(135deg, #5b2ed1, #c1318a 55%, #f5a142); }
.cm-plat-facebook .cm-link-plat { background: #1877F2; }
.cm-plat-drive .cm-link-plat { background: #1FA463; }
.cm-plat-vimeo .cm-link-plat { background: #1AB7EA; }
.cm-plat-snapchat .cm-link-plat { background: #FFFC00; color: #111; }
.cm-plat-x .cm-link-plat, .cm-plat-other .cm-link-plat { background: #1b1b1d; }
.cm-plat-youtube:not(.has-thumb) .cm-link-media { background: linear-gradient(145deg, #3a0000, #cc0000); }
.cm-plat-tiktok:not(.has-thumb) .cm-link-media { background: linear-gradient(145deg, #0b0b0b 0%, #1f1f22 60%, #25f4ee 160%); }
.cm-plat-instagram:not(.has-thumb) .cm-link-media { background: linear-gradient(135deg, #5b2ed1 0%, #c1318a 50%, #f5a142 100%); }
.cm-plat-facebook:not(.has-thumb) .cm-link-media { background: linear-gradient(145deg, #0c3aa3, #1877F2); }
.cm-plat-drive:not(.has-thumb) .cm-link-media { background: linear-gradient(145deg, #0c6b3a, #1fa463 60%, #f6c032); }
.cm-plat-vimeo:not(.has-thumb) .cm-link-media { background: linear-gradient(145deg, #0b4f64, #1ab7ea); }
.cm-plat-snapchat:not(.has-thumb) .cm-link-media { background: linear-gradient(145deg, #e6d800, #fffc00); }
.cm-plat-snapchat:not(.has-thumb) .cm-link-logo, .cm-plat-snapchat:not(.has-thumb) .cm-link-play { color: #111; }

/* attached campaign */
.cm-job { margin-top: 12px; display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; border: 1px solid var(--gold-line); background: linear-gradient(135deg, #FFFBF4, #F7EFE3); color: var(--ink); transition: border-color .2s, box-shadow .2s; }
.cm-job:hover { border-color: var(--gold); box-shadow: var(--shadow-sm); color: var(--ink); }
.cm-job-ico { width: 46px; height: 46px; border-radius: 13px; background: var(--ink); color: var(--gold-2); display: grid; place-items: center; flex: none; }
.cm-job-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cm-job-main small { font-size: 12px; font-weight: 800; color: var(--gold-3); letter-spacing: .02em; }
.cm-job-main b { font-size: 15px; line-height: 1.5; }
.cm-job-facts { display: flex; flex-wrap: wrap; gap: 3px 14px; font-size: 13px; color: #5b564e; font-weight: 600; margin-top: 2px; }
.cm-job-facts span { display: inline-flex; align-items: center; gap: 5px; }
.cm-job-facts .i { width: 15px; height: 15px; color: var(--gold-3); }
.cm-job-cta { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 11px; background: var(--ink); color: #fff; font-weight: 700; font-size: 13.5px; transition: background .2s; }
.cm-job:hover .cm-job-cta { background: var(--ink-3); }
.cm-job-cta .i { width: 16px; height: 16px; }
.cm-job.is-closed { background: var(--surface-2); border-color: var(--line-2); }
.cm-job.is-closed .cm-job-main small { color: var(--red); }
.cm-job.is-closed .cm-job-cta { background: #fff; color: var(--ink); border: 1px solid var(--line-2); }
@media (max-width: 560px) {
  .cm-job { flex-wrap: wrap; }
  .cm-job-main { flex-basis: calc(100% - 58px); }
  .cm-job-cta { width: 100%; justify-content: center; }
}

/* action bar */
.cm-bar { display: flex; align-items: center; gap: 2px; margin-top: 14px; padding-top: 8px; border-top: 1px solid var(--line); }
.cm-act {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; min-width: 40px; padding: 0 10px;
  border: 0; border-radius: 10px; background: transparent; color: #57524a; font-weight: 700; font-size: 14px; cursor: pointer;
  transition: background .15s, color .15s;
}
.cm-act .i { width: 20px; height: 20px; transition: transform .2s var(--ease); }
.cm-act:hover { background: var(--surface-2); color: var(--ink); }
.cm-act-like:hover, .cm-act-like.is-on { color: #E0433A; }
.cm-act-like:hover { background: #FDF0EF; }
.cm-act-like.is-on .i { fill: #E0433A; }
.cm-act-like.is-pop .i { animation: cmPop .38s var(--ease); }
.cm-act-save.is-on { color: var(--gold-3); }
.cm-act-save.is-on .i { fill: var(--gold); }
.cm-act-comment.is-active { color: var(--ink); background: var(--surface-2); }
.cm-act.is-locked { opacity: .78; }
.cm-count { font-variant-numeric: tabular-nums; }
.cm-count:empty { display: none; }
.cm-bar-sp { flex: 1; }
.cm-act-more { padding: 0 8px; }
@keyframes cmPop { 0% { transform: scale(1); } 40% { transform: scale(1.32); } 100% { transform: scale(1); } }
@media (max-width: 400px) { .cm-act-label { display: none; } .cm-act { padding: 0 9px; } }

.cm-menu-list { min-width: 220px; }
.cm-menu-list .dropdown-item { font-size: 14.5px; }
.cm-del-form { margin: 0; display: contents; }
.cm-menu .dropdown-menu { top: auto; bottom: calc(100% + 6px); }
@media (min-width: 640px) { .cm-menu .dropdown-menu { top: calc(100% + 6px); bottom: auto; } }

/* ---------------- comments ---------------- */
.cm-cbox { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; padding-top: 12px; border-top: 1px dashed var(--line-2); }
.cm-call { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 800; color: var(--gold-3); }
.cm-call:hover { color: var(--ink); }
.cm-clist { display: flex; flex-direction: column; gap: 10px; }
.cm-clist:empty { display: none; }
.cm-comment { display: flex; gap: 9px; align-items: flex-start; scroll-margin-top: calc(var(--header-h) + 20px); }
.cm-comment-av { flex: none; display: inline-flex; }
.cm-comment-main { flex: 1; min-width: 0; }
.cm-bubble { display: inline-block; max-width: 100%; padding: 8px 13px 9px; border-radius: 16px; border-start-start-radius: 6px; background: var(--surface-2); transition: box-shadow .3s, background .6s; }
.cm-comment-head { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; font-size: 13.5px; line-height: 1.5; }
.cm-comment-name { font-weight: 800; color: var(--ink); }
a.cm-comment-name:hover { color: var(--gold-3); }
.cm-op { font-size: 11px; font-weight: 800; color: var(--gold-4); background: var(--gold-soft); padding: 0 7px; border-radius: 999px; line-height: 18px; }
.cm-comment-text { font-size: 14.5px; line-height: 1.75; color: #2a2824; word-break: break-word; overflow-wrap: anywhere; }
.cm-comment-text a { color: var(--gold-3); text-decoration: underline; word-break: break-all; }
.cm-comment-meta { display: flex; align-items: center; gap: 12px; margin-top: 3px; padding-inline-start: 12px; font-size: 12.5px; color: var(--muted-2); }
.cm-cmeta-btn { padding: 0; border: 0; background: none; font: inherit; font-weight: 700; color: var(--muted); cursor: pointer; }
.cm-cmeta-btn:hover { color: var(--ink); text-decoration: underline; }
.cm-cmeta-del:hover { color: var(--red); }
.cm-comment:target .cm-bubble, .cm-comment.is-new .cm-bubble { box-shadow: 0 0 0 2px var(--gold-2); background: #FFF8EC; }
.cm-comment.is-removing { opacity: 0; transition: opacity .25s; }

.cm-cform { display: flex; align-items: flex-start; gap: 9px; }
.cm-cform > .avatar { margin-top: 3px; }
.cm-cinput { flex: 1; min-width: 0; display: flex; align-items: flex-end; gap: 6px; padding: 4px; padding-inline-start: 14px; border: 1px solid var(--line-2); border-radius: 21px; background: #fff; transition: border-color .2s, box-shadow .2s; }
.cm-cinput:focus-within { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(196, 149, 90, .15); }
.cm-cinput textarea { flex: 1; min-width: 0; min-height: 32px; max-height: 180px; padding: 5px 0; border: 0; outline: none; resize: none; background: transparent; font-size: 14.5px; line-height: 1.6; }
.cm-cinput textarea::placeholder { color: #aaa49b; }
.cm-cinput .counter { display: none; }
.cm-csend { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--gold-grad); color: var(--ink); cursor: pointer; transition: filter .2s, opacity .2s; }
.cm-csend:hover { filter: brightness(1.06); }
.cm-csend .i { width: 17px; height: 17px; }
html[dir="rtl"] .cm-csend .i { transform: scaleX(-1); }
.cm-cform.is-busy .cm-csend { opacity: .5; pointer-events: none; }
.cm-cgate { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 14px; background: var(--surface-2); color: var(--muted); font-size: 14px; }
.cm-cgate .i { color: var(--gold-3); width: 16px; height: 16px; flex: none; }

/* ---------------- single post page ---------------- */
.cm-crumbs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; font-size: 14px; font-weight: 700; color: var(--muted); }
.cm-crumbs a { display: inline-flex; align-items: center; gap: 6px; }
.cm-crumbs a:hover { color: var(--ink); }
.cm-crumbs > span { color: #cfc8bd; }
.cm-thread { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 16px; scroll-margin-top: calc(var(--header-h) + 16px); }
@media (min-width: 640px) { .cm-thread { padding: 20px; } }
.cm-thread h2 { display: flex; align-items: center; gap: 8px; font-size: 18px; margin: 0 0 14px; }
.cm-thread h2 .i { color: var(--gold-3); }
.cm-thread-count { display: inline-grid; place-items: center; min-width: 26px; height: 24px; padding: 0 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 13px; font-weight: 800; }
.cm-noc { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.cm-thread-form { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.cm-thread-form .counter { display: none; }

.cm-author { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.cm-author-av { display: inline-flex; margin-bottom: 4px; }
.cm-author-av .avatar { box-shadow: 0 0 0 4px #fff, 0 0 0 5px var(--gold-line); }
.cm-author-name { display: flex; align-items: center; gap: 5px; font-size: 16.5px; }
.cm-author-name b { font-weight: 800; color: var(--ink); }
.cm-author-head { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.cm-author-stats { font-size: 13.5px; color: var(--muted); }
.cm-author-stats b { color: var(--ink); font-weight: 800; }
.cm-author-cta { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.cm-minis { display: flex; flex-direction: column; }
.cm-mini { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.cm-mini:first-child { border-top: 0; padding-top: 2px; }
.cm-mini img { width: 54px; height: 54px; border-radius: 12px; object-fit: cover; flex: none; background: var(--surface-2); }
.cm-mini span { min-width: 0; }
.cm-mini b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13.5px; font-weight: 700; line-height: 1.6; color: var(--text); }
.cm-mini small { display: block; margin-top: 2px; color: var(--muted-2); font-size: 12px; }
.cm-mini:hover b { color: var(--gold-3); }

/* ---------------- sidebar ---------------- */
.cm-side-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 16px; box-shadow: var(--shadow-xs); }
.cm-side-title { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 15.5px; }
.cm-side-title .i { color: var(--gold-3); }
.cm-secnav { display: flex; flex-direction: column; gap: 2px; }
.cm-secnav a { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 12px; font-weight: 700; font-size: 14.5px; color: #3d3a35; transition: background .15s, color .15s; }
.cm-secnav a:hover { background: var(--surface-2); color: var(--ink); }
.cm-secnav a.is-active { background: var(--ink); color: #fff; }
.cm-secnav-ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--gold-soft); color: var(--gold-3); }
.cm-secnav a.is-active .cm-secnav-ico { background: rgba(255, 255, 255, .1); color: var(--gold-2); }
.cm-secnav small { margin-inline-start: auto; font-size: 12px; font-weight: 800; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.cm-secnav a.is-active small { color: #bdb6aa; }
.cm-who { display: flex; flex-direction: column; }
.cm-who-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.cm-who-row:first-child { border-top: 0; padding-top: 0; }
.cm-who-av { flex: none; display: inline-flex; }
.cm-who-info { flex: 1; min-width: 0; line-height: 1.45; }
.cm-who-name { display: flex; align-items: center; gap: 4px; min-width: 0; }
.cm-who-name b { font-size: 14px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-who-info small { display: block; color: var(--muted-2); font-size: 12px; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-who-info .cm-who-head { color: var(--muted); text-align: left; }
html[dir="rtl"] .cm-who-info .cm-who-head { text-align: right; }
.cm-who-row .cm-follow { margin-top: 0; align-self: center; }
.cm-side-more { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 13.5px; font-weight: 800; color: var(--gold-3); }
.cm-side-more:hover { color: var(--ink); }
.cm-rules ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.cm-rules li { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.7; color: #4a4640; }
.cm-rules li .i { width: 18px; height: 18px; color: var(--gold-3); flex: none; margin-top: 3px; }

/* ---------------- lightbox (UGCA.modal + .cm-lightbox) ---------------- */
.modal.cm-lightbox { padding: 0; background: rgba(8, 8, 9, .94); }
.modal.cm-lightbox .modal-box { width: 100%; height: 100%; max-height: none; border-radius: 0; background: transparent; box-shadow: none; overflow: hidden; animation: none; }
.modal.cm-lightbox .modal-body { padding: 0; height: 100%; }
.cm-lb { position: relative; width: 100%; height: 100%; display: grid; place-items: center; padding: 64px 12px; user-select: none; }
.cm-lb-img { max-width: min(100%, 1400px); max-height: calc(100vh - 128px); max-height: calc(100dvh - 128px); object-fit: contain; border-radius: 10px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8); animation: pop .2s var(--ease); }
.cm-lb-x, .cm-lb-nav { position: absolute; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer; transition: background .2s; z-index: 2; }
.cm-lb-x { top: 14px; inset-inline-end: 14px; width: 44px; height: 44px; font-size: 18px; }
.cm-lb-nav { top: 50%; transform: translateY(-50%); width: 48px; height: 48px; }
.cm-lb-x:hover, .cm-lb-nav:hover { background: rgba(255, 255, 255, .24); }
.cm-lb-nav .i { width: 24px; height: 24px; }
.cm-lb-prev { inset-inline-start: 14px; }
.cm-lb-next { inset-inline-end: 14px; }
.cm-lb-count { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, .12); color: #e8e2d8; font-size: 13px; font-weight: 700; direction: ltr; }
@media (max-width: 640px) { .cm-lb-nav { top: auto; bottom: 12px; transform: none; width: 44px; height: 44px; } }

/* «اطلب فيديو زي ده» — creator work → a direct offer to its creator (brands + visitors) */
.cm-req { margin-top: 12px; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--ink); color: #fff; border: 1px solid var(--ink); transition: transform .15s var(--ease), box-shadow .2s; }
.cm-req:hover { color: #fff; box-shadow: var(--shadow); transform: translateY(-1px); }
.cm-req-ico { width: 40px; height: 40px; border-radius: 12px; background: var(--gold-grad); color: var(--ink); display: grid; place-items: center; flex: none; }
.cm-req-ico .i { width: 20px; height: 20px; }
.cm-req-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cm-req-text b { font-size: 15px; line-height: 1.5; color: var(--gold-2); }
.cm-req-text small { font-size: 12.5px; line-height: 1.55; color: #cfc8bd; font-weight: 600; }
.cm-req-go { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 255, 255, .08); color: var(--gold-2); }

/* ---------------- the Manager account's posts & comments (app/lib/staff.php) ---------------- */
.cm-post.is-mgr-post {
  border: 1.5px solid transparent; padding-top: 0;
  background: linear-gradient(180deg, #FFFBF2 0, #fff 170px) padding-box, linear-gradient(135deg, #F3D9A8 0%, #C4955A 45%, #8a6534 100%) border-box;
  box-shadow: 0 16px 36px -20px rgba(196, 149, 90, .7);
}
.cm-post.is-mgr-post:hover { border-color: transparent; box-shadow: 0 20px 44px -20px rgba(196, 149, 90, .85); }
.cm-post.is-mgr-post::before { display: none; }
.cm-mgr-ribbon {
  display: flex; align-items: center; gap: 7px; margin: 0 -16px 14px; padding: 8px 16px; border-radius: 18px 18px 0 0;
  background: linear-gradient(100deg, #0b0b0c 0%, #241e15 62%, #3a2f1f 100%); color: #E9C893; font-size: 12.5px; font-weight: 800; line-height: 1.5;
}
.cm-mgr-ribbon .i { color: #E0BD8A; flex: none; }
@media (min-width: 640px) { .cm-mgr-ribbon { margin-inline: -20px; padding-inline: 20px; } }
.cm-comment.is-mgr .cm-bubble { background: linear-gradient(135deg, #FFF8EA, #F5E8D2); box-shadow: inset 0 0 0 1px var(--gold-line); }
.cm-side-card.cm-author.is-mgr { border-color: var(--gold-line); background: linear-gradient(180deg, #FFF9EE 0%, #fff 70%); }
.cm-role-mgr { background: var(--ink); color: #E9C893; }
.cm-author-av .avatar.is-mgr { box-shadow: 0 0 0 3px #fff, 0 0 0 6px #C4955A, 0 0 22px 5px rgba(224, 189, 138, .55); }
