.community-page { padding-block: 32px 56px; }
.community-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.community-heading h1, .community-gate h1 { margin: 7px 0 8px; font-size: clamp(2rem,4vw,3rem); letter-spacing: -.04em; }
.community-heading p { margin: 0; color: var(--muted); font-size: 1rem; }
.community-heading .eyebrow { font-size: .8rem; letter-spacing: .12em; font-weight: 800; }
.community-layout { display: grid; grid-template-columns: minmax(0,1fr) 290px; gap: 24px; align-items: start; }
.community-chat { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: white; box-shadow: 0 8px 24px #0f4c5c08; }
.community-room-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 20px 24px; background: var(--navy); color: white; }
.community-room-head h2 { color: white; margin: 0 0 4px; font-size: 1.25rem; }
.community-room-head p { margin: 0; color: #e1efed; font-size: .875rem; }
.community-room-icon svg { width: 30px; height: 30px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.community-connection { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 24px 4px; min-height: 38px; color: var(--muted); font-size: .8125rem; }
.community-connection button { padding: 5px 0; color: var(--navy); font-weight: 700; font-size: .875rem; flex-shrink: 0; }
.community-history { text-align: center; padding: 8px 20px; }
.community-history .textlink { font-size: .875rem; }
.community-messages { height: clamp(280px,48vh,540px); overflow-y: auto; overscroll-behavior: contain; padding: 10px 24px 22px; scrollbar-gutter: stable; }
.community-message { display: flex; gap: 11px; margin-top: 20px; }
.community-message:first-child { margin-top: 0; }
.community-avatar { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%; background: #e5f1ef; color: var(--navy); overflow: hidden; font-size: .8125rem; font-weight: 800; }
.community-avatar img { width: 100%; height: 100%; object-fit: cover; }
.community-message-content { min-width: 0; flex: 1; border: 1px solid #e2ebe9; border-radius: 3px 15px 15px; padding: 12px 15px; background: #fafcfb; }
.community-message.is-own .community-message-content { background: #edf7f3; border-color: #d1e7df; }
.community-message-meta { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 5px 16px; }
.community-message-meta strong { font-size: .875rem; overflow-wrap: anywhere; }
.community-message-meta strong span { font-weight: 400; }
.community-message-meta time { color: #587078; font-size: .75rem; white-space: nowrap; }
.community-message-content > p { white-space: pre-wrap; overflow-wrap: anywhere; margin: 8px 0 0; line-height: 1.6; font-size: 1rem; }
.community-message-content blockquote { display: grid; gap: 4px; margin: 9px 0; padding: 8px 12px; border-left: 3px solid #7dad9e; border-radius: 0 8px 8px 0; background: #0f4c5c08; font-size: .875rem; overflow-wrap: anywhere; }
.community-message-content blockquote span { white-space: pre-wrap; color: #4f6b71; }
.community-message-actions { display: flex; gap: 18px; margin-top: 7px; }
.community-message-actions button { font-size: .875rem; color: #356773; min-height: 30px; padding: 4px 0; }
.community-message-actions button:hover { text-decoration: underline; text-underline-offset: 3px; }
.community-message .community-deleted { font-style: italic; color: #61797f; font-size: .875rem; }
.community-empty { padding: 48px 15px; text-align: center; color: var(--muted); max-width: 420px; margin: auto; }
.community-empty > span { display: inline-grid; place-items: center; width: 60px; height: 60px; background: #e5f1ef; color: var(--navy); border-radius: 18px; }
.community-empty svg { width: 30px; height: 30px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.community-empty h3 { color: var(--navy); margin: 18px 0 8px; font-size: 1.2rem; }
.community-empty p { line-height: 1.6; font-size: 1rem; }
.community-new { display: block; margin: 0 auto 12px; border-radius: 18px; padding: 8px 15px; background: var(--navy); color: white; font-size: .875rem; }
.community-compose { padding: 18px 24px; border-top: 1px solid var(--line); background: #fffcf7; }
.community-compose > label { display: block; font-size: .875rem; font-weight: 800; margin-bottom: 8px; }
.community-compose textarea { display: block; width: 100%; min-height: 85px; max-height: 260px; resize: vertical; border: 1px solid #b7cfcd; border-radius: 12px; padding: 12px 14px; background: white; font: inherit; font-size: 1rem; line-height: 1.5; color: var(--navy); }
.community-compose textarea:focus { outline: 2px solid var(--navy); outline-offset: 2px; }
.community-compose-actions { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
.community-compose-actions small { flex: 1; font-size: .8125rem; color: #526d76; }
.community-compose-actions > span { font-size: .75rem; color: #526d76; }
.community-compose-actions .btn { min-height: 42px; }
.community-form-status { margin: 8px 0 0; font-size: .875rem; color: #506b74; overflow-wrap: anywhere; }
.community-form-status:empty { display: none; }
.community-reply-draft { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; margin-bottom: 12px; border-left: 3px solid var(--navy); background: #e9f3ef; border-radius: 8px; font-size: .875rem; }
.community-reply-draft > span { min-width: 0; }
.community-reply-draft small { display: block; overflow-wrap: anywhere; margin-top: 4px; }
.community-reply-draft button { flex-shrink: 0; width: 36px; height: 36px; }
.community-reply-draft svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }
.community-sidebar { display: grid; gap: 18px; min-width: 0; }
.community-sidebar section { padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: white; }
.community-sidebar h2 { font-size: 1.05rem; margin: 0 0 17px; }
.community-sidebar p { font-size: .875rem; line-height: 1.55; color: #526d76; }
.community-sidebar small { display: block; line-height: 1.5; font-size: .8125rem; color: #526d76; }
.community-switch { display: flex; align-items: center; gap: 10px; position: relative; cursor: pointer; font-size: .875rem; font-weight: 700; }
.community-switch input { position: absolute; left: 0; width: 42px; height: 26px; opacity: 0; cursor: pointer; }
.community-toggle { flex: 0 0 42px; width: 42px; height: 26px; border-radius: 15px; background: #a4b4b8; padding: 3px; }
.community-toggle::before { display: block; content: ''; width: 20px; height: 20px; background: white; border-radius: 50%; transition: transform .15s ease; box-shadow: 0 1px 3px #0002; }
.community-switch input:checked + .community-toggle { background: #257258; }
.community-switch input:checked + .community-toggle::before { transform: translateX(16px); }
.community-switch input:focus-visible + .community-toggle { outline: 2px solid var(--navy); outline-offset: 3px; }
.community-switch input:disabled + .community-toggle { opacity: .5; }
.community-people h2 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.community-people h2 > span { display: inline-grid; place-items: center; min-width: 25px; height: 25px; padding: 0 6px; background: #e5f1ef; border-radius: 12px; font-size: .8125rem; }
.community-person { display: flex; align-items: center; gap: 10px; margin-top: 15px; font-size: .875rem; }
.community-person > span:nth-child(2) { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.community-online { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; background: #257258; }
.community-sidebar .community-care { background: #f9f4e8; border: 0; }
.community-care h2 { margin-bottom: 12px; }
.community-care p:last-child { margin-bottom: 0; }
.community-gate { padding-block: 56px; }
.community-gate > p { font-size: 1.1rem; max-width: 580px; color: var(--muted); }
.community-gate-card { max-width: 610px; margin-top: 28px; padding: 30px; background: white; border: 1px solid var(--line); border-radius: 20px; }
.community-gate-card h2 { font-size: 1.4rem; }
.community-home-link { display: flex; align-items: center; gap: 17px; padding: 22px 26px; margin-top: 26px; background: #e5f1ef; border: 1px solid #d2e3de; border-radius: 18px; color: var(--navy); text-decoration: none; }
.community-home-link > svg { width: 30px; height: 30px; stroke: currentColor; fill: none; stroke-width: 1.7; flex-shrink: 0; }
.community-home-link span { display: grid; gap: 5px; }
.community-home-link b { font-size: 1.15rem; }
.community-home-link small { font-size: .875rem; color: #526d76; }
.community-page button:disabled { cursor: wait; opacity: .6; }
.community-page [hidden] { display: none !important; }
@media(max-width: 1180px) {
  .header nav { display: none; }
  .header .menu-btn { display: grid; }
  .header nav.open { display: flex; position: absolute; left: 0; right: 0; top: 92px; z-index: 40; flex-direction: column; align-items: stretch; gap: 0; padding: 17px 30px; background: white; box-shadow: 0 12px 20px #0f4c5c19; }
  .header nav.open a { padding: 11px 0; }
}
@media(max-width: 860px) {
  .community-layout { grid-template-columns: minmax(0,1fr); }
  .community-sidebar { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .community-sidebar .community-care { grid-column: 1 / -1; }
  .community-messages { height: 48vh; min-height: 290px; }
}
@media(max-width: 740px) { .header nav.open { top: 75px; } }
@media(max-width: 540px) {
  .community-page { padding-top: 22px; }
  .community-heading { align-items: start; gap: 12px; }
  .community-heading > a { font-size: .875rem; flex-shrink: 0; margin-top: 6px; }
  .community-heading h1 { font-size: 2rem; }
  .community-room-head, .community-compose { padding: 17px; }
  .community-connection { padding-inline: 17px; }
  .community-messages { padding-inline: 12px; }
  .community-message { gap: 7px; }
  .community-message > .community-avatar { width: 29px; height: 29px; flex-basis: 29px; font-size: .75rem; }
  .community-message-content { padding: 11px; }
  .community-compose-actions { flex-wrap: wrap; gap: 10px; }
  .community-compose-actions small { flex-basis: 100%; }
  .community-compose-actions .btn { margin-left: auto; }
  .community-sidebar { grid-template-columns: minmax(0,1fr); }
  .community-gate-card { padding: 22px; }
}
@media(prefers-reduced-motion: reduce) { .community-toggle::before { transition: none; } }
