:root {
  --bg: #f5f3ea;
  --panel: #fffefa;
  --panel-strong: #eef5df;
  --ink: #182013;
  --muted: #66705d;
  --brand: #356b2c;
  --brand-strong: #244e22;
  --gold: #d9ad39;
  --rust: #9c5931;
  --sky: #d7e7ed;
  --survey-blue: #3569b7;
  --survey-blue-soft: #eaf2ff;
  --line: #d8dccd;
  --danger: #9d3f32;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--sky) 0, var(--bg) 260px);
}

body.menu-open {
  overflow: hidden;
}

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

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

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

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

textarea {
  min-height: 104px;
  resize: vertical;
  line-height: 1.45;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.45rem;
  font-size: clamp(2.2rem, 8vw, 5rem);
  letter-spacing: 0;
  line-height: 0.92;
}

h2,
h3 {
  margin-bottom: 0.7rem;
}

.mobile-topbar {
  display: none;
}

.menu-overlay {
  display: none;
}

.app-shell {
  width: min(1280px, 94vw);
  margin: 1rem auto;
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr) 280px;
  gap: 1rem;
  align-items: start;
}

.left-rail,
.composer,
.contact-panel,
.surveys-panel,
.news-panel,
.timeline {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 254, 250, 0.94);
  box-shadow: 0 8px 24px rgba(24, 32, 19, 0.06);
}

.left-rail {
  padding: 1rem;
  position: sticky;
  top: 1rem;
}

.brand-lockup {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1.05rem;
}

.brand-mark {
  width: 52px;
  aspect-ratio: 1;
  flex: 0 0 auto;
  display: block;
  border-radius: 8px;
  background: #f8faf1;
  box-shadow: 0 0 0 1px rgba(53, 107, 44, 0.18);
  overflow: hidden;
  transform: translateY(0.18rem);
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand {
  font-size: 1.68rem;
  font-weight: 900;
  line-height: 0.95;
  white-space: nowrap;
  word-spacing: 0;
}

.tagline,
.meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.tagline {
  max-width: 15rem;
  margin: 0.45rem 0 0;
  line-height: 1.35;
}

.auth-stack h3,
#profilePanel h3 {
  margin: 0.9rem 0 0.45rem;
}

.account-toggle {
  width: 100%;
  margin-bottom: 0.85rem;
  color: var(--brand-strong);
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.post-search {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 0.9rem;
}

.tag-filter {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 0.9rem;
}

.tag-filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag-filter-btn {
  border: 1px solid var(--line);
  padding: 0.38rem 0.56rem;
  color: var(--brand-strong);
  background: #fff;
  font-size: 0.82rem;
  line-height: 1.15;
}

.tag-filter-btn.active {
  border-color: rgba(53, 107, 44, 0.55);
  background: var(--panel-strong);
  box-shadow: inset 0 0 0 1px rgba(53, 107, 44, 0.16);
}

.contact-menu-btn {
  width: 100%;
  margin-bottom: 0.85rem;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.45rem;
  align-items: center;
}

.account-panel {
  margin-bottom: 0.85rem;
}

.profile-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.profile-summary h3 {
  margin: 0;
}

.secondary-btn {
  color: var(--brand-strong);
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.text-btn {
  width: fit-content;
  padding: 0;
  color: var(--brand-strong);
  background: transparent;
  border-radius: 0;
  font-size: 0.88rem;
  text-align: left;
}

.compact-btn {
  padding: 0.42rem 0.58rem;
  font-size: 0.82rem;
}

.auth-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4f5ed;
}

.auth-switch-btn {
  min-height: 36px;
  padding: 0.45rem 0.5rem;
  color: var(--muted);
  background: transparent;
}

.auth-switch-btn.active {
  color: #fff;
  background: var(--brand);
}

.auth-view {
  margin-top: 0.85rem;
}

body.signup-page .mobile-topbar,
body.signup-page .timeline-col,
body.signup-page .account-toggle,
body.signup-page .post-search,
body.signup-page .tag-filter,
body.signup-page .contact-menu-btn,
body.signup-page .mobile-news-panel,
body.signup-page .news-rail,
body.signup-page #profilePanel {
  display: none;
}

