/* Shared composer, message modules and channel layout; all surfaces use the app's theme tokens. */
.lc-page[data-page="forum"]:has(#forum-news-pane:not([hidden])) { max-width: 920px; }
.forum-subnav:not([hidden]) { margin: 0 var(--lc-gutter) var(--ds-space-2); }
.forum-subnav button { min-width: 5.5rem; }
.news-tools button[aria-pressed="true"] {
  --ds-btn-fill: var(--ds-control-tint); --ds-btn-ink: var(--ds-ink); --ds-btn-line: transparent;
}
[data-hub-panel="forum"]:has(#forum-subnav:not([hidden])) .forum-thread {
  height: clamp(280px,calc(var(--app-height,100dvh) - var(--lc-bar-space,64px) - var(--ds-safe-top,0px) - 139px),744px);
}
.forum-draft:has(.community-add:not([hidden])) { grid-template-columns: auto minmax(0,1fr) auto; }
.community-add { position: relative; align-self: end; }
.community-plus, .community-icon-button { width: var(--ds-touch); height: var(--ds-touch); padding-inline: 0; }
:is(.community-add,.community-sheet,.community-badge) .lc-icon { width: 20px; height: 20px; flex: 0 0 20px; }
.community-plus { border-radius: 50%; background: var(--ds-surface-inset); }
.community-plus[aria-expanded="true"] { color: var(--ds-ink); border-color: var(--ds-edge); }
.community-menu:not([hidden]) {
  position: absolute; inset-inline-start: 0; bottom: calc(100% + 6px); z-index: 5;
  min-width: 10.75rem; display: grid; padding: 4px; border: 1px solid var(--ds-edge);
  border-radius: var(--ds-radius-card); background: var(--ds-surface-raised); box-shadow: var(--ds-shadow-card);
}
.community-menu .ds-btn { gap: var(--ds-space-2); min-height: var(--ds-touch); justify-content: flex-start; }
.community-sheet { --lc-modal-width: 30rem; }
.community-form { display: flex; flex-direction: column; max-block-size: min(70dvh,36rem); }
/* Chromium fieldsets have an anonymous inner box; scroll the wrapper, not the fieldset. */
.community-scroll, .community-form > .community-fields { min-block-size: 0; overflow-y: auto; overscroll-behavior: contain; }
.community-fields {
  min-inline-size: 0; min-block-size: 0; margin: 0; padding: var(--ds-space-3); border: 0;
  display: grid; gap: var(--ds-space-3);
}
.community-fields .ds-field { width: 100%; min-width: 0; }
.community-fields textarea { resize: vertical; }
.community-fields button { justify-self: start; }
.community-groups, .community-question, .community-options, .community-settings { display: grid; gap: var(--ds-space-2); min-width: 0; }
.community-question > .ds-field { min-height: var(--ds-touch); }
.community-groups .community-question + .community-question { border-top: 1px solid var(--ds-edge); padding-top: var(--ds-space-2); }
.community-label, .community-muted, .community-error, .community-title, .community-plain { margin: 0; overflow-wrap: anywhere; }
.community-label, .community-muted { font-size: var(--ds-fs-label); color: var(--ds-ink-muted); line-height: 1.4; }
.community-label { font-weight: 700; }
.community-title { color: var(--ds-ink); line-height: 1.35; }
.community-option-field { display: grid; grid-template-columns: 18px minmax(0,1fr) var(--ds-touch); gap: var(--ds-space-2); align-items: center; }
.community-option-dot { inline-size: 17px; block-size: 17px; border: 1.5px solid var(--ds-ink-muted); border-radius: 50%; flex: 0 0 17px; }
.community-toggle, .community-deadline, .community-play-option { display: flex; align-items: center; gap: var(--ds-space-2); }
.community-toggle, .community-play-option { min-block-size: var(--ds-touch); cursor: pointer; }
.community-deadline .ds-field { width: auto; flex: 1; }
:is(.community-fields,.community-module) :is(input[type="checkbox"],input[type="radio"]) { inline-size: 18px; block-size: 18px; flex: 0 0 18px; accent-color: var(--lc-accent); }
.community-footer { flex: 0 0 auto; padding: var(--ds-space-2) var(--ds-space-3) var(--ds-space-3); border-top: 1px solid var(--ds-edge); }
.community-footer .ds-btn { width: 100%; }
.community-footer .community-error:not(:empty) { margin-bottom: var(--ds-space-2); }
.community-error, .news-error, .news-moderation .news-error { color: var(--ds-status-error); font-size: var(--ds-fs-label); }
.community-error:empty, .news-error:empty { display: none; }
.forum-round-message { width: min(96%,28rem); }
.community-module {
  display: grid; gap: var(--ds-space-2); min-width: 0; padding: var(--ds-space-2) var(--ds-space-3);
  border: 1px solid var(--ds-edge); background: var(--ds-surface-inset); border-radius: var(--ds-radius-inset);
}
.community-badge { display: flex; align-items: center; gap: 6px; color: var(--ds-ink-muted); font-size: var(--ds-fs-label); }
.community-plain, .news-plain { white-space: pre-wrap; overflow-wrap: anywhere; }
.community-choices { display: grid; }
.community-choices .community-choice, .community-play-option { justify-content: flex-start; text-align: start; white-space: normal; overflow-wrap: anywhere; }
.community-choices .community-choice { gap: var(--ds-space-2); padding-inline: var(--ds-space-1); width: 100%; }
.community-choices .community-choice + .community-choice, .community-play-option + .community-play-option { border-top: 1px solid var(--ds-edge); }
.community-quiz-readout { display: flex; justify-content: space-between; gap: var(--ds-space-2); color: var(--ds-ink-muted); font-size: var(--ds-fs-label); }
.community-timer { width: 100%; height: 6px; accent-color: var(--lc-accent); }
.community-quiz-choices { display: grid; gap: var(--ds-space-2); }
.community-quiz-choices .ds-btn { width: 100%; justify-content: flex-start; text-align: start; white-space: normal; overflow-wrap: anywhere; gap: var(--ds-space-2); }
.community-choice-letter { display: grid; place-items: center; min-width: 1.5rem; height: 1.5rem; border: 1px solid var(--ds-edge); border-radius: 50%; }
.community-results { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--ds-space-2); }
.community-result { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 3px var(--ds-space-2); font-size: var(--ds-fs-label); overflow-wrap: anywhere; }
.community-result meter { width: 100%; height: 8px; grid-column: 1 / -1; accent-color: var(--lc-accent); }
.community-result meter::-webkit-meter-optimum-value { background: var(--lc-accent); }
.community-result[data-correct="true"] { color: var(--ds-status-ok); }
.news-page { margin-inline: var(--lc-gutter); color: var(--ds-ink); }
#news-thread { grid-template-rows: auto auto minmax(0,1fr) auto; }
#news-thread > header { grid-row: 1; }
.news-toolbar { grid-row: 2; min-height: 0; }
.news-toolbar:has(p:not(:empty)) { padding-block: var(--ds-space-1); }
.news-toolbar p:empty { display: none; }
#news-scroll { grid-row: 3; overflow-anchor: auto; }
#news-dock { grid-row: 4; text-align: center; }
#news-readonly { color: var(--ds-ink-muted); font-size: var(--ds-fs-label); min-height: var(--ds-touch); align-content: center; }
#news-input { resize: none; width: 100%; min-width: 0; }
.news-page :where(p,h4) { margin: 0; }
.news-log, .news-discussion, .news-comment-form { display: grid; align-content: start; gap: var(--ds-space-2); }
.news-discussion > button, .news-comment-form > button { justify-self: start; }
.news-log { min-block-size: calc(100% - 1px); }
.news-blank { min-height: 100px; color: var(--ds-ink-muted); display: grid; place-items: center; }
.news-message { display: grid; gap: var(--ds-space-2); padding: var(--ds-space-2) var(--ds-space-3); width: min(100%,32rem); min-width: 0;
  background: var(--ds-surface-raised); border: 1px solid var(--ds-edge); border-radius: var(--ds-radius-card); }
