:root {
  color-scheme: light;
  --ink: #18211d;
  --muted: #66736d;
  --line: #d8dfda;
  --panel: #ffffff;
  --soft: #f3f7f4;
  --brand: #1f6f4a;
  --brand-dark: #174f37;
  --accent: #c2462e;
  --gold: #d89b2b;
  --shadow: 0 18px 45px rgba(29, 44, 37, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(140deg, rgba(31, 111, 74, 0.10), transparent 38%),
    linear-gradient(0deg, #edf3ef, #f8faf8);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 8px;
  padding: 0.82rem 1rem;
  color: #fff;
  background: var(--brand);
  cursor: pointer;
  font-weight: 700;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0.82rem 1rem;
  color: #fff;
  background: var(--brand);
  font-weight: 800;
  text-decoration: none;
}

button:hover {
  background: var(--brand-dark);
}

.button-link:hover {
  background: var(--brand-dark);
}

button.secondary,
.segmented button {
  color: var(--ink);
  background: #eef3f0;
}

button.secondary:hover,
.segmented button:hover {
  background: #dfe9e4;
}

button.is-active,
.segmented button.is-active {
  color: #fff;
  background: var(--brand);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.78rem 0.82rem;
  color: var(--ink);
  background: #fff;
}

textarea {
  resize: vertical;
}

label {
  display: grid;
  gap: 0.38rem;
  color: #324039;
  font-size: 0.92rem;
  font-weight: 700;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.62fr);
  gap: 28px;
  align-items: center;
  min-height: calc(100vh - 64px);
}

.auth-copy {
  padding: 28px;
}

.auth-copy h1,
.topbar h1 {
  margin: 0;
  font-size: 4rem;
  line-height: 1;
  letter-spacing: 0;
}

.auth-copy p {
  max-width: 700px;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.65;
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.auth-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.auth-highlights span,
.topic-list button,
.thread-tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.58rem 0.78rem;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 800;
}

.auth-card,
.panel {
  border: 1px solid rgba(216, 223, 218, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.auth-card {
  padding: 20px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}

.stack {
  display: grid;
  gap: 14px;
}

.compact {
  gap: 12px;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.status-line {
  min-height: 1.3rem;
  color: var(--accent);
  font-weight: 800;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 18px;
}

.topbar h1 {
  font-size: 2.6rem;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px;
  background: #fff;
}

.user-pill img,
.profile-row img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--soft);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.tabs button {
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
}

.tabs button.is-active {
  color: #fff;
  border-color: var(--brand);
  background: var(--brand);
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.panel {
  padding: 18px;
}

.panel.wide {
  grid-column: 1 / -1;
}

.quoter-host {
  margin-bottom: 16px;
}

.quoter-frame {
  display: block;
  width: 100%;
  min-height: 760px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.foam-tools-grid {
  margin-top: 16px;
}

.panel h2 {
  margin: 0 0 12px;
  font-size: 1.18rem;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 14px;
}

.muted {
  color: var(--muted);
  line-height: 1.5;
}

.summary-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.summary-list div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.summary-list dt {
  color: var(--muted);
}

.summary-list dd {
  margin: 0;
  font-weight: 900;
  text-align: right;
}

.stat-number {
  margin: 8px 0 0;
  color: var(--brand);
  font-size: 3rem;
  font-weight: 950;
}

.inline-check {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.inline-check input {
  width: auto;
}

.list,
.post-list {
  display: grid;
  gap: 10px;
}

.list-item,
.post-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.list-item button {
  padding: 0.62rem 0.78rem;
}

.item-heading {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.item-heading strong {
  display: block;
  margin-bottom: 3px;
}

.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.forum-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) minmax(320px, 0.8fr);
  gap: 16px;
}

.topic-list {
  display: grid;
  gap: 8px;
}

.topic-list button {
  width: 100%;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
}

.topic-list button.is-active {
  color: #fff;
  border-color: var(--brand);
  background: var(--brand);
}

.thread-row {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  background: #fff;
  text-align: left;
}

.thread-row:hover {
  color: #fff;
  background: var(--brand);
}

.author-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
}

.thread-row:hover .author-line {
  color: rgba(255, 255, 255, 0.82);
}

.post-item {
  display: grid;
  gap: 8px;
}

.post-author {
  display: flex;
  align-items: center;
  gap: 10px;
}

.post-author img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--soft);
}

.post-body {
  white-space: pre-wrap;
  line-height: 1.55;
}

.profile-row {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.profile-row img {
  width: 76px;
  height: 76px;
}

.avatar-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

.avatar-form label {
  min-width: min(320px, 100%);
}

[hidden] {
  display: none !important;
}

@media (max-width: 980px) {
  .auth-layout,
  .forum-layout,
  .panel-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .user-pill {
    justify-content: space-between;
    border-radius: 8px;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding: 16px 0;
  }

  .auth-copy,
  .auth-card,
  .panel {
    padding: 14px;
  }

  .auth-copy h1,
  .topbar h1 {
    font-size: 2.1rem;
  }

  .two-col {
    grid-template-columns: 1fr;
  }

  .item-heading,
  .panel-heading {
    display: grid;
  }

  .tabs button {
    flex: 1 1 140px;
  }
}