body.signup-page .app-shell {
  width: min(520px, calc(100% - 2rem));
  grid-template-columns: minmax(0, 1fr);
  justify-content: center;
  margin: 2rem auto;
}

body.signup-page .left-rail {
  position: static;
  width: auto;
  min-height: auto;
  padding: 1.2rem;
}

body.signup-page .auth-stack {
  margin-top: 1rem;
}

body.signup-page .auth-switch {
  grid-template-columns: 1fr 1fr;
}

.stack-form,
.timeline-col,
.reply-list {
  display: grid;
  gap: 0.75rem;
}

.field-label {
  margin-bottom: -0.45rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.member-panel {
  margin: 0.9rem 0;
  display: grid;
  gap: 0.7rem;
}

.member-list {
  display: grid;
  gap: 0.55rem;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 0.15rem;
}

.member-row {
  min-width: 0;
  display: grid;
  gap: 0.45rem;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.member-row-head {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: 0.5rem;
}

.member-row strong,
.member-row .meta {
  overflow-wrap: anywhere;
}

.member-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.role-badge {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.14rem 0.42rem;
  color: var(--brand-strong);
  background: var(--panel-strong);
  font-size: 0.72rem;
  font-weight: 900;
}

.divider {
  margin: 0.75rem 0 0.45rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.composer,
.contact-panel,
.surveys-panel,
.news-panel,
.timeline {
  padding: 1rem;
}

.news-rail {
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
}

.news-panel {
  display: grid;
  gap: 0.75rem;
  max-height: none;
  overflow: visible;
}

.news-panel .section-head {
  align-items: flex-start;
}

.news-panel h2 {
  margin-bottom: 0;
  font-size: 1.2rem;
}

.news-list {
  display: grid;
  gap: 0.65rem;
  min-height: 0;
  padding-right: 0.2rem;
}

.news-item {
  display: grid;
  gap: 0.3rem;
  padding: 0.72rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  text-decoration: none;
}

.news-item:hover {
  border-color: rgba(53, 107, 44, 0.48);
  background: #f8fbf3;
}

.news-item strong {
  font-size: 0.92rem;
  line-height: 1.25;
}

.news-item span,
.news-updated {
  color: var(--muted);
  font-size: 0.8rem;
}

.news-more-btn {
  width: 100%;
  border: 1px solid var(--line);
  color: var(--brand-strong);
  background: var(--panel-strong);
}

.mobile-news-panel {
  display: none;
}

.menu-news-list {
  display: grid;
  gap: 0.45rem;
}

.menu-news-item {
  display: grid;
  gap: 0.2rem;
  padding: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  text-decoration: none;
}

.menu-news-item strong {
  font-size: 0.82rem;
  line-height: 1.25;
}

.menu-news-item span {
  color: var(--muted);
  font-size: 0.74rem;
}

.composer-bar {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 0.6rem;
  align-items: center;
  color: var(--muted);
}

.contact-panel {
  display: grid;
  gap: 0.8rem;
}

.contact-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.contact-grid {
  display: grid;
  gap: 0;
}

.contact-field {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 0.85rem;
  align-items: start;
  padding: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.contact-field > span {
  color: var(--ink);
  font-weight: 800;
  text-align: right;
}

.contact-field small {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.contact-message-field textarea {
  min-height: 150px;
}

.contact-human-check {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 0.85rem 0.85rem calc(210px + 1.7rem);
  border-bottom: 1px solid var(--line);
  font-weight: 800;
}

.contact-human-check input {
  width: 22px;
  height: 22px;
  accent-color: var(--brand);
}

.contact-submit-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px;
  gap: 0.8rem;
  align-items: center;
  padding: 0.75rem 0.85rem;
  background: #f1faee;
}

.media-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 39px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.5rem 0.72rem;
  background: var(--panel-strong);
  color: var(--brand-strong);
  font-weight: 800;
  cursor: pointer;
}

.media-picker input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

.media-preview {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem;
  background: #fbfaf3;
  color: var(--muted);
  font-weight: 700;
}

.media-preview-item {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.media-preview-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-preview img,
.media-preview video {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
  background: #dfe7d8;
}

.ghost-btn {
  color: var(--danger);
  background: #f4e7e2;
}

.google-fallback {
  width: min(100%, 260px);
  min-height: 42px;
  display: block;
  margin: 0 auto;
  border: 1px solid #d5d8df;
  background: #fff;
  color: #2f3440;
}

.google-wrap,
#loginGoogleSignIn,
#signupGoogleSignIn {
  display: flex;
  justify-content: center;
}

#loginGoogleSignIn iframe,
#signupGoogleSignIn iframe {
  margin: 0 auto;
}

.google-hint {
  margin: 0.55rem 0 0;
  text-align: center;
}

.reset-result {
  margin: 0.65rem 0;
  overflow-wrap: anywhere;
}

.reset-result a {
  color: var(--brand-strong);
  font-weight: 800;
}

.google-fallback:disabled {
  opacity: 1;
  color: #818895;
  background: #f4f5f7;
  cursor: not-allowed;
}

.hidden {
  display: none;
}

.flash {
  margin: 0.8rem 0 0;
  min-height: 1.1rem;
  color: var(--danger);
  font-size: 0.9rem;
}

.form-status {
  margin: 0.15rem 0 0;
  min-height: 1.05rem;
  font-size: 0.85rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.status-warning {
  color: var(--danger);
  font-weight: 700;
}

.empty-feed {
  padding: 1rem 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
}

.post {
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}

.post:first-child {
  border-top: 0;
}

.post-head {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.pin-badge {
  display: inline-block;
  margin-left: 0.45rem;
  border: 1px solid rgba(217, 173, 57, 0.7);
  border-radius: 999px;
  padding: 0.12rem 0.42rem;
  color: var(--brand-strong);
  background: rgba(217, 173, 57, 0.2);
  font-size: 0.74rem;
  font-weight: 900;
  vertical-align: middle;
}

.post-category {
  display: inline-block;
  margin-left: 0.45rem;
  border: 1px solid rgba(53, 107, 44, 0.22);
  border-radius: 999px;
  padding: 0.13rem 0.48rem;
  color: var(--brand-strong);
  background: var(--panel-strong);
  font-size: 0.74rem;
  font-weight: 900;
  vertical-align: middle;
}

.avatar {
  width: 42px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  color: #fff;
  background: var(--rust);
  font-size: 0.95rem;
  font-weight: 900;
}

.post .content {
  margin: 0.65rem 0;
  line-height: 1.5;
  white-space: pre-wrap;
}

.tag {
  color: var(--brand);
  font-weight: 800;
}

.media-limit-note {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.25;
}

.post-media-grid {
  display: grid;
  gap: 0.5rem;
}

.post-media-grid[data-count="2"],
.post-media-grid[data-count="3"],
.post-media-grid[data-count="4"],
.post-media-grid[data-count="5"],
.post-media-grid[data-count="6"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.post-media {
  width: 100%;
  max-height: 560px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #dfe7d8;
}

.post-media-frame {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.post-media-frame:focus-visible {
  outline: 3px solid rgba(53, 107, 44, 0.38);
  outline-offset: 3px;
}

.post-media-frame .post-media {
  display: block;
}

.media-lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  grid-template-columns: minmax(44px, 1fr) minmax(0, 1120px) minmax(44px, 1fr);
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background: rgba(12, 20, 12, 0.88);
}

.media-lightbox.hidden {
  display: none;
}

.media-viewer-open {
  overflow: hidden;
}

.media-lightbox-frame {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  margin: 0;
}

.media-lightbox-frame img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 7rem);
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 22px 80px rgba(0, 0, 0, 0.45);
}

.media-lightbox-close,
.media-lightbox-nav {
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
}

.media-lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 1.75rem;
  line-height: 1;
}

.media-lightbox-nav {
  width: 48px;
  height: 60px;
  padding: 0;
  justify-self: center;
  font-size: 2.8rem;
  line-height: 1;
}

.media-lightbox-nav:disabled {
  opacity: 0;
  pointer-events: none;
}

.media-lightbox-counter {
  min-height: 1.5rem;
  margin-top: 0.85rem;
  color: #fff;
  font-weight: 900;
  text-align: center;
}

.actions {
  margin-top: 0.65rem;
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.action-btn {
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.danger-action {
  color: var(--danger);
  background: #fff4f1;
}

.reply-box {
  margin-top: 0.7rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem;
}

.reply {
  background: #f6f3e8;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
}

.reply-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.45rem;
}

.small-action {
  padding: 0.4rem 0.65rem;
}

.nested-reply-box {
  width: 100%;
  margin-top: 0.35rem;
}

.nested-replies {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.55rem;
  padding-left: 0.85rem;
  border-left: 2px solid #d9e2c9;
}

.nested-reply {
  background: #fbfaf4;
}

.reply p {
  margin-bottom: 0;
}

.survey-list {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.survey-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.mobile-survey-toggle {
  display: none;
}

.survey-builder {
  margin-top: 0.85rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff 0, #f8fbff 100%);
}

.survey-builder-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.85rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #dce6f4;
}

.survey-builder-head h3 {
  margin: 0.15rem 0 0;
}

.eyebrow {
  margin: 0;
  color: var(--survey-blue);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.survey-builder-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(160px, 0.6fr) minmax(190px, 0.7fr);
  gap: 0.75rem;
}

.survey-field {
  display: grid;
  gap: 0.42rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.survey-field input,
.survey-field select,
.survey-field textarea {
  border-color: #cfdbea;
}

.survey-field small {
  color: var(--muted);
  font-weight: 600;
  line-height: 1.35;
}

.survey-submit-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.85rem;
}

.survey-submit-row button {
  min-width: 150px;
}

.survey-card {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
  border: 1px solid #d9e3ef;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(38, 62, 94, 0.07);
}

.survey-card:first-child {
  border-top: 1px solid #d9e3ef;
  padding-top: 1rem;
}

.pinned-survey {
  border-color: rgba(53, 105, 183, 0.42);
  box-shadow: 0 10px 24px rgba(53, 105, 183, 0.11);
}

.survey-card-top,
.survey-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.survey-kicker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  color: var(--survey-blue);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.survey-visibility-badge {
  border-radius: 999px;
  padding: 0.16rem 0.42rem;
  font-size: 0.7rem;
  text-transform: none;
}

.survey-visibility-badge.public {
  color: #225b32;
  background: #e9f5e7;
  border: 1px solid #c8dfc2;
}

.survey-visibility-badge.private {
  color: #6b4a14;
  background: #fff5d8;
  border: 1px solid #ead59a;
}

.survey-response-count {
  border: 1px solid #d7e3f3;
  border-radius: 999px;
  padding: 0.24rem 0.55rem;
  color: #315c93;
  background: var(--survey-blue-soft);
  font-size: 0.78rem;
  font-weight: 800;
}

.survey-question {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.25;
}

.survey-meta-row {
  justify-content: flex-start;
  color: var(--muted);
  font-size: 0.84rem;
}

.survey-meta-row span + span::before {
  content: "·";
  margin-right: 0.75rem;
}

.survey-head {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  align-items: start;
}

.survey-options {
  display: grid;
  gap: 0.55rem;
}

.survey-option {
  position: relative;
  min-height: 48px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.6rem;
  align-items: center;
  overflow: hidden;
  border: 1px solid #d8e2ef;
  border-radius: 8px;
  background: #fbfdff;
  color: var(--ink);
  padding: 0.68rem 0.82rem;
  text-align: left;
}

.survey-option-label,
.survey-percent {
  position: relative;
  z-index: 1;
}

.survey-percent {
  color: #315c93;
  font-weight: 900;
}

.survey-option i {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, rgba(53, 105, 183, 0.18), rgba(217, 173, 57, 0.15));
}

.survey-option.selected {
  border-color: var(--survey-blue);
  background: #f3f8ff;
  color: #173f73;
}

.survey-option:disabled {
  opacity: 1;
  cursor: default;
}

.survey-note {
  margin: 0;
}

.survey-private-note {
  margin: 0;
  padding: 0.62rem 0.72rem;
  border: 1px solid #ead59a;
  border-radius: 8px;
  color: #6b4a14;
  background: #fff9e7;
}

.survey-empty {
  display: grid;
  gap: 0.25rem;
  padding: 0.9rem;
  border: 1px dashed #c8d7e8;
  border-radius: 8px;
  color: var(--muted);
  background: #fbfdff;
}

.survey-check-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.55rem;
  align-items: center;
  min-height: 42px;
  border: 1px solid #d8e2ef;
  border-radius: 8px;
  padding: 0.56rem 0.72rem;
  background: #fbfdff;
  font-weight: 700;
}

.survey-check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--survey-blue);
}

