/* Scoped to Community so checkout and existing Shop styles are preserved. */
#communityRoot { max-width: 880px; margin: 0 auto; padding: 22px 4px 40px; color: #17263d; }
#communityRoot * { box-sizing: border-box; }
#communityRoot button, #communityRoot input, #communityRoot select, #communityRoot textarea { font: inherit; }
#communityRoot button { cursor: pointer; }
#communityRoot button:disabled { opacity: .5; cursor: default; }
#communityRoot button:focus-visible, #communityRoot a:focus-visible, #communityRoot summary:focus-visible { outline: 3px solid #8dc8ff; outline-offset: 3px; }
.cm-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.cm-eyebrow { font-size: 10px; font-weight: 700; letter-spacing: .12em; color: #64758c; }
.cm-heading h2 { margin: 7px 0; font-size: clamp(23px, 4vw, 30px); letter-spacing: -.04em; }
.cm-heading p, .cm-handoff p { color: #64758c; font-size: 13px; line-height: 1.65; margin: 0; }
.cm-primary { border: 0; border-radius: 12px; background: #087fd0; color: white; padding: 12px 17px; font-weight: 650 !important; white-space: nowrap; }
.cm-text, .cm-title { border: 0; background: transparent; color: #176ba5; padding: 5px 0; text-align: left; }
.cm-title { color: inherit; font-weight: 650 !important; font-size: inherit !important; }
.cm-tools { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.cm-tools input { flex: 1; min-width: 0; }
.cm-tools input, .cm-tools select, .cm-compose input, .cm-compose select, .cm-compose textarea { background: #fff; border: 1px solid #dce5ee; border-radius: 10px; padding: 12px; color: #24364f; }
.cm-tools input:focus, .cm-compose input:focus, .cm-compose textarea:focus, .cm-compose select:focus { outline: 2px solid #a9d8fa; }
.cm-card { background: white; border: 1px solid #e4ebf2; border-radius: 16px; padding: 21px; margin-bottom: 14px; }
.cm-meta { display: flex; align-items: center; gap: 12px; font-size: 11px; color: #728094; flex-wrap: wrap; }
.cm-meta time { margin-left: auto; }
.cm-label { display: inline-block; margin-top: 16px; font-size: 10px; font-weight: 650; color: #176ba5; background: #edf6fc; padding: 5px 8px; border-radius: 6px; }
.cm-card h3 { font-size: 18px; line-height: 1.4; margin: 10px 0; letter-spacing: -.02em; }
.cm-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.7; margin: 10px 0; color: #43516a; }
.cm-actions { display: flex; gap: 24px; align-items: center; border-top: 1px solid #edf1f5; margin-top: 16px; padding-top: 10px; font-size: 12px; }
.cm-selected { font-weight: 700 !important; }
.cm-recognised { font-size: 10px; color: #31765d; margin-left: auto; }
.cm-images { display: flex; gap: 8px; margin: 14px 0; overflow-x: auto; }
.cm-images img { width: min(180px, 30%); aspect-ratio: 1; object-fit: cover; border-radius: 12px; background: #edf2f7; cursor: default; }
.cm-more { position: relative; }
.cm-more summary { cursor: pointer; font-weight: 700; padding: 0 5px; font-size: 17px; list-style: none; }
.cm-more > div { position: absolute; right: 0; z-index: 3; display: grid; min-width: 125px; background: #fff; box-shadow: 0 8px 30px #17345022; border: 1px solid #e4ebf2; border-radius: 10px; padding: 6px; }
.cm-more button { text-align: left; border: 0; padding: 10px; background: #fff; color: #43516a; }
.cm-handoff { display: flex; align-items: center; gap: 20px; background: #edf6fc; border-radius: 14px; padding: 18px; margin: 18px 0 25px; }
.cm-compose { background: white; padding: 22px; border: 1px solid #e4ebf2; border-radius: 16px; }
.cm-compose fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.cm-compose label { display: grid; gap: 8px; font-size: 12px; font-weight: 600; margin-bottom: 17px; }
.cm-compose input, .cm-compose select, .cm-compose textarea { width: 100%; font-weight: 400; }
.cm-fields { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 12px; }
.cm-note { font-size: 12px; line-height: 1.7; color: #728094; }
.cm-error { color: #ac3434; font-size: 13px; }
.cm-error:empty { display: none; }
.cm-empty { padding: 35px 15px; color: #728094; text-align: center; font-size: 13px; }
.cm-section { font-size: 16px; margin: 28px 0 16px; }
.cm-reward-total { padding: 25px; background: #edf6fc; border-radius: 16px; }
.cm-reward-total span { font-size: 12px; }
.cm-reward-total strong { display: block; font-size: 36px; margin-top: 8px; }
.cm-reward-total p { font-size: 12px; color: #64758c; }
.cm-link { display: inline-block; font-size: 12px; color: #176ba5; margin: 8px 0; }
#communityRoot code { overflow-wrap: anywhere; }
@media (max-width: 600px) {
    #communityRoot { padding: 16px 0 30px; }
    .cm-heading { align-items: flex-start; gap: 10px; }
    .cm-heading p { max-width: 240px; font-size: 12px; }
    .cm-primary { font-size: 12px !important; padding: 11px 13px; }
    .cm-tools { flex-wrap: wrap; }
    .cm-tools input { flex-basis: 100%; }
    .cm-tools select { flex: 1; }
    .cm-card, .cm-compose { padding: 16px; }
    .cm-fields { grid-template-columns: 1fr; gap: 0; }
    .cm-handoff { flex-direction: column; align-items: flex-start; gap: 12px; }
    .cm-actions { gap: 15px; }
}

/* One search field at a time; product search belongs to Explore. */
body.ff-community-open #page-shop > .container > .search-row { display: none; }
body.ff-parent-dark #communityRoot { color: var(--ink, #e5edf8); }
body.ff-parent-dark #communityRoot :is(.cm-card, .cm-compose, .cm-more > div, .cm-more button, input, select, textarea) { background: var(--surface, #172133); color: var(--ink, #e5edf8); border-color: var(--line, #344054); }
body.ff-parent-dark #communityRoot :is(.cm-body, .cm-heading p, .cm-note, .cm-meta) { color: var(--muted, #a1adc0); }
body.ff-parent-dark #communityRoot :is(.cm-handoff, .cm-reward-total, .cm-label) { background: #142f47; }

/* Feed media opens its discussion, with keyboard access. */
.cm-images .cm-media-open { width: min(180px, 30%); flex-shrink: 0; padding: 0; border: 0; border-radius: 12px; background: transparent; overflow: hidden; }
.cm-images .cm-media-open img { width: 100%; display: block; cursor: pointer; }

.cm-author { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.cm-author-name { font-size: 12px; font-weight: 650; overflow-wrap: anywhere; }
.cm-author-name small { display: block; font-size: 11px; font-weight: 500; }
.cm-avatar {
    position: relative;
    display: inline-grid;
    place-items: center;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #152b42;
    background: var(--cm-avatar-color);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}
.cm-avatar-color-0 { --cm-avatar-color: #c9e7fc; }
.cm-avatar-color-1 { --cm-avatar-color: #d7e9cb; }
.cm-avatar-color-2 { --cm-avatar-color: #f5d7e2; }
.cm-avatar-color-3 { --cm-avatar-color: #f5dfbf; }
.cm-avatar-color-4 { --cm-avatar-color: #ded7fa; }
.cm-avatar-color-5 { --cm-avatar-color: #c3ebe4; }
.cm-avatar-color-6 { --cm-avatar-color: #f3d1c8; }
.cm-avatar-color-7 { --cm-avatar-color: #d6e2f4; }
.cm-avatar-mark {
    width: 14px;
    height: 14px;
    border-radius: 70% 18% 70% 18%;
    background: linear-gradient(135deg, #204b6f 0 55%, #527da0 55% 100%);
    transform: rotate(var(--cm-avatar-angle));
}
.cm-avatar-badge {
    position: absolute;
    bottom: -3px;
    right: -5px;
    display: grid;
    place-items: center;
    max-width: 23px;
    min-width: 16px;
    min-height: 16px;
    overflow: hidden;
    border: 1px solid #dce7ef;
    border-radius: 10px;
    background: #fff;
    font-size: 10px;
    white-space: nowrap;
}
.cm-reward-profile { margin-bottom: 12px; }

.cm-rewards-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 14px; }
.cm-rewards-panel, .cm-rewards-balance {
    min-width: 0;
    padding: clamp(16px, 3vw, 22px);
    border: 1px solid #dde6ee;
    border-radius: 16px;
    background: #fff;
}
.cm-rewards-balance { display: grid; align-content: start; gap: 8px; background: #eaf4ff; color: #162b43; }
.cm-rewards-balance > strong { font-size: clamp(30px, 6vw, 46px); line-height: 1.1; }
.cm-rewards-balance > span { font-size: 13px; font-weight: 650; }
.cm-rewards-balance .cm-author { margin-bottom: 6px; }
.cm-rewards-panel h3, .cm-rewards-layout p { margin: 0; }
.cm-rewards-layout p { font-size: 13px; line-height: 1.55; }
.cm-rewards-panel h3 + p { margin-top: 5px; }
.cm-rewards-wide { grid-column: 1 / -1; }
.cm-referral-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.cm-referral-stats > div { padding: 8px; border: 1px solid #dde6ee; border-radius: 10px; }
.cm-referral-stats dt { font-size: 11px; overflow-wrap: anywhere; }
.cm-referral-stats dd { margin: 4px 0 0; font-size: 18px; font-weight: 700; }
.cm-referral-copy { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.cm-referral-copy input { min-width: 0; width: 100%; box-sizing: border-box; padding: 9px; border: 1px solid #b9cadb; border-radius: 8px; color: inherit; background: transparent; }
.cm-referral-copy button { min-height: 40px; }
.cm-rewards-section-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.cm-rewards-history { list-style: none; padding: 0; margin: 10px 0 0; }
.cm-rewards-history li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid #dde6ee; font-size: 13px; }
.cm-rewards-history li > strong { white-space: nowrap; }
.cm-rewards-history small { display: block; margin-top: 3px; overflow-wrap: anywhere; }
.cm-rewards-campaign { padding: 10px 0; border-top: 1px solid #dde6ee; margin-top: 8px; }
body.ff-parent-dark #communityRoot :is(.cm-rewards-panel, .cm-rewards-balance) { color: #e3edf9; background: #142338; border-color: #32465e; }
body.ff-parent-dark #communityRoot :is(.cm-referral-stats > div, .cm-rewards-history li, .cm-rewards-campaign, .cm-referral-copy input) { border-color: #32465e; }
@media (max-width: 650px) { .cm-rewards-layout { grid-template-columns: minmax(0, 1fr); } }
