/* Community UI. Shared colors, typography, logo, and blurred background use ../css/styles.css. */
.community-header, .community-main, .community-footer { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.community-header { min-height: 82px; }
.brand-light { color: var(--muted); font-weight: 430; }
.community-main { padding-top: 58px; padding-bottom: 82px; }
.community-hero { display: flex; align-items: end; justify-content: space-between; gap: 35px; padding: 6px 0 39px; border-bottom: 1px solid var(--line); }
.community-hero .eyebrow { display: flex; align-items: center; gap: 10px; }
.community-hero h1 { margin: 19px 0 14px; font-size: clamp(43px, 6vw, 68px); }
.community-lead { max-width: 590px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.75; }
.hero-action { display: grid; justify-items: end; gap: 14px; padding-bottom: 3px; }
.connection-status { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #d39b55; box-shadow: 0 0 0 4px #d39b551c; }
.primary-action { min-height: 42px; padding: 0 15px; border: 1px solid var(--forest); border-radius: 10px; background: var(--forest); color: #fff; font: inherit; font-size: 12px; font-weight: 580; cursor: pointer; transition: transform .16s ease, background .16s ease; }
.primary-action:hover { transform: translateY(-1px); background: var(--forest-deep); }
.community-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(275px, .75fr); gap: 22px; padding-top: 27px; }
.feed-column, .sidebar-card { border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.85); backdrop-filter: blur(12px); box-shadow: 0 14px 40px #263b2a0b; }
.feed-column { min-height: 530px; padding: 23px; }
.feed-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.feed-toolbar .eyebrow, .sidebar-card .eyebrow { margin-bottom: 7px; }
.feed-toolbar h2, .sidebar-card h2 { margin: 0; color: var(--ink); font-size: 20px; font-weight: 620; letter-spacing: -.035em; }
.search-box { display: flex; width: min(245px, 48%); min-height: 38px; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: #859087; }
.search-box > span:not(.visually-hidden) { font-size: 20px; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: 11px; }
.search-box input::placeholder { color: #9aa19b; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.filter-row { display: flex; flex-wrap: wrap; gap: 7px; padding: 19px 0 17px; border-bottom: 1px solid var(--line); }
.filter-chip { padding: 7px 11px; border: 1px solid transparent; border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-size: 10px; cursor: pointer; }
.filter-chip:hover { background: #f0f4ef; }
.filter-chip.is-active { border-color: #d5e2d4; background: #edf3ec; color: var(--forest); font-weight: 620; }
.discussion-empty { min-height: 335px; display: grid; align-content: center; justify-items: center; padding: 30px; text-align: center; }
.empty-mark { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 15px; background: #edf3ec; color: var(--forest); font-size: 22px; }
.discussion-empty h3 { margin: 17px 0 7px; color: var(--ink); font-size: 16px; font-weight: 620; }
.discussion-empty p { max-width: 370px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.text-action { margin-top: 14px; padding: 6px; border: 0; background: transparent; color: var(--forest); font: inherit; font-size: 11px; font-weight: 620; cursor: pointer; }
.text-action:hover { text-decoration: underline; }
.community-message { display: none; margin: 0; padding: 11px 13px; border-radius: 9px; background: #f0f4ef; color: var(--forest); font-size: 11px; line-height: 1.6; }
.community-message.is-visible { display: block; }
.community-sidebar { display: grid; align-content: start; gap: 15px; }
.sidebar-card { padding: 21px; }
.topics-card h2 { margin-bottom: 13px; }
.topic-row { display: grid; width: 100%; grid-template-columns: 34px minmax(0,1fr) 14px; align-items: center; gap: 10px; padding: 12px 0; border: 0; border-top: 1px solid #edf0eb; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.topic-row:hover strong { color: var(--accent); }
.topic-symbol { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 9px; background: #eff3ee; color: var(--forest); font-size: 14px; }
.topic-row strong, .topic-row small { display: block; }
.topic-row strong { font-size: 11px; font-weight: 620; }
.topic-row small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.topic-arrow { color: #929b92; font-size: 18px; }
.guidelines-card { position: relative; padding-top: 20px; }
.guideline-icon { display: grid; width: 29px; height: 29px; margin-bottom: 12px; place-items: center; border-radius: 9px; background: #edf3ec; color: var(--forest); font-size: 14px; }
.guidelines-card h2 { font-size: 14px; }
.guidelines-card p { margin: 8px 0 13px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.backend-note { display: block; padding-top: 11px; border-top: 1px solid #edf0eb; color: #848d85; font-size: 10px; line-height: 1.5; }
.community-footer { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.community-footer a { color: var(--forest); text-decoration: none; }
.community-footer a:hover { text-decoration: underline; }

@media (max-width: 780px) {
  .community-header, .community-main, .community-footer { width: min(100% - 36px, 580px); }
  .community-header { min-height: 70px; }
  .community-header .header-actions { width: auto; display: flex; }
  .community-header .header-link { padding: 8px 9px; font-size: 10px; }
  .community-main { padding-top: 40px; padding-bottom: 55px; }
  .community-hero { display: grid; align-items: start; gap: 22px; padding-bottom: 27px; }
  .community-hero h1 { font-size: clamp(42px, 11vw, 60px); }
  .hero-action { display: flex; align-items: center; justify-content: space-between; }
  .community-grid { grid-template-columns: 1fr; gap: 14px; padding-top: 17px; }
  .feed-column { min-height: 445px; padding: 17px; }
  .discussion-empty { min-height: 285px; padding-inline: 10px; }
  .community-sidebar { grid-template-columns: 1fr; }
  .community-footer { flex-wrap: wrap; justify-content: center; padding: 15px 0; }
}
@media (max-width: 430px) {
  .community-header { align-items: flex-start; flex-wrap: wrap; padding: 10px 0; gap: 8px; }
  .community-header .header-actions { width: 100%; display: grid; grid-template-columns: repeat(3,1fr); }
  .community-header .header-link { padding-inline: 5px; text-align: center; }
  .feed-toolbar { align-items: start; flex-direction: column; }
  .search-box { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; } }

/* Local community feed and posting UI */
.status-dot.is-online { background: #68a56f; box-shadow: 0 0 0 4px #68a56f1c; }
.status-dot.is-offline { background: #c26b5d; box-shadow: 0 0 0 4px #c26b5d1c; }
.discussion-empty[hidden], .comments-section[hidden] { display: none; }
.discussion-list { display: grid; gap: 12px; padding-top: 16px; }
.feed-message { margin: 0; padding: 22px 10px; color: var(--muted); font-size: 12px; text-align: center; }
.feed-message.is-error { color: #a44b42; }
.post-card { padding: 17px; border: 1px solid #e8ece6; border-radius: 12px; background: rgba(255,255,255,.78); }
.post-meta { display: flex; align-items: center; gap: 9px; }
.author-avatar { display: grid; width: 33px; height: 33px; flex: 0 0 33px; place-items: center; border-radius: 50%; background: #e8efe6; color: var(--forest); font-size: 12px; font-weight: 700; }
.author-info { display: grid; flex: 1; gap: 3px; }
.author-info strong { color: var(--ink); font-size: 11px; font-weight: 620; }
.author-info time, .comment-meta time { color: #909890; font-size: 9px; }
.post-category { padding: 5px 8px; border-radius: 999px; background: #edf3ec; color: var(--forest); font-size: 9px; }
.post-title { margin: 14px 0 6px; color: var(--ink); font-size: 15px; font-weight: 650; line-height: 1.4; }
.post-body { margin: 0; color: #5e685f; font-size: 12px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.post-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 13px; padding-top: 11px; border-top: 1px solid #edf0eb; }
.comments-toggle { padding: 4px 0; border: 0; background: transparent; color: var(--forest); font: inherit; font-size: 10px; cursor: pointer; }
.comments-toggle:hover { text-decoration: underline; }
.comments-section { display: grid; gap: 9px; padding-top: 12px; }
.comment-item { padding: 10px; border-radius: 9px; background: #f4f6f2; }
.comment-meta { display: flex; justify-content: space-between; gap: 10px; }
.comment-meta strong { color: var(--ink); font-size: 10px; }
.comment-item p, .no-comments { margin: 7px 0 0; color: #5e685f; font-size: 11px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.no-comments { margin: 0; }
.no-comments.is-error { color: #a44b42; }
.post-dialog { width: min(500px, calc(100% - 28px)); max-height: min(90vh, 760px); padding: 0; overflow: auto; border: 1px solid var(--line); border-radius: 17px; background: #fbfcfa; color: var(--ink); box-shadow: 0 26px 90px #17251c3b; }
.post-dialog::backdrop { background: #17251c70; backdrop-filter: blur(3px); }
.post-form { display: grid; gap: 14px; padding: 23px; }
.dialog-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 2px; }
.dialog-heading .eyebrow { margin-bottom: 7px; }
.dialog-heading h2 { margin: 0; font-size: 20px; }
.dialog-close { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 50%; background: white; color: var(--muted); font-size: 19px; cursor: pointer; }
.post-form label { display: grid; gap: 6px; color: #414b42; font-size: 11px; font-weight: 600; }
.post-form input, .post-form select, .post-form textarea { width: 100%; min-height: 39px; padding: 10px 11px; border: 1px solid #dfe5dc; border-radius: 8px; outline: none; background: white; color: var(--ink); font: inherit; font-size: 12px; }
.post-form textarea { min-height: 110px; resize: vertical; }
.post-form input:focus, .post-form select:focus, .post-form textarea:focus { border-color: #8da58f; box-shadow: 0 0 0 3px #557a5f18; }
.form-error { min-height: 15px; margin: 0; color: #a44b42; font-size: 11px; }
.form-actions { display: flex; justify-content: end; gap: 9px; }
.form-actions button { min-height: 38px; padding: 0 13px; border-radius: 8px; font: inherit; font-size: 11px; cursor: pointer; }
.secondary-action { border: 1px solid var(--line); background: white; color: var(--muted); }
.form-actions .primary-action { min-height: 38px; }
.form-actions .primary-action:disabled { opacity: .6; cursor: wait; }
.community-message.is-error { background: #fbefed; color: #a44b42; }
.comment-form { display: grid; grid-template-columns: minmax(90px, .55fr) minmax(100px, 1fr) auto; gap: 6px; padding-top: 5px; }
.comment-form input { min-width: 0; height: 34px; padding: 0 9px; border: 1px solid var(--line); border-radius: 7px; outline: none; background: white; color: var(--ink); font: inherit; font-size: 10px; }
.comment-form input:focus { border-color: #8da58f; }
.comment-form button { padding: 0 10px; border: 0; border-radius: 7px; background: var(--forest); color: white; font: inherit; font-size: 10px; cursor: pointer; }
.comment-form button:disabled { opacity: .6; cursor: wait; }
@media (max-width: 560px) { .comment-form { grid-template-columns: 1fr auto; } .comment-form input:first-child { grid-column: 1 / -1; } }
.feed-controls { display: flex; align-items: center; gap: 7px; }
.sort-control select { min-height: 38px; padding: 0 9px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.9); color: var(--forest); font: inherit; font-size: 10px; }
.load-more-button { display: block; margin: 16px auto 0; padding: 9px 14px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.8); color: var(--forest); font: inherit; font-size: 11px; cursor: pointer; }
.load-more-button:hover { background: #edf3ec; }
.load-more-button[hidden] { display: none; }
@media (max-width: 560px) { .feed-controls { width: 100%; } .sort-control select { min-width: 96px; } }

/* Board layout: discovery controls stay together above the discussion stream. */
.board-controls { margin: 25px 0 16px; padding: 20px 22px 12px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.88); backdrop-filter: blur(12px); box-shadow: 0 14px 40px #263b2a0b; }
.board-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.board-heading .eyebrow { margin: 0 0 6px; }
.board-heading h2 { margin: 0; color: var(--ink); font-size: 20px; font-weight: 620; letter-spacing: -.035em; }
.board-hint { color: var(--muted); font-size: 11px; }
.board-filter-line { display: flex; gap: 9px; }
.board-filter-line .search-box { flex: 1; width: auto; min-height: 42px; }
.board-filter-line .sort-control select { min-height: 42px; }
.board-controls .filter-row { padding: 12px 0 0; border: 0; }
.discussion-area { display: grid; grid-template-columns: minmax(0, 1fr) 270px; align-items: start; gap: 16px; }
.discussion-area .feed-column, .discussion-area .sidebar-card { border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.88); backdrop-filter: blur(12px); box-shadow: 0 14px 40px #263b2a0b; }
.discussion-area .feed-column { min-height: 360px; padding: 14px; }
.discussion-list { padding-top: 0; gap: 10px; }
.post-card { padding: 17px 19px; border-radius: 12px; }
.post-meta { gap: 10px; }
.author-info small { color: #869087; font-size: 9px; }
.post-title { font-size: 16px; }
.post-footer { justify-content: start; }
.community-sidebar { gap: 12px; }
.discussion-area .sidebar-card { padding: 18px; }
.account-button { cursor: pointer; font: inherit; }
.account-button.is-signed-in { border-color: #cbdaca; border-radius: 999px; background: #edf3ec; color: var(--forest); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border: 1px solid #e7ebe5; border-radius: 9px; background: #f4f6f3; }
.auth-tab { min-height: 34px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font: inherit; font-size: 11px; cursor: pointer; }
.auth-tab.is-active { background: white; color: var(--forest); box-shadow: 0 1px 5px #1f33200f; font-weight: 650; }
#auth-form { display: grid; gap: 12px; }
#register-fields { display: grid; gap: 12px; }
#register-fields[hidden], #login-fields[hidden] { display: none; }
.auth-help { margin: -2px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.auth-submit { width: 100%; }
.profile-summary { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 10px; background: #f1f5ef; }
.profile-avatar { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 50%; background: var(--forest); color: white; font-size: 15px; font-weight: 700; }
.profile-summary strong, .profile-summary small { display: block; }
.profile-summary strong { color: var(--ink); font-size: 12px; }
.profile-summary small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.comment-form { grid-template-columns: minmax(0, 1fr) auto; }
.comment-form input { height: 38px; font-size: 11px; }
.comment-form button { padding-inline: 14px; font-size: 11px; }
@media (max-width: 780px) { .discussion-area { grid-template-columns: 1fr; } .community-sidebar { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 560px) { .community-grid { grid-template-columns: 1fr; } .board-controls { margin-top: 16px; padding: 16px 14px 10px; } .board-heading { align-items: start; flex-direction: column; } .board-filter-line { flex-direction: column; } .board-filter-line .sort-control select { width: 100%; } .discussion-area .feed-column { padding: 9px; } .post-card { padding: 14px; } .community-sidebar { grid-template-columns: 1fr; } .community-header .header-actions { grid-template-columns: repeat(4,1fr); } }

/* Discord-like FreeLand chat: the room browser owns the left rail; the selected room owns the canvas. */
.chat-page { min-height: 100vh; height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.chat-header { width: min(1320px, calc(100% - 52px)); min-height: 68px; flex: 0 0 68px; margin-inline: auto; }
.chat-header .header-actions { align-items: center; }
.chat-shell { width: min(1320px, calc(100% - 52px)); min-height: 0; flex: 1; display: grid; grid-template-columns: 285px minmax(0,1fr); margin: 0 auto 12px; overflow: hidden; border: 1px solid #dfe5dc; border-radius: 16px; background: rgba(255,255,255,.77); box-shadow: 0 18px 55px #25382a12; backdrop-filter: blur(16px); }
.room-sidebar { min-height: 0; display: flex; flex-direction: column; border-right: 1px solid #e6eae4; background: rgba(250,251,249,.8); }
.sidebar-title { display: flex; align-items: center; justify-content: space-between; padding: 21px 17px 14px; }
.sidebar-title .eyebrow { margin: 0 0 5px; font-size: 8px; letter-spacing: .12em; }
.sidebar-title h1 { margin: 0; color: var(--ink); font-size: 17px; letter-spacing: -.04em; }
.sidebar-add { width: 31px; height: 31px; border: 1px solid #dfe6dc; border-radius: 9px; background: white; color: var(--forest); font-size: 18px; cursor: pointer; }
.sidebar-add:hover { background: #edf3ec; }
.room-search { display: flex; align-items: center; gap: 8px; min-height: 37px; margin: 0 13px 17px; padding: 0 9px; border: 1px solid #e2e7e0; border-radius: 9px; background: white; color: #7e897f; }
.room-search > span { font-size: 19px; }
.room-search input { width: 100%; min-width: 0; padding: 0; border: 0; outline: none; background: transparent; color: var(--ink); font: inherit; font-size: 10px; }
.room-search kbd { white-space: nowrap; padding: 2px 4px; border: 1px solid #e8ece6; border-radius: 4px; color: #969e96; font: 9px inherit; }
.room-list-heading { display: flex; justify-content: space-between; padding: 0 16px 8px; color: #929b92; font-size: 8px; font-weight: 700; letter-spacing: .1em; }
.room-tree { min-height: 0; flex: 1; overflow-y: auto; padding: 0 8px 12px; }
.room-loading { padding: 9px; color: var(--muted); font-size: 11px; }
.room-group { margin-bottom: 8px; }
.room-group-top { display: flex; align-items: center; gap: 3px; }
.room-group-button { min-width: 0; flex: 1; display: flex; align-items: center; gap: 8px; padding: 8px; border: 0; border-radius: 7px; background: transparent; color: #344137; text-align: left; cursor: pointer; }
.room-group-button:hover, .room-link:hover { background: #edf2eb; }
.room-group-button.is-active, .room-link.is-active { background: #e8f0e7; color: var(--forest); }
.room-topic-mark { width: 22px; height: 22px; flex: 0 0 22px; display: grid; place-items: center; border-radius: 6px; background: #edf2eb; color: var(--forest); font-size: 10px; }
.room-group-button strong { min-width: 0; flex: 1; overflow: hidden; color: inherit; font-size: 10px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.room-activity { color: #9aa39a; font-size: 8px; }
.room-group-toggle { width: 20px; height: 25px; border: 0; background: transparent; color: #929b92; cursor: pointer; }
.room-group-toggle::before { content: '⌄'; display: inline-block; transition: transform .15s ease; }
.room-group.is-collapsed .room-group-toggle::before { transform: rotate(-90deg); }
.room-children { display: grid; gap: 2px; margin: 2px 0 2px 20px; padding-left: 8px; border-left: 1px solid #e5eae2; }
.room-group.is-collapsed .room-children { display: none; }
.room-link { min-width: 0; display: flex; align-items: center; gap: 7px; padding: 7px 8px; border: 0; border-radius: 7px; background: transparent; color: #677167; text-align: left; cursor: pointer; }
.room-hash { color: #9ba59c; font-size: 13px; }
.room-link strong { flex: 1; overflow: hidden; font-size: 10px; font-weight: 520; text-overflow: ellipsis; white-space: nowrap; }
.room-unread { width: 5px; height: 5px; border-radius: 50%; background: #d384a3; }
.room-empty { padding: 18px 10px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.sidebar-bottom { display: grid; gap: 8px; padding: 10px; border-top: 1px solid #e6eae4; }
.sidebar-bottom .connection-status { padding: 0 5px; font-size: 9px; }
.sidebar-profile { min-width: 0; display: flex; align-items: center; gap: 9px; padding: 8px; border: 0; border-radius: 9px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.sidebar-profile:hover { background: #edf2eb; }
.mini-avatar { width: 31px; height: 31px; flex: 0 0 31px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: #e1ebe0; color: var(--forest); font-size: 11px; font-weight: 700; }
.mini-avatar img { width: 100%; height: 100%; object-fit: cover; }
.mini-user { min-width: 0; flex: 1; }
.mini-user strong, .mini-user small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-user strong { color: var(--ink); font-size: 10px; }
.mini-user small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.chat-panel { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: rgba(255,255,255,.38); }
.room-header { min-height: 64px; display: flex; align-items: center; gap: 11px; padding: 0 21px; border-bottom: 1px solid #e8ece6; background: rgba(255,255,255,.45); }
.room-title-icon { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; background: #edf3ec; color: var(--forest); font-size: 17px; font-weight: 650; }
.room-title-copy { min-width: 0; flex: 1; }
.room-title-copy h2 { margin: 0; color: var(--ink); font-size: 13px; font-weight: 650; }
.room-title-copy p { overflow: hidden; margin: 4px 0 0; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.room-header-status { color: #889288; font-size: 9px; }
.chat-empty { flex: 1; display: grid; align-content: center; justify-items: center; padding: 25px; text-align: center; }
.chat-empty-icon { width: 47px; height: 47px; display: grid; place-items: center; border: 1px solid #e2e9e0; border-radius: 15px; background: #f5f8f4; color: var(--forest); font-size: 20px; }
.chat-empty h2 { margin: 17px 0 6px; color: var(--ink); font-size: 19px; letter-spacing: -.04em; }
.chat-empty p { max-width: 330px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.chat-empty[hidden], .chat-messages[hidden] { display: none; }
.chat-messages { min-height: 0; flex: 1; overflow-y: auto; padding: 18px 24px 16px; scroll-behavior: smooth; }
.chat-room-welcome { margin: 4px 0 22px; padding: 19px; border: 1px solid #e7ece5; border-radius: 12px; background: rgba(255,255,255,.65); }
.chat-room-welcome .welcome-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: #edf3ec; color: var(--forest); font-size: 18px; }
.chat-room-welcome h3 { margin: 12px 0 4px; color: var(--ink); font-size: 16px; }
.chat-room-welcome p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.chat-day { display: flex; align-items: center; gap: 12px; margin: 17px 0 12px; color: #97a097; font-size: 8px; }
.chat-day::before, .chat-day::after { height: 1px; flex: 1; background: #e7ebe5; content: ''; }
.chat-message { display: flex; gap: 10px; padding: 7px 0; }
.chat-message:hover { border-radius: 8px; background: #ffffff58; }
.chat-avatar { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: #e6eee4; color: var(--forest); font-size: 10px; font-weight: 700; }
.chat-avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-message-content { min-width: 0; flex: 1; }
.chat-message-meta { display: flex; align-items: baseline; gap: 7px; }
.chat-message-meta strong { color: #344137; font-size: 10px; font-weight: 650; }
.chat-message-meta time { color: #9aa29a; font-size: 8px; }
.chat-message-content p { margin: 4px 0 0; color: #59645b; font-size: 11px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-composer { position: relative; display: grid; grid-template-columns: minmax(0,1fr) 35px; align-items: center; gap: 8px; margin: 0 19px 14px; padding: 9px 10px 18px 13px; border: 1px solid #dfe5dc; border-radius: 12px; background: rgba(255,255,255,.9); box-shadow: 0 5px 20px #243b2907; }
.message-composer textarea { width: 100%; max-height: 160px; min-height: 28px; resize: none; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: 11px; line-height: 1.55; }
.message-composer textarea::placeholder { color: #a1a9a1; }
.message-composer button { width: 32px; height: 32px; border: 0; border-radius: 9px; background: var(--forest); color: white; font-size: 19px; cursor: pointer; }
.message-composer button:disabled { background: #dfe5dc; color: #9ca59c; cursor: default; }
.message-composer small { position: absolute; right: 56px; bottom: 5px; color: #a0a8a0; font-size: 8px; }
.chat-footer { width: min(1320px, calc(100% - 52px)); min-height: 24px; flex: 0 0 24px; display: flex; justify-content: space-between; margin: 0 auto; color: #899289; font-size: 8px; }
.chat-footer a { color: var(--forest); text-decoration: none; }
.profile-summary { position: relative; }
.profile-image { width: 44px; height: 44px; display: none; border-radius: 50%; object-fit: cover; }
.profile-image.is-visible { display: block; }
.profile-avatar.is-hidden { display: none; }
.image-picker { margin-left: auto; padding: 7px 9px; border: 1px solid #dfe6dc; border-radius: 7px; background: white; color: var(--forest); font-size: 9px; cursor: pointer; }
.image-picker:hover { background: #edf3ec; }
.image-status { margin: -7px 0 0; color: var(--muted); font-size: 9px; }
@media (max-width: 720px) {
 .chat-page { height: 100dvh; }
 .chat-header { width: calc(100% - 26px); min-height: 58px; flex-basis: 58px; }
 .chat-header .header-link:not(.account-button) { display: none; }
 .chat-shell { position: relative; width: calc(100% - 18px); grid-template-columns: 225px minmax(0,1fr); margin-bottom: 8px; }
 .sidebar-title { padding: 15px 12px 11px; }
 .room-search { margin-inline: 9px; }
 .room-header { padding-inline: 12px; }
 .chat-messages { padding-inline: 12px; }
 .message-composer { margin-inline: 9px; }
 .chat-footer { width: calc(100% - 26px); }
 .chat-header .theme-toggle { display: inline-flex; }
}
@media (max-width: 520px) {
 .chat-header { min-height: 53px; flex-basis: 53px; }
 .chat-header .brand { font-size: 12px; }
 .chat-header .brand-logo { width: 28px; height: 28px; }
 .chat-shell { grid-template-columns: 1fr; }
 .room-sidebar, .chat-panel { grid-area: 1 / 1; }
 .chat-panel { display: none; }
 .chat-shell.has-active-room .room-sidebar { display: none; }
 .chat-shell.has-active-room .chat-panel { display: flex; }
 .room-header { min-height: 57px; }
 .room-header::before { content: '‹'; margin-right: 1px; color: var(--forest); font-size: 22px; cursor: pointer; }
 .chat-footer { min-height: 20px; flex-basis: 20px; }
 .chat-messages { padding: 13px 10px; }
 .chat-room-welcome { padding: 14px; }
 .message-composer small { display: none; }
 .message-composer { padding-bottom: 9px; }
}

.mobile-room-back { display: none; width: 24px; height: 30px; border: 0; background: transparent; color: var(--forest); font-size: 23px; cursor: pointer; }
@media (max-width: 520px) { .room-header::before { display: none; } .mobile-room-back { display: block; } }

html[data-theme="dark"] .chat-shell,
html[data-theme="dark"] .feed-column,
html[data-theme="dark"] .sidebar-card,
html[data-theme="dark"] .board-controls,
html[data-theme="dark"] .discussion-area .feed-column,
html[data-theme="dark"] .discussion-area .sidebar-card { border-color: var(--line); background: rgba(27,35,29,.9); color: var(--ink); }
html[data-theme="dark"] .room-sidebar { border-color: var(--line); background: rgba(23,30,25,.9); }
html[data-theme="dark"] .chat-panel { background: rgba(20,27,22,.52); }
html[data-theme="dark"] .room-header { border-color: var(--line); background: rgba(28,36,30,.72); }
html[data-theme="dark"] .room-group-button,
html[data-theme="dark"] .room-link,
html[data-theme="dark"] .chat-message-content p,
html[data-theme="dark"] .chat-message-meta strong { color: var(--ink); }
html[data-theme="dark"] .room-group-button:hover,
html[data-theme="dark"] .room-link:hover,
html[data-theme="dark"] .room-group-button.is-active,
html[data-theme="dark"] .room-link.is-active,
html[data-theme="dark"] .sidebar-profile:hover { background: #354438; color: #e5f0e2; }
html[data-theme="dark"] .room-topic-mark,
html[data-theme="dark"] .room-title-icon,
html[data-theme="dark"] .chat-empty-icon,
html[data-theme="dark"] .chat-room-welcome .welcome-mark,
html[data-theme="dark"] .author-avatar,
html[data-theme="dark"] .chat-avatar,
html[data-theme="dark"] .mini-avatar { background: #344638; color: #d6e8d2; }
html[data-theme="dark"] .room-search,
html[data-theme="dark"] .post-dialog,
html[data-theme="dark"] .post-form input,
html[data-theme="dark"] .post-form select,
html[data-theme="dark"] .post-form textarea,
html[data-theme="dark"] .comment-form input,
html[data-theme="dark"] .message-composer,
html[data-theme="dark"] .image-picker,
html[data-theme="dark"] .dialog-close,
html[data-theme="dark"] .secondary-action,
html[data-theme="dark"] .auth-tabs,
html[data-theme="dark"] .auth-tab.is-active { border-color: var(--line); background: #242e27; color: var(--ink); }
html[data-theme="dark"] .room-search input,
html[data-theme="dark"] .post-form input,
html[data-theme="dark"] .post-form select,
html[data-theme="dark"] .post-form textarea,
html[data-theme="dark"] .comment-form input,
html[data-theme="dark"] .message-composer textarea { color: var(--ink); }
html[data-theme="dark"] .chat-room-welcome,
html[data-theme="dark"] .post-card,
html[data-theme="dark"] .comment-item,
html[data-theme="dark"] .profile-summary,
html[data-theme="dark"] .auth-tabs,
html[data-theme="dark"] .filter-chip.is-active,
html[data-theme="dark"] .post-category { border-color: var(--line); background: #29352c; color: var(--ink); }
html[data-theme="dark"] .chat-day::before,
html[data-theme="dark"] .chat-day::after,
html[data-theme="dark"] .room-children { border-color: var(--line); background-color: var(--line); }
html[data-theme="dark"] .sidebar-bottom,
html[data-theme="dark"] .room-header,
html[data-theme="dark"] .room-children { border-color: var(--line); }
html[data-theme="dark"] .filter-chip:hover,
html[data-theme="dark"] .load-more-button:hover { background: #344638; }