.survey-text-input {
  min-height: 84px;
}

.survey-text-response {
  display: grid;
  gap: 0.55rem;
}

.survey-text-response .action-btn,
.survey-options + .action-btn {
  justify-self: end;
}

.survey-rating-summary {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid #d8e2ef;
  border-radius: 8px;
  background: #fbfdff;
}

.survey-rating-summary strong {
  color: var(--survey-blue);
  font-size: 1.6rem;
}

.survey-rating-summary span {
  color: var(--muted);
  font-size: 0.9rem;
}

.survey-operator-tools {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding-top: 0.65rem;
  border-top: 1px solid #e5ecf4;
}

.survey-edit-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: end;
  padding: 0.8rem;
  border: 1px solid #d8e2ef;
  border-radius: 8px;
  background: #fbfdff;
}

ul {
  padding-left: 1.2rem;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

@media (max-width: 1040px) {
  .mobile-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    gap: 0.35rem;
    min-height: 56px;
    padding: 0.45rem 0.75rem;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 254, 250, 0.96);
    backdrop-filter: blur(12px);
  }

  .menu-toggle {
    width: 42px;
    height: 42px;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 5px;
    padding: 0;
    color: var(--ink);
    background: transparent;
  }

  .menu-toggle span {
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: var(--ink);
  }

