/* ══════════════════════════════════════════════════════════════════════════
   Customer account (AccountLayout) and community (سوشال مدیا) — loaded after theme.css.
   ac-* : the account's side menu and its phone version.   cx-* : community pages.   cm-* : posts (PostCard).
   ══════════════════════════════════════════════════════════════════════════ */

/* An «empty» notice on a .card: the card's flex column broke its sentence and link into separate lines. */
.empty.card { display: block; }

/* ── Account shell ─────────────────────────────────────────────────────── */
.ac-shell { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 1.5rem; align-items: start; margin-top: 1.25rem; }
.ac-main { min-width: 0; }
.ac-plain, .ac-plain > .ac-main { display: contents; }
.ac-main > .page-title:first-child, .ac-main > .pt-hello:first-child .page-title { margin-top: 0; }

.ac-side {
    position: sticky; top: calc(var(--st-header-h, 140px) + 1rem);
    display: flex; flex-direction: column; gap: .25rem;
    padding: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg, 18px);
    max-height: calc(100vh - var(--st-header-h, 140px) - 2rem); overflow-y: auto; scrollbar-width: thin;
}
.ac-user { display: flex; align-items: center; gap: .75rem; padding: .25rem .25rem 1rem; margin-bottom: .25rem; border-bottom: 1px solid var(--border); }
.ac-avatar {
    flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
    font-weight: 800; font-size: 1.15rem; color: #fff;
    background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 55%, #0b100e));
}
.ac-user-text { display: grid; min-width: 0; line-height: 1.5; }
.ac-user-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-user-text small { color: var(--muted); font-size: .8rem; text-align: right; }
.ac-user-edit { margin-inline-start: auto; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.ac-user-edit:hover { background: var(--tint); color: var(--primary); }

.ac-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ac-group { margin: .9rem .6rem .35rem; font-size: .72rem; font-weight: 700; color: var(--muted); letter-spacing: 0; }
.ac-link {
    display: flex; align-items: center; gap: .7rem; width: 100%; padding: .6rem .7rem; border: 0; border-radius: 12px;
    background: none; color: var(--text); font-size: .92rem; text-align: start; transition: background .15s, color .15s;
}
.ac-link .ti { font-size: 1.2rem; color: var(--muted); transition: color .15s; }
.ac-link:hover { background: var(--bg); color: var(--primary); }
.ac-link:hover .ti { color: var(--primary); }
.ac-link.active { background: var(--tint); color: var(--primary); font-weight: 700; box-shadow: inset -3px 0 0 var(--primary); }
[dir="ltr"] .ac-link.active { box-shadow: inset 3px 0 0 var(--primary); }
.ac-link.active .ti { color: var(--primary); }
.ac-logout { margin: .5rem 0 0; padding-top: .5rem; border-top: 1px solid var(--border); }
.ac-link.danger, .ac-link.danger .ti { color: #c0392b; }
.ac-link.danger:hover { background: #fdecea; }

/* Phones and tablets: the menu folds into a button above the page. */
.ac-mobile { display: none; }
@media (max-width: 991.98px) {
    .ac-shell { grid-template-columns: minmax(0, 1fr); gap: 1rem; margin-top: .75rem; }
    .ac-side { display: none; }
    .ac-mobile { display: block; position: relative; z-index: 5; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }
    .ac-mobile > summary {
        list-style: none; display: flex; align-items: center; justify-content: space-between; gap: .75rem;
        padding: .8rem 1rem; cursor: pointer; font-weight: 700;
    }
    .ac-mobile > summary::-webkit-details-marker { display: none; }
    .ac-mobile-current { display: inline-flex; align-items: center; gap: .5rem; color: var(--primary); }
    .ac-mobile-current .ti { font-size: 1.25rem; }
    .ac-mobile-hint { display: inline-flex; align-items: center; gap: .25rem; font-size: .8rem; font-weight: 500; color: var(--muted); }
    .ac-mobile-hint .ti { transition: transform .2s; }
    .ac-mobile[open] .ac-mobile-hint .ti { transform: rotate(180deg); }
    .ac-mobile-panel { padding: 0 .75rem .75rem; border-top: 1px solid var(--border); }
    .ac-mobile-panel .ac-nav ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ac-mobile-panel .ac-link { padding: .65rem .6rem; font-size: .88rem; }
    .ac-mobile-panel .ac-link.active { box-shadow: none; }
}
@media (max-width: 380px) { .ac-mobile-panel .ac-nav ul { grid-template-columns: minmax(0, 1fr); } }

/* The header's «حساب من» dropdown: the same groups as the side menu. */
.st-header .st-account-menu { min-width: 250px; max-height: calc(100vh - 140px); overflow-y: auto; scrollbar-width: thin; }
.st-menu-group { padding: .6rem .75rem .2rem; font-size: .72rem; font-weight: 700; color: var(--muted); }

/* Dashboard header inside the shell */
.ac-main .pt-hello { align-items: center; margin-bottom: .5rem; }
.ac-main .pt-hello .page-title { margin-bottom: .25rem; }
.ac-main .pt-stats { grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr)); }
@media (max-width: 1199.98px) and (min-width: 992px) { .ac-main .pt-grid { grid-template-columns: minmax(0, 1fr); } }

/* ── Community: shared ─────────────────────────────────────────────────── */
.cx-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg, 18px); padding: 1.15rem; }
.cx-card + .cx-card { margin-top: 1rem; }
.cx-card-title { display: flex; align-items: center; gap: .45rem; margin: 0 0 .85rem; font-size: 1rem; font-weight: 800; }
.cx-card-title .ti { color: var(--primary); font-size: 1.2rem; }
.cx-btn-ghost { --bs-btn-border-radius: 999px; color: #fff; border: 1px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .06); }
.cx-btn-ghost:hover { color: #fff; background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .6); }

.cx-empty { display: grid; justify-items: center; gap: .5rem; padding: 2.5rem 1.25rem; text-align: center; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius-lg, 18px); color: var(--muted); }
.cx-empty > .ti { font-size: 2.4rem; color: var(--primary); opacity: .8; }
.cx-empty strong { color: var(--text); font-size: 1.05rem; }
.cx-empty p { margin: 0 0 .5rem; max-width: 420px; }

/* Hero */
.cx-hero {
    position: relative; overflow: hidden; display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
    padding: 1.75rem 2rem; margin-bottom: 1.5rem; border-radius: 24px; color: #f1f5f2;
    background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--primary) 55%, transparent) 0%, transparent 55%),
                linear-gradient(135deg, #0b100e 0%, #142019 100%);
}
.cx-hero h1 { margin: .35rem 0 .4rem; font-size: clamp(1.35rem, 2.6vw, 1.9rem); font-weight: 900; color: #fff !important; }
.cx-hero p { margin: 0; max-width: 560px; color: #c4d0c9; font-size: .95rem; }
.cx-eyebrow { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .7rem; border-radius: 999px; font-size: .78rem; font-weight: 700; color: #fff; background: rgba(255, 255, 255, .1); }
.cx-hero-cta { display: flex; gap: .6rem; flex-wrap: wrap; }

/* Layout: side column + feed */
.cx-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.cx-side { position: sticky; top: calc(var(--st-header-h, 140px) + 1rem); }
.cx-main { min-width: 0; max-width: 720px; }
@media (max-width: 991.98px) {
    .cx-layout { grid-template-columns: minmax(0, 1fr); }
    .cx-side { position: static; order: 2; }
    .cx-main { max-width: none; }
    .cx-hero { padding: 1.35rem 1.25rem; }
    .cx-hero-cta { width: 100%; }
    .cx-hero-cta .btn { flex: 1 1 auto; }
}

/* «Me» card */
.cx-me { display: grid; gap: .6rem; text-align: center; }
.cx-me > p { margin: 0; color: var(--muted); font-size: .88rem; }
.cx-me-icon { width: 56px; height: 56px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; font-size: 1.6rem; color: var(--primary); background: var(--tint); }
.cx-me-head { display: flex; align-items: center; gap: .7rem; text-align: start; }
.cx-me-head > div { display: grid; min-width: 0; }
.cx-me-head small { color: var(--muted); text-align: right; }
.cx-me-head .cm-avatar { width: 52px; height: 52px; font-size: 1.4rem; }
.cx-me-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: .25rem 0; padding: .6rem 0; border-block: 1px solid var(--border); }
.cx-me-stats > div { display: grid; }
.cx-me-stats dt { order: 2; font-size: .72rem; font-weight: 400; color: var(--muted); }
.cx-me-stats dd { margin: 0; font-size: 1.15rem; font-weight: 800; }
.cx-me-links { display: grid; gap: 2px; text-align: start; }
.cx-me-links a { display: flex; align-items: center; gap: .55rem; padding: .5rem .6rem; border-radius: 10px; color: var(--text); font-size: .9rem; }
.cx-me-links a .ti { color: var(--muted); font-size: 1.1rem; }
.cx-me-links a:hover { background: var(--tint); color: var(--primary); }
.cx-me-links a:hover .ti { color: var(--primary); }

.cx-challenges { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.cx-challenges li { display: grid; gap: .2rem; padding: .75rem; border-radius: 14px; background: #fff8e6; border: 1px solid #f5e1a8; }
.cx-challenges small { color: #8a6100; }
.cx-challenges p { margin: .15rem 0 .35rem; font-size: .85rem; color: var(--text); }
.cx-challenges .btn { justify-self: start; }

.cx-how ol { list-style: none; counter-reset: how; margin: 0; padding: 0; display: grid; gap: .65rem; }
.cx-how li { counter-increment: how; display: grid; grid-template-columns: 28px 1fr; column-gap: .6rem; font-size: .85rem; }
.cx-how li::before { content: counter(how); grid-row: span 2; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: var(--primary); background: var(--tint); }
.cx-how li span { color: var(--muted); }

/* Stories */
.cx-main .cm-stories { padding: .25rem 0 1rem; margin-bottom: .25rem; }
.cm-story img, .cm-story > span { border-color: transparent; box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--primary); }

/* Filters */
.cx-pills, .cx-topics { display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.cx-pills::-webkit-scrollbar, .cx-topics::-webkit-scrollbar { display: none; }
.cx-pills a, .cx-topics a {
    flex: none; padding: .45rem .95rem; border-radius: 999px; font-size: .85rem; white-space: nowrap;
    color: var(--text); background: var(--surface); border: 1px solid var(--border); transition: background .15s, color .15s, border-color .15s;
}
.cx-pills a:hover, .cx-topics a:hover { border-color: var(--primary); color: var(--primary); }
.cx-pills a.active { color: #fff; background: var(--text); border-color: var(--text); }
.cx-topics a { padding: .3rem .75rem; font-size: .8rem; }
.cx-topics a.active { color: var(--primary); background: var(--tint); border-color: color-mix(in srgb, var(--primary) 40%, transparent); font-weight: 700; }
.cx-toolbar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin: .75rem 0 1rem; flex-wrap: wrap; }
.cx-search { position: relative; flex: 0 1 260px; min-width: 200px; }
.cx-search .ti { position: absolute; top: 50%; inset-inline-start: .8rem; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.cx-search .form-control { padding-inline-start: 2.3rem; border-radius: 999px; min-height: 40px; }
.cx-filtered { margin: -.25rem 0 1rem; font-size: .85rem; color: var(--muted); }
@media (max-width: 575.98px) { .cx-search { flex: 1 1 100%; } }

.cx-feed { display: grid; gap: 1rem; }
.cx-pager { display: flex; align-items: center; justify-content: center; gap: 1rem; margin: 1.5rem 0; color: var(--muted); font-size: .85rem; }
.cx-pager .btn { border-radius: 999px; }

/* ── Posts ─────────────────────────────────────────────────────────────── */
.cm-post { border-radius: 20px; scroll-margin-top: calc(var(--st-header-h, 140px) + 1rem); transition: box-shadow .2s; }
.cm-post:target { box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 35%, transparent); }
.cm-post-head { padding: .9rem 1rem .5rem; flex-wrap: nowrap; align-items: flex-start; }
.cm-who { display: grid; min-width: 0; flex: 1; line-height: 1.55; }
.cm-who > a, .cm-who > strong { color: var(--text); }
.cm-who > a:hover strong { color: var(--primary); }
.cm-who .cm-handle { display: inline; color: var(--muted); font-size: .78rem; }
.cm-who small { color: var(--muted); font-size: .78rem; }
.cm-kind { color: var(--primary); font-weight: 700; }
.cm-head-badges { display: flex; gap: .25rem; flex-wrap: wrap; justify-content: flex-end; }
.cm-avatar { width: 44px; height: 44px; font-size: 1.25rem; }
.cm-text { padding: .25rem 1rem .75rem; line-height: 1.95; font-size: .95rem; }
.cm-more { margin-inline-start: .35rem; font-weight: 700; }
.cm-media { margin: 0 1rem .75rem; border-radius: 14px; overflow: hidden; background: #0b100e; }
.cm-media img { aspect-ratio: 4 / 3; max-height: 460px; }
.cm-products { padding: 0 1rem .75rem; display: flex; flex-direction: row; flex-wrap: wrap; gap: .5rem; }
.cm-products li { gap: 0; flex-wrap: nowrap; border: 1px solid var(--border); border-radius: 14px; background: var(--bg); padding: .3rem; padding-inline-end: .5rem; max-width: 100%; }
.cm-product { display: flex; align-items: center; gap: .5rem; min-width: 0; color: var(--text); }
.cm-product img, .cm-product-icon { width: 38px; height: 38px; flex: none; border-radius: 10px; object-fit: cover; display: grid; place-items: center; background: var(--surface); }
.cm-product-name { font-size: .85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-products form { margin: 0 0 0 0; margin-inline-start: .35rem; }
.cm-cart { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; border: 0; color: #fff; background: var(--primary); }
.cm-cart:hover { filter: brightness(.92); }
.cm-verified { font-size: .7rem; padding: .1rem .45rem; border-radius: 999px; background: #e3f6eb; color: #127a3e; }
.cm-post-foot { display: flex; gap: .25rem; padding: .4rem .6rem; border-top: 1px solid var(--border); }
.cm-post-foot form { margin: 0; }
.cm-post-foot .cm-save { margin-inline-start: auto; }
.cm-act { padding: .45rem .7rem; border-radius: 999px; font-size: .88rem; color: var(--muted); }
.cm-act .ti { font-size: 1.15rem; }
.cm-act:hover:not(:disabled) { color: var(--primary); background: var(--tint); }
.cm-act.on { color: var(--primary); }
.cm-count { margin-inline-start: .15rem; font-weight: 700; }
.cm-count:empty { display: none; }
.cm-status { display: inline-flex; align-items: center; white-space: nowrap; font-weight: 700; font-size: .72rem; padding: .15rem .55rem; }
.cm-status.s-Draft { background: #eef0ef; color: #4a5650; }
.cm-status.s-Pending { background: #e7f0fd; color: #1d4ed8; }
.cm-kind-chip { display: inline-flex; padding: .15rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 700; color: var(--primary); background: var(--tint); }

/* Post page */
.cm-single .co-card { border-radius: 20px; }

/* ── سوشال من (account) ────────────────────────────────────────────────── */
.cx-mine-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.cx-mine-head .page-title { margin: 0 0 .35rem; }
.cx-mine-head .page-lead { margin: 0; color: var(--muted); }
.cx-tabs { display: flex; gap: .25rem; margin-bottom: 1.25rem; padding: .3rem; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.cx-tabs::-webkit-scrollbar { display: none; }
.cx-tabs a { flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .6rem 1rem; border-radius: 12px; color: var(--muted); font-size: .9rem; white-space: nowrap; }
.cx-tabs a:hover { color: var(--primary); }
.cx-tabs a.active { color: var(--primary); background: var(--tint); font-weight: 800; }
.cx-tabs b { min-width: 1.4rem; padding: 0 .35rem; border-radius: 999px; font-size: .72rem; line-height: 1.4rem; text-align: center; background: var(--bg); color: var(--text); }
.cx-tabs a.active b { background: var(--primary); color: #fff; }

.cx-onboard h2 { margin: 0 0 .5rem; font-size: 1.15rem; font-weight: 800; }
.cx-onboard p { color: var(--muted); margin: 0 0 1rem; }
.cx-steps { list-style: none; margin: 0; padding: 0; display: flex; gap: .5rem; flex-wrap: wrap; }
.cx-steps li { display: inline-flex; align-items: center; gap: .45rem; padding: .35rem .8rem .35rem .4rem; border-radius: 999px; font-size: .85rem; color: var(--muted); background: var(--bg); }
.cx-steps li span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--surface); }
.cx-steps li.current { color: var(--primary); background: var(--tint); font-weight: 700; }
.cx-steps li.current span { color: #fff; background: var(--primary); }

.cx-invite { margin-bottom: 1rem; background: linear-gradient(180deg, var(--tint), var(--surface) 70%); }
.cx-invites { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.cx-invites li { display: flex; align-items: center; gap: .5rem; padding: .6rem .75rem; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); flex-wrap: wrap; }
.cx-invite-text { display: grid; flex: 1; min-width: 180px; }
.cx-invite-text strong { text-align: right; }
.cx-invite-text small { color: var(--muted); }

.cx-mine { list-style: none; margin: 0 0 .75rem; padding: 0; display: grid; gap: .75rem; }
.cx-mine-item { padding: 1rem 1.1rem; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); }
.cx-mine-top { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.cx-mine-top .hint { margin-inline-start: auto; }
.cx-mine-text { margin: .6rem 0 .35rem; line-height: 1.85; overflow-wrap: anywhere; }
.cx-note { margin: 0 0 .35rem; padding: .5rem .7rem; border-radius: 10px; font-size: .85rem; background: #fff6dc; color: #7a5600; }
.cx-next { margin: 0 0 .7rem; font-size: .8rem; color: var(--muted); }
.cx-mine-actions { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.cx-mine-actions form { margin: 0; }
.cx-mine-actions .btn { border-radius: 999px; }
.cx-mine-stats { display: inline-flex; align-items: center; gap: .3rem; margin-inline-end: auto; color: var(--muted); font-size: .85rem; }

.cx-profile-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.cx-profile-grid .cx-card + .cx-card { margin-top: 0; }
.cx-profile-side { display: grid; gap: 1rem; }
.cx-preview .cx-me-head { margin-bottom: .6rem; }
@media (max-width: 1199.98px) { .cx-profile-grid { grid-template-columns: minmax(0, 1fr); } }
.cx-form .co-fields label, .cx-form > label { font-size: .88rem; font-weight: 600; }
.cx-switches { display: grid; gap: .35rem; margin-top: 1rem; padding: .75rem; border-radius: 12px; background: var(--bg); }
.copyable { cursor: copy; }
.copyable.copied { border-color: var(--primary); box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--primary) 18%, transparent); }

/* Post editor */
.cx-editor { padding: 1.4rem; }
.cx-editor fieldset { margin: 0; }
.cx-step-title { display: flex; align-items: center; gap: .5rem; margin-bottom: .7rem; font-size: 1rem; font-weight: 800; color: var(--text); float: none; width: auto; }
.cx-step-title > span { width: 26px; height: 26px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; color: #fff; background: var(--primary); }
.cx-kinds { grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr)); }
.cx-order-pick { display: flex; align-items: center; gap: .4rem; margin: 1rem 0 0; padding: .6rem .8rem; border-radius: 12px; background: var(--tint); font-size: .9rem; }
.cx-order-pick a { margin-inline-start: auto; font-weight: 700; }
.cx-editor .wz-nav { margin-top: 1.25rem; }
@media (min-width: 768px) { .cx-pills { flex-wrap: wrap; overflow: visible; } }

/* Comments: name, @handle, badges and date on one spaced line. */
.cm-comment { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .5rem; padding: .7rem .85rem; background: var(--bg); border-radius: 14px; }
.cm-comment > a[dir="ltr"] { color: var(--muted); font-size: .8rem; }
.cm-comment > small { margin-inline-start: auto !important; }
.cm-comment > p { flex-basis: 100%; }
.cm-comments > li { margin-bottom: .6rem; }
.cm-reply, .cm-report { margin-top: .25rem; }
