/* ---------- Communauté ---------- */
.finder { padding: 10px; margin-bottom: 40px; }
.finder-input { display: flex; align-items: center; gap: 12px; height: 68px; padding: 0 20px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); transition: border-color 0.2s; }
.finder-input:focus-within { border-color: var(--text); }
.finder-input i { font-size: 22px; color: var(--accent-text); }
.finder-input .muted { font-family: var(--display); font-size: 22px; font-weight: 600; letter-spacing: -0.02em; white-space: nowrap; }
.finder-input input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: none; font-family: var(--display); font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.finder-input input::placeholder { color: var(--faint); }
.instant { display: grid; gap: 14px; padding: 18px 10px 8px; justify-items: start; }
.instant-hits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: 100%; }
.hit { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; padding: 8px; border-radius: var(--r-sm); transition: background-color 0.2s; }
.hit:hover { background: var(--surface-2); }
.hit .cover { width: 64px; height: 48px; border-radius: 8px; }
.hit .cover::after { display: none; }
.hit b { display: block; }
.hit small { color: var(--muted); font-size: 13px; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.comm { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; }
.comm-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.comm .chips { margin-bottom: 20px; }
.req-list { display: grid; gap: 10px; }
.req { display: grid; grid-template-columns: 64px minmax(0, 1fr) 96px; gap: 18px; align-items: start; padding: 18px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); transition: border-color 0.25s; }
.req:hover { border-color: var(--line-2); }
.metoo { display: grid; justify-items: center; align-content: center; gap: 2px; width: 64px; height: 68px; border-radius: var(--r-sm); border: 1px solid var(--line-2); font-size: 14px; transition: background-color 0.25s, color 0.25s, border-color 0.25s; }
.metoo i { font-size: 20px; }
.metoo:hover { border-color: var(--text); }
.metoo.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.metoo.big { width: 92px; height: 104px; }
.metoo.big i { font-size: 28px; }
.metoo.big .mono { font-size: 20px; }
.metoo small { font-size: 11px; opacity: 0.7; }
.req-title { display: block; font-family: var(--display); font-size: 22px; font-weight: 650; letter-spacing: -0.025em; line-height: 1.15; }
.req-title:hover { color: var(--accent-text); }
.req-details { color: var(--muted); font-size: 15px; margin-top: 6px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.req-meta { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-top: 12px; font-size: 13px; }
.req-side { display: grid; justify-items: center; align-content: center; gap: 2px; height: 100%; min-height: 68px; border-radius: var(--r-sm); background: var(--bg-2); text-align: center; }
.req-side b { font-size: 24px; font-weight: 500; }
.req-side small { font-size: 12px; color: var(--muted); }
.req-avs { display: flex; margin-bottom: 4px; }
.req-avs span { width: 22px; height: 22px; border-radius: 6px; margin-left: -6px; display: grid; place-items: center; color: #fff; font: 700 11px var(--display); box-shadow: 0 0 0 2px var(--bg-2); }
.req-avs span:first-child { margin-left: 0; }
.comm-side { display: grid; gap: 14px; position: sticky; top: calc(var(--nav-h) + 32px); }
.comm-stats { display: grid; grid-template-columns: repeat(3, 1fr); padding: 20px; gap: 8px; text-align: center; }
.comm-stats strong { display: block; font-size: 30px; font-weight: 500; }
.comm-stats span { font-size: 12px; color: var(--muted); }
.comm-helpers, .comm-how { padding: 20px; display: grid; gap: 12px; }
.helper { display: grid; grid-template-columns: 16px 36px 1fr; gap: 10px; align-items: center; }
.helper .av, .answer .av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-weight: 600; font-size: 13px; }
.helper small { display: block; font-size: 12px; color: var(--muted); }
.comm-how ol { margin: 0; padding-left: 18px; display: grid; gap: 10px; color: var(--muted); font-size: 14px; }
.comm-how b { color: var(--text); font-weight: 600; }
.ask { padding: clamp(20px, 3vw, 32px); display: grid; gap: 20px; margin-bottom: 28px; border-color: var(--accent-text); }
.ask-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.req-head { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: start; }
.answers { display: grid; gap: 14px; }
.answer { position: relative; padding: 22px; display: grid; gap: 14px; }
.answer.accepted { border-color: var(--accent-text); }
.answer header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.answer footer { display: flex; gap: 8px; flex-wrap: wrap; }
.accepted-tag { justify-self: start; }
.answer-project { display: grid; grid-template-columns: 120px 1fr auto; gap: 16px; align-items: center; padding: 10px; border-radius: var(--r-sm); background: var(--bg-2); border: 1px solid var(--line); transition: border-color 0.2s; }
.answer-project:hover { border-color: var(--text); }
.answer-project .cover { width: 120px; aspect-ratio: 4 / 3; border-radius: 10px; }
.answer-project b { display: block; font-family: var(--display); font-size: 20px; letter-spacing: -0.02em; }
.answer-project small { display: block; color: var(--muted); margin: 2px 0 6px; }
.answer-project > i { font-size: 22px; margin-right: 8px; }
.btn.on-line { border-color: var(--accent-text); color: var(--accent-text); }
.reply { padding: 22px; display: grid; gap: 16px; }
.reply h3 { font-size: 22px; }
.picker { display: grid; gap: 4px; max-height: 260px; overflow: auto; }
.pick { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; padding: 6px; border-radius: 10px; text-align: left; transition: background-color 0.2s; }
.pick:hover { background: var(--surface-2); }
.pick.on { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--accent-text); }
.pick .cover { width: 44px; height: 34px; border-radius: 7px; }
.pick .cover::after { display: none; }
.pick b { display: block; font-size: 14px; }
.pick small { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }

/* bloc communauté de l'accueil */
.home-comm { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.home-comm .finder { margin: 28px 0 16px; }
.home-comm .req { grid-template-columns: 56px minmax(0, 1fr) 84px; padding: 14px; }
.home-comm .metoo { width: 56px; height: 60px; }
.home-comm .req-title { font-size: 19px; }
.home-comm .req-details { display: none; }
.examples { display: flex; flex-wrap: wrap; gap: 8px; }
.examples button { height: 34px; padding: 0 14px; border-radius: 999px; border: 1px dashed var(--line-2); font-size: 14px; color: var(--muted); transition: color 0.2s, border-color 0.2s; }
.examples button:hover { color: var(--text); border-color: var(--text); }

@media (max-width: 1080px) {
  .comm, .home-comm { grid-template-columns: 1fr; }
  .comm-side { position: static; }
  .instant-hits { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .req { grid-template-columns: 52px minmax(0, 1fr); }
  .req-side { grid-column: 2; justify-items: start; padding: 8px 12px; min-height: 0; grid-auto-flow: column; align-items: center; gap: 8px; }
  .metoo { width: 52px; height: 60px; }
  .finder-input .muted { display: none; }
  .finder-input input { font-size: 18px; }
  .ask-row { grid-template-columns: 1fr; }
  .req-head { grid-template-columns: 1fr; }
  .answer-project { grid-template-columns: 80px 1fr; }
  .answer-project .cover { width: 80px; }
  .answer-project > i { display: none; }
}

/* les colonnes de grille ne doivent pas s'élargir à cause des puces qui défilent */
.comm > *, .home-comm > * { min-width: 0; }

@media (max-width: 720px) {
  .home-comm .req { grid-template-columns: 52px minmax(0, 1fr); }
  .home-comm .metoo { width: 52px; }
}

/* ---------- Communautés (espaces, publications, commentaires) ---------- */
.sp-switch { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 28px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); max-width: 100%; }
.sp-switch a { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 999px; font-size: 14px; color: var(--muted); white-space: nowrap; transition: background-color 0.25s, color 0.25s; }
.sp-switch a:hover { color: var(--text); }
.sp-switch a.on { background: var(--text); color: var(--bg); }
.sp-ic { --s: 40px; flex: none; display: grid; place-items: center; width: var(--s); height: var(--s); border-radius: 12px; background: color-mix(in srgb, var(--c) 18%, var(--surface-2)); color: color-mix(in srgb, var(--c) 70%, var(--text)); font-size: calc(var(--s) * 0.52); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 35%, transparent); }
.sp-ic.xs { --s: 22px; border-radius: 7px; }
.sp-ic.lg { --s: 72px; border-radius: 20px; }