.topbar-brand {
  text-align: center;
  font-weight: 900;
  font-size: 1.05rem;
  white-space: nowrap;
  word-spacing: 0;
}

.topbar-search-toggle {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--ink);
  background: transparent;
}

.topbar-search-toggle span {
  width: 17px;
  height: 17px;
  display: block;
  border: 2px solid currentColor;
  border-radius: 999px;
  position: relative;
}

.topbar-search-toggle span::after {
  content: "";
  position: absolute;
  right: -6px;
  bottom: -5px;
  width: 8px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(45deg);
  transform-origin: center;
}

  .menu-overlay:not(.hidden) {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: block;
    background: rgba(24, 32, 19, 0.36);
  }

  .app-shell {
    grid-template-columns: minmax(0, 1fr);
    margin-top: 0.75rem;
  }

  .news-rail {
    display: none;
    position: static;
  }

  .mobile-news-panel {
    display: grid;
    gap: 0.45rem;
    margin: 0.9rem 0;
  }

  .post-search {
    display: none;
  }

  body.search-open .post-search {
    position: fixed;
    top: 62px;
    left: 0.75rem;
    right: 0.75rem;
    z-index: 65;
    display: grid;
    gap: 0.4rem;
    margin: 0;
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 254, 250, 0.98);
    box-shadow: 0 12px 28px rgba(24, 32, 19, 0.14);
  }

  body.search-open .post-search .field-label {
    display: none;
  }

  .left-rail {
    position: fixed;
    top: 0;
    bottom: 0;
    left: -340px;
    z-index: 70;
    width: min(84vw, 340px);
    overflow-y: auto;
    border-radius: 0 8px 8px 0;
    transition: left 180ms ease;
  }

  body.menu-open .left-rail,
  .left-rail.menu-open,
  #mainMenu.menu-open {
    left: 0;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 1rem, 1280px);
    margin-top: 0.5rem;
  }

  .composer {
    padding: 0.6rem;
  }

  .composer #postForm {
    display: grid;
    gap: 0;
  }

  .composer .field-label,
  .composer #postCategory,
  .composer .composer-bar,
  .composer .media-preview {
    display: none;
  }

  .composer:focus-within .field-label,
  .composer:focus-within #postCategory,
  .composer:focus-within .composer-bar,
  .composer:focus-within .media-preview:not(.hidden),
  .composer.composer-open .field-label,
  .composer.composer-open #postCategory,
  .composer.composer-open .composer-bar,
  .composer.composer-open .media-preview:not(.hidden) {
    display: block;
  }

  .composer:focus-within #postForm,
  .composer.composer-open #postForm {
    gap: 0.62rem;
  }

  .composer:focus-within .field-label,
  .composer.composer-open .field-label {
    margin-bottom: 0;
  }

  .composer textarea {
    min-height: 42px;
    max-height: 42px;
    padding: 0.6rem 0.85rem;
    resize: none;
  }

  .composer:focus-within textarea,
  .composer.composer-open textarea {
    min-height: 92px;
    max-height: none;
    resize: vertical;
  }

  .composer:focus-within .composer-bar,
  .composer.composer-open .composer-bar,
  .reply-box {
    display: grid;
    grid-template-columns: 1fr;
  }

  .composer:focus-within .media-limit-note,
  .composer.composer-open .media-limit-note {
    font-size: 0.78rem;
    line-height: 1.25;
  }

  .surveys-panel {
    padding: 0.72rem;
  }

  .surveys-panel .section-head {
    margin-bottom: 0;
    align-items: center;
    flex-direction: row;
    gap: 0.5rem;
  }

  .surveys-panel h2 {
    margin-bottom: 0;
    font-size: 1.1rem;
  }

  .mobile-survey-toggle {
    display: inline-flex;
    justify-content: center;
  }

  .surveys-panel .survey-list,
  .surveys-panel .survey-builder {
    display: none;
  }

  body.surveys-open .surveys-panel .survey-list {
    display: grid;
  }

  body.surveys-open .surveys-panel .survey-builder:not(.hidden) {
    display: grid;
  }

  .timeline {
    padding: 0.85rem;
  }

  .timeline .section-head {
    margin-bottom: 0.7rem;
  }

  .contact-field {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.45rem;
  }

  .contact-field > span {
    text-align: left;
  }

  .contact-human-check {
    padding: 0.85rem;
  }

  .contact-submit-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .contact-submit-row button {
    width: 100%;
  }

  .media-preview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .media-preview img,
  .media-preview video {
    width: 100%;
  }

  .media-lightbox {
    grid-template-columns: minmax(0, 1fr);
    padding: 0.75rem;
  }

  .media-lightbox-frame img {
    max-height: calc(100vh - 6rem);
  }

  .media-lightbox-nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    width: 42px;
    height: 54px;
    transform: translateY(-50%);
  }

  .media-lightbox-prev {
    left: 0.75rem;
  }

  .media-lightbox-next {
    right: 0.75rem;
  }

  .surveys-panel .section-head,
  .survey-builder-head,
  .survey-submit-row,
  .survey-card-top {
    align-items: stretch;
    flex-direction: column;
  }

  .survey-actions {
    justify-content: stretch;
  }

  .surveys-panel .survey-actions {
    justify-content: flex-end;
    flex: 1;
  }

  .surveys-panel .survey-actions button {
    width: auto;
  }

  .survey-submit-row button {
    width: 100%;
  }

  .survey-builder-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .survey-card {
    padding: 0.85rem;
  }

  .survey-edit-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .survey-question {
    font-size: 1.04rem;
  }

  .survey-option {
    min-height: 46px;
  }
}
