:root {
  color-scheme: light;
  --ink: #14221b;
  --muted: #3a4a43;
  --paper: #f3efe4;
  --card: #fffdf8;
  --line: #d5cbb8;
  --accent: #0c6a3a;
  --accent-ink: #0b3d24;
  --danger: #9b2c2c;
  --ok: #1b5e3b;
  --radius: 14px;
  --max: 1120px;
  --font: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --shadow: 0 10px 30px rgba(11, 61, 36, 0.08);
}
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  background: #102018;
  color-scheme: light;
  min-height: 100%;
  min-height: 100dvh;
}
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: #102018;
  line-height: 1.55;
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
#main { flex: 1; background: var(--paper); }
a { color: var(--accent-ink); }
a:hover { color: #083522; }
.site-header a:hover,
.site-header a:focus { color: #ffffff; }
.site-footer a:hover,
.site-footer a:focus { color: #ffffff; }
img { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; }
.skip {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip:focus {
  left: 8px;
  top: 8px;
  width: auto;
  height: auto;
  clip: auto;
  padding: .5rem .8rem;
  z-index: 100;
  background: #fff;
  color: var(--accent-ink);
  border-radius: 8px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.wrap { width: min(var(--max), calc(100% - 1.5rem)); margin-inline: auto; }

.site-header {
  background: var(--accent-ink);
  color: #e8f6ee;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .7rem 0;
  position: relative;
  flex-wrap: nowrap;
}
.brand {
  display: flex;
  gap: .6rem;
  align-items: center;
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  flex-shrink: 0;
}
.site-header .brand,
.site-header .brand:link,
.site-header .brand:visited,
.site-header .brand:hover,
.site-header .brand:focus,
.site-header .brand:active {
  color: #ffffff;
  text-decoration: none;
}
.brand img { height: 36px; width: auto; }
.mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: .8rem;
  font-weight: 800;
}
.nav {
  display: flex;
  align-items: center;
  gap: .15rem;
  flex: 1 1 auto;
  min-width: 0;
}
.nav a {
  color: #ffffff;
  text-decoration: none;
  padding: .4rem .65rem;
  border-radius: 8px;
  white-space: nowrap;
}
.nav a:visited { color: #ffffff; }
.nav a:hover { background: rgba(255, 255, 255, 0.14); color: #ffffff; }
.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 0;
  margin-left: auto;
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 10px;
  cursor: pointer;
  place-items: center;
  flex-shrink: 0;
}
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 18px;
  height: 2px;
  background: #fff;
  border-radius: 1px;
  position: relative;
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }
.site-header.is-open .nav-toggle-bars { background: transparent; }
.site-header.is-open .nav-toggle-bars::before { top: 0; transform: rotate(45deg); }
.site-header.is-open .nav-toggle-bars::after { top: 0; transform: rotate(-45deg); }
.search-strip {
  background: #145c38;
  padding: .35rem 0 .4rem;
}
.site-search {
  display: flex;
  align-items: center;
  gap: .35rem;
  width: min(48rem, 100%);
  max-width: 48rem;
  margin-inline: auto;
}
.site-search input,
.site-search input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  height: 40px;
  border: 0;
  border-radius: 999px;
  padding: 0 .85rem;
  background: #fff;
  font-size: .95rem;
  line-height: 40px;
}
.site-search button {
  flex: 0 0 auto;
  height: 40px;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 0 1rem;
  font: inherit;
  font-size: .95rem;
  font-weight: 650;
  cursor: pointer;
  line-height: 1;
}
input:not([type="checkbox"]):not([type="radio"]),
select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .65rem .75rem;
  font: inherit;
  background: #fff;
  color: var(--ink);
}
.site-search input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  height: 40px;
  border: 0;
  border-radius: 999px;
  padding: 0 .85rem;
  background: #fff;
}
input::placeholder,
textarea::placeholder {
  color: #3a4a43;
  opacity: 1;
}
.page-search, .hero-search {
  display: flex;
  gap: .4rem;
  max-width: 36rem;
  margin: 1rem 0;
}
.btn, button.btn {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: .65rem 1.1rem;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}
.header-search button:hover, .site-search button:hover, .btn:hover { filter: brightness(1.08); color: #fff; }
.btn-ghost {
  background: transparent;
  color: inherit;
  border: 1px solid currentColor;
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.12); color: inherit; }
.btn-sm { padding: .55rem 1rem; font-size: .9rem; min-height: 44px; }
.btn-join { font-size: 1.05rem; padding: .8rem 1.3rem; }
.group-page .actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  align-items: center;
}
.btn-danger { background: var(--danger); }

