:root {
  --bg: #f3eee4;
  --fg: #1a1713;
  --card: #faf7f0;
  --muted: #6e675c;
  --primary: #2d4a42;
  --primary-fg: #f4efe6;
  --border: #d4cbb8;
  --rule: #c9beaa;
  --danger: #8f3d32;
  --secondary: #e8e0d2;
  --font: "Figtree", system-ui, sans-serif;
  --display: "Fraunces", "Times New Roman", serif;
  --radius: 8px;
  --radius-xl: 24px;
  --shadow: 0 1px 0 rgba(26, 23, 19, 0.04), 0 12px 32px -18px rgba(26, 23, 19, 0.18);
}

* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  line-height: 1.55;
}
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 1.4rem + 2vw, 3rem); margin: 0.3rem 0 0.6rem; }
h2 { font-size: 1.5rem; }
a { color: inherit; }
button, [role="button"] { cursor: pointer; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

.site-header, .site-footer { border-color: var(--border); border-style: solid; border-width: 0; }
.site-header { border-bottom-width: 1px; background: color-mix(in srgb, var(--card) 80%, transparent); }
.site-footer { border-top-width: 1px; color: var(--muted); font-size: 0.9rem; }
.bar {
  max-width: 64rem; margin: 0 auto; padding: 0.75rem 1.25rem;
  display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
}
.site-footer .bar { justify-content: space-between; flex-wrap: wrap; padding: 1.25rem; }
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; min-height: 44px; font-family: var(--display); font-size: 1.25rem; font-weight: 600; }
.mark { width: 2rem; height: 2rem; color: var(--primary); }
.search { display: none; flex: 1; max-width: 20rem; }
.search input, .search-page input, select, textarea, input[type="email"], input[type="password"], input[type="text"], input[type="search"] {
  width: 100%; height: 44px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card); color: var(--fg); font: inherit; padding: 0 0.75rem;
}
textarea { height: auto; min-height: 8rem; padding: 0.75rem; }
.actions { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; }
.shell { max-width: 64rem; margin: 0 auto; padding: 2rem 1.25rem 3rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 1rem; border-radius: var(--radius);
  text-decoration: none; font: inherit; font-weight: 500; border: 1px solid transparent;
}
.btn-primary { background: var(--primary); color: var(--primary-fg); }
.btn-outline { background: var(--card); border-color: var(--border); }
.btn-ghost { background: transparent; }
.btn.wide { width: 100%; }
.icon-btn {
  width: 44px; height: 44px; display: none; align-items: center; justify-content: center;
  background: var(--primary); color: var(--primary-fg); border-radius: var(--radius); text-decoration: none; font-size: 1.4rem;
}
.linkish, .text-btn {
  background: none; border: 0; font: inherit; color: var(--muted); min-height: 44px; padding: 0 0.5rem;
  text-decoration: none; display: inline-flex; align-items: center;
}
.who { text-decoration: none; font-weight: 500; min-height: 44px; display: inline-flex; align-items: center; }