.news-message > header { min-height: var(--ds-touch); align-items: center; }
.news-more { margin-inline-start: auto; min-width: var(--ds-touch); padding-inline: var(--ds-space-2); }
.news-tools, .news-paging { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.news-paging { padding-block: var(--ds-space-1); }
.news-updates { font-size: var(--ds-fs-label); color: var(--ds-ink-muted); }
.news-tools .ds-btn, .news-paging .ds-btn { font-size: var(--ds-fs-label); padding-inline: var(--ds-space-2); }
.news-comment-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--ds-space-2); }
.news-comment-list li { border-top: 1px solid var(--ds-edge); padding-block: var(--ds-space-2); display: grid; justify-items: start; gap: var(--ds-space-2); }
.news-discussion .ds-field { width: 100%; max-width: 100%; }
.news-moderation .news-moderation-preview { display: grid; gap: var(--ds-space-2); padding: var(--ds-space-3); border: 1px solid var(--ds-edge); border-radius: var(--ds-radius-inset); }
.news-moderation .news-moderation-preview p { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Closed 02A channel: reuse the publication renderer, not the framed Forum room. */
#hub-dialog[data-page="forum"][data-channel-edition][open] {
  --channel-gutter: max(0px, calc((100% - var(--ds-page-width)) / 2));
  --channel-left: calc(var(--channel-gutter) + var(--ds-safe-left));
  --channel-right: calc(var(--channel-gutter) + var(--ds-safe-right));
  position: fixed;
  inset: var(--app-offset-top, 0px) 0 auto;
  z-index: 10;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  max-width: none;
  height: var(--app-height, 100dvh);
  padding: 0;
  overflow: hidden;
  background: var(--lc-bg);
}
#hub-dialog[data-page="forum"][data-channel-edition] .lc-page-head {
  position: static;
  min-height: calc(var(--ds-touch) + var(--ds-safe-top) + 8px);
  margin: 0;
  padding: calc(var(--ds-safe-top) + 4px) calc(var(--channel-right) + var(--lc-gutter))
    4px calc(var(--channel-left) + var(--lc-gutter));
  background: var(--lc-bg);
  border-bottom: 1px solid var(--lc-hairline);
}
#hub-dialog[data-page="forum"][data-channel-edition] :is(.lc-page-scene, .lc-medal) { display: none; }
#hub-dialog[data-page="forum"][data-channel-edition] .lc-page-head::before { content: none; }
#hub-dialog[data-channel-edition] [data-hub-panel="forum"] { min-width: 0; min-height: 0; }
#hub-dialog[data-channel-edition] .news-page { height: 100%; margin-inline: 0; }
/* The shell bleeds; the header controls, publication column and form do not. */
#hub-dialog[data-channel-edition] #news-admission {
  margin-inline: var(--channel-left) var(--channel-right);
  padding: var(--ds-space-4); background: transparent; border: 0; box-shadow: none;
}
#hub-dialog[data-channel-edition] #news-admission > :is(.forum-kicker, h3),
#hub-dialog[data-channel-edition] #news-admission::before,
#hub-dialog[data-channel-edition] #news-admission::after { display: none; }
#hub-dialog[data-channel-edition] #news-thread {
  height: 100%; min-height: 0; margin: 0;
  background: transparent; border: 0; border-radius: 0; box-shadow: none;
}
#hub-dialog[data-channel-edition] #news-thread > header { display: none; }
#hub-dialog[data-channel-edition] .news-toolbar {
  margin-inline: var(--channel-left) var(--channel-right);
}
#hub-dialog[data-channel-edition] #news-scroll {
  background: transparent; border: 0;
  padding-inline: calc(var(--channel-left) + var(--ds-space-3)) calc(var(--channel-right) + var(--ds-space-3));
}
#hub-dialog[data-channel-edition] #news-thread:has(#news-dock[hidden]) #news-scroll {
  padding-block-end: calc(var(--lc-bar-space) + var(--ds-space-3));
}
#hub-dialog[data-channel-edition] #news-dock {
  display: flex; align-items: end; gap: var(--ds-space-2);
  padding-inline: calc(var(--channel-left) + var(--ds-space-3)) calc(var(--channel-right) + var(--ds-space-3));
  padding-block-end: calc(var(--lc-bar-space) + var(--ds-space-2));
  border-top: 1px solid var(--lc-hairline);
  background: var(--ds-surface-raised);
}
#hub-dialog[data-channel-edition] #news-form { flex: 1; min-width: 0; }
#news-new-post .lc-icon, .news-comments-panel :where(:not(.lc-modal-close) > .lc-icon) { width: var(--ds-icon); height: var(--ds-icon); }
#news-new-post[aria-expanded="true"] { color: var(--lc-accent); }
#news-new-post[aria-expanded="true"] .lc-icon { rotate: 45deg; }
.news-comments-panel { --lc-modal-width: 32rem; --lc-modal-limit: 84dvh; overflow: hidden; }
.news-comments-panel[open], .channel-author-card[open] { display: flex; flex-direction: column; }
.news-comments-panel > .lc-modal-head { flex: none; }
.news-comments-panel :where(p, h4) { margin: 0; }
.news-comments-panel .news-discussion { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: var(--ds-space-3); }
.news-comments-panel > :is(.news-comment-form, .news-error, .news-panel-status) { padding: var(--ds-space-2) var(--ds-space-3); border-top: 1px solid var(--ds-edge); }
.news-panel-status { font-size: var(--ds-fs-label); }
.news-panel-status:empty { display: none; }
.news-comments-panel .news-comment-form { flex-shrink: 0; }
.news-comments-panel .news-comment-form .ds-field { box-sizing: border-box; min-height: var(--ds-touch); resize: none; }
.news-comment-reply:not([hidden]) { display: flex; align-items: center; justify-content: space-between; gap: var(--ds-space-2); font-size: var(--ds-fs-label); }
#hub-dialog[data-channel-edition] #news-admission h3 { display: none; }
/* Channel-only labels and reserve form; Forum/legacy rounds keep their original controls. */
.channel-compose-access, .channel-prizes, .channel-prize-fields { display: grid; gap: 6px; min-width: 0; }
.channel-compose-access, .channel-prizes { border-top: 1px solid var(--ds-edge); padding-top: var(--ds-space-2); }
.channel-prize-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) var(--ds-touch); align-items: end; gap: 6px; }
.community-labeled { display: grid; gap: 4px; min-width: 0; }
.community-labeled .ds-field, .channel-compose-access .ds-field { width: 100%; min-width: 0; }
.channel-fund-value { font-size: var(--ds-fs-title); font-weight: 650; margin: 0; }
.channel-personal-result, .channel-ranks li { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; }
.channel-personal-result { padding: var(--ds-space-2); background: var(--ds-surface-raised); border-radius: var(--ds-radius-lg); }
.channel-ranks { list-style: none; margin: 0; padding: 0; font-size: var(--ds-fs-label); }
.channel-ranks li { padding-block: 6px; border-bottom: 1px solid var(--ds-edge); }
.channel-amount { color: var(--ds-status-ok); }
.channel-explanation { font-size: var(--ds-fs-label); border-inline-start: 2px solid var(--ds-edge); padding-inline-start: var(--ds-space-2); }

/* Comment card (never a profile link) and its independent account settings. */
.channel-author-button { min-block-size: 44px; padding-inline: 6px; text-decoration: underline; text-underline-offset: 3px; }
.channel-author-card { --lc-modal-width: 28rem; overflow: hidden; }
.channel-author-card > .lc-modal-head { flex: none; }
.channel-card-body { padding: var(--ds-space-3); min-block-size: 0; overflow: auto; overscroll-behavior: contain; }
