:root {
  --page: #f5f6f8;
  --surface: #ffffff;
  --surface-soft: #f9fafb;
  --ink: #202632;
  --muted: #687184;
  --line: #dfe3e9;
  --line-strong: #cbd1da;
  --accent: #3157a4;
  --accent-soft: #e9eef9;
  --green: #31705a;
  --danger: #a83e3e;
  --shadow: 0 1px 2px rgb(28 39 57 / 6%);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: .18em; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-nav {
  width: min(1180px, calc(100% - 40px));
  min-height: 70px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; }
.brand > span:last-child { display: grid; gap: 1px; }
.brand strong { font-family: Georgia, "Times New Roman", serif; font-size: 20px; line-height: 1; }
.brand small { color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--accent);
  color: white;
  font: 700 21px/1 Georgia, serif;
}
.brand-mark.large { width: 46px; height: 46px; border-radius: 12px; font-size: 27px; }
.nav-links { display: flex; align-items: center; gap: 28px; font-size: 13px; font-weight: 650; }
.nav-links a { color: var(--muted); text-decoration: none; }
.nav-links a:hover { color: var(--ink); }
.nav-links .nav-action { padding: 9px 13px; border-radius: 7px; background: var(--accent); color: white; }

.forum-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 42px 0 80px; }
.forum-intro { display: flex; align-items: end; justify-content: space-between; gap: 40px; margin-bottom: 28px; }
.forum-intro h1 { max-width: 680px; margin: 0; font: 500 clamp(38px, 5vw, 62px)/1.02 Georgia, serif; letter-spacing: -.035em; }
.forum-intro > p { max-width: 430px; margin: 0 0 5px; color: var(--muted); font: 16px/1.55 Georgia, serif; }
.eyebrow { margin: 0 0 11px; color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.forum-grid { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 22px; align-items: start; }
.discussion-panel, .sidebar-card, .thread-card, .discussion-section, .gate-card, .account-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.panel-heading { min-height: 77px; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.panel-heading h2, .sidebar-card h2, .discussion-placeholder h2 { margin: 0; font-size: 15px; }
.panel-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.post-count { padding: 6px 9px; border-radius: 999px; background: var(--surface-soft); color: var(--muted); font-size: 11px; font-weight: 700; }
.discussion-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) 78px; gap: 14px; padding: 20px; border-bottom: 1px solid var(--line); }
.discussion-row:last-child { border-bottom: 0; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; flex: 0 0 auto; background: #e4eadf; color: #476142; font-size: 11px; font-weight: 800; }
.discussion-copy h3 { margin: 0 0 6px; font: 650 18px/1.25 Georgia, serif; }
.discussion-copy h3 a { color: var(--ink); text-decoration: none; }
.discussion-copy h3 a:hover { color: var(--accent); }
.discussion-copy > p { max-width: 690px; margin: 0 0 10px; color: var(--muted); font: 13px/1.48 Georgia, serif; }
.discussion-meta { display: flex; flex-wrap: wrap; gap: 7px; color: var(--muted); font-size: 10px; }
.discussion-meta span::before { margin-right: 7px; color: var(--line-strong); content: "•"; }
.discussion-meta strong { color: var(--green); }
.provenance-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  padding: 4px 7px;
  border: 1px solid #b9c9b5;
  border-radius: 999px;
  background: #edf4eb;
  color: #38603a;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .04em;
  line-height: 1;
  text-transform: uppercase;
}
.provenance-badge.ai { border-color: #b9c7e8; background: var(--accent-soft); color: var(--accent); }
.provenance-badge.ai-audited { border-color: #d5c29d; background: #f7f0df; color: #775a21; }
.provenance-badge span { font-weight: 650; letter-spacing: 0; text-transform: none; }
.discussion-meta .provenance-badge { margin-left: 2px; }
.discussion-meta .provenance-badge::before, .discussion-meta .provenance-badge span::before { content: none; }
.thread-type { align-self: center; display: grid; gap: 4px; color: var(--muted); text-align: right; text-decoration: none; font-size: 10px; }
.thread-type strong { color: var(--accent); font-size: 11px; text-transform: uppercase; }
.forum-sidebar { display: grid; gap: 16px; }
.sidebar-card { padding: 19px; }
.sidebar-card h2 { margin-bottom: 10px; }
.sidebar-card p { margin: 0; color: var(--muted); font: 13px/1.55 Georgia, serif; }
.topic-list { display: flex; flex-wrap: wrap; gap: 7px; }
.topic-list span { padding: 6px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-size: 10px; font-weight: 700; }
.sidebar-card dl { margin: 0; }
.sidebar-card dl div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.sidebar-card dl div:last-child { padding-bottom: 0; border: 0; }
.sidebar-card dt { color: var(--muted); }
.sidebar-card dd { margin: 0; font-weight: 700; }
.empty-state { padding: 48px 20px; color: var(--muted); text-align: center; }
.empty-state p { margin: 0 0 6px; color: var(--ink); font: 22px Georgia, serif; }
.site-footer { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 24px 0 38px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; letter-spacing: .07em; }

.thread-shell { width: min(900px, calc(100% - 40px)); margin: 0 auto; padding: 26px 0 80px; }
.breadcrumbs { display: flex; gap: 8px; margin-bottom: 17px; color: var(--muted); font-size: 11px; }
.breadcrumbs a { color: var(--muted); }
.thread-card { overflow: hidden; }
.article-header { padding: 46px 58px 34px; border-bottom: 1px solid var(--line); }
.content-label { display: inline-block; margin-bottom: 16px; padding: 5px 8px; border-radius: 5px; background: var(--accent-soft); color: var(--accent); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.article-header h1 { max-width: 760px; margin: 0 0 28px; font: 500 clamp(38px, 6vw, 64px)/1.04 Georgia, serif; letter-spacing: -.035em; }
.author-line { display: flex; align-items: center; gap: 11px; }
.author-line > div { display: grid; gap: 3px; }
.author-line strong { font-size: 12px; }
.author-line div span { color: var(--muted); font-size: 10px; }
.author-line .provenance-badge { margin-left: 5px; }
.prose { padding: 48px 58px 55px; font: 18px/1.75 Georgia, "Times New Roman", serif; }
.prose h2, .prose h3 { margin: 2em 0 .65em; line-height: 1.15; }
.prose h2 { font-size: 31px; }
.prose h3 { font-size: 24px; }
.prose p, .prose ul, .prose ol, .prose blockquote { margin: 0 0 1.35em; }
.prose blockquote { margin-left: 0; padding-left: 20px; border-left: 3px solid var(--accent); color: #4e5664; }
.prose pre { overflow: auto; padding: 20px; background: var(--ink); color: white; font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; }
.prose code { font-size: .86em; }
.prose img { max-width: 100%; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; }
.prose th, .prose td { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; }
.article-tools { padding: 15px 58px; border-top: 1px solid var(--line); background: var(--surface-soft); font-size: 11px; }
.discussion-section { margin-top: 18px; overflow: hidden; }
.discussion-heading { padding: 19px 22px; border-bottom: 1px solid var(--line); }
.discussion-heading h2 { margin: 0; font-size: 15px; }
.discussion-heading p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.feedback-form { padding: 17px 22px; border-bottom: 1px solid var(--line); background: #f7f9fd; }
.feedback-form > label { display: block; margin-bottom: 9px; font-size: 11px; font-weight: 800; }
.feedback-form > label span { margin-left: 5px; color: var(--muted); font-weight: 500; }
.feedback-form > div { display: flex; gap: 9px; }
.feedback-form input { min-width: 0; flex: 1; padding: 11px 12px; border: 1px solid var(--line-strong); border-radius: 7px; font: inherit; }
.comment-list > .comment-card { border-bottom: 1px solid var(--line); }
.comment-card { padding: 22px; background: var(--surface); }
.comment-card.comment-reply { margin-top: 15px; padding: 18px 0 0 22px; border-top: 1px solid var(--line); border-left: 2px solid var(--accent-soft); }
.comment-byline { display: flex; align-items: center; gap: 10px; }
.comment-byline > div:nth-child(2) { display: grid; gap: 2px; }
.comment-byline strong { font-size: 11px; }
.comment-byline div > span { color: var(--muted); font-size: 9px; }
.comment-tags { margin-left: auto; display: flex; flex-wrap: wrap; justify-content: end; gap: 6px; }
.avatar.ai-avatar { background: var(--accent-soft); color: var(--accent); }
.feedback-badge { padding: 4px 7px; border-radius: 999px; background: #eee8f8; color: #644293; font-size: 9px; font-weight: 800; line-height: 1; text-transform: uppercase; }
.comment-prose { padding: 14px 0 2px 51px; font: 15px/1.65 Georgia, "Times New Roman", serif; }
.comment-prose p, .comment-prose ul, .comment-prose ol, .comment-prose blockquote { margin: 0 0 1em; }
.comment-prose pre { overflow: auto; padding: 14px; background: var(--ink); color: white; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.reply-control { margin-left: 51px; }
.reply-control summary { width: fit-content; color: var(--muted); font-size: 10px; font-weight: 750; cursor: pointer; }
.comment-form { display: grid; gap: 9px; }
.comment-form label { font-size: 11px; font-weight: 800; }
.comment-form textarea { width: 100%; min-height: 110px; padding: 12px; resize: vertical; border: 1px solid var(--line-strong); border-radius: 7px; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.comment-form .button { justify-self: start; }
.comment-form.compact { margin-top: 10px; padding: 13px; border-radius: 7px; background: var(--surface-soft); }
.comment-form.compact textarea { min-height: 80px; }
.new-comment { padding: 22px; background: var(--surface-soft); }

.form-shell { width: min(920px, calc(100% - 40px)); margin: 0 auto; padding: 70px 0; }
.form-shell.narrow { width: min(500px, calc(100% - 40px)); }
.form-shell h1, .gate-card h1 { margin: 0; font: 500 clamp(40px, 6vw, 62px)/1.03 Georgia, serif; letter-spacing: -.035em; }
.form-intro { margin: 16px 0 30px; color: var(--muted); font: 16px/1.5 Georgia, serif; }
.stacked-form { display: grid; gap: 11px; }
.stacked-form label { font-size: 11px; font-weight: 750; }
.stacked-form input { width: 100%; padding: 13px 14px; border: 1px solid var(--line-strong); border-radius: 7px; background: white; font: inherit; }
.stacked-form input:focus { outline: 2px solid #b9c7e8; border-color: var(--accent); }
.form-error { margin: 0 0 20px; padding: 12px 14px; border-left: 3px solid var(--danger); border-radius: 4px; background: #f8e7e7; color: #772f2f; font-size: 12px; }
.form-success { margin: 0 0 20px; padding: 12px 14px; border-left: 3px solid #43845b; border-radius: 4px; background: #e9f5ec; color: #245b36; font-size: 12px; }
.field-help { margin: -4px 0 8px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.auth-links { display: flex; justify-content: space-between; gap: 18px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 12px; }
.auth-links a { color: var(--accent); text-decoration: none; }
.account-card { margin-top: 28px; padding: 28px; }
.account-card dl { margin: 0 0 28px; display: grid; gap: 12px; }
.account-card dl div { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.account-card dt { color: var(--muted); font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; }
.account-card dd { margin: 0; font-size: 13px; }
.button { display: inline-flex; min-height: 42px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 7px; align-items: center; justify-content: center; background: white; color: var(--ink); font: 700 12px ui-sans-serif, sans-serif; text-decoration: none; cursor: pointer; }
.button.primary { border-color: var(--accent); background: var(--accent); color: white; }
.button.primary:hover { background: #26478d; }
.button.quiet:hover { background: var(--surface-soft); }
.author-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 38px; }
.draft-list { overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: white; }
.draft-list article { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px; border-bottom: 1px solid var(--line); }
.draft-list article:last-child { border: 0; }
.draft-list h2 { margin: 7px 0 3px; font: 22px Georgia, serif; }
.draft-list p { margin: 0; color: var(--muted); font-size: 10px; }
.status { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.status.published { color: var(--green); }
.logout-form { margin-top: 32px; }
.text-button { padding: 0; border: 0; background: transparent; color: var(--muted); text-decoration: underline; cursor: pointer; }

.editor-page { background: white; }
.editor-shell { width: min(900px, calc(100% - 40px)); margin: 0 auto; padding: 55px 0; }
.editor-form { display: flex; min-height: calc(100vh - 190px); flex-direction: column; }
.title-input { width: 100%; padding: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: 48px/1.1 Georgia, serif; letter-spacing: -.03em; }
.title-input::placeholder { color: #a5aab3; }
.slug-row { display: flex; margin: 18px 0 34px; color: var(--muted); font: 11px ui-monospace, SFMono-Regular, Menlo, monospace; }
.slug-row input { min-width: 260px; padding: 0; border: 0; outline: 0; background: transparent; color: inherit; font: inherit; }
.editor-form textarea { width: 100%; min-height: 450px; flex: 1; padding: 0; resize: vertical; border: 0; outline: 0; background: transparent; color: var(--ink); font: 17px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; }
.editor-actions { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 0; border-top: 1px solid var(--line); background: white; color: var(--muted); font-size: 10px; }
.editor-actions div { display: flex; gap: 9px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.gate-page { min-height: 100vh; background: #eef1f6; }
.gate-shell { width: min(470px, calc(100% - 32px)); min-height: 100vh; margin: 0 auto; padding: 54px 0 40px; display: flex; flex-direction: column; justify-content: center; }
.gate-brand { margin: 0 auto 22px; display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font: 500 24px Georgia, serif; }
.gate-card { padding: 38px; }
.gate-card h1 { font-size: 46px; }
.gate-note { margin: 20px 0 0; color: var(--muted); text-align: center; font-size: 10px; letter-spacing: .05em; }

@media (max-width: 820px) {
  .forum-intro { align-items: start; flex-direction: column; gap: 16px; }
  .forum-grid { grid-template-columns: 1fr; }
  .forum-sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sidebar-card.compact { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  .site-nav { min-height: 64px; }
  .brand small, .nav-links > a:first-child { display: none; }
  .nav-links { gap: 12px; }
  .forum-shell { padding-top: 30px; }
  .discussion-row { grid-template-columns: 34px minmax(0, 1fr); padding: 16px; }
  .avatar { width: 34px; height: 34px; }
  .thread-type { display: none; }
  .forum-sidebar { grid-template-columns: 1fr; }
  .sidebar-card.compact { grid-column: auto; }
  .article-header, .prose { padding-left: 24px; padding-right: 24px; }
  .article-header { padding-top: 32px; }
  .article-header h1 { font-size: 40px; }
  .prose { padding-top: 34px; font-size: 17px; }
  .article-tools { padding-left: 24px; padding-right: 24px; }
  .feedback-form > div { align-items: stretch; flex-direction: column; }
  .comment-prose, .reply-control { margin-left: 0; padding-left: 0; }
  .comment-card.comment-reply { padding-left: 14px; }
  .site-footer { flex-direction: column; gap: 8px; }
  .author-heading { align-items: start; flex-direction: column; gap: 22px; }
  .title-input { font-size: 38px; }
  .editor-actions { align-items: stretch; flex-direction: column; }
  .editor-actions div { display: grid; grid-template-columns: 1fr 1fr; }
  .gate-card { padding: 28px 23px; }
}
