:root {
  --cream: #f7f2ea;
  --cream-deep: #efe7da;
  --card: #ffffff;
  --ink: #2a241f;
  --muted: #6f655b;
  --rust: #a8472a;
  --rust-dark: #853620;
  --green: #5a7d4f;
  --green-dark: #41603a;
  --line: #e6ddcd;
  --chip: #f1e6dc;
  --shadow: 0 1px 2px rgba(42, 36, 31, .06), 0 8px 24px rgba(42, 36, 31, .06);
  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--rust-dark); }

.container { width: 100%; max-width: 860px; margin: 0 auto; padding: 0 22px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(247, 242, 234, .85);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.header-left { display: flex; align-items: center; gap: 18px; min-width: 0; }
.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; letter-spacing: .2px;
}
.brand-mark { width: 32px; height: 32px; border-radius: 50%; flex: 0 0 auto;
  box-shadow: 0 1px 3px rgba(42,36,31,.18); }
.brand-text { font-family: var(--serif); font-size: 1.2rem; font-weight: 700; color: var(--ink); }
.brand-text span { color: var(--rust); }

/* Primary nav tabs (Palapala / Aʻoaʻo Sīwilia) */
.nav-primary { display: flex; align-items: center; gap: 4px; }
.nav-tab {
  font-family: var(--serif); font-size: 1.04rem; font-weight: 700; color: var(--muted);
  text-decoration: none; padding: 6px 12px; border-radius: 8px; white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.nav-tab:hover { color: var(--ink); background: var(--cream-deep); }
.nav-tab.active { color: var(--rust-dark); border-bottom-color: var(--rust); border-radius: 8px 8px 0 0; }

/* Page-tinted nav bar: rust on Palapala, green on Aʻoaʻo Sīwilia.
   On a colored bar all header text/controls flip to white for legibility. */
.site-header.header-home { background: var(--rust); border-bottom-color: var(--rust-dark); }
.site-header.header-civics { background: var(--green); border-bottom-color: var(--green-dark); }
.header-home, .header-civics { backdrop-filter: none; }
.header-home .nav-tab, .header-civics .nav-tab { color: rgba(255,255,255,.78); border-bottom-color: transparent; }
.header-home .nav-tab:hover, .header-civics .nav-tab:hover { color: #fff; background: rgba(255,255,255,.14); }
.header-home .nav-tab.active, .header-civics .nav-tab.active { color: #fff; background: transparent; border-bottom-color: #fff; }
.header-home .nav-link, .header-civics .nav-link { color: rgba(255,255,255,.85); }
.header-home .nav-link:hover, .header-civics .nav-link:hover { color: #fff; background: rgba(255,255,255,.14); }
.header-home .nav-user, .header-civics .nav-user { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.3); color: #fff; }
.header-home .nav-user:hover, .header-civics .nav-user:hover { background: rgba(255,255,255,.22); border-color: rgba(255,255,255,.55); }
.header-home .nav-logout, .header-civics .nav-logout { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.3); color: #fff; }
.header-home .nav-logout:hover, .header-civics .nav-logout:hover { background: rgba(255,255,255,.22); border-color: rgba(255,255,255,.55); color: #fff; }
/* CTA buttons (New proposal / Sign up): white pill with the bar's color as text. */
.header-home .nav .btn:not(.btn-ghost), .header-civics .nav .btn:not(.btn-ghost) { background: #fff; }
.header-home .nav .btn:not(.btn-ghost) { color: var(--rust-dark); }
.header-civics .nav .btn:not(.btn-ghost) { color: var(--green-dark); }
.header-home .nav .btn:not(.btn-ghost):hover, .header-civics .nav .btn:not(.btn-ghost):hover { background: rgba(255,255,255,.9); }
@media (max-width: 560px) {
  .header-left { gap: 8px; }
  .nav-tab { font-size: .92rem; padding: 6px 8px; }
}
.nav { display: flex; align-items: center; gap: 10px; }
.nav a { text-decoration: none; }
.nav-link { color: var(--muted); font-size: .92rem; padding: 8px 10px; border-radius: 8px; }
.nav-link:hover { color: var(--ink); background: var(--cream-deep); }
.nav .btn:not(.btn-ghost), .nav .btn:not(.btn-ghost):hover { color: #fff; }
.nav-new { font-size: .88rem; padding: 8px 14px; display: inline-flex; align-items: center; gap: 6px; }
.nav-new .plus { font-size: 1.05rem; line-height: 1; font-weight: 700; }

/* User pill (avatar + name) -> profile edit */
.nav-user {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); transition: border-color .12s ease, background .12s ease;
}
.nav-user:hover { border-color: var(--rust); background: var(--cream); }
.nav-user-name { font-size: .9rem; font-weight: 600; max-width: 130px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.nav-logout {
  border: 1px solid var(--line); background: #fff; color: var(--muted); cursor: pointer;
  width: 36px; height: 36px; border-radius: 50%; font-size: 1rem; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; transition: all .12s ease;
}
.nav-logout:hover { color: var(--rust-dark); border-color: var(--rust); background: var(--cream); }

@media (max-width: 560px) {
  .nav-user-name { display: none; }
  .nav-user { padding: 4px; }
  .brand-text { font-size: 1.05rem; }
}

/* Buttons */
.btn {
  display: inline-block; border: 0; cursor: pointer;
  background: var(--rust); color: #fff;
  font: inherit; font-size: .92rem; font-weight: 600;
  padding: 8px 16px; border-radius: 8px; text-decoration: none;
}
.btn:hover { background: var(--rust-dark); color: #fff; }
.btn-ghost {
  background: transparent; color: var(--ink);
  border: 1px solid var(--line); padding: 7px 15px;
}
.btn-ghost:hover { background: var(--cream-deep); color: var(--ink); }

/* Hero */
.hero { padding: 46px 0 26px; }
.hero h1 { font-family: var(--serif); font-size: 2.3rem; line-height: 1.15; margin: 0 0 10px; }
.hero p { color: var(--muted); font-size: 1.06rem; max-width: 60ch; margin: 0; }

/* Notice strip */
.notice {
  background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--rust);
  border-radius: 8px; padding: 12px 16px; margin: 0 0 26px;
  color: var(--muted); font-size: .94rem;
}
.notice a { font-weight: 600; }

/* Card grid */
.card-grid { display: grid; gap: 16px; padding-bottom: 56px; }
.card {
  display: block; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 20px 22px; text-decoration: none; color: var(--ink);
  box-shadow: var(--shadow); transition: transform .12s ease, box-shadow .12s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(42,36,31,.08), 0 14px 34px rgba(42,36,31,.10); }
.card h3 { font-family: var(--serif); font-size: 1.28rem; margin: 8px 0 8px; }
.card p { color: var(--muted); margin: 0; font-size: .97rem; }

/* Geo chip */
.chip {
  display: inline-block; background: var(--chip); color: var(--rust-dark);
  font-size: .76rem; font-weight: 600; letter-spacing: .3px; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px;
}

/* Article (detail) */
.article { padding: 30px 0 10px; }
.backlink { color: var(--muted); text-decoration: none; font-size: .92rem; }
.article h1 { font-family: var(--serif); font-size: 2rem; line-height: 1.2; margin: 14px 0 10px; }
.article .body { font-size: 1.06rem; margin-top: 18px; }
.meta-row { display: flex; align-items: center; gap: 12px; }

/* Discussion */
.discussion { border-top: 1px solid var(--line); margin-top: 36px; padding: 26px 0 60px; }
.discussion h2 { font-family: var(--serif); font-size: 1.4rem; margin: 0 0 16px; }
.comment {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; margin-bottom: 12px;
}
.comment .who { color: var(--muted); font-size: .84rem; margin-top: 6px; }
.muted { color: var(--muted); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .86rem; }
.site-footer .container { padding-top: 22px; padding-bottom: 30px; }

/* Flash messages */
.messages { margin: 18px 0 0; display: grid; gap: 8px; }
.msg { padding: 11px 15px; border-radius: 8px; font-size: .92rem; border: 1px solid var(--line); }
.msg-success { background: #eef6ec; border-color: #cfe6c8; color: #2f6b2a; }
.msg-error { background: #fbecea; border-color: #f0cfc9; color: #9a2a1c; }

/* Forms */
.field { margin-bottom: 16px; display: flex; flex-direction: column; }
.field label { font-size: .85rem; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.field input, .field select, textarea {
  font: inherit; padding: 10px 12px; color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; background: #fdfbf7; width: 100%;
}
.field input:focus, textarea:focus {
  outline: none; border-color: var(--rust); box-shadow: 0 0 0 3px rgba(168, 71, 42, .12);
}
.field input[type="checkbox"] { width: auto; align-self: flex-start; }
.radio-row, .radio-row > div { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.radio-row label { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; margin: 0; cursor: pointer; }
.radio-row input[type="radio"] { width: auto; margin: 0; }
.help, small.help { color: var(--muted); font-size: .8rem; margin-top: 5px; }
.help ul { margin: 6px 0 0; padding-left: 18px; }
.field-error, .form-errors { color: #9a2a1c; font-size: .85rem; margin-top: 6px; }
.form-errors { margin-bottom: 14px; }

/* Auth card */
.auth-card {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); max-width: 440px; margin: 48px auto; padding: 30px 30px 34px;
}
.auth-card h1 { font-family: var(--serif); font-size: 1.7rem; margin: 0 0 6px; }
.auth-card form { margin-top: 20px; }
.auth-card .btn { width: 100%; text-align: center; padding: 11px; margin-top: 6px; }
.auth-card .forgot { display: inline-block; margin-top: 14px; font-size: .85rem; }
.btn-social {
  width: 100%; background: #fff; color: var(--ink);
  border: 1px solid var(--line); padding: 11px; font-weight: 600; margin-top: 16px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.btn-social:hover { background: var(--cream-deep); color: var(--ink); }
.btn-social .g-logo { flex: 0 0 auto; display: block; }

/* Styling for allauth's default-theme pages (verify-sent, social signup,
   password reset, logout, auth errors). Scoped to .allauth-page so the
   hand-built login/signup cards are unaffected. */
.allauth-page h1 { font-family: var(--serif); font-size: 1.7rem; margin: 0 0 10px; }
.allauth-page p { color: var(--muted); margin: 0 0 14px; }
.allauth-page a { color: var(--rust-dark); font-weight: 600; }
.allauth-page form { margin-top: 18px; }
.allauth-page label { display: block; font-size: .85rem; font-weight: 600; color: var(--ink); margin: 14px 0 6px; }
.allauth-page input {
  font: inherit; padding: 10px 12px; color: var(--ink); width: 100%;
  border: 1px solid var(--line); border-radius: 8px; background: #fdfbf7;
}
.allauth-page input:focus { outline: none; border-color: var(--rust); box-shadow: 0 0 0 3px rgba(168, 71, 42, .12); }
.allauth-page button, .allauth-page [type="submit"] {
  display: inline-block; border: 0; cursor: pointer; background: var(--rust); color: #fff;
  font: inherit; font-size: .92rem; font-weight: 600; padding: 11px 16px; border-radius: 8px;
  width: 100%; text-align: center; margin-top: 16px; text-decoration: none;
}
.allauth-page button:hover, .allauth-page [type="submit"]:hover { background: var(--rust-dark); color: #fff; }
.allauth-page [tags~="cancel"], .allauth-page [tags~="link"] {
  background: transparent; color: var(--muted); margin-top: 8px;
}
.allauth-page [tags~="cancel"]:hover, .allauth-page [tags~="link"]:hover { background: var(--cream-deep); color: var(--ink); }
.allauth-page ul { padding-left: 18px; color: var(--muted); }
.or-divider {
  display: flex; align-items: center; text-align: center;
  color: var(--muted); font-size: .8rem; margin: 16px 0;
}
.or-divider::before, .or-divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.or-divider span { padding: 0 12px; }
.fineprint { font-size: .82rem; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }

/* Comment form */
.comment-form { margin: 0 0 22px; }
.comment-form textarea { margin-bottom: 10px; }
.comment.pending { border-style: dashed; opacity: .9; }
.comment.pending .who { color: var(--rust-dark); }

/* AI summary stub box */
.summary-box {
  background: #fbf7f0; border: 1px solid var(--line); border-left: 3px solid #7aa35a;
  border-radius: 10px; padding: 14px 18px; margin: 22px 0 4px; font-size: .96rem;
}
.summary-label {
  font-size: .7rem; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  color: var(--muted); margin-bottom: 6px;
}
.decide-note {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 16px; margin-top: 20px; color: var(--muted); font-size: .92rem;
}

/* Detail layout with docs sidebar */
.detail-layout { display: flex; gap: 30px; align-items: flex-start; }
.detail-main { flex: 1; min-width: 0; }
.detail-aside { width: 244px; flex-shrink: 0; position: sticky; top: 84px; }
.aside-title { font-family: var(--serif); font-size: 1.1rem; margin: 30px 0 12px; }
.doc-form { display: grid; gap: 8px; margin-bottom: 18px; }
.doc-form .btn { justify-self: start; padding: 7px 14px; font-size: .85rem; }
.doc-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.doc-list li { font-size: .92rem; }
.doc-list a { word-break: break-word; }
.votes.horizontal { flex-direction: row; align-items: center; gap: 6px; min-width: 0; }
.meta-row .votes { margin-left: auto; }
@media (max-width: 760px) {
  .detail-layout { flex-direction: column; }
  .detail-aside { width: 100%; position: static; }
}

/* Threaded comments */
.comment-row { display: flex; gap: 12px; align-items: flex-start; }
.comment-main { flex: 1; min-width: 0; }
.votes { display: flex; flex-direction: column; align-items: center; min-width: 30px; user-select: none; }
.vote-btn {
  background: none; border: 0; cursor: pointer; font-size: .8rem; line-height: 1;
  padding: 2px 4px; color: var(--muted);
}
.vote-btn.up:hover, .vote-btn.up.active { color: #3f7d3a; }
.vote-btn.down:hover, .vote-btn.down.active { color: var(--rust); }
.vote-btn.disabled { cursor: default; opacity: .45; }
.votes .score { font-size: .82rem; font-weight: 700; color: var(--ink); margin: 1px 0; }
.handle { color: var(--muted); font-size: .8rem; font-weight: 400; }
.comment-meta { display: flex; align-items: center; gap: 14px; margin-top: 6px; }
.comment-children {
  margin-top: 12px; margin-left: 16px; padding-left: 14px;
  border-left: 2px solid var(--line); display: grid; gap: 12px;
}
.comment .reply, .comment .edit { font-size: .82rem; }
.comment .reply > summary, .comment .edit > summary {
  cursor: pointer; color: var(--rust-dark); font-weight: 600; list-style: none; user-select: none;
}
.comment .reply > summary::-webkit-details-marker,
.comment .edit > summary::-webkit-details-marker { display: none; }
.edited { color: var(--muted); font-size: .78rem; font-weight: 400; }
.reply-form { margin-top: 10px; }
.reply-form textarea { margin-bottom: 8px; }
.reply-form .btn { padding: 6px 14px; font-size: .85rem; }

/* Seed -> Tree growth bar */
.growth { margin-top: 14px; }
.growth-track {
  position: relative; height: 8px; background: var(--cream-deep);
  border-radius: 999px; overflow: hidden;
}
.growth-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, #c9b393 0%, #9bb56a 55%, #3f7d3a 100%);
  border-radius: 999px;
}
.growth-labels {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-top: 6px; font-size: .72rem; letter-spacing: .4px;
  text-transform: uppercase; color: var(--muted);
}
.growth-stage { color: var(--rust-dark); font-weight: 700; }
.growth.lg .growth-track { height: 11px; }
.growth.lg .growth-labels { font-size: .8rem; }

/* ============================================================
   Community feed (home) — Reddit/Skool layout
   ============================================================ */
.container { max-width: 1040px; }

/* Banner */
.community-banner {
  margin: 26px 0 22px;
  background: linear-gradient(120deg, var(--rust) 0%, var(--rust-dark) 100%);
  border-radius: 16px; color: #fff; box-shadow: var(--shadow);
  overflow: hidden;
}
.banner-inner { display: flex; align-items: center; gap: 20px; padding: 24px 28px; }
.banner-mark { width: 64px; height: 64px; border-radius: 50%; flex: 0 0 auto;
  box-shadow: 0 2px 10px rgba(0,0,0,.18); background: #fff; }
.banner-text { flex: 1; min-width: 0; }
.banner-text h1 { font-family: var(--serif); font-size: 1.9rem; margin: 0 0 4px; color: #fff; }
.banner-text p { margin: 0 0 10px; color: rgba(255,255,255,.92); font-size: 1rem; max-width: 64ch; }
.banner-stats { display: flex; gap: 18px; font-size: .86rem; color: rgba(255,255,255,.85); }
.banner-stats strong { color: #fff; }
.banner-cta { flex: 0 0 auto; background: #fff; color: var(--rust-dark); font-weight: 700; padding: 11px 18px; }
.banner-cta:hover { background: var(--cream); color: var(--rust-dark); }

/* Two-column layout */
.banner-about {
  margin: 0 0 22px; padding: 16px 20px; font-size: 1rem; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--rust);
  border-radius: 14px; box-shadow: var(--shadow);
}
.banner-about strong { color: var(--rust-dark); }

.feed-layout { display: grid; grid-template-columns: 1fr 300px; gap: 26px; align-items: start; padding-bottom: 60px; }
.feed-main { min-width: 0; }

/* Composer prompt */
.composer {
  display: flex; align-items: center; gap: 12px; text-decoration: none;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 16px; box-shadow: var(--shadow);
  transition: border-color .12s ease;
}
.composer:hover { border-color: var(--rust); }
.composer-avatar { flex: 0 0 auto; display: flex; }
.composer-avatar .avatar { width: 38px; height: 38px; font-size: 1rem; }
.composer-prompt { flex: 1; color: var(--muted); font-size: .96rem; }
.composer-go { background: var(--rust); color: #fff; font-weight: 600; font-size: .85rem;
  padding: 7px 14px; border-radius: 8px; }

/* Sort tabs */
.feed-toolbar { display: flex; gap: 8px; margin-bottom: 14px; }
.feed-toolbar .tab {
  text-decoration: none; color: var(--muted); font-weight: 600; font-size: .9rem;
  padding: 8px 14px; border-radius: 999px; border: 1px solid transparent;
}
.feed-toolbar .tab:hover { background: var(--cream-deep); color: var(--ink); }
.feed-toolbar .tab.active { background: #fff; color: var(--rust-dark); border-color: var(--line); box-shadow: var(--shadow); }

/* Proposal cards */
.feed { display: grid; gap: 14px; }
.pcard {
  display: flex; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow); overflow: hidden;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.pcard:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(42,36,31,.08), 0 14px 34px rgba(42,36,31,.10); border-color: #ddd0bd; }
.pcard-vote {
  flex: 0 0 52px; background: var(--cream); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  padding: 14px 0; gap: 2px;
}
.pcard-body { flex: 1; min-width: 0; padding: 16px 18px; }
.pcard-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.pcard-stage {
  font-size: .68rem; font-weight: 700; letter-spacing: .4px; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px; color: #fff;
}
.stage-seed { background: #b9a079; }
.stage-sprout { background: #9bb56a; }
.stage-sapling { background: #6f9e4e; }
.stage-tree { background: #3f7d3a; }
.pcard-title { font-family: var(--serif); font-size: 1.3rem; margin: 0 0 6px; line-height: 1.25; }
.pcard-title a { color: var(--ink); text-decoration: none; }
.pcard-title a:hover { color: var(--rust-dark); }
.pcard-excerpt { color: var(--muted); margin: 0 0 12px; font-size: .96rem; }
.pcard-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .84rem; color: var(--muted); }
.pcard-author { font-weight: 600; color: var(--ink); }
.pcard-meta .dot { color: var(--line); }
.pcard-comments { color: var(--muted); text-decoration: none; }
.pcard-comments:hover { color: var(--rust-dark); }

.empty-state { background: #fff; border: 1px dashed var(--line); border-radius: 12px; padding: 40px 20px; text-align: center; }
.empty-state .btn { margin-top: 10px; }

/* Sidebar cards */
.feed-aside { display: grid; gap: 16px; position: sticky; top: 84px; }
.side-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px 18px 20px; box-shadow: var(--shadow); }
.side-card h4 { margin: 0 0 10px; font-size: .78rem; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); }
.side-card p { margin: 0 0 12px; font-size: .92rem; color: var(--ink); }
.side-btn { width: 100%; text-align: center; }
.side-stats { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.side-stats li { display: flex; justify-content: space-between; align-items: baseline; font-size: .92rem; color: var(--muted); }
.side-stats strong { color: var(--ink); font-size: 1.05rem; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; font-size: .88rem; color: var(--muted); }
.legend li { display: flex; align-items: center; gap: 9px; }
.dot-stage { width: 11px; height: 11px; border-radius: 50%; flex: 0 0 auto; }

/* Proposal form page */
.form-page { padding-top: 18px; }
.form-page .backlink { display: inline-block; margin-bottom: 12px; }
.form-card { max-width: 680px; margin: 8px auto 60px; }
.form-card select, .form-card textarea, .form-card input { width: 100%; font: inherit;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fdfbf7; color: var(--ink); }
.form-card select:focus, .form-card textarea:focus, .form-card input:focus {
  outline: none; border-color: var(--rust); box-shadow: 0 0 0 3px rgba(168,71,42,.12); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.form-actions .btn { width: auto; padding: 10px 20px; }

@media (max-width: 860px) {
  .feed-layout, .detail-layout { grid-template-columns: 1fr; }
  .feed-aside { position: static; order: -1; }
  .banner-inner { flex-wrap: wrap; }
  .banner-cta { width: 100%; text-align: center; }
}

/* ============================================================
   Avatars, profile/stats card, hālāwai, detail redesign
   ============================================================ */
.avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: 0 0 auto;
  object-fit: cover; display: inline-flex; align-items: center; justify-content: center;
  background: var(--rust); color: #fff; font-weight: 700; font-size: .78rem;
  text-transform: uppercase; vertical-align: middle;
}
.avatar.avatar-initials { line-height: 1; }
.avatar.lg { width: 56px; height: 56px; font-size: 1.15rem; }
.avatar.sm { width: 26px; height: 26px; font-size: .72rem; }

/* "Your activity" sidebar card */
.you-card .you-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.you-id { min-width: 0; }
.you-name { font-weight: 700; font-size: 1.02rem; color: var(--ink); }
.you-place { font-size: .82rem; color: var(--muted); }
.you-handle { font-size: .82rem; color: var(--rust-dark); }
.you-bio { font-size: .9rem; color: var(--ink); margin: 0 0 14px; }
.you-stats { list-style: none; margin: 0 0 14px; padding: 14px 0; display: flex;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; }
.you-stats li { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.you-stats strong { font-size: 1.25rem; color: var(--ink); font-family: var(--serif); }
.you-stats span { font-size: .68rem; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); }
.you-actions { display: grid; gap: 8px; }

/* Place + halawai chips */
.chip-halawai { background: #e8f0e0; color: #3f6b32; }
.district-tag { font-size: .72rem; color: var(--muted); background: var(--cream-deep);
  padding: 3px 8px; border-radius: 6px; }

/* Detail page cards */
.detail-back { display: inline-block; margin: 18px 0 12px; }
.detail-card { background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); padding: 26px 28px; margin-bottom: 18px; }
.detail-card.discussion { margin-top: 0; }
.detail-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.detail-vote { margin-left: auto; }
.detail-byline { display: flex; align-items: center; gap: 8px; color: var(--muted);
  font-size: .9rem; margin: 4px 0 18px; }
.detail-byline .dot { color: var(--line); }
.article.detail-card h1 { margin-top: 0; }

/* Hālāwai card */
.halawai-card .halawai-date { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.halawai-day { font-family: var(--serif); font-size: 1.15rem; font-weight: 700; color: var(--ink); }
.halawai-time { color: var(--rust-dark); font-weight: 600; }
.halawai-where { font-size: .9rem; color: var(--muted); margin-bottom: 8px; display: grid; gap: 4px; }
.halawai-where a { font-weight: 600; }
.halawai-count { font-size: .82rem; color: var(--muted); margin-bottom: 12px; }

/* Docs in sidebar */
.doc-add { margin-top: 12px; }
.doc-add > summary { cursor: pointer; color: var(--rust-dark); font-weight: 600; font-size: .88rem; list-style: none; }
.doc-add > summary::-webkit-details-marker { display: none; }
.doc-add .doc-form { margin-top: 10px; }

/* Comment avatars */
.comment-meta .avatar { margin-right: 2px; }

/* Profile form */
.profile-preview { display: flex; align-items: center; gap: 12px; margin: 16px 0 8px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-group { border: 1px solid var(--line); border-radius: 10px; padding: 0 14px; margin-bottom: 16px; background: #fdfbf7; }
.field-group > summary { cursor: pointer; font-weight: 600; color: var(--rust-dark); padding: 12px 0; list-style: none; }
.field-group > summary::-webkit-details-marker { display: none; }
.field-group[open] { padding-bottom: 10px; }
.field-group .field:first-of-type { margin-top: 4px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }

/* ============================================================
   "How proposals grow" spectrum + hālāwai explainer (sidebar)
   ============================================================ */
.spectrum { margin: 2px 0 12px; }
.spectrum-bar {
  height: 10px; border-radius: 999px;
  background: linear-gradient(90deg, #c9b393 0%, #9bb56a 55%, #3f7d3a 100%);
}
.spectrum-ends { display: flex; justify-content: space-between; margin-top: 8px; }
.spectrum-end { display: flex; flex-direction: column; font-size: .8rem; color: var(--muted); line-height: 1.3; }
.spectrum-end.right { text-align: right; }
.spectrum-end strong { font-family: var(--serif); font-size: .98rem; color: var(--ink); }
.spectrum-note { font-size: .86rem; color: var(--muted); margin: 0 0 14px; }
.halawai-explain { border-top: 1px solid var(--line); padding-top: 12px; }
.halawai-explain-label {
  display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; color: #3f6b32; background: #e8f0e0;
  padding: 3px 9px; border-radius: 999px; margin-bottom: 8px;
}
.halawai-explain p { margin: 0; font-size: .88rem; color: var(--ink); line-height: 1.55; }

/* ============================================================
   Aʻoaʻo Sīwilia (civics / history) page
   ============================================================ */
.civics-banner { background: linear-gradient(120deg, #4a6b4a 0%, #2f4a2f 100%); }

.invite-card {
  background: #fff; border: 1px solid var(--line); border-left: 3px solid #6f9e4e;
  border-radius: 12px; padding: 18px 20px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.invite-card h3 { font-family: var(--serif); font-size: 1.25rem; margin: 0 0 6px; }
.invite-card p { color: var(--muted); margin: 0 0 14px; font-size: .96rem; }

.history-feed { display: grid; gap: 18px; padding-bottom: 60px; }
.history-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); padding: 22px 24px;
}
.history-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.history-title { font-family: var(--serif); font-size: 1.5rem; line-height: 1.2; margin: 0; }
.history-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-curated { background: #efe7da; color: var(--muted); }
.chip-kind { font-weight: 700; }
.chip-history { background: #f3e3dc; color: var(--rust-dark); }
.chip-system { background: #e3ece0; color: var(--green-dark); }

.video-poster {
  position: relative; display: flex; align-items: flex-end; width: 100%;
  aspect-ratio: 16 / 9; margin-bottom: 16px; border-radius: 10px; overflow: hidden;
  background-color: #000; background-size: cover; background-position: center;
  text-decoration: none; box-shadow: var(--shadow);
}
.video-poster::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(0,0,0,.65) 100%); }
.video-play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 64px; height: 64px; border-radius: 50%; background: rgba(168,71,42,.92);
  box-shadow: 0 4px 18px rgba(0,0,0,.4); transition: transform .12s ease, background .12s ease; z-index: 1;
}
.video-play::before { content: ""; position: absolute; top: 50%; left: 54%;
  transform: translate(-50%,-50%); border-style: solid; border-width: 12px 0 12px 20px;
  border-color: transparent transparent transparent #fff; }
.video-poster:hover .video-play { transform: translate(-50%,-50%) scale(1.08); background: var(--rust); }
.video-label { position: relative; z-index: 1; color: #fff; font-weight: 700; font-size: .92rem;
  padding: 14px 16px; text-shadow: 0 1px 3px rgba(0,0,0,.5); }

.history-summary { font-size: 1.02rem; color: var(--ink); }
.history-summary p { margin: 0 0 12px; }
.history-link { font-weight: 600; }

/* Glossary (collapsible) */
.glossary { margin: 8px 0 4px; border: 1px solid var(--line); border-radius: 10px;
  background: #fbf7f0; padding: 0 16px; }
.glossary > summary {
  cursor: pointer; list-style: none; padding: 13px 0; font-weight: 700; color: var(--rust-dark);
  font-size: .92rem;
}
.glossary > summary::-webkit-details-marker { display: none; }
.glossary > summary::before { content: "▸ "; font-size: .8rem; }
.glossary[open] > summary::before { content: "▾ "; }
.glossary[open] { padding-bottom: 14px; }
.glossary-section { margin-top: 14px; }
.glossary-section h4 {
  font-family: var(--serif); font-size: 1.02rem; margin: 0 0 8px; color: var(--ink);
  padding-bottom: 5px; border-bottom: 1px solid var(--line);
}
.glossary dl { margin: 0; }
.glossary dt { font-weight: 700; color: var(--ink); font-size: .92rem; margin-top: 9px; }
.glossary dd { margin: 2px 0 0; color: var(--muted); font-size: .9rem; line-height: 1.5; }

.history-byline { display: flex; align-items: center; gap: 8px; margin-top: 16px;
  color: var(--muted); font-size: .86rem; }
.history-byline .dot { color: var(--line); }
.history-byline span:not(.dot) { font-weight: 600; color: var(--ink); }
.history-byline span.dot, .history-byline span:last-child { font-weight: 400; color: var(--muted); }

/* ============================================================
   Goals, subgoals, tasks + proposal team
   ============================================================ */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.section-head h2 { margin: 0; }
.member-pill { font-size: .72rem; font-weight: 700; color: #3f6b32; background: #e8f0e0;
  padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.goals-card h2 { font-family: var(--serif); font-size: 1.4rem; }
.goals-intro { margin: 6px 0 16px; font-size: .92rem; }

.goal-list { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 10px; }
.goal-row { border: 1px solid var(--line); border-radius: 10px; background: #fff;
  transition: border-color .12s ease, transform .12s ease, box-shadow .12s ease; }
.goal-row:hover { border-color: var(--rust); transform: translateY(-1px); box-shadow: var(--shadow); }
.goal-row.is-done { background: #f4f8f1; }
.goal-link { display: flex; align-items: center; gap: 12px; padding: 13px 16px;
  text-decoration: none; color: var(--ink); }
.goal-row-main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.goal-row-title { font-family: var(--serif); font-size: 1.08rem; font-weight: 700; }
.goal-row.is-done .goal-row-title { text-decoration: line-through; color: var(--muted); }
.goal-row-desc { font-size: .88rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.goal-row-tags { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }
.mini-progress { display: inline-block; width: 80px; height: 7px; border-radius: 999px;
  background: var(--cream-deep); overflow: hidden; vertical-align: middle; }
.mini-progress-fill { display: block; height: 100%;
  background: linear-gradient(90deg, #9bb56a, #3f7d3a); border-radius: 999px; }
.goal-row-count { font-weight: 600; }
.goal-row-sub { background: var(--chip); color: var(--rust-dark); padding: 2px 8px; border-radius: 999px; font-weight: 600; }
.goal-row-arrow { font-size: 1.5rem; color: var(--muted); flex: 0 0 auto; }

.add-goal { margin-top: 12px; }
.add-goal > summary, .doc-add > summary { cursor: pointer; color: var(--rust-dark); font-weight: 600;
  font-size: .9rem; list-style: none; }
.add-goal > summary::-webkit-details-marker { display: none; }
.stack-form { display: grid; gap: 8px; margin-top: 10px; }
.stack-form input, .stack-form textarea, .stack-form select { width: 100%; font: inherit;
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fdfbf7; color: var(--ink); }
.stack-form .btn { justify-self: start; }

/* Proposal team card */
.member-list { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 8px; }
.member-list li { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.member-name { font-weight: 600; }
.owner-badge { font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  color: var(--rust-dark); background: var(--chip); padding: 2px 7px; border-radius: 999px; margin-left: auto; }
.pending-apps { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.pending-apps h5 { margin: 0 0 10px; font-size: .72rem; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.pending-app { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; background: #fdfbf7; }
.pending-who { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .9rem; }
.pending-msg { margin: 8px 0; font-size: .86rem; color: var(--ink); }
.pending-actions { display: flex; gap: 8px; }
.pending-actions .btn { padding: 6px 12px; font-size: .82rem; }
.join-box { margin-top: 8px; }
.join-box > summary { cursor: pointer; color: var(--rust-dark); font-weight: 600; font-size: .9rem; list-style: none; }
.join-box > summary::-webkit-details-marker { display: none; }
.join-box p { margin: 8px 0; }
.join-status { margin: 6px 0 0; }

/* Breadcrumbs */
.crumbs { font-size: .86rem; color: var(--muted); margin: 18px 0 14px; display: flex;
  flex-wrap: wrap; align-items: center; gap: 6px; }
.crumbs a { color: var(--rust-dark); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumb-sep { color: var(--line); }
.crumb-current { color: var(--ink); font-weight: 600; }

/* Goal page */
.goal-page { padding-bottom: 60px; display: grid; gap: 18px; }
.goal-header-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.goal-header h1 { font-family: var(--serif); font-size: 1.7rem; margin: 0; }
.goal-progress-badge { font-size: .78rem; font-weight: 700; color: #3f6b32; background: #e8f0e0;
  padding: 4px 11px; border-radius: 999px; }
.goal-desc { margin: 12px 0 0; color: var(--ink); }
.goal-byline { display: flex; align-items: center; gap: 12px; margin-top: 14px;
  font-size: .82rem; color: var(--muted); }

/* Tasks */
.task-list { display: grid; gap: 2px; margin-bottom: 14px; }
.task-row { display: flex; align-items: center; gap: 12px; padding: 9px 6px;
  border-bottom: 1px solid var(--line); }
.task-row:last-child { border-bottom: 0; }
.task-check { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--line);
  background: #fff; cursor: pointer; color: #fff; font-size: .8rem; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; }
.task-check.checked { background: #3f7d3a; border-color: #3f7d3a; }
.task-check:disabled { cursor: default; opacity: .6; }
.task-title { flex: 1; min-width: 0; font-size: .98rem; }
.task-row.is-done .task-title { text-decoration: line-through; color: var(--muted); }
.task-assign { flex: 0 0 auto; }
.assign-select { font: inherit; font-size: .84rem; padding: 5px 8px; border: 1px solid var(--line);
  border-radius: 7px; background: #fdfbf7; color: var(--ink); max-width: 150px; }
.assignee-chip { display: inline-flex; align-items: center; gap: 6px; font-size: .84rem; color: var(--ink); }
.inline-form { display: inline; margin: 0; }
.link-btn { background: none; border: 0; cursor: pointer; font: inherit; color: var(--rust-dark);
  font-weight: 600; padding: 0; }
.link-btn.danger { color: var(--muted); }
.link-btn.danger:hover { color: #9a2a1c; }
.task-del { font-size: .9rem; }
.task-add-form { display: flex; gap: 8px; align-items: center; margin-top: 14px;
  border-top: 1px dashed var(--line); padding-top: 14px; flex-wrap: wrap; }
.task-add-form input[name="title"] { flex: 1; min-width: 180px; font: inherit; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: 8px; background: #fdfbf7; color: var(--ink); }
@media (max-width: 560px) {
  .task-add-form { flex-direction: column; align-items: stretch; }
  .assign-select { max-width: none; }
}
