/* community.css — Chamaps Community: topbar cluster, drawer, feeds, chats, map markers.
   Reuses tokens and classes from style.css (.btn .iconbtn .panel .tab .tabs .seg .chips .empty .stat). */

:root {
  --c-freeride: #a78bfa;
  --c-other: #b7c1c8;
  --hz-low: #3ddc84; --hz-moderate: #facc15; --hz-considerable: #ff9a3d; --hz-high: #ff4747; --hz-extreme: #1c1c1c; --hz-info: #4f9cff; --hz-none: #7f8c95;
  --cmty-w: 400px;
}

/* ---------- Topbar cluster ---------- */
.cmty-bar { grid-column: 3; justify-self: end; display: flex; align-items: center; gap: 8px; pointer-events: auto; }
.cmty-bar__btn { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px 0 12px; border-radius: var(--r-md); background: rgba(11,15,18,.72); backdrop-filter: blur(10px); border: 1px solid var(--line); color: var(--text); font-weight: 600; font-size: 13px; white-space: nowrap; transition: border-color .15s var(--ease), background .15s var(--ease); }
.cmty-bar__btn:hover { border-color: var(--line-strong); background: rgba(20,26,32,.85); }
.cmty-bar__btn[aria-expanded="true"] { border-color: var(--accent); }
.cmty-bar__btn svg { width: 18px; height: 18px; color: var(--accent); flex: none; }
.cmty-bar__btn--av.is-av { padding: 0 6px; width: 42px; justify-content: center; }
.cmty-bar__btn--av:not(.is-av) svg { color: var(--text-2); }
.cmty-badge { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--bg-0); }
.cmty-badge:empty, .cmty-badge[data-n="0"] { display: none; }

.cmty-av { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--av, var(--bg-3)); color: #0b0f12; font-weight: 700; font-size: 12px; letter-spacing: .02em; flex: none; user-select: none; }
.cmty-av--sm { width: 24px; height: 24px; font-size: 10px; }
.cmty-av--lg { width: 48px; height: 48px; font-size: 17px; }

