:root {
  --paper: #f8f3e8;
  --ink: #211f1b;
  --muted: #70675a;
  --line: #ded1bb;
  --gold: #c4902b;
  --gold-dark: #8d5f12;
  --green: #275846;
  --blue: #283e61;
  --rose: #8f3f4a;
  --white: #fffdf8;
  --shadow: 0 18px 50px rgba(37, 28, 13, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(196, 144, 43, 0.18), transparent 28rem),
    linear-gradient(135deg, #f8f3e8 0%, #efe7d7 48%, #f4efe5 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  cursor: pointer;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(180px, 1fr);
  gap: 18px;
  align-items: center;
  padding: 14px 0;
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: #f8e5a8;
  background: linear-gradient(145deg, var(--green), #18392f);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.brand-mark svg {
  width: 34px;
  height: 34px;
  fill: rgba(196, 144, 43, 0.44);
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.18rem;
}

.brand small,
.eyebrow,
.hero-panel small {
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

nav,
.account-area,
.segmented {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.account-area {
  justify-content: flex-end;
}

.nav-link,
.secondary-action,
.segment,
.icon-button,
.text-button {
  color: var(--ink);
  background: rgba(255, 253, 248, 0.55);
  border: 1px solid rgba(141, 95, 18, 0.18);
  border-radius: 8px;
  transition: 160ms ease;
}

.nav-link,
.secondary-action,
.segment {
  min-height: 38px;
  padding: 0 13px;
}

.nav-link:hover,
.nav-link.active,
.segment:hover,
.segment.active {
  color: #fffdf8;
  background: var(--green);
  border-color: var(--green);
}

.primary-action {
  min-height: 42px;
  padding: 0 16px;
  color: #fffdf8;
  background: var(--gold-dark);
  border: 1px solid var(--gold-dark);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(141, 95, 18, 0.18);
}

.primary-action:hover {
  background: #6f4b0f;
}

.secondary-action:hover,
.text-button:hover {
  border-color: var(--gold-dark);
}

.hero-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 390px);
  gap: 28px;
  align-items: end;
  min-height: 360px;
  padding: 54px;
  overflow: hidden;
  background:
    linear-gradient(120deg, rgba(24, 57, 47, 0.95), rgba(40, 62, 97, 0.74)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 80px);
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  color: #fffdf8;
  box-shadow: var(--shadow);
}

.hero-copy h1 {
  margin: 0;
  max-width: 760px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 8vw, 6.6rem);
  line-height: 0.93;
  letter-spacing: 0;
}

.hero-copy p:last-child {
  max-width: 560px;
  margin: 18px 0 0;
  color: rgba(255, 253, 248, 0.82);
  font-size: 1.08rem;
}

.hero-band .eyebrow {
  color: #f6d58b;
}

.hero-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.hero-panel div {
  min-height: 116px;
  padding: 18px;
  background: rgba(255, 253, 248, 0.12);
  border: 1px solid rgba(255, 253, 248, 0.22);
  border-radius: 8px;
}

.hero-panel span {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.5rem;
}

.hero-panel small {
  color: rgba(255, 253, 248, 0.72);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 14px;
  align-items: end;
  margin: 24px 0;
}

label,
.search-field,
.select-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.8);
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}

input,
select {
  min-height: 46px;
  padding: 0 13px;
}

textarea {
  min-height: 260px;
  padding: 14px;
  resize: vertical;
  line-height: 1.55;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold-dark);
  box-shadow: 0 0 0 4px rgba(196, 144, 43, 0.13);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.section-heading {
  display: flex;
  gap: 16px;
  align-items: end;
  justify-content: space-between;
  margin: 28px 0 18px;
}

.section-heading h2 {
  margin: 3px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 5vw, 3.6rem);
  letter-spacing: 0;
}

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

.post-card,
.editor,
.member-card,
.auth-card,
.empty-state {
  background: rgba(255, 253, 248, 0.82);
  border: 1px solid rgba(141, 95, 18, 0.16);
  border-radius: 8px;
  box-shadow: 0 12px 34px rgba(37, 28, 13, 0.08);
}

.post-card {
  display: flex;
  min-height: 280px;
  flex-direction: column;
  padding: 20px;
}

.post-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.avatar {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: #fffdf8;
  background: var(--blue);
  border-radius: 50%;
  font-weight: 800;
}

.post-card h3 {
  margin: 18px 0 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
  line-height: 1.12;
}

.post-card p {
  display: -webkit-box;
  margin: 0 0 20px;
  overflow: hidden;
  color: #4b443b;
  line-height: 1.58;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}

.text-button {
  align-self: flex-start;
  margin-top: auto;
  padding: 9px 0;
  color: var(--gold-dark);
  background: transparent;
  border: 0;
  font-weight: 800;
}

.editor {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.editor-actions {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}

.editor-actions p,
.form-message {
  margin: 0;
  color: var(--muted);
}

.member-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.member-card {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 90px;
  padding: 16px;
}

.member-card strong,
.member-card span {
  display: block;
}

.member-card span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.88rem;
}

.empty-state {
  padding: 38px;
  text-align: center;
}

.empty-state h3 {
  margin: 0 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
}

.hidden {
  display: none;
}

dialog {
  width: min(430px, calc(100% - 28px));
  padding: 0;
  background: transparent;
  border: 0;
}

dialog::backdrop {
  background: rgba(20, 18, 14, 0.45);
  backdrop-filter: blur(6px);
}

.auth-card {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.auth-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
}

.auth-header h2 {
  margin: 2px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.2rem;
}

.icon-button {
  width: 38px;
  height: 38px;
  padding: 0;
  font-size: 1.5rem;
}

.user-pill {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  min-height: 40px;
  padding: 4px 12px 4px 5px;
  background: rgba(255, 253, 248, 0.72);
  border: 1px solid rgba(141, 95, 18, 0.18);
  border-radius: 999px;
  font-weight: 800;
}

.full-post {
  max-width: 760px;
  margin: 0 auto;
}

.full-post p {
  white-space: pre-wrap;
}

@media (max-width: 860px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
  }

  .topbar {
    grid-template-columns: 1fr;
    position: static;
  }

  nav,
  .account-area {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .hero-band,
  .toolbar {
    grid-template-columns: 1fr;
  }

  .hero-band {
    min-height: auto;
    padding: 32px 22px;
  }

  .post-grid,
  .member-list {
    grid-template-columns: 1fr;
  }

  .section-heading,
  .editor-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (min-width: 861px) and (max-width: 1080px) {
  .post-grid,
  .member-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
