.community-top{padding-block:36px}
.community-intro{display:flex;align-items:center;justify-content:space-between;gap:32px}
.community-intro>div{min-width:0}
.community-top h1{font-size:clamp(34px,4vw,48px)}
.community-top .eyebrow{margin-bottom:12px}
.community-top p{max-width:650px;margin:12px 0 0;font-size:16px}
.community-actions{display:flex;gap:12px;flex-shrink:0}
.community-actions .button{gap:8px;min-height:48px;white-space:nowrap;margin:0}
.community-actions svg{flex-shrink:0}
.community-layout{padding-block:36px 48px}
.community-feed{min-width:0}
#community-search-panel[hidden]{display:none}
#community-search-panel{padding:24px;border:1px solid var(--line);border-radius:18px;background:var(--mint);margin-bottom:24px;scroll-margin-top:110px}
.community-search-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:20px}
.community-search-heading h2{font-size:28px}
.community-search-heading .text-link{background:transparent;border:0;border-bottom:1px solid var(--teal)}
.community-tools{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:20px;align-items:end}
.community-search{margin:0;font-size:14px;font-weight:600}
.community-search input{margin-top:8px;width:100%;min-height:48px}
.community-tools .sort-control{display:grid;gap:8px;margin:0;font-size:14px}
.community-tools select{min-height:48px;font-size:14px}
.community-topics{margin-top:20px}
.community-topics .filters{margin:0;gap:8px}
.community-topics button{font-size:13px;min-height:44px;padding:8px 13px}
#story-results{margin:0 0 20px;color:var(--muted)}
#story-results:empty{display:none}
.community-feed-heading{font-size:28px;margin:0 0 20px}
.community-highlights{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px}
.community-story{min-width:0;box-shadow:none}
.community-story .card-body{display:flex;flex-direction:column;height:100%;padding:28px}
.community-story-labels{display:flex;align-items:center;flex-wrap:wrap;gap:8px 12px;font-size:13px;line-height:1.5}
.story-topic{color:var(--teal);border:1px solid var(--line);border-radius:20px;padding:4px 10px;background:var(--paper);font-weight:600}
.story-demo{color:var(--muted)}
.community-story h3{font-size:clamp(26px,3vw,34px);line-height:1.16;margin:20px 0 0;text-wrap:initial}
.community-story .card-body>p{max-width:65ch;flex:1;font-size:16px;line-height:1.7;margin:16px 0}
.community-story .story-meta{padding:0;font-size:13px}
.community-story .story-actions{justify-content:space-between;gap:8px 20px;border-top:1px solid var(--line);padding-top:14px;margin-top:20px}
.highlighted-story{background:var(--mint);border:1px solid var(--line);border-top:3px solid var(--teal);border-radius:18px}
.highlighted-story:nth-child(2){border-top-color:var(--purple)}
:root[data-theme=dark] .highlighted-story{background:var(--mint)}
.community-more{margin-top:36px}
.community-story-list .community-story{border:0;border-bottom:1px solid var(--line);border-radius:0;background:transparent}
:root[data-theme=dark] .community-story-list .community-story{background:transparent}
.community-story-list .card-body{padding:24px 0}
.community-story-list h3{font-size:28px}
.community-story-list .story-actions{justify-content:flex-start;gap:24px;border-top:0;padding-top:0;margin-top:10px}
.community-footer-note{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-top:32px;padding:20px 0}
.community-footer-note p{font-size:14px;margin:0;max-width:55ch}
.community-footer-note .text-link{flex-shrink:0}
.community-rules{border-top:1px solid var(--line);padding-top:12px;scroll-margin-top:110px}
.community-rules summary{cursor:pointer;font-size:16px;font-weight:600;padding:12px 0}
.community-rules .guidelines{margin-top:20px}
@media(max-width:1000px){.community-intro{display:block}.community-actions{margin-top:22px}}
@media(max-width:600px){
 .community-top{padding-block:24px}
 .community-top p{font-size:15px}
 .community-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:20px;max-width:360px}
 .community-actions .button{padding:10px 8px;font-size:14px}
 .community-layout{padding-top:26px}
 .community-highlights{grid-template-columns:1fr;gap:18px}
 .community-story .card-body{padding:20px}
 .community-story h3{font-size:27px;margin-top:16px}
 .community-story .card-body>p{font-size:15px;margin:12px 0}
 .community-story .story-actions{margin-top:16px;padding-top:10px}
 .community-story-list .card-body{padding:20px 0}
 .community-story-list .story-actions{margin-top:10px;padding-top:0}
 .community-feed-heading{font-size:25px;margin-bottom:18px}
 #community-search-panel{padding:18px 16px}
 .community-tools{grid-template-columns:1fr;gap:14px}
 .community-tools .sort-control{display:flex;justify-content:space-between;align-items:center}
 .community-tools select{width:auto}
 .community-search input{font-size:16px}
 .community-footer-note{display:block;margin-top:24px;padding:0 0 20px}
 .community-footer-note .text-link{margin-top:12px}
}

