/* SABR Community — loaded only on /community/ pages (includes/community.php → cm_head).
   Uses the shop's own colours and fonts from style.css: ink #141413, gold fill with black text, deep gold #7F650F for gold
   text on white, light gold #E2C46A on black, green only for "Solved" / success. All classes start with "cm-". */

/* ---------- Community bar (under the shop header) ---------- */
.cm-bar { background: #fff; border-bottom: 1px solid var(--line); }
.cm-bar-inner { display: flex; align-items: center; gap: 12px; min-height: 58px; }
.cm-bar-home { display: inline-flex; align-items: center; gap: 8px; color: var(--head); text-decoration: none; font: 700 19px/1 var(--f-head); letter-spacing: .04em; text-transform: uppercase; flex: none; }
.cm-bar-home .ti { color: var(--accent); font-size: 22px; }
.cm-bar-home:hover { color: var(--accent); text-decoration: none; }
.cm-bar-search { position: relative; flex: 1; max-width: 440px; margin-left: auto; }
.cm-bar-search .ti { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--grey); font-size: 18px; pointer-events: none; }
.cm-bar-search input { width: 100%; min-height: 40px; padding: 0 14px 0 40px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); font-size: 15px; }
.cm-bar-search input:focus { background: #fff; }
.cm-bar-icon { position: relative; display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: var(--head); flex: none; }
.cm-bar-icon .ti { font-size: 22px; }
.cm-bar-icon:hover { background: var(--bg); color: var(--accent); }
.cm-bar-search-link { display: none; }
.cm-dot { position: absolute; top: 3px; right: 1px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: var(--primary); color: var(--on-primary); font: 700 11px/18px var(--f-body); font-style: normal; text-align: center; box-shadow: 0 0 0 2px #fff; }
.cm-bar-post { flex: none; border-radius: 999px; }

/* ---------- Shared bits ---------- */
.cm-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 14px; font-size: 13px; color: #CFCAC0; }
.cm-crumbs a { color: var(--gold-light); text-decoration: none; }
.cm-crumbs a:hover { text-decoration: underline; }
.cm-crumbs .ti { font-size: 13px; opacity: .7; }
.cm-crumbs-light { color: var(--grey); margin-top: 4px; }
.cm-crumbs-light a { color: var(--accent); }
.cm-eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 12px; color: var(--gold-light); font: 700 13px/1 var(--f-body); letter-spacing: .12em; text-transform: uppercase; }
.cm-dim { color: var(--grey); }
.cm-small { font-size: 13px; }
.cm-inline-form { display: inline-flex; margin: 0; }
.cm-h1 { font-size: clamp(28px, 3.4vw, 36px); margin: 6px 0 18px; }
.cm-h2 { font-size: 24px; margin: 30px 0 12px; }
.cm-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin-bottom: 20px; }
.cm-section-head h2 { font-size: clamp(28px, 3.2vw, 38px); margin: 0; }
.cm-section-head .eyebrow { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.cm-section-head .eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--primary); flex: none; }
.cm-section-head > p { margin: 0; max-width: 46ch; }
.cm-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Avatars: initials on brand tones (no outside pictures) */
.cm-avatar { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; flex: none; font: 700 15px/1 var(--f-head); letter-spacing: .02em; overflow: hidden; }
.cm-avatar .ti { font-size: 20px; }
.cm-tone-0 { background: var(--ink); color: var(--gold-light); }
.cm-tone-1 { background: var(--primary-tint); color: var(--accent); }
.cm-tone-2 { background: #EFEDE8; color: var(--ink-3); }
.cm-tone-3 { background: var(--ink-3); color: #fff; }
.cm-avatar-sm { width: 24px; height: 24px; font-size: 11px; }
.cm-avatar-lg { width: 76px; height: 76px; font-size: 30px; }
.cm-avatar-expert { background: #fff; box-shadow: inset 0 0 0 2px var(--primary); }
.cm-avatar-expert img { width: 72%; height: 72%; object-fit: contain; }

/* Chips and badges */
.cm-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cm-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px 3px 3px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--head); font: 600 13px/1.2 var(--f-body); text-decoration: none; }
.cm-chip img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.cm-chip:hover { border-color: var(--primary); color: var(--head); text-decoration: none; }
.cm-tag { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; background: #EFEDE8; color: var(--grey-2); font: 600 12px/1.3 var(--f-body); text-decoration: none; }
a.cm-tag:hover { background: var(--primary-tint); color: var(--accent); text-decoration: none; }
.cm-kind { display: inline-flex; align-items: center; gap: 4px; color: var(--grey-2); font: 600 12px/1.3 var(--f-body); }
.cm-kind .ti { font-size: 15px; }
.cm-kind-question .ti { color: var(--accent); }
.cm-pin { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font: 700 12px/1 var(--f-body); }
.cm-solved { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; background: var(--ok-tint); color: var(--ok); font: 700 12px/1.2 var(--f-body); }
.cm-expert-tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; background: var(--primary-tint); color: var(--accent); font: 700 12px/1.2 var(--f-body); }
.cm-op { padding: 2px 8px; border-radius: 999px; background: #EFEDE8; color: var(--grey-2); font: 700 11px/1.3 var(--f-body); text-transform: uppercase; letter-spacing: .06em; }
.cm-solved .ti, .cm-expert-tag .ti, .cm-pin .ti { font-size: 14px; }

/* ---------- Mother community hero ---------- */
.cm-hero { position: relative; background: var(--ink); color: #fff; overflow: hidden; isolation: isolate; }
.cm-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse at 85% 10%, rgba(201, 162, 38, .18), transparent 55%), linear-gradient(180deg, var(--ink) 0%, var(--ink-2) 100%); }
.cm-hero-inner { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 48px; align-items: center; padding-top: 44px; padding-bottom: 56px; }
.cm-hero h1 { color: #fff; font-size: clamp(38px, 5vw, 62px); line-height: .98; margin: 0 0 14px; }
.cm-hero-sub { color: #D4CEC2; font-size: 18px; max-width: 52ch; margin: 0; }
.cm-hero .btn-row { margin-top: 24px; }
.cm-stats { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin: 30px 0 0; padding: 0; max-width: 520px; background: rgba(255, 255, 255, .08); border-radius: 14px; overflow: hidden; }
.cm-stats li { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--ink-2); }
.cm-stats strong { font: 700 30px/1 var(--f-head); color: var(--gold-light); }
.cm-stats span { font-size: 13px; color: #A39E92; }
.cm-mosaic { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cm-mosaic a { position: relative; display: block; border-radius: 14px; overflow: hidden; box-shadow: 0 16px 36px rgba(0, 0, 0, .35); transition: transform .2s var(--ease); }
.cm-mosaic a:nth-child(3n+2) { transform: translateY(22px); }
.cm-mosaic a:hover { transform: translateY(-3px); }
.cm-mosaic a:nth-child(3n+2):hover { transform: translateY(19px); }
.cm-mosaic img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.cm-mosaic span { position: absolute; left: 8px; bottom: 8px; padding: 5px 10px; border-radius: 999px; background: rgba(20, 20, 19, .86); color: #fff; font: 600 13px/1 var(--f-head); letter-spacing: .04em; }

/* ---------- Car community cards ---------- */
.cm-groups-section { padding-top: 52px; padding-bottom: 52px; }
.cm-group-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.cm-group-card { position: relative; display: block; border-radius: 16px; overflow: hidden; background: var(--ink); color: #fff; text-decoration: none; isolation: isolate;
  box-shadow: 0 1px 2px rgba(20, 20, 19, .08); transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.cm-group-img { display: block; }
.cm-group-img img { display: block; width: 100%; aspect-ratio: 16 / 11; object-fit: cover; transition: transform .4s var(--ease); }
.cm-group-card::after { content: ""; position: absolute; inset: 0; z-index: 0; background: linear-gradient(180deg, rgba(20, 20, 19, 0) 38%, rgba(20, 20, 19, .55) 62%, rgba(20, 20, 19, .95) 100%); }
.cm-group-body { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; display: flex; flex-direction: column; gap: 3px; padding: 14px 16px 15px; }
.cm-group-body small { color: var(--gold-light); font: 700 11px/1 var(--f-body); letter-spacing: .14em; text-transform: uppercase; }
.cm-group-body strong { font: 700 25px/1.02 var(--f-head); letter-spacing: .01em; color: #fff; }
.cm-group-nums { font-size: 13px; color: #D4CEC2; }
.cm-joined { position: absolute; top: 10px; right: 10px; z-index: 1; display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; background: var(--primary); color: var(--on-primary); font: 700 12px/1.2 var(--f-body); font-style: normal; }
.cm-group-card:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(20, 20, 19, .18); color: #fff; text-decoration: none; }
.cm-group-card:hover img { transform: scale(1.05); }
.cm-group-card:focus-visible { outline-offset: 3px; }

/* ---------- Car community cover ---------- */
.cm-cover { position: relative; min-height: 380px; display: flex; align-items: flex-end; background: var(--ink); color: #fff; overflow: hidden; isolation: isolate; }
.cm-cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.cm-cover::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(20, 20, 19, .92) 0%, rgba(20, 20, 19, .72) 45%, rgba(20, 20, 19, .2) 100%), linear-gradient(0deg, rgba(20, 20, 19, .7) 0%, rgba(20, 20, 19, 0) 50%); }
.cm-cover-inner { padding-top: 40px; padding-bottom: 40px; }
.cm-cover h1 { color: #fff; font-size: clamp(36px, 5vw, 60px); line-height: 1; margin: 0 0 10px; }
.cm-cover-sub { color: #D4CEC2; font-size: 17px; margin: 0; }
.cm-cover .btn-row { margin-top: 20px; }
.cm-joined-btn { background: rgba(201, 162, 38, .16); border-color: rgba(201, 162, 38, .6); color: var(--gold-light); }
.cm-cover-credit { position: absolute; right: 12px; bottom: 8px; margin: 0; font-size: 11px; color: rgba(255, 255, 255, .55); max-width: 60%; text-align: right; }
.cm-cover-credit a { color: inherit; }

/* Model chips (BMW 3 Series, BYD Seal …) */
.cm-models { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 0 14px; padding: 2px; }
.cm-models::-webkit-scrollbar { display: none; }
.cm-models a { display: inline-flex; align-items: center; gap: 8px; flex: none; padding: 4px 14px 4px 4px; border-radius: 12px; background: #fff; border: 1px solid var(--line); color: var(--head); font: 600 14px/1 var(--f-body); text-decoration: none; }
.cm-models img { width: 54px; height: 36px; border-radius: 8px; object-fit: cover; }
.cm-model-all { display: inline-grid; place-items: center; width: 54px; height: 36px; border-radius: 8px; background: var(--bg); color: var(--accent); }
.cm-models a:hover { border-color: var(--primary); text-decoration: none; color: var(--head); }
.cm-models a.is-active { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: #FAF8F3; }

/* ---------- Feed layout ---------- */
.cm-feed-section { padding-top: 40px; }
.cm-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; }
.cm-main { min-width: 0; }
.cm-side { display: flex; flex-direction: column; gap: 16px; }
.cm-composer { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 14px; background: #fff; border: 1px solid var(--line); border-radius: 16px; color: var(--grey); text-decoration: none; box-shadow: 0 1px 2px rgba(20, 20, 19, .04); }
.cm-composer > span:nth-child(2) { flex: 1; min-width: 0; padding: 10px 16px; border-radius: 999px; background: var(--bg); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-composer .btn { border-radius: 999px; flex: none; }
.cm-composer:hover { border-color: var(--primary); color: var(--grey-2); text-decoration: none; }
.cm-tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.cm-tabs::-webkit-scrollbar { display: none; }
.cm-tabs a { flex: none; padding: 11px 14px; color: var(--grey-2); font: 600 15px/1 var(--f-body); text-decoration: none; }
.cm-tabs a:hover { color: var(--head); text-decoration: none; }
.cm-tabs a.is-active { color: var(--head); box-shadow: inset 0 -3px 0 var(--primary); }
.cm-feed { display: flex; flex-direction: column; gap: 12px; }

.cm-card { display: flex; gap: 16px; padding: 16px 18px; background: #fff; border: 1px solid var(--line); border-radius: 16px; transition: border-color .15s, box-shadow .15s; }
.cm-card:hover { border-color: var(--line-strong); box-shadow: 0 10px 26px rgba(20, 20, 19, .07); }
.cm-card.is-pinned { box-shadow: inset 3px 0 0 var(--primary); }
.cm-card-main { flex: 1; min-width: 0; }
.cm-card-title { font: 700 22px/1.15 var(--f-head); letter-spacing: .005em; margin: 9px 0 4px; }
.cm-card-title a { color: var(--head); text-decoration: none; }
.cm-card-title a:hover { color: var(--accent); }
.cm-card-title a::after { content: ""; }
.cm-card-text { margin: 0; color: var(--grey-2); font-size: 15px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.cm-card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 10px; font-size: 13px; color: var(--grey); }
.cm-by { display: inline-flex; align-items: center; gap: 6px; color: var(--head); font-weight: 600; }
.cm-count { display: inline-flex; align-items: center; gap: 4px; }
.cm-count .ti { font-size: 16px; }
.cm-card-img { position: relative; flex: none; width: 112px; height: 112px; border-radius: 12px; overflow: hidden; background: var(--bg); align-self: center; }
.cm-card-img img { width: 100%; height: 100%; object-fit: cover; }
.cm-card-img em { position: absolute; right: 6px; bottom: 6px; padding: 2px 7px; border-radius: 999px; background: rgba(20, 20, 19, .82); color: #fff; font: 700 12px/1.3 var(--f-body); font-style: normal; }
.cm-empty { padding: 36px 20px; text-align: center; background: #fff; border: 1px dashed var(--line-strong); border-radius: 16px; }
.cm-empty > .ti { font-size: 40px; color: var(--accent); }
.cm-empty h3 { margin: 10px 0 4px; font-size: 24px; }
.cm-empty p { color: var(--grey-2); margin: 0 0 16px; }
.cm-pages { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 22px; }

/* Side boxes */
.cm-side-box { padding: 18px 20px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.cm-side-box h2 { display: flex; align-items: center; gap: 8px; font-size: 21px; margin: 0 0 10px; }
.cm-side-box h2 .ti { color: var(--accent); font-size: 20px; }
.cm-side-box h2 a { color: var(--head); text-decoration: none; }
.cm-side-box p { margin: 0 0 10px; color: var(--grey-2); font-size: 15px; }
.cm-side-box p:last-child { margin-bottom: 0; }
.cm-steps { margin: 0; padding: 0; list-style: none; counter-reset: cm; display: grid; gap: 12px; }
.cm-steps li { position: relative; padding-left: 40px; font-size: 15px; color: var(--grey-2); counter-increment: cm; }
.cm-steps li::before { content: counter(cm); position: absolute; left: 0; top: -2px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: var(--on-primary); font: 700 14px/1 var(--f-body); }
.cm-steps strong { color: var(--head); }
.cm-rules { margin: 0; padding-left: 18px; color: var(--grey-2); font-size: 15px; display: grid; gap: 6px; }
.cm-parts { border-top: 3px solid var(--primary); }
.cm-parts ul { list-style: none; margin: 0; padding: 0; }
.cm-parts li a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); color: var(--head); font-weight: 600; text-decoration: none; }
.cm-parts li a:hover { color: var(--accent); }
.cm-other { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.cm-other a { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 10px; color: var(--head); font-weight: 600; font-size: 15px; text-decoration: none; }
.cm-other a span { flex: 1; }
.cm-other a .ti { color: var(--grey); }
.cm-other img { width: 48px; height: 30px; border-radius: 6px; object-fit: cover; }
.cm-other a:hover { background: var(--bg); }
.cm-group-mini > a img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; margin-bottom: 12px; }
.cm-credits { padding-top: 18px; padding-bottom: 30px; font-size: 12px; color: var(--grey); }
.cm-credits summary { cursor: pointer; font-weight: 600; }
.cm-credits ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 3px; }
.cm-credits a { color: var(--grey-2); }

/* ---------- Post page ---------- */
.cm-post-page { padding-top: 22px; padding-bottom: 60px; }
.cm-notice { display: flex; align-items: center; gap: 8px; }
.cm-admin-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 12px; border-radius: 12px; background: #EFEDE8; font-weight: 600; color: var(--ink-3); }
.cm-admin-bar > span { display: inline-flex; align-items: center; gap: 6px; margin-right: 4px; }
.cm-post { padding: 24px 28px 14px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 1px 2px rgba(20, 20, 19, .04); }
.cm-post h1 { font-size: clamp(28px, 3.3vw, 40px); line-height: 1.08; margin: 12px 0 14px; overflow-wrap: anywhere; }
.cm-author { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.cm-author > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cm-author a { color: var(--head); text-decoration: none; }
.cm-author a:hover { color: var(--accent); }
.cm-author small { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--grey-2); }
.cm-text { font-size: 16.5px; line-height: 1.65; color: var(--charcoal); overflow-wrap: anywhere; }
.cm-text p { margin: 0 0 12px; }
.cm-text p:last-child { margin-bottom: 0; }
.cm-text a { color: var(--accent); }
.cm-text[lang="bn"], [lang="bn"] .cm-text { line-height: 1.8; }
.cm-mention { color: var(--accent); font-weight: 600; }
.cm-photos { display: grid; gap: 6px; margin-top: 16px; border-radius: 14px; overflow: hidden; }
.cm-photos a { display: block; background: var(--bg); }
.cm-photos img { display: block; width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; }
.cm-photos-1 img { aspect-ratio: auto; max-height: 620px; object-fit: contain; background: var(--ink); }
.cm-photos-2 { grid-template-columns: 1fr 1fr; }
.cm-photos-3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.cm-photos-3 a:first-child { grid-row: span 2; }
.cm-photos-3 a:first-child img { aspect-ratio: auto; height: 100%; }
.cm-photos-4 { grid-template-columns: 1fr 1fr; }
.cm-post-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 16px; padding-top: 10px; border-top: 1px solid var(--line); }
.cm-act { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 12px; border: 0; border-radius: 999px; background: none; color: var(--grey-2); font: 600 14px/1 var(--f-body); text-decoration: none; cursor: pointer; list-style: none; }
.cm-act::-webkit-details-marker { display: none; }
.cm-act .ti { font-size: 18px; }
.cm-act:hover { background: var(--bg); color: var(--head); text-decoration: none; }
.cm-act.is-on { background: var(--primary-tint); color: var(--accent); }
.cm-act.is-static { cursor: default; }
.cm-act.is-static:hover { background: none; color: var(--grey-2); }
.cm-act b { font-weight: 700; }
.cm-act b:empty { display: none; }
.cm-more { position: relative; display: inline-block; }
.cm-more[open] > .cm-act { background: var(--bg); color: var(--head); }
.cm-share-menu, .cm-report-form { position: absolute; left: 0; top: calc(100% + 6px); z-index: 30; display: flex; flex-direction: column; gap: 2px; min-width: 220px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); }
.cm-share-menu a, .cm-share-menu button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 0; border-radius: 10px; background: none; color: var(--head); font: 600 15px/1 var(--f-body); text-decoration: none; cursor: pointer; text-align: left; }
.cm-share-menu a:hover, .cm-share-menu button:hover { background: var(--bg); color: var(--head); }
.cm-share-menu .ti { font-size: 20px; color: var(--accent); }
.cm-report-form { gap: 8px; padding: 12px; min-width: 250px; }
.cm-report-form select, .cm-report-form input { width: 100%; }

/* Answers */
.cm-answers h2, .cm-answer-box h2, .cm-related h2 { font-size: 25px; margin: 30px 0 12px; }
.cm-answer { padding: 16px 18px; margin-bottom: 12px; background: #fff; border: 1px solid var(--line); border-radius: 16px; scroll-margin-top: 90px; }
.cm-answer:target { box-shadow: 0 0 0 3px rgba(201, 162, 38, .35); }
.cm-answer.is-best { border-color: var(--ok); box-shadow: inset 4px 0 0 var(--ok); }
.cm-answer.is-expert { background: #FFFDF6; border-color: #E8DDB8; box-shadow: inset 4px 0 0 var(--primary); }
.cm-answer.is-best.is-expert { box-shadow: inset 4px 0 0 var(--ok); }
.cm-answer.is-removed { background: #FAF9F6; }
.cm-best-label { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; color: var(--ok); font: 700 13px/1.2 var(--f-body); letter-spacing: .04em; text-transform: uppercase; }
.cm-answer-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.cm-answer-who { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; font-size: 14px; }
.cm-answer-who a, .cm-answer-who strong { color: var(--head); font-weight: 700; text-decoration: none; }
.cm-answer-who a:hover { color: var(--accent); }
.cm-answer .cm-text { font-size: 16px; }
.cm-answer-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin: 8px 0 0 -8px; }
.cm-answer-actions .cm-act { min-height: 34px; padding: 0 10px; font-size: 13px; }
.cm-answer-actions .cm-act .ti { font-size: 16px; }
.cm-removed { margin: 0; color: var(--grey); font-style: italic; display: flex; align-items: center; gap: 6px; }
.cm-admin-note { margin: 0 0 8px; padding: 4px 10px; border-radius: 8px; background: var(--yellow-tint); color: var(--yellow-text); font-size: 13px; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
.cm-replies { margin-top: 12px; padding-left: 16px; border-left: 2px solid var(--line); display: grid; gap: 8px; }
.cm-answer.is-reply { margin: 0; padding: 12px 14px; background: #FAF9F6; border: 0; border-radius: 12px; }
.cm-answer.is-reply.is-expert { background: #FFFBEF; }
.cm-reply-box { margin-top: 10px; }
.cm-reply-form textarea, .cm-answer-box textarea { width: 100%; resize: vertical; min-height: 64px; border-radius: 12px; font-size: 16px; }
.cm-reply-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px 14px; margin-top: 8px; }
.cm-answer-box { padding: 4px 22px 20px; margin-top: 18px; background: #fff; border: 1px solid var(--line); border-radius: 18px; }
.cm-answer-box h2 { margin-top: 16px; }
.cm-signin { padding: 6px 0 2px; }
.cm-signin > p { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-weight: 600; color: var(--head); }
.cm-signin > p .ti { color: var(--accent); }
.cm-signin [data-google-signin] { margin-bottom: 4px; }
.cm-related ul { list-style: none; margin: 0; padding: 0; background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.cm-related li { display: flex; flex-direction: column; gap: 2px; padding: 12px 18px; border-top: 1px solid var(--line); }
.cm-related li:first-child { border-top: 0; }
.cm-related a { color: var(--head); font-weight: 700; text-decoration: none; }
.cm-related a:hover { color: var(--accent); }
.cm-related span { font-size: 13px; }

/* Photo viewer (opens only when a photo is tapped) */
.cm-viewer { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: 16px; background: rgba(20, 20, 19, .94); }
.cm-viewer img { max-width: 100%; max-height: 88vh; border-radius: 8px; }
.cm-viewer button { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; font-size: 24px; cursor: pointer; }
.cm-viewer .cm-viewer-prev, .cm-viewer .cm-viewer-next { top: 50%; transform: translateY(-50%); }
.cm-viewer .cm-viewer-prev { left: 12px; right: auto; }
.cm-viewer .cm-viewer-next { right: 12px; }

/* ---------- Write a post ---------- */
.cm-write { max-width: 880px; padding-top: 22px; padding-bottom: 60px; }
.cm-write h1 { font-size: clamp(30px, 3.6vw, 40px); margin: 6px 0 4px; }
.cm-write > .muted { margin: 0 0 20px; }
.cm-fieldset { margin: 0 0 16px; padding: 16px 20px 6px; background: #fff; border: 1px solid var(--line); border-radius: 18px; min-width: 0; }
.cm-fieldset legend { padding: 0 6px; font: 700 20px/1 var(--f-head); color: var(--head); letter-spacing: .01em; }
.cm-pick-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 10px; margin: 6px 0 14px; }
.cm-pick { position: relative; cursor: pointer; }
.cm-pick input, .cm-kind-pick input { position: absolute; opacity: 0; pointer-events: none; }
.cm-pick span { display: flex; flex-direction: column; gap: 6px; padding: 6px 6px 9px; border: 1px solid var(--line); border-radius: 12px; text-align: center; background: #fff; transition: border-color .15s; }
.cm-pick img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 8px; }
.cm-pick b { font: 700 15px/1.1 var(--f-head); color: var(--head); letter-spacing: .01em; }
.cm-pick:hover span { border-color: var(--primary); }
.cm-pick input:checked + span, .cm-kind-pick input:checked + span { border-color: var(--ink); background: #FAF8F3; box-shadow: inset 0 0 0 1px var(--ink); }
.cm-pick input:focus-visible + span, .cm-kind-pick input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.cm-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.cm-row .field[hidden] { display: none; }
.cm-kinds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 6px 0 14px; }
.cm-kind-pick { position: relative; cursor: pointer; }
.cm-kind-pick span { display: flex; flex-direction: column; gap: 3px; height: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.cm-kind-pick .ti { font-size: 22px; color: var(--accent); }
.cm-kind-pick b { font-size: 15px; color: var(--head); }
.cm-kind-pick small { font-size: 13px; color: var(--grey); line-height: 1.35; }
.cm-kind-pick:hover span { border-color: var(--primary); }
.cm-write-form input[type=text], .cm-write-form textarea, .cm-write-form select { width: 100%; font-size: 16px; }
.cm-write-form textarea { resize: vertical; border-radius: 12px; }
.cm-count-note { font-size: 12px; color: var(--grey); text-align: right; }
.cm-photo-drop { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border: 1.5px dashed var(--line-strong); border-radius: 14px; background: #FAF9F6; cursor: pointer; color: var(--head); }
.cm-photo-drop .ti { font-size: 32px; color: var(--accent); }
.cm-photo-drop span { display: flex; flex-direction: column; gap: 2px; }
.cm-photo-drop small { color: var(--grey); font-size: 13px; }
.cm-photo-drop:hover, input:focus-visible + .cm-photo-drop { border-color: var(--primary); background: var(--primary-tint); }
.cm-photo-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.cm-photo-list:empty { display: none; }
.cm-photo-item { position: relative; border-radius: 12px; overflow: hidden; background: var(--bg); aspect-ratio: 1; }
.cm-photo-item img { width: 100%; height: 100%; object-fit: cover; }
.cm-photo-item button { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border: 0; border-radius: 50%; background: rgba(20, 20, 19, .8); color: #fff; font-size: 18px; line-height: 1; cursor: pointer; }
.cm-photo-item small { position: absolute; left: 6px; bottom: 6px; padding: 2px 6px; border-radius: 6px; background: rgba(20, 20, 19, .78); color: #fff; font-size: 11px; }
.cm-privacy { display: flex; gap: 6px; align-items: flex-start; margin: 10px 0 0; }
.cm-privacy .ti { color: var(--accent); margin-top: 2px; }
.cm-write-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }

/* ---------- Member, notifications, search ---------- */
.cm-member-page { padding-top: 22px; padding-bottom: 60px; }
.cm-member-head { display: flex; align-items: center; gap: 18px; padding: 20px 22px; background: #fff; border: 1px solid var(--line); border-radius: 18px; }
.cm-member-head h1 { font-size: clamp(28px, 3.4vw, 38px); margin: 0 0 4px; }
.cm-member-head p { margin: 0 0 2px; display: flex; align-items: center; gap: 6px; }
.cm-member-about { color: var(--grey-2); margin-top: 6px !important; }
.cm-member-stats { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 14px 0; padding: 0; }
.cm-member-stats li { display: flex; flex-direction: column; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.cm-member-stats strong { font: 700 28px/1 var(--f-head); color: var(--head); }
.cm-member-stats span { font-size: 13px; color: var(--grey); }
.cm-member-groups { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.cm-profile-edit { margin: 6px 0 10px; }
.cm-profile-edit summary { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 700; color: var(--head); }
.cm-profile-edit form { margin-top: 14px; }
.cm-profile-edit input, .cm-profile-edit textarea { width: 100%; }
.cm-answer-list { list-style: none; margin: 0; padding: 0; background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.cm-answer-list li { display: flex; flex-direction: column; gap: 3px; padding: 12px 18px; border-top: 1px solid var(--line); }
.cm-answer-list li:first-child { border-top: 0; }
.cm-answer-list a { color: var(--head); font-weight: 700; text-decoration: none; }
.cm-answer-list span { color: var(--grey-2); font-size: 14px; }
.cm-narrow { max-width: 860px; padding-top: 22px; padding-bottom: 60px; }
.cm-notes { list-style: none; margin: 0; padding: 0; background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.cm-notes li { border-top: 1px solid var(--line); }
.cm-notes li:first-child { border-top: 0; }
.cm-notes a { display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: var(--head); text-decoration: none; }
.cm-notes a > span:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cm-notes small { color: var(--grey); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-notes a:hover { background: #FAF9F6; }
.cm-notes li.is-new { background: var(--primary-tint); box-shadow: inset 3px 0 0 var(--primary); }
.cm-note-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--bg); color: var(--accent); flex: none; }
.cm-search-big { display: flex; gap: 8px; margin-bottom: 18px; }
.cm-search-big input { flex: 1; min-width: 0; font-size: 16px; border-radius: 999px; padding-left: 18px; }
.cm-search-big .btn { border-radius: 999px; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .cm-group-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
  .cm-layout { grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; }
  .cm-hero-inner { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-top: 34px; }
  .cm-mosaic { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .cm-mosaic a:nth-child(3n+2) { transform: none; }
  .cm-mosaic a:nth-child(3n+2):hover { transform: translateY(-3px); }
  .cm-mosaic img { aspect-ratio: 3 / 4; }
}
@media (max-width: 900px) {
  .cm-layout { grid-template-columns: minmax(0, 1fr); }
  .cm-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}
@media (max-width: 760px) {
  .cm-bar-inner { gap: 6px; min-height: 52px; }
  .cm-bar-home { font-size: 17px; }
  .cm-bar-search { display: none; }
  .cm-bar-search-link { display: inline-grid; margin-left: auto; }
  .cm-bar-icon { width: 40px; height: 40px; }
  .cm-bar-post { min-height: 36px; padding: 0 14px; }

  .cm-hero-inner { padding-top: 18px; padding-bottom: 28px; }
  .cm-hero h1 { font-size: 36px; }
  .cm-hero-sub { font-size: 16px; }
  .cm-hero .btn-row { flex-direction: column; align-items: stretch; }
  .cm-hero .btn-lg { width: 100%; justify-content: center; }
  .cm-mosaic { display: none; }
  .cm-stats { margin-top: 22px; }
  .cm-stats li { padding: 10px 10px; }
  .cm-stats strong { font-size: 24px; }
  .cm-stats span { font-size: 12px; }

  .cm-groups-section { padding-top: 28px; padding-bottom: 28px; }
  .cm-section-head { margin-bottom: 14px; }
  .cm-section-head h2 { font-size: 28px; }
  .cm-group-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .cm-group-card { border-radius: 14px; }
  .cm-group-img img { aspect-ratio: 4 / 4.2; }
  .cm-group-body { padding: 10px 11px 11px; gap: 2px; }
  .cm-group-body small { font-size: 10px; }
  .cm-group-body strong { font-size: 20px; }
  .cm-group-nums { font-size: 11.5px; }
  .cm-joined { top: 7px; right: 7px; padding: 3px 8px; font-size: 11px; }

  .cm-cover { min-height: 300px; }
  .cm-cover-inner { padding-top: 26px; padding-bottom: 34px; }
  .cm-cover h1 { font-size: 34px; }
  .cm-cover-sub { font-size: 15px; }
  .cm-cover::before { background: linear-gradient(0deg, rgba(20, 20, 19, .95) 0%, rgba(20, 20, 19, .72) 55%, rgba(20, 20, 19, .35) 100%); }
  .cm-cover-credit { max-width: 90%; font-size: 10px; bottom: 6px; }

  .cm-feed-section { padding-top: 20px; }
  .cm-composer { padding: 10px; gap: 10px; border-radius: 14px; }
  .cm-composer > span:nth-child(2) { padding: 9px 12px; font-size: 14px; }
  .cm-card { padding: 13px 14px; gap: 12px; border-radius: 14px; }
  .cm-card-title { font-size: 19px; margin-top: 7px; }
  .cm-card-text { font-size: 14px; }
  .cm-card-img { width: 84px; height: 84px; align-self: flex-start; margin-top: 30px; }
  .cm-card-foot { gap: 4px 10px; font-size: 12.5px; }
  .cm-side { grid-template-columns: minmax(0, 1fr); }

  .cm-post-page, .cm-member-page { padding-top: 10px; padding-bottom: 36px; }
  .cm-post { padding: 16px 16px 8px; border-radius: 16px; }
  .cm-post h1 { font-size: 27px; }
  .cm-text { font-size: 16px; }
  .cm-photos { margin-left: -16px; margin-right: -16px; border-radius: 0; }
  .cm-post-actions { gap: 0; }
  .cm-act { padding: 0 10px; }
  .cm-answer { padding: 14px; border-radius: 14px; }
  .cm-replies { padding-left: 8px; }
  .cm-answer.is-reply { padding: 10px 12px; }
  .cm-answer-box { padding: 2px 14px 16px; }
  .cm-share-menu, .cm-report-form { position: fixed; left: 12px; right: 12px; top: auto; bottom: calc(70px + env(safe-area-inset-bottom)); min-width: 0; }

  .cm-write { padding-top: 10px; padding-bottom: 36px; }
  .cm-fieldset { padding: 12px 12px 4px; border-radius: 16px; }
  .cm-pick-groups { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .cm-pick b { font-size: 13px; }
  .cm-kinds { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .cm-kind-pick span { display: grid; grid-template-columns: 26px minmax(0, 1fr); column-gap: 10px; }
  .cm-kind-pick .ti { grid-row: span 2; align-self: center; }
  .cm-write-actions .btn { flex: 1; justify-content: center; }

  .cm-member-head { padding: 16px; gap: 14px; }
  .cm-avatar-lg { width: 60px; height: 60px; font-size: 24px; }
  .cm-member-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .cm-group-card, .cm-group-img img, .cm-mosaic a { transition: none; }
}