.hero {
  background:
    radial-gradient(circle at 10% 20%, #1f7a4c 0, transparent 40%),
    linear-gradient(160deg, #0b3d24, #145c38);
  color: #f4fff8;
  padding: 2.5rem 0 2.8rem;
}
.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin: 0 0 .6rem;
  letter-spacing: -.03em;
  max-width: 18ch;
  line-height: 1.15;
  color: #fff;
}
.hero p { max-width: 46rem; color: #eaf7ef; }

.page { padding: 1.4rem 0 3rem; }
.page h1, .wrap > h2, section.wrap h2 {
  color: var(--accent-ink);
}
.cat-grid, .cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .75rem;
}
.cat-tile, .card, .cat-row, .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .9rem 1rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
}
.cat-tile {
  font-weight: 650;
  min-height: 3.4rem;
  display: flex;
  align-items: center;
}
.cat-tile:hover, .card:hover { border-color: var(--accent); }
.group-card h3 { margin: 0 0 .3rem; font-size: 1.05rem; }
.group-card p { margin: 0.35rem 0; }
.group-card { contain: layout style; }
.group-card-icon {
  display: block;
  flex-shrink: 0;
  margin: 0 0 .65rem;
  width: 96px;
  height: 96px;
  overflow: hidden;
  border-radius: 16px;
}
.group-card-icon img {
  display: block;
  width: 96px;
  height: 96px;
  border-radius: 16px;
  object-fit: cover;
  background: #efe8d6;
  border: 1px solid var(--line);
}
.group-card-icon img.is-default {
  object-fit: cover;
  background: #128c4b;
  border-color: #0c6a3a;
}
.meta, .muted, .tiny { color: var(--muted); font-size: .9rem; }
.split { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; }
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(15rem, 17.5rem);
  grid-template-areas:
    "crumbs crumbs"
    "article aside"
    "comments comments";
  column-gap: 2rem;
  row-gap: 1.25rem;
  align-items: start;
}
.article-layout > .crumbs { grid-area: crumbs; margin-bottom: 0; }
.article-layout > .prose { grid-area: article; min-width: 0; }
.article-layout > aside {
  grid-area: aside;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  min-width: 0;
}
.article-layout > .comments { grid-area: comments; }
.article-layout aside h2 { margin: 0 0 .5rem; font-size: 1.05rem; }
.article-layout aside h2 + ul { margin: 0 0 1.1rem; padding-left: 1.1rem; }
.page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
.page-layout > .prose {
  min-width: 0;
  width: 100%;
  max-width: none;
}
.page-layout > .prose :where(p, li) { max-width: none; }
.page-layout .stack.panel { max-width: 36rem; }
.invite-preview-status { margin: .15rem 0 .35rem; min-height: 1.3em; }
.invite-preview {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 0 0 .5rem;
}
.invite-preview[hidden] { display: none !important; }
.invite-preview img {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  background: #efe8d6;
  border: 1px solid var(--line);
}
.group-icon { margin: 0 0 1rem; }
.group-icon img {
  width: 96px;
  height: 96px;
  border-radius: 16px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #efe8d6;
}
.prose { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.35rem 1.5rem; }
.prose h1, .prose h2 { color: var(--accent-ink); }
.prose h2 { margin-top: 1.6rem; }
.prose :where(p, li) { max-width: 68ch; }
.hero-img { border-radius: var(--radius); margin-bottom: 1rem; }
.site-footer {
  background: #102018;
  color: #f4fbf7;
  padding: 1.5rem 0;
  margin-top: auto;
  flex-shrink: 0;
}
.site-footer p,
.site-footer strong {
  color: #f4fbf7;
}
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; }
.footer-grid h2 { font-size: 1rem; color: #ffffff; margin: 0 0 .4rem; }
.footer-grid a,
.footer-grid a:link,
.footer-grid a:visited {
  display: block;
  color: #f4fbf7;
  margin: .2rem 0;
  text-decoration: none;
}
.footer-grid a:hover,
.footer-grid a:focus,
.footer-grid a:active {
  color: #ffffff;
}
.site-footer .tiny,
.site-footer .muted {
  color: #e5f3eb;
}
.flash { padding: .8rem 1rem; border-radius: 10px; margin: .8rem 0; }
.flash-ok { background: #e4f6ea; color: var(--ok); }
.flash-err { background: #fde8e8; color: var(--danger); }
.stack { display: grid; gap: .7rem; }
.stack label { display: grid; gap: .25rem; font-weight: 600; }
.narrow { max-width: 42rem; }
.empty {
  background: #fff;
  border: 1px dashed var(--line);
  padding: 1.2rem;
  border-radius: var(--radius);
}
.pager { display: flex; gap: 1rem; align-items: center; margin: 1.2rem 0; flex-wrap: wrap; }
.pager a, .pager-btn {
  font-weight: 650;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.home-cats {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 1.25rem 0 0;
}
.home-cats summary {
  padding: .75rem 1.1rem;
  min-height: 44px;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.home-cats summary::-webkit-details-marker { display: none; }
.home-cats summary h2 { margin: 0; font-size: 1.15rem; }
.home-cats summary::after { content: "▾"; font-size: .9rem; color: var(--accent); }
.home-cats .cat-grid { padding: 1rem; }
.cat-jump { padding: .85rem 1.1rem 0; }
.cat-jump select { max-width: 28rem; }
.cat-all { padding: 0 1.1rem 1rem; margin: .6rem 0 0; }
.home-pager { display: flex; align-items: center; gap: .75rem; margin-top: 1.25rem; flex-wrap: wrap; }
.pager-btn {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: .55rem 1.1rem;
  text-decoration: none;
}
.pager-btn:hover { color: #fff; }
.pager-info { color: var(--muted); font-size: .9rem; }
.more-articles { margin: .5rem 0 1rem; }
.more-articles summary {
  cursor: pointer;
  font-weight: 650;
  color: var(--accent-ink);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.crumbs { display: flex; flex-wrap: wrap; gap: .4rem; font-size: .9rem; margin-bottom: 1rem; }
.crumbs a { text-decoration: none; }
.sort-bar { display: flex; gap: 1rem; margin: 1rem 0; flex-wrap: wrap; }
.cat-list { display: grid; gap: .5rem; }
.cat-row { display: flex; justify-content: space-between; gap: 1rem; }
.ad-slot { margin: 1rem 0; min-height: 0; }
.comment { border-bottom: 1px solid var(--line); padding: .6rem 0; }
code { background: #efe8d6; padding: .1rem .3rem; border-radius: 4px; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: .35rem 0; border-bottom: 1px solid rgba(213, 203, 184, 0.6); }
section.wrap { padding-top: 1.4rem; padding-bottom: .4rem; }
.join-box, .report-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  margin: 1rem 0;
}
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .45rem .3rem; border-bottom: 1px solid var(--line); }

a.fab-submit {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  box-sizing: border-box;
  width: 60px;
  height: 60px;
  min-width: 60px;
  min-height: 60px;
  max-width: 60px;
  max-height: 60px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 50%;
  background: #25d366;
  color: #0a3d22;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  line-height: 1;
}
a.fab-submit:hover,
a.fab-submit:focus {
  background: #1ebe5d;
  color: #0a3d22;
  filter: none;
}
a.fab-submit .fab-icon {
  display: block;
  width: 28px;
  height: 28px;
  flex: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.nav-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.site-header a:focus-visible,
.site-header button:focus-visible,
.site-search button:focus-visible {
  outline-color: #ffffff;
}
a.fab-submit:focus-visible {
  outline: 2px solid #0a3d22;
  outline-offset: 3px;
}

@media (max-width: 900px) {
  .split, .article-layout { grid-template-columns: 1fr; }
  .article-layout {
    grid-template-areas:
      "crumbs"
      "article"
      "aside"
      "comments";
    gap: 1rem;
  }
  .article-layout > aside { padding: .9rem 1rem; }
  .prose { padding: 1.2rem 1.15rem; }
  .header-inner { flex-wrap: wrap; }
  .nav-toggle { display: grid; }
  .nav {
    display: none;
    flex: 1 1 100%;
    flex-direction: column;
    align-items: stretch;
    gap: .3rem;
    margin-top: .35rem;
    padding: .45rem .2rem .55rem;
    background: #082818;
    border-radius: 10px;
  }
  .site-header .nav a,
  .site-header .nav a:visited {
    color: #ffffff;
    background: #1f5c3c;
    padding: .75rem .9rem;
    font-weight: 650;
    border-radius: 8px;
  }
  .site-header .nav a:hover,
  .site-header .nav a:focus {
    background: #25d366;
    color: #08351c;
  }
  .site-header.is-open .nav { display: flex; }
}