.story-page .story-full{padding-bottom:24px;border-bottom:1px solid var(--line)}
.story-page .story-body{max-width:65ch}
.story-page .comment{border-radius:12px;padding:20px;background:var(--paper);border:1px solid var(--line)}
.story-page #comment-form{gap:18px;padding:24px;border-radius:16px;background:var(--paper)}
:root[data-theme=dark] .story-page #comment-form{background:var(--paper)}
.comment-compose-heading{padding-bottom:16px;border-bottom:1px solid var(--line)}
#comment-form .comment-compose-heading h3{margin:0 0 8px;font-size:25px}
#comment-form #comment-mode{margin:0;color:var(--muted);font-size:13px;line-height:1.6}
.comment-writing{display:grid;gap:8px}
#comment-form textarea{min-height:110px;line-height:1.6}
#comment-form .counter{margin:0;font-size:13px}
#comment-form label{font-size:14px}
#comment-form .comment-nickname{max-width:360px}
#nickname-hint{font-size:13px;font-weight:400;color:var(--muted)}
#comment-form .check{font-size:13px;line-height:1.6;gap:10px;max-width:620px;align-items:flex-start}
#comment-form .button{justify-self:start;min-height:46px;padding-inline:24px}
#comment-form .form-error:empty,#comment-result:empty{display:none}
#comment-form .comment-receipt{margin-bottom:0}
#comment-form .comment-reminder{font-size:13px;line-height:1.6;margin:0;color:var(--muted)}
.share-page{max-width:720px;padding-block:32px 48px}
.share-page h1{font-size:clamp(30px,4vw,40px);margin:20px 0 10px;text-wrap:initial}
.share-page #share-mode{font-size:14px;margin:0;color:var(--muted)}
.share-page #story-form{margin-top:24px;gap:20px}
.share-page #story-form textarea{min-height:180px;line-height:1.7}
.share-page #story-form label{font-size:14px}
.share-writing{display:grid;gap:7px}
.share-writing .counter{margin:0}
.share-details{display:grid;grid-template-columns:1fr 1fr;gap:20px;align-items:start}
.share-details label{display:block}
.share-details input,.share-details select{display:block;margin-top:7px}
.share-details .optional{font-weight:400;color:var(--muted)}
#share-reminder{margin:0;font-size:13px}
.share-page input,.share-page select,.share-page textarea{scroll-margin-block:120px 24px}
.share-page #story-form .button{justify-self:start}
.share-page #story-form .form-error:empty{display:none}
#story-preview{scroll-margin-top:110px}
.story-preview-panel{margin-top:32px;padding:24px;border:1px solid var(--line);border-radius:16px;background:var(--paper);overflow-wrap:anywhere}
.story-preview-panel h2{margin-top:16px}
.preview-body{white-space:pre-wrap;line-height:1.8}
@media(max-width:600px){
 .share-page{padding-top:16px;padding-bottom:32px}
 .share-page h1{font-size:30px;margin-top:14px}
 .share-page #story-form{margin-top:20px;gap:16px}
 .share-details{grid-template-columns:1fr;gap:16px}
 .share-page #story-form .button{justify-self:stretch;min-height:48px}
 .share-page .story-preview-panel{padding:20px 16px}
}
@media(max-width:600px){.story-page #comment-form{padding:20px 16px}#comment-form .comment-nickname{max-width:none}#comment-form .button{justify-self:stretch}}

/* The composer opens inline above the public comments. */
.story-page #comment-form[hidden]{display:none}
.comment-toggle{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:52px;margin:20px 0;padding:14px 18px;border:1px solid var(--line);border-radius:12px;background:var(--paper);color:var(--teal);font-size:16px;text-align:left}
.comment-toggle:hover{border-color:var(--teal)}
.story-page #comment-form{margin:0 0 24px}
.story-page .comments-section{margin-top:24px;padding-top:24px;border-top:0}

.story-page .comments-list{display:grid;gap:12px}

.story-page .story-footer{justify-content:flex-end}

.community-tabs{display:flex;gap:24px;border-bottom:1px solid var(--line);padding-top:8px}
.community-tabs a{display:flex;align-items:center;min-height:52px;padding:10px 2px;font-size:15px;font-weight:600;border-bottom:3px solid transparent;color:var(--muted)}
.community-tabs a[aria-current=page]{border-color:var(--teal);color:var(--teal)}
.message-board{max-width:820px;padding-block:30px 48px}
#board-form{padding:26px;border:1px solid var(--line);border-radius:18px;gap:12px;background:var(--mint)}
#board-mode{margin:0 0 4px;font-size:13px}
#board-form label{font-size:14px}
#board-form textarea{display:block;min-height:120px;margin-top:8px;line-height:1.6;font-size:16px}
#board-count{margin:0;font-size:13px}
.board-compose-bottom{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:20px;align-items:end}
.board-compose-bottom input{display:block;margin-top:8px}
.board-compose-bottom .button{min-height:48px}
#board-form .board-reminder{font-size:13px;margin:4px 0 0}
#board-form .form-error:empty,#board-status:empty,#board-receipt:empty{display:none}
#board-receipt{margin-top:20px;scroll-margin-top:110px}
.board-preview-body{white-space:pre-wrap;overflow-wrap:anywhere}
.board-feed{margin-top:36px}
.board-feed h2{font-size:28px;margin-bottom:22px}
#board-messages{list-style:none;margin:0;padding:0;display:grid;gap:16px}
.board-message{padding:22px;border:1px solid var(--line);border-radius:16px;background:var(--paper);min-width:0}
.board-message-meta{display:flex;justify-content:space-between;gap:8px 16px;flex-wrap:wrap;font-size:13px;color:var(--muted)}
.board-message-meta strong{color:var(--ink);overflow-wrap:anywhere}
.board-message p{font-size:16px;line-height:1.7;white-space:pre-wrap;overflow-wrap:anywhere;margin:14px 0 0}
#board-retry{background:transparent;border:0;color:var(--teal)}
@media(max-width:600px){.message-board{padding-top:24px}#board-form{padding:20px 16px}.board-compose-bottom{grid-template-columns:1fr;gap:16px}.board-compose-bottom .button{width:100%}.board-message{padding:18px}.board-message p{font-size:15px}}

#board-composer[hidden]{display:none}
.message-board #board-toggle{margin:0 0 20px}
.message-board .board-feed{margin-top:24px}

/* Bounded chat thread with the composer always below its own scroll area. */
.message-board{max-width:580px}
#board-panel[hidden]{display:none}
.board-chat{border:1px solid var(--line);border-radius:18px;overflow:hidden;background:var(--paper)}
.board-chat-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 18px;border-bottom:1px solid var(--line)}
.board-chat-heading h2{font-size:23px}
.message-board .board-feed{height:300px;height:clamp(180px,32svh,320px);overflow-y:auto;overscroll-behavior:contain;padding:18px;margin:0;background:var(--mint)}
.board-chat #board-messages{gap:12px}
.board-chat .board-message{padding:12px;border-radius:10px}
.board-chat .board-message p{font-size:14px;margin-top:6px;line-height:1.55}
.board-chat #board-form{padding:16px;border:0;border-top:1px solid var(--line);border-radius:0;background:var(--paper);gap:10px}
.board-chat #board-mode{margin:0;font-size:13px}
.board-name{display:grid;grid-template-columns:auto minmax(0,1fr);gap:10px;align-items:center}
.board-name input{min-height:44px;padding:8px 10px;font-size:16px}
.board-chat #board-form textarea{min-height:70px;height:70px;resize:vertical;max-height:150px;margin-top:6px}
.board-send-row{display:flex;align-items:center;justify-content:space-between;gap:10px}
.board-send-row .button{min-height:44px;font-size:14px;padding:10px 14px}
.board-chat #board-receipt{margin:0;max-height:160px;overflow:auto}
.board-chat #board-receipt .success{padding:14px;margin:0;font-size:13px}
@media(max-width:359px){.board-name{grid-template-columns:1fr;gap:5px}.board-chat #board-form{padding:12px}.board-chat-heading,.message-board .board-feed{padding:12px}.board-send-row .button{padding-inline:10px}}

/* Community chat launcher stays separate from the story navigation. */
.chat-bubble{position:fixed;right:22px;bottom:22px;z-index:28;width:56px;height:56px;display:grid;place-items:center;border:1px solid var(--teal);border-radius:50%;background:var(--teal);color:var(--on-teal);box-shadow:0 4px 18px #0003}
.community-chat-widget #board-panel{position:fixed;right:22px;bottom:90px;z-index:28;width:min(390px,calc(100% - 32px));height:min(640px,calc(100vh - 182px));height:min(640px,calc(100dvh - 182px));display:flex;flex-direction:column;overflow-y:auto;scroll-padding-top:66px;box-shadow:0 10px 40px #0003}
.community-chat-widget #board-panel[hidden]{display:none}
.community-chat-widget .board-chat-heading{flex-shrink:0;padding:10px 14px;position:sticky;top:0;z-index:1;background:var(--paper)}
.community-chat-widget .board-chat-heading h2{font-size:22px;flex:1}
#board-close{background:transparent;color:var(--ink);border:0;width:44px;height:44px;font-size:26px;flex-shrink:0}
.community-chat-widget .board-feed{height:auto;flex:1 1 0;min-height:56px;overflow-y:auto;overscroll-behavior:contain;padding:12px;background:var(--mint);margin:0}
.community-chat-widget #board-form{flex-shrink:0;padding:12px}
.community-chat-widget .board-name{font-size:13px}
.community-chat-widget #board-receipt{max-height:120px}
.board-chat #board-receipt .success p{margin:4px 0 0;font-size:13px;overflow-wrap:anywhere}
.community-chat-widget .board-feed:focus-visible{outline:3px solid #7957bd;outline-offset:-3px}
:root[data-theme=dark] .community-chat-widget .board-feed:focus-visible{outline-color:#c6afff}
@media(max-width:600px){.chat-bubble{right:16px;bottom:16px}.community-chat-widget #board-panel{right:16px;bottom:84px;height:calc(100vh - 172px);height:calc(100dvh - 172px)}.community-chat-widget .board-name{grid-template-columns:auto minmax(0,1fr)}}
/* Short screens: keep the chat heading and composer in view; the thread takes what is left. */
@media(max-height:640px){.community-chat-widget #board-form{gap:8px}.community-chat-widget #board-form textarea{min-height:52px;height:52px}.community-chat-widget .board-chat-heading{padding-block:4px}.community-chat-widget #board-panel{scroll-padding-top:54px}}
@media(max-height:640px) and (max-width:600px){.community-chat-widget #board-panel{bottom:76px;height:calc(100vh - 156px);height:calc(100dvh - 156px)}}
/* Very short screens (phone landscape): the open panel uses the full height, over the header and bubble. */
@media(max-height:560px){.community-chat-widget #board-panel{top:8px;bottom:8px;height:auto;z-index:31}}
@media(max-width:359px){.community-chat-widget .board-chat-heading h2{font-size:19px}}

/* Small composer leaves more room for the message thread. */
.community-chat-widget #board-form{padding:10px;gap:6px}
.community-chat-widget #board-mode{font-size:13px;line-height:1.4}
.community-chat-widget .board-name{grid-template-columns:auto minmax(0,1fr);gap:8px}
.community-chat-widget .board-name input{min-height:40px;height:40px;padding:6px 10px}
.community-chat-widget #board-form textarea{margin-top:0;min-height:48px;height:48px;padding:10px;line-height:1.4}
.community-chat-widget .board-send-row .button{padding:8px 12px;min-height:44px}
.community-chat-widget .board-message-label{display:block}
@media(max-width:359px){.community-chat-widget .board-name{font-size:13px}}

.board-message-label .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}

.community-chat-widget #board-form textarea{max-height:none;resize:none;overflow-y:hidden}
.community-chat-widget #board-body{font-weight:400}

@media (prefers-reduced-motion:no-preference){
 .community-chat-widget #board-panel:not([hidden]){
  transform-origin:bottom right;
  animation:chat-open .18s var(--ease);
 }
 #community-search-panel:not([hidden]),.story-page #comment-form:not([hidden]){
  animation:composer-open .16s var(--ease);
 }
}
@keyframes chat-open{
 from{opacity:.88;transform:translateY(6px) scale(.99)}
 to{opacity:1;transform:none}
}
@keyframes composer-open{
 from{transform:translateY(-4px)}
 to{transform:none}
}