.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; font-weight: 500; color: var(--muted); margin: 0; }
.lede { color: var(--muted); font-size: 1.1rem; max-width: 36rem; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.hero { max-width: 36rem; margin-bottom: 2rem; }
.room-grid { display: grid; gap: 0.75rem; margin-bottom: 2.5rem; }
.room-card, .thread-row, .post, .card, .empty {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-xl);
  padding: 1.15rem 1.25rem; box-shadow: var(--shadow); text-decoration: none;
}
.room-card h2 { margin: 0 0 0.4rem; }
.stack { display: flex; flex-direction: column; gap: 0.75rem; }
.section-title { margin: 0 0 0.5rem; }
.thread-row { display: flex; gap: 0.75rem; align-items: flex-start; }
.thread-row h3 { margin: 0.25rem 0; font-size: 1.15rem; }
.meta-row { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.badge { border: 1px solid var(--border); background: var(--secondary); border-radius: 999px; padding: 0.1rem 0.6rem; font-size: 0.75rem; font-weight: 500; }
.count { min-width: 44px; height: 44px; display: grid; place-items: center; background: #e7e0d4; border-radius: var(--radius); font-variant-numeric: tabular-nums; color: var(--muted); }
.split { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: flex-end; margin-bottom: 1.5rem; }
.crumbs { color: var(--muted); font-size: 0.9rem; }
.crumbs a { text-decoration: none; }
.thread-title { max-width: 40rem; }
.post-list { display: flex; flex-direction: column; gap: 1rem; max-width: 40rem; }
.post-op { border-color: var(--rule); }
.post-head { display: flex; gap: 0.75rem; align-items: flex-start; }
.avatar {
  width: 44px; height: 44px; border-radius: 999px; background: var(--secondary);
  display: grid; place-items: center; text-decoration: none; font-weight: 500;
}
.avatar.lg { width: 64px; height: 64px; font-size: 1.1rem; }
.name { font-weight: 500; text-decoration: none; }
.body { white-space: pre-wrap; margin: 0.9rem 0; }
.post-foot { display: flex; flex-wrap: wrap; gap: 0.25rem; align-items: center; }
.like { min-height: 44px; border: 0; background: none; font: inherit; color: var(--muted); padding: 0 0.6rem; }
.like.on { color: var(--primary); font-weight: 600; }
.danger { color: var(--danger); }
.composer { max-width: 40rem; margin-top: 1.5rem; }
.form-narrow, .stack-form { max-width: 36rem; display: flex; flex-direction: column; gap: 0.9rem; }
.form-narrow label, .card form label { display: flex; flex-direction: column; gap: 0.35rem; font-weight: 500; font-size: 0.95rem; }
.row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.row.end { justify-content: flex-end; }
.auth-grid { display: grid; gap: 2rem; }
.card form { display: flex; flex-direction: column; gap: 0.8rem; }
.check { flex-direction: row !important; align-items: center; font-weight: 400 !important; }
.center { text-align: center; }
.flash-error { color: var(--danger); }
.field-error { color: var(--danger); font-weight: 400; font-size: 0.85rem; }
.search-page { display: flex; gap: 0.5rem; max-width: 36rem; margin: 1.25rem 0 1.5rem; }
.search-page input { flex: 1; }
.member-head { display: flex; gap: 1rem; align-items: flex-start; }
.bio { max-width: 36rem; margin: 1.25rem 0 2rem; }
.show-sm { display: none; }

@media (min-width: 640px) {
  .search { display: block; }
  .room-grid { grid-template-columns: 1fr 1fr; }
  .auth-grid { grid-template-columns: 1fr 20rem; align-items: start; }
}
@media (max-width: 639px) {
  .hide-sm { display: none; }
  .show-sm, .icon-btn { display: inline-flex; }
  .who { display: none; }
  .bar { padding: 0.65rem 0.9rem; row-gap: 0.2rem; }
  .brand { font-size: 1.05rem; min-width: 0; }
  .brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .actions { order: 2; flex-shrink: 0; gap: 0.2rem; }
  .actions .btn { padding: 0 0.75rem; }
  .site-nav {
    order: 3;
    flex: 1 1 100%;
    flex-wrap: wrap;
    gap: 0;
  }
  .site-nav a { padding: 0 0.55rem; }
}

.site-nav { display: flex; gap: 0.15rem; }
.site-nav a {
  min-height: 44px; display: inline-flex; align-items: center;
  padding: 0 0.7rem; border-radius: 999px; text-decoration: none; color: var(--muted);
}
.site-nav a.on { background: var(--secondary); color: var(--fg); font-weight: 600; }
.door-grid { display: grid; gap: 0.9rem; margin-bottom: 2.5rem; }
.door-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-xl);
  padding: 1.4rem 1.35rem; box-shadow: var(--shadow); text-decoration: none; min-height: 12rem;
  display: flex; flex-direction: column;
}
.door-card h2 { margin: 0.2rem 0 0.5rem; font-size: 1.8rem; }
.door-card p { margin: 0 0 0.6rem; }
.door-card .muted { margin-top: auto; }
.home-latest { display: grid; gap: 2rem; }
.more { margin: 0.75rem 0 0; }
.more a { color: var(--muted); }
:root { --open: #2d4a42; --closed: #6e675c; }
.grow { flex: 1; min-width: 0; }
.issue-filters { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin-bottom: 1rem; }
.issue-filters input, .issue-filters select { width: auto; min-width: 10rem; flex: 1; }
.tabs { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.tab { min-height: 44px; display: inline-flex; align-items: center; padding: 0 0.8rem; border-radius: 999px; text-decoration: none; color: var(--muted); }
.tab.on { background: var(--secondary); color: var(--fg); font-weight: 600; }
.issue-list { display: flex; flex-direction: column; gap: 0.65rem; }
.issue-row { display: flex; gap: 0.75rem; align-items: flex-start; }
.issue-row h3 { margin: 0 0 0.25rem; font-size: 1.08rem; }
.num { color: var(--muted); font-family: var(--font); font-weight: 500; font-size: 0.9rem; }
.status { font-size: 0.85rem; margin-top: 0.35rem; }
.status.open, .state-badge.open { color: var(--open); }
.status.closed, .state-badge.closed { color: var(--closed); }
.state-badge { text-transform: capitalize; border: 1px solid currentColor; border-radius: 999px; padding: 0.2rem 0.7rem; font-size: 0.85rem; font-weight: 600; align-self: center; }
.pills { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.4rem; }
.pill { display: inline-flex; align-items: center; min-height: 1.5rem; padding: 0 0.55rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; color: #fff; background: var(--pill, var(--muted)); }
.issue-layout { display: grid; gap: 1.25rem; }
.sidebar { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 1.1rem; height: fit-content; }
.label-edit { display: flex; flex-direction: column; gap: 0.2rem; margin-top: 0.75rem; border: 0; padding: 0; }
.flash-key { border-color: var(--primary); }
.key { font-family: ui-monospace, Consolas, monospace; word-break: break-all; font-size: 0.95rem; }
fieldset.label-edit legend { font-weight: 500; margin-bottom: 0.4rem; }
.room-card, .thread-row, .post, .card, .empty, .issue-row {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-xl);
  padding: 1.15rem 1.25rem; box-shadow: var(--shadow); text-decoration: none;
}
@media (min-width: 640px) {
  .door-grid { grid-template-columns: 1fr 1fr; }
  .home-latest { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
  .issue-layout { grid-template-columns: 1fr 16rem; }
}
.vote {
  min-width: 44px; min-height: 52px; padding: 0.25rem;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.05rem; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card); color: var(--muted); font: inherit; font-variant-numeric: tabular-nums;
  text-decoration: none;
}
.vote.on { color: var(--primary); border-color: var(--primary); font-weight: 600; }
}