/* ---------- Drawer ---------- */
.cmty { display: flex; flex-direction: column; background: rgba(14, 19, 24, .92); backdrop-filter: blur(14px); border: 1px solid var(--line-strong); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; animation: rise .3s var(--ease); }
.cmty__handle { display: none; }
.cmty__head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 10px 16px; border-bottom: 1px solid var(--line); flex: none; }
.cmty__title { font-family: var(--font-display); font-weight: 600; font-size: 18px; letter-spacing: -.005em; flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.cmty__live { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: none; }
.cmty__live.is-on { background: var(--hz-low); box-shadow: 0 0 0 3px rgba(61,220,132,.2); }
.cmty__tabs { flex: none; overflow-x: auto; scrollbar-width: none; }
.cmty__tabs::-webkit-scrollbar { display: none; }
.cmty__tabs .tab { position: relative; flex: 1 0 auto; padding: 9px 8px; font-size: 12.5px; letter-spacing: -.01em; white-space: nowrap; }
.cmty__tabs .tab:has(.tab__n) { padding-right: 14px; }
.tab__n { position: absolute; top: 3px; right: 2px; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 9.5px; font-weight: 700; line-height: 15px; text-align: center; }
.cmty__tabs .tab.is-active .tab__n { top: 2px; }
.cmty__body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.cmty__panel { gap: 14px; }
.cmty__panel .panel__title { font-size: 18px; }
.cmty .field textarea { width: 100%; min-height: 84px; padding: 9px 12px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--text); outline: none; resize: vertical; line-height: 1.45; transition: border-color .15s var(--ease); }
.cmty .field textarea:focus { border-color: var(--accent); }
.cmty .field input[type="file"] { padding: 7px 10px; height: auto; font-size: 12px; color: var(--text-2); }
.cmty .field input[type="file"]::file-selector-button { background: var(--bg-3); color: var(--text); border: 0; border-radius: 4px; padding: 4px 10px; margin-right: 10px; font: inherit; font-size: 12px; cursor: pointer; }
.cmty .field__count { margin-left: auto; font-weight: 400; font-variant-numeric: tabular-nums; }
.cmty .field__label { display: flex; align-items: center; gap: 6px; }
.cmty .seg__btn { display: flex; flex-direction: column; gap: 2px; padding: 8px 6px; line-height: 1.2; }
.cmty .seg__btn small { font-size: 10.5px; font-weight: 400; color: var(--muted); }
.cmty .seg__btn.is-active small { color: var(--text-2); }
.cmty-form { display: flex; flex-direction: column; gap: 12px; }
.cmty-form .btnrow { margin-top: 2px; }
.cmty-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cmty-form__err { color: var(--danger); font-size: 12.5px; min-height: 0; }
.cmty-form__err:empty { display: none; }
.cmty-sec { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.cmty-sec:first-child { padding-top: 0; border-top: 0; }
.cmty-sec__h { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 600; font-size: 15px; }
.cmty-sec__h .hint { font-family: var(--font-body); font-weight: 400; margin-left: auto; }
.cmty-sec__h .btn { margin-left: auto; }
.cmty-note { padding: 10px 12px; border-radius: var(--r-sm); background: rgba(255,255,255,.035); border: 1px solid var(--line); color: var(--text-2); font-size: 12.5px; line-height: 1.5; }
.cmty-note b { color: var(--text); font-weight: 600; }
.cmty-consent { display: flex; align-items: flex-start; gap: 10px; font-size: 12.5px; color: var(--text-2); line-height: 1.45; cursor: pointer; }
.cmty-consent input { accent-color: var(--accent); width: 16px; height: 16px; margin: 2px 0 0; flex: none; }
.cmty-back { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-weight: 500; font-size: 13px; padding: 4px 0; align-self: flex-start; }
.cmty-back:hover { color: var(--text); }
.cmty-back svg { width: 14px; height: 14px; }
.cmty-fold > summary { list-style: none; display: inline-flex; cursor: pointer; }
.cmty-fold > summary::-webkit-details-marker { display: none; }
.cmty-fold[open] > summary { margin-bottom: 12px; }
.cmty-fold[open] > summary .btn { background: var(--bg-3); color: var(--text); }
.cmty-list { display: flex; flex-direction: column; gap: 6px; }
.cmty-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r-md); background: rgba(255,255,255,.025); border: 1px solid transparent; text-align: left; width: 100%; transition: background .15s var(--ease), border-color .15s var(--ease); }
.cmty-row:hover { background: rgba(255,255,255,.055); }
.cmty-row--btn { cursor: pointer; }
.cmty-row--btn:hover { border-color: var(--line-strong); }
.cmty-row__t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cmty-row__n { font-weight: 500; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.cmty-row__s { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmty-row__a { display: flex; gap: 6px; flex: none; }
.cmty-row .btn--sm { height: 30px; padding: 0 10px; font-size: 12px; }
.cmty-row .iconbtn { width: 30px; height: 30px; }
.cmty-row .iconbtn svg { width: 15px; height: 15px; }
.cmty-vf { display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; background: var(--hz-info); color: #fff; flex: none; }
.cmty-vf svg { width: 9px; height: 9px; }
.cmty-online { width: 8px; height: 8px; border-radius: 50%; background: var(--bg-3); flex: none; box-shadow: 0 0 0 2px rgba(14,19,24,.9); }
.cmty-online.is-on { background: var(--hz-low); }
.cmty-avwrap { position: relative; flex: none; }
.cmty-avwrap .cmty-online { position: absolute; right: -1px; bottom: -1px; }
.cmty-pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--bg-2); color: var(--text-2); white-space: nowrap; }
.cmty-pill--ok { background: rgba(61,220,132,.16); color: #8ff0b8; }
.cmty-pill--warn { background: rgba(250,204,21,.16); color: #f5dc72; }
.cmty-pill--bad { background: rgba(255,93,93,.16); color: #ff9c9c; }
.cmty-pill--acc { background: var(--accent-soft); color: var(--accent); }
.cmty-kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 12.5px; }
.cmty-kv dt { color: var(--muted); }
.cmty-kv dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }

/* hazard chips */
.hz { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #0b0f12; background: var(--hz-none); white-space: nowrap; }
.hz--low { background: var(--hz-low); } .hz--moderate { background: var(--hz-moderate); } .hz--considerable { background: var(--hz-considerable); } .hz--high { background: var(--hz-high); }
.hz--extreme { background: var(--hz-extreme); color: #ff6b6b; box-shadow: inset 0 0 0 1.5px var(--hz-high); }
.hz--info { background: var(--hz-info); color: #fff; }

/* Conditions feed */
.cpost { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: var(--r-md); border: 1px solid var(--line); background: rgba(255,255,255,.025); }
.cpost__hit { display: flex; flex-direction: column; gap: 6px; text-align: left; width: 100%; border-radius: 6px; }
.cpost__hit:hover .cpost__title { color: var(--accent); }
.cpost__top { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.cpost__zone { color: var(--text-2); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.cpost__time { flex: none; }
.cpost__title { font-family: var(--font-display); font-weight: 600; font-size: 15.5px; line-height: 1.25; transition: color .15s var(--ease); }
.cpost__body { color: var(--text-2); font-size: 13px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.cpost__photo { width: 100%; max-height: 180px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--line); cursor: zoom-in; }
.cpost__foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.cpost__author { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-weight: 500; }
.cpost__exp { margin-left: auto; white-space: nowrap; }
.cpost__exp.is-soon { color: var(--hz-considerable); }
.cpost__tags { display: flex; gap: 4px; flex-wrap: wrap; }
.cpost__tag { padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 11px; color: var(--text-2); }

/* Guidebook */
.gbent__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--c-other)); flex: none; box-shadow: 0 0 0 2px rgba(255,255,255,.08); }
.gbent__kind { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.gbdet__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.gbdet__meta b { color: var(--text); font-weight: 600; }
.gbdet__sum { color: var(--text-2); font-size: 13.5px; line-height: 1.5; }
.gbdet__photo { width: 100%; max-height: 220px; object-fit: cover; border-radius: var(--r-md); border: 1px solid var(--line); }
.mdbody { color: var(--text-2); font-size: 13.5px; line-height: 1.6; display: flex; flex-direction: column; gap: 10px; }
.mdbody h3, .mdbody h4, .mdbody h5 { font-family: var(--font-display); font-weight: 600; color: var(--text); line-height: 1.25; margin-top: 4px; }
.mdbody h3 { font-size: 17px; } .mdbody h4 { font-size: 15px; } .mdbody h5 { font-size: 14px; }
.mdbody ul, .mdbody ol { padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.mdbody ul { list-style: disc; } .mdbody ol { list-style: decimal; }
.mdbody strong { color: var(--text); font-weight: 600; }
.mdbody code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: var(--bg-2); padding: 1px 5px; border-radius: 4px; }
.cmty-geo { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--r-sm); border: 1px dashed var(--line-strong); font-size: 12.5px; color: var(--text-2); }
.cmty-geo.is-set { border-style: solid; border-color: rgba(61,220,132,.5); }
.cmty-geo span { flex: 1; }

/* Draw HUD */
.cmty-hud { position: absolute; z-index: 18; left: 50%; top: calc(var(--topbar-h) + 12px); transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; background: rgba(14,19,24,.92); border: 1px solid var(--accent); border-radius: 999px; box-shadow: var(--shadow); font-weight: 500; font-size: 13px; max-width: calc(100vw - 24px); }
.cmty-hud b { color: var(--accent); font-variant-numeric: tabular-nums; }
.map.cmty-drawing .maplibregl-canvas { cursor: crosshair; }

/* Friends */
.cmty-search { position: relative; }
.cmty-search input { padding-left: 34px !important; }
.cmty-search svg { position: absolute; left: 11px; top: 11px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }

/* Chats */
.cchat__unread { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; line-height: 20px; text-align: center; flex: none; }
.cchat__time { font-size: 11px; color: var(--muted); flex: none; }
.cchat__avs { display: flex; flex: none; }
.cchat__avs .cmty-av { box-shadow: 0 0 0 2px rgba(14,19,24,.95); }
.cchat__avs .cmty-av + .cmty-av { margin-left: -10px; }
.cthread { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.cthread__head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); flex: none; }
.cthread__head .cmty-back { padding: 6px; border-radius: 6px; }
.cthread__head .cmty-back:hover { background: var(--bg-2); }
.cthread__t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cthread__n { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cthread__s { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cthread__msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; scrollbar-width: thin; scrollbar-color: var(--bg-3) transparent; }
.cthread__more { align-self: center; font-size: 12px; color: var(--text-2); padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-strong); }
.cthread__more:hover { color: var(--text); }
.msg { max-width: 82%; align-self: flex-start; display: flex; flex-direction: column; gap: 2px; }
.msg__b { padding: 8px 11px; border-radius: 12px 12px 12px 4px; background: var(--bg-2); color: var(--text); font-size: 13.5px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg__a { font-size: 11px; color: var(--text-2); font-weight: 600; padding-left: 4px; display: flex; align-items: center; gap: 5px; }
.msg__t { font-size: 10.5px; color: var(--muted); padding: 0 4px; }
.msg--mine { align-self: flex-end; align-items: flex-end; }
.msg--mine .msg__b { background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); border-radius: 12px 12px 4px 12px; }
.msg--sys { align-self: center; align-items: center; max-width: 92%; margin: 4px 0; }
.msg--sys .msg__b { background: none; color: var(--muted); font-size: 12px; text-align: center; padding: 2px 8px; border-radius: 0; }
.msg--beacon .msg__b { color: var(--text-2); border: 1px dashed var(--line-strong); border-radius: 999px; padding: 4px 12px; }
.msg--beacon .msg__b::before { content: '◉ '; color: var(--hz-low); }
.cthread__composer { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); flex: none; }
.cthread__composer textarea { flex: 1; min-height: 40px; max-height: 120px; height: 40px; padding: 9px 12px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-md); color: var(--text); outline: none; resize: none; line-height: 1.4; }
.cthread__composer textarea:focus { border-color: var(--accent); }
.cthread__composer .btn { height: 40px; padding: 0 14px; }
.cmty-members { display: flex; flex-direction: column; gap: 8px; }
.cmty-chipsel { max-height: 160px; overflow-y: auto; scrollbar-width: thin; }
.chip .cmty-av { width: 18px; height: 18px; font-size: 8px; }

/* Me */
.cmty-me { display: flex; align-items: center; gap: 12px; }
.cmty-me__t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cmty-me__n { font-family: var(--font-display); font-weight: 600; font-size: 18px; line-height: 1.15; display: flex; align-items: center; gap: 6px; overflow-wrap: anywhere; }
.cmty-me__u { color: var(--muted); font-size: 12.5px; }
.cmty-sw { display: flex; gap: 6px; flex-wrap: wrap; }
.cmty-sw button { width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent; background: var(--sw); transition: transform .12s var(--ease); }
.cmty-sw button:hover { transform: scale(1.1); }
.cmty-sw button[aria-pressed="true"] { border-color: var(--text); box-shadow: 0 0 0 2px var(--bg-1); }
.cmty-beacon { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: var(--r-md); border: 1px solid var(--line); background: linear-gradient(160deg, rgba(61,220,132,.06), transparent 60%); }
.cmty-beacon.is-live { border-color: rgba(61,220,132,.45); }
.cmty-beacon__st { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.cmty-beacon__st .bcn__ring { position: relative; width: 14px; height: 14px; margin: 0 4px; }
.cmty-beacon__st span:last-child { color: var(--text-2); font-weight: 400; font-size: 12.5px; }
.cmty-danger { border-color: rgba(255,93,93,.35); }
.cmty-danger .cmty-sec__h { color: var(--danger); }
.btn--danger { background: transparent; border-color: rgba(255,93,93,.5); color: var(--danger); }
.btn--danger:hover { background: rgba(255,93,93,.1); }

/* Review */
.capp { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: var(--r-md); border: 1px solid var(--line); background: rgba(255,255,255,.025); }
.capp__u { display: flex; align-items: center; gap: 10px; }
.capp__zones { display: flex; flex-wrap: wrap; gap: 6px; max-height: 120px; overflow-y: auto; }

/* Map: beacons */
.bcn { position: relative; width: 34px; height: 34px; cursor: pointer; }
.bcn__ring { position: absolute; inset: 0; border-radius: 50%; }
.bcn__ring::before, .bcn__ring::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--av, var(--hz-low)); opacity: .8; animation: bcnPulse 2.2s ease-out infinite; }
.bcn__ring::after { animation-delay: 1.1s; }
.bcn__chip { position: absolute; inset: 4px; border-radius: 50%; background: var(--av, var(--hz-low)); color: #0b0f12; font-weight: 700; font-size: 11px; display: grid; place-items: center; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.5); }
.bcn__name { position: absolute; left: 50%; top: calc(100% + 4px); transform: translateX(-50%); font: 600 11px/1 var(--font-body); color: #fff; background: rgba(11,15,18,.82); border: 1px solid rgba(255,255,255,.14); padding: 4px 8px; border-radius: 6px; white-space: nowrap; backdrop-filter: blur(6px); }
.bcn__name small { display: block; font-weight: 400; color: var(--text-2); font-size: 10px; margin-top: 2px; }
.bcn--mine .bcn__chip { border-color: var(--accent); }
@keyframes bcnPulse { 0% { transform: scale(.7); opacity: .9; } 100% { transform: scale(2.1); opacity: 0; } }
.cmty-beacon.is-live .bcn__ring::before, .cmty-beacon.is-live .bcn__ring::after { --av: var(--hz-low); }
.zonepop { min-width: 200px; max-width: 260px; display: flex; flex-direction: column; gap: 6px; }
.zonepop__z { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.zonepop__t { font-family: var(--font-display); font-weight: 600; font-size: 15px; line-height: 1.25; }
.zonepop__m { font-size: 12px; color: var(--text-2); }
.zonepop .btn { margin-top: 4px; width: 100%; }
.ovl__sw--czones { background: linear-gradient(90deg, var(--hz-low) 0 20%, var(--hz-moderate) 20% 40%, var(--hz-considerable) 40% 60%, var(--hz-high) 60% 80%, var(--hz-extreme) 80%); }
.ovl__sw--cgb { background: repeating-linear-gradient(90deg, var(--c-skitour) 0 6px, transparent 6px 10px, var(--c-hike) 10px 16px, transparent 16px 20px); }
.ovl__sw--cbcn { background: radial-gradient(circle at 50% 50%, var(--hz-low) 0 4px, rgba(61,220,132,.35) 5px 7px, transparent 8px), var(--bg-3); }

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
  .topbar { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto; }
  .cmty-bar { grid-column: 3; gap: 6px; }
  .cmty-bar__btn { padding: 0; width: 42px; justify-content: center; }
  .cmty-bar__btn .cmty-bar__txt { display: none; }
  .cmty__handle { display: block; width: 44px; height: 4px; border-radius: 2px; background: var(--line-strong); margin: 8px auto 0; flex: none; }
  .cmty__head { padding: 6px 10px 8px 14px; }
  .cmty__tabs { padding: 6px 8px; }
  .cmty__tabs .tab { flex: 0 0 auto; padding: 8px 12px; font-size: 13px; }
  .cmty__tabs .tab:has(.tab__n) { padding-right: 18px; }
  .cmty-form__row { grid-template-columns: 1fr; }
  .cmty-hud { top: 68px; font-size: 12px; }
  .cmty .seg__btn small { display: none; }
  .msg { max-width: 88%; }
}
@media (max-width: 480px) {
  .brand__name { display: none; }
  .brand { padding: 8px; }
}

/* ---------- Chat settings (cog panel) ---------- */
.cthread__cog { margin-left: auto; }
.cthread__cog svg { width: 18px; height: 18px; }
.cmty-chats__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 2px 6px; flex-wrap: wrap; }
.cmty-chats__new { margin: 0; }
.cmty-chats__new[open] { flex-basis: 100%; }
.cmty-chats__archived { margin-left: auto; }
.cmty-sec { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.cmty-sec:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.cmty-sec__h { margin: 0 0 8px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.cmty-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cmty__settings .hint { display: block; margin-top: 8px; color: var(--text-muted); font-size: 12px; }
.cmty-members .cmty-row { gap: 6px; }
.cmty-members .cmty-row .btn { padding: 4px 8px; font-size: 12px; }
.cmty-pill--ok { background: color-mix(in oklab, var(--accent) 22%, transparent); border-color: color-mix(in oklab, var(--accent) 40%, transparent); color: var(--accent); }
.btn--danger { color: var(--danger, #ff8a8a); }
.btn--danger:hover:not(:disabled) { background: color-mix(in oklab, var(--danger, #ff8a8a) 12%, transparent); }
.btn.is-armed { color: #fff; background: var(--danger, #ff5a5a); border-color: var(--danger, #ff5a5a); animation: cmty-arm-pulse 1s ease-in-out infinite; }
@keyframes cmty-arm-pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--danger, #ff5a5a) 45%, transparent); } 50% { box-shadow: 0 0 0 6px color-mix(in oklab, var(--danger, #ff5a5a) 0%, transparent); } }

/* ---- v9 safety: report flags, block, report dialog, admin reports ---------------------------------------------- */
.iconbtn--flag { width: 28px; height: 28px; border-color: transparent; color: var(--muted); }
.iconbtn--flag:hover, .iconbtn--flag:focus-visible { color: var(--hz-high, #f87171); background: rgba(248,113,113,.10); border-color: transparent; }
.iconbtn--flag svg { width: 15px; height: 15px; }
.msg__row { display: flex; align-items: flex-end; gap: 4px; max-width: 100%; }
.msg__flag { flex: none; width: 24px; height: 24px; border-radius: 999px; display: grid; place-items: center; color: var(--muted); opacity: 0; transition: opacity .15s; }
.msg__flag svg { width: 13px; height: 13px; }
.msg__row:hover .msg__flag, .msg__flag:focus-visible, .msg__row:focus-within .msg__flag { opacity: 1; }
.msg__flag:hover { color: var(--hz-high, #f87171); background: rgba(248,113,113,.12); }
@media (hover: none) { .msg__flag { opacity: .55; } }
.cmty-dialog { background: var(--bg-1); color: var(--text); border: 1px solid var(--line-strong); border-radius: var(--r-lg); padding: 18px; width: min(92vw, 420px); box-shadow: var(--shadow); }
.cmty-dialog::backdrop { background: rgba(0,0,0,.6); backdrop-filter: blur(var(--glass-blur, 12px)) saturate(140%); }
.cmty-dialog .cmty-form { display: flex; flex-direction: column; gap: 10px; }
.cmty-dialog .btnrow { justify-content: flex-end; }
.crep--urgent { border-color: color-mix(in srgb, var(--hz-high, #f87171) 45%, transparent); }
.cmty-sec .btnrow a.btn { text-decoration: none; }