/* rangée de communautés : visible quand la colonne latérale passe sous le fil */
.sp-rail { display: none; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 18px; scrollbar-width: none; }
.sp-rail::-webkit-scrollbar { display: none; }
.sp-pill { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; white-space: nowrap; }
.sp-pill.add { padding: 0 14px; color: var(--muted); border-style: dashed; border-color: var(--line-2); }

.sp-compose { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; margin-bottom: 16px; text-align: left; color: var(--muted); font-size: 15px; transition: border-color 0.2s; }
.sp-compose:hover { border-color: var(--line-2); color: var(--text); }
.sp-compose .av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--text); font-weight: 600; font-size: 13px; flex: none; }
.sp-compose span:nth-child(2) { flex: 1; }
.sp-compose > i { font-size: 18px; }
.sp-bar { margin-bottom: 16px; }
.sp-bar .seg button { display: inline-flex; align-items: center; gap: 6px; }
.comm .sp-chips, .sp-chips { margin: 0; flex-wrap: wrap; overflow: visible; }
.sp-chips .chip { display: inline-flex; align-items: center; gap: 6px; }
.sp-feed { display: grid; gap: 10px; }
.sp-more { display: flex; margin: 18px auto 0; }

/* une publication */
.sp-post, .sp-full { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 14px; padding: 16px 18px 14px 12px; transition: border-color 0.25s; }
.sp-post:hover { border-color: var(--line-2); }
.sp-post.pinned { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.sp-vote { display: grid; justify-items: center; align-content: start; gap: 2px; }
.sp-vote button { display: grid; place-items: center; width: 36px; height: 34px; border-radius: 10px; font-size: 20px; color: var(--muted); transition: background-color 0.2s, color 0.2s; }
.sp-vote button:hover { background: var(--surface-2); color: var(--text); }
.sp-vote .sp-up.on { color: var(--accent-ink); background: var(--accent); }
.sp-vote .sp-down.on { color: #fff; background: #5b63d3; }
.sp-vote b { font-size: 14px; font-weight: 500; }
.sp-post-b { min-width: 0; display: grid; gap: 8px; align-content: start; }
.sp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; color: var(--muted); }
.sp-meta .dot { opacity: 0.5; }
.sp-in { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-weight: 600; }
.sp-in:hover, .sp-author:hover { text-decoration: underline; text-underline-offset: 3px; }
.sp-author { color: var(--text); }
.sp-role { margin-left: 6px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 11px; color: var(--muted); }
.sp-role.creator { border-color: color-mix(in srgb, var(--accent-text) 50%, transparent); color: var(--accent-text); }
.sp-title { font-family: var(--display); font-size: 20px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.2; overflow-wrap: anywhere; }
.sp-title:hover { color: var(--accent-text); }
.sp-excerpt { color: var(--muted); font-size: 15px; line-height: 1.5; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow-wrap: anywhere; white-space: pre-line; }
.sp-project { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 12px 8px 8px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--bg-2); transition: border-color 0.2s; }
.sp-project:hover { border-color: var(--line-2); }
.sp-project-mark { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; overflow: hidden; color: #fff; font: 700 15px var(--display); }
.sp-project-mark img { width: 100%; height: 100%; object-fit: cover; }
.sp-project b { display: block; font-size: 14.5px; }
.sp-project small { display: block; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-link { display: inline-flex; align-items: center; gap: 6px; width: fit-content; max-width: 100%; color: var(--accent-text); font-size: 14px; overflow-wrap: anywhere; }
.sp-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.sp-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 2px; }
.sp-kind { height: 26px; font-size: 12px; margin-right: 4px; }
.sp-act { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px; border-radius: 8px; font-size: 13px; color: var(--muted); transition: background-color 0.2s, color 0.2s; }
.sp-act:hover { background: var(--surface-2); color: var(--text); }
.sp-act.on { color: var(--accent-text); }
.sp-act.danger:hover { color: #e66767; }

/* colonne latérale */
.sp-side { display: grid; gap: 14px; padding: 20px; }
.sp-side-h { display: flex; justify-content: space-between; align-items: baseline; }
.sp-search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2); color: var(--muted); }
.sp-search:focus-within { border-color: var(--text); }
.sp-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; font-size: 14px; }
.sp-list { display: grid; gap: 4px; }
.sp-row { display: flex; align-items: center; gap: 10px; }
.sp-row a { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 6px; margin-left: -6px; border-radius: 10px; transition: background-color 0.2s; }
.sp-row a:hover { background: var(--surface-2); }
.sp-row a span:last-child { min-width: 0; }
.sp-row b { display: block; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-row small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-rules { display: grid; gap: 12px; padding: 20px; }
.sp-rules ol { margin: 0; padding-left: 18px; display: grid; gap: 8px; font-size: 14px; line-height: 1.45; }
.sp-rules-f { font-size: 13px; padding-top: 12px; border-top: 1px solid var(--line); }
.sp-about { display: grid; gap: 12px; padding: 20px; border-top: 3px solid var(--c); }
.sp-about-h { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.sp-about p { font-size: 14px; }

/* en-tête d'une communauté */
.sp-hero { overflow: hidden; margin-bottom: 24px; }
.sp-hero-band { height: 84px; background: linear-gradient(120deg, color-mix(in srgb, var(--c) 70%, var(--bg)), color-mix(in srgb, var(--c) 18%, var(--bg))); }
.sp-hero-b { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: start; padding: 0 24px 22px; }
.sp-hero-b > .sp-ic { margin-top: -28px; background: color-mix(in srgb, var(--c) 22%, var(--surface)); box-shadow: 0 0 0 4px var(--surface), inset 0 0 0 1px color-mix(in srgb, var(--c) 40%, transparent); }
.sp-hero-t { display: grid; gap: 8px; padding-top: 16px; }
.sp-hero-t h1 { line-height: 1.05; }
.sp-hero-m { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.sp-hero-m span { display: inline-flex; align-items: center; gap: 6px; }
.sp-hero-a { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 16px; justify-content: flex-end; }

/* publication ouverte et fil de commentaires */
.sp-full { padding: 22px 24px 18px 14px; }
.sp-h { font-size: clamp(24px, 3vw, 34px); line-height: 1.1; overflow-wrap: anywhere; }
.sp-body { font-size: 16px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.sp-body a, .sp-c-t a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
.sp-ch { margin: 32px 0 14px; }
.sp-write, .sp-closed { display: grid; gap: 10px; padding: 14px; margin-bottom: 18px; }
.sp-closed { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.sp-write .textarea, .sp-reply .textarea { min-height: 84px; }
.sp-write .p-actions { justify-content: flex-end; }
.sp-thread { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.sp-thread .sp-thread { margin-top: 14px; padding-left: 18px; border-left: 2px solid var(--line); }
.sp-thread .sp-thread.flat { padding-left: 0; border-left: 0; }
.sp-c { display: grid; gap: 6px; }
.sp-c-h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; }
.sp-c-h .av { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-weight: 600; font-size: 11px; }
.sp-c-t { font-size: 15px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.sp-c-a { display: flex; flex-wrap: wrap; gap: 2px; margin-left: -10px; }
.sp-c.gone > .sp-c-h { font-style: italic; }
.sp-reply { display: grid; gap: 8px; margin-top: 4px; }
.sp-nocom { padding: 36px 16px; border: 1px dashed var(--line-2); border-radius: var(--r); }

/* formulaires en fenêtre */
.sp-form { display: grid; gap: 16px; padding: clamp(20px, 4vw, 32px); }
.sp-form h2 { padding-right: 44px; }
.sp-form .field { min-width: 0; }
.sp-thread.root { margin-bottom: 36px; }
.sp-form-in { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.sp-form select.input { appearance: auto; }
.sp-icons, .sp-colors { display: flex; flex-wrap: wrap; gap: 6px; }
.sp-icons button { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); font-size: 19px; color: var(--muted); }
.sp-icons button.on { border-color: var(--text); color: var(--text); background: var(--surface-2); }
.sp-colors button { width: 34px; height: 34px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2); }
.sp-colors button.on { outline: 2px solid var(--text); outline-offset: 3px; }

@media (max-width: 1080px) {
  .sp-rail { display: flex; }
  .sp-layout > .comm-side .sp-search, .sp-layout > .comm-side .comm-how { display: none; }
  .sp-hero-b { grid-template-columns: auto minmax(0, 1fr); }
  .sp-hero-a { grid-column: 1 / -1; justify-content: flex-start; padding-top: 0; }
}
@media (max-width: 720px) {
  .sp-switch { display: flex; width: 100%; }
  .sp-switch a { flex: 1; justify-content: center; padding: 0 10px; height: 44px; }
  .sp-post, .sp-full { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 14px; }
  .sp-vote { order: 2; display: flex; align-items: center; gap: 4px; width: fit-content; padding: 2px; border-radius: 12px; border: 1px solid var(--line); }
  .sp-vote button { width: 40px; height: 36px; }
  .sp-vote b { min-width: 24px; text-align: center; }
  .sp-title { font-size: 18px; }
  .sp-bar { gap: 10px; }
  .sp-bar .sp-chips { flex-wrap: nowrap; overflow-x: auto; width: 100%; }
  .sp-bar .sp-chips .chip { flex: 1; justify-content: center; }
  .sp-bar .seg { width: 100%; }
  .sp-bar .seg button { flex: 1; justify-content: center; padding: 0 8px; }
  .sp-hero-band { height: 60px; }
  .sp-hero-b { padding: 0 16px 16px; gap: 12px; }
  .sp-ic.lg { --s: 56px; border-radius: 16px; }
  .sp-hero-a .btn { flex: 1; justify-content: center; }
  .sp-thread .sp-thread { padding-left: 12px; }
  .sp-act { min-height: 40px; }
  .sp-icons button { width: 44px; height: 44px; }
}

/* réponses sous un commentaire : un seul niveau, décalé, avec le même langage visuel */
.c-reply { margin: 12px 0 0 14px; padding: 10px 0 10px 14px; border-left: 2px solid var(--line); }
.c-reply header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.c-reply small { color: var(--muted); }
.c-reply p { margin-top: 4px; font-size: 14px; }
.c-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.c-rbox:not(:empty) { margin-top: 10px; }
.c-replyform { display: grid; gap: 8px; }
.c-replyform .row { display: flex; justify-content: flex-end; gap: 8px; }
/* écrans étroits : la colonne et ses cartes ne dépassent jamais de l'écran */
.comm-side, .comm-side > *, .sp-side, .sp-side > *, .sp-list { min-width: 0; }
.sp-side-h { gap: 8px; flex-wrap: wrap; }

@media (max-width: 760px) {
  .sp-switch { overflow-x: auto; scrollbar-width: none; }
  .sp-switch::-webkit-scrollbar { display: none; }
  .sp-switch a { padding: 0 12px; font-size: 13px; flex: none; }
  .sp-switch a i { display: none; }
}
