:root {
  color-scheme: light;
  --ink: #1c2927;
  --muted: #78827e;
  --line: #e8ebe6;
  --paper: #fff;
  --canvas: #f7f8f5;
  --green: #2f725f;
  --green-dark: #215647;
  --green-pale: #eaf3ed;
  --orange: #e6a05a;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 400 15px/1.65 "Segoe UI", sans-serif;
}
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
.topbar {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(calc((100vw - 1180px) / 2), 5.2vw);
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.82);
}
.brand { display: inline-flex; align-items: center; gap: 11px; font: 800 20px/1 "Segoe UI", sans-serif; letter-spacing: -.8px; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px 11px 11px 4px; background: var(--green); color: #fff; font: 800 18px "Segoe UI", sans-serif; }
.brand-dot { color: var(--orange); }
.brand small { display: block; margin-top: 5px; color: var(--muted); font: 500 10px/1 "Segoe UI", sans-serif; letter-spacing: .45px; }
.top-actions { display: flex; align-items: center; gap: 9px; }
.button { display: inline-flex; min-height: 41px; align-items: center; justify-content: center; gap: 9px; padding: 0 17px; border: 1px solid transparent; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 700; transition: background .16s ease, border-color .16s ease, transform .16s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--green); color: #fff; }
.button-primary:hover { background: var(--green-dark); }
.button-discord { background: #5965d9; color: #fff; }
.button-discord:hover { background: #4854c8; }
.button-quiet { border-color: var(--line); background: #fff; }
.button-quiet:hover, .button-small:hover { border-color: #b7c9bd; background: var(--green-pale); }
.button-small { min-height: 34px; padding: 0 12px; border-color: var(--line); background: #fff; font-size: 12px; }
.button-full { width: 100%; margin-top: 12px; }
.profile-chip { max-width: 190px; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.layout { width: min(1120px, calc(100% - 48px)); display: grid; grid-template-columns: minmax(0, 1fr) 294px; gap: 66px; margin: 0 auto; padding: 62px 0 90px; }
.content-column { min-width: 0; }
.hero { position: relative; padding: 18px 0 39px; border-bottom: 1px solid var(--line); }
.eyebrow { margin: 0 0 11px; color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: 1.65px; line-height: 1.4; }
.hero h1 { max-width: 650px; margin: 0; font: 700 clamp(38px, 5vw, 58px)/1.12 "Segoe UI", sans-serif; letter-spacing: -2.6px; }
.hero h1 span { color: var(--green); }
.hero > p:not(.eyebrow) { margin: 16px 0 24px; color: var(--muted); font-size: 15px; }
.editor-panel { margin-top: 26px; padding: 25px; border: 1px solid #dfe7df; border-radius: 12px; background: var(--paper); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.section-heading h2, .side-heading h2 { margin: 0; font: 700 23px/1.2 "Segoe UI", sans-serif; letter-spacing: -.6px; }
.icon-button { width: 34px; height: 34px; display: inline-grid; flex: 0 0 auto; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; font-size: 23px; line-height: 1; }
.icon-button:hover { border-color: #b7c9bd; color: var(--green); }
.field-label { display: block; margin: 18px 0 7px; color: #47544f; font-size: 12px; font-weight: 700; }
.field-label span { color: var(--muted); font-weight: 400; }
.text-input { width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid #dfe4df; border-radius: 7px; background: #fff; color: var(--ink); outline: none; font-size: 13px; }
.text-input:focus { border-color: #6b9a82; box-shadow: 0 0 0 3px rgba(47,114,95,.1); }
.title-input { font-size: 15px; }
.field-row { max-width: 380px; }
.editor-toolbar { display: flex; align-items: center; justify-content: space-between; margin: 17px 0 8px; color: #52615b; font-size: 12px; font-weight: 700; }
.markdown-input { min-height: 230px; resize: vertical; font: 400 13px/1.7 "Segoe UI", sans-serif; }
.editor-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 12px; }
.editor-footer > span { color: var(--muted); font-size: 11px; }
.markdown-preview { min-height: 230px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 7px; overflow-wrap: anywhere; }
.feed-section { padding-top: 31px; }
.feed-heading { margin-bottom: 15px; }
.feed-heading .eyebrow { margin-bottom: 6px; }
.article-list { display: grid; }
.article-card { padding: 24px 0 25px; border-bottom: 1px solid var(--line); }
.article-card:first-child { padding-top: 12px; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.author-button { display: inline-flex; align-items: center; gap: 7px; padding: 0; border: 0; background: transparent; cursor: pointer; color: var(--ink); font-size: 12px; font-weight: 700; }
.author-button:hover { color: var(--green); }
.avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; background: var(--green-pale); }
.meta-dot { color: #b6bfba; }
.room-tag { padding: 2px 8px; border-radius: 99px; background: var(--green-pale); color: var(--green-dark); font-size: 10px; font-weight: 700; }
.room-tag.private { background: #fbf0e2; color: #9c642a; }
.article-title { display: block; width: fit-content; margin: 12px 0 7px; padding: 0; border: 0; background: transparent; cursor: pointer; text-align: left; font: 700 22px/1.3 "Segoe UI", sans-serif; letter-spacing: -.6px; }
.article-title:hover { color: var(--green); }
.article-excerpt { display: -webkit-box; overflow: hidden; margin: 0; color: #6d7873; font-size: 13px; line-height: 1.7; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.article-actions { display: flex; align-items: center; gap: 15px; margin-top: 15px; }
.action-button { display: inline-flex; align-items: center; gap: 5px; padding: 3px 0; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 11px; }
.action-button:hover, .action-button.liked { color: #bd655b; }
.action-button.owner-action:hover { color: var(--green); }
.empty-state { padding: 42px 18px; border: 1px dashed #dfe4df; border-radius: 10px; color: var(--muted); text-align: center; font-size: 13px; }
.sidebar { display: flex; flex-direction: column; gap: 16px; padding-top: 7px; }
.side-card { padding: 22px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.about-card { padding-top: 25px; background: #edf4ee; border-color: #e5eee6; }
.side-icon { display: inline-grid; width: 32px; height: 32px; place-items: center; margin-bottom: 17px; border-radius: 9px; background: #dceade; color: var(--green); font-size: 19px; }
.side-card .eyebrow { margin-bottom: 8px; font-size: 9px; }
.side-card h2 { margin: 0; font: 700 18px/1.35 "Segoe UI", sans-serif; letter-spacing: -.35px; }
.about-card > p:not(.eyebrow), .side-copy { margin: 10px 0 0; color: #6d7873; font-size: 12px; line-height: 1.7; }
.text-link { margin: 17px 0 0; padding: 0; border: 0; background: transparent; color: var(--green-dark); cursor: pointer; font-size: 12px; font-weight: 800; }
.side-heading { display: flex; justify-content: space-between; align-items: center; }
.side-heading h2 { font-size: 19px; }
.room-list { display: grid; gap: 5px; margin-top: 14px; }
.room-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 8px; border-radius: 7px; cursor: pointer; }
.room-item:hover, .room-item.selected { background: #f0f5f0; }
.room-name { display: flex; align-items: center; gap: 7px; min-width: 0; padding: 0; border: 0; background: transparent; cursor: pointer; text-align: left; font-size: 12px; font-weight: 700; }
.room-symbol { color: var(--green); }
.room-count { flex: 0 0 auto; color: var(--muted); font-size: 10px; }
.room-controls { display: flex; align-items: center; gap: 5px; }
.room-join { padding: 3px 7px; border: 1px solid var(--line); border-radius: 5px; background: #fff; cursor: pointer; font-size: 10px; }
.room-join:hover { border-color: #a9c1ae; color: var(--green); }
.join-form { display: grid; gap: 7px; margin-top: 14px; }
.join-form .text-input { min-height: 36px; font-size: 11px; }
.room-create-form { margin-top: 15px; padding-top: 14px; border-top: 1px solid var(--line); }
.room-create-form .field-label { margin-top: 11px; }
.room-create-form .text-input { min-height: 37px; font-size: 11px; }
.invite-result { margin-top: 12px; padding: 11px; border-radius: 7px; background: #fbf3e8; color: #6c4a24; overflow-wrap: anywhere; font-size: 11px; }
.invite-result code { display: block; margin-top: 6px; font-weight: 700; }
.form-message { min-height: 18px; margin: 8px 0 0; color: #ad5144; font-size: 11px; }
.form-message.success { color: var(--green); }
.muted, .sidebar-note { color: var(--muted); font-size: 11px; }
.sidebar-note { margin: 2px 3px; line-height: 1.7; }
.article-dialog { position: relative; width: min(760px, calc(100% - 32px)); max-width: none; max-height: min(88vh, 900px); padding: 37px; border: 1px solid var(--line); border-radius: 13px; background: #fff; color: var(--ink); }
.article-dialog::backdrop { background: rgba(17, 29, 24, .52); backdrop-filter: blur(2px); }
.dialog-close { position: sticky; float: right; top: 0; margin: -20px -20px 2px 14px; }
.dialog-article-title { margin: 14px 0; font: 700 34px/1.2 "Segoe UI", sans-serif; letter-spacing: -1.2px; }
.markdown-body { overflow-wrap: anywhere; }
.markdown-body h1, .markdown-body h2, .markdown-body h3 { margin: 1.3em 0 .45em; font-family: "Segoe UI", sans-serif; line-height: 1.25; }
.markdown-body h1 { font-size: 27px; }.markdown-body h2 { font-size: 22px; }.markdown-body h3 { font-size: 18px; }
.markdown-body p { margin: .8em 0; }
.markdown-body ul, .markdown-body ol { padding-left: 1.5em; }
.markdown-body blockquote { margin: 1em 0; padding: 3px 15px; border-left: 3px solid #9cbaa5; color: #63716a; }
.markdown-body pre { padding: 14px; overflow-x: auto; border-radius: 7px; background: #f2f4f1; font-size: 12px; }
.markdown-body code { padding: 2px 4px; border-radius: 4px; background: #f0f3ef; font: 12px/1.5 Consolas, monospace; }
.markdown-body pre code { padding: 0; background: transparent; }
.markdown-body a { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.comments-section { margin-top: 34px; padding-top: 21px; border-top: 1px solid var(--line); }
.comments-section h3 { margin: 0 0 13px; font: 700 17px "Segoe UI", sans-serif; }
.comment-item { display: flex; gap: 10px; margin: 13px 0; }
.comment-item .avatar { width: 27px; height: 27px; flex: 0 0 auto; }
.comment-author { font-size: 11px; font-weight: 800; }
.comment-date { margin-left: 7px; color: var(--muted); font-size: 10px; }
.comment-body { margin: 3px 0 0; color: #59655f; font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-form { display: flex; gap: 8px; margin-top: 15px; }
.comment-form .text-input { flex: 1; }
footer { min-height: 77px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px max(calc((100vw - 1180px) / 2), 5.2vw); border-top: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 10px; }
.footer-brand { font-size: 16px; }.footer-brand .brand-mark { width: 28px; height: 28px; font-size: 15px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 850px) {
  .layout { grid-template-columns: minmax(0, 1fr) 260px; gap: 30px; }
}
@media (max-width: 680px) {
  .topbar { height: 70px; padding: 0 18px; }
  .brand { font-size: 17px; }.brand-mark { width: 30px; height: 30px; }
  .top-actions { gap: 6px; }.top-actions .button { min-height: 36px; padding: 0 10px; font-size: 11px; }
  .profile-chip { display: none; }
  .layout { width: min(100% - 34px, 550px); grid-template-columns: 1fr; gap: 35px; padding: 37px 0 55px; }
  .hero { padding-top: 8px; }.hero h1 { font-size: clamp(38px, 10vw, 53px); letter-spacing: -1.8px; }
  .sidebar { display: grid; grid-template-columns: 1fr; }
  .article-dialog { padding: 24px 19px; }.dialog-close { margin: -10px -8px 2px 10px; }.dialog-article-title { font-size: 28px; }
  footer { flex-direction: column; align-items: flex-start; padding: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
