:root {
  color-scheme: light;
  --paper: #f6f7f2;
  --surface: #fffefa;
  --surface-soft: #edf3ef;
  --ink: #173b3a;
  --ink-strong: #102e2d;
  --muted: #61716d;
  --quiet: #83908b;
  --line: #dce5df;
  --line-strong: #cbd8d1;
  --teal: #176d66;
  --teal-dark: #10534e;
  --teal-wash: #e2f0eb;
  --rose: #9c4f4c;
  --rose-wash: #f7eae7;
  --gold: #b17b39;
  --shadow: 0 18px 50px rgba(22, 54, 48, 0.075);
  --radius: 18px;
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 12% 0%, rgba(221, 237, 228, 0.58), transparent 32rem),
    var(--paper);
  font-size: 16px;
  line-height: 1.55;
}

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

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

button {
  cursor: pointer;
}

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

:focus-visible {
  outline: 3px solid rgba(23, 109, 102, 0.45);
  outline-offset: 3px;
}

.site-shell {
  width: min(100% - 48px, 1160px);
  margin: 0 auto;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  color: #fff;
  background: var(--ink-strong);
  border-radius: 8px;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border-bottom: 1px solid rgba(203, 216, 209, 0.8);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-strong);
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  position: relative;
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  background: var(--teal);
  border-radius: 50% 50% 50% 11px;
  transform: rotate(-45deg);
}

.brand-mark::before,
.brand-mark::after {
  position: absolute;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 50%;
}

.brand-mark::before {
  width: 12px;
  height: 12px;
}

.brand-mark::after {
  width: 4px;
  height: 4px;
  border: 0;
  background: #fff;
}

.brand-name {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.7px;
}

.brand-name span {
  color: var(--teal);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.main-nav a {
  padding: 10px 14px;
  color: var(--muted);
  border-radius: 9px;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  transition: color 150ms ease, background 150ms ease;
}

.main-nav a:hover,
.main-nav a.is-active {
  color: var(--teal-dark);
  background: var(--teal-wash);
}

.preview-marker {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  color: #80602e;
  background: #f5eedc;
  border: 1px solid #eadfbd;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.025em;
  white-space: nowrap;
}

.preview-marker[hidden] {
  display: none;
}

.notice-band {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 30px;
  padding: 11px 14px;
  color: #345e58;
  background: #e8f2ed;
  border: 1px solid #d4e5dc;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
}

.notice-icon {
  display: inline-grid;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  place-items: center;
  color: #fff;
  background: var(--teal);
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 12px;
  font-style: italic;
}

.notice-divider {
  width: 1px;
  height: 16px;
  margin: 0 3px;
  background: #bfd5ca;
}

.notice-open {
  color: var(--teal-dark);
}

#app-main {
  min-height: 55vh;
  outline: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.7fr);
  align-items: center;
  gap: clamp(38px, 8vw, 100px);
  padding: 50px 0 68px;
}

.hero-copy {
  max-width: 640px;
}

.eyebrow,
.card-kicker {
  margin: 0 0 12px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.15em;
  line-height: 1.4;
  text-transform: uppercase;
}

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

.hero h1,
.publish-intro h1,
.admin-intro h1,
.detail-heading h1,
.state-title {
  margin: 0;
  color: var(--ink-strong);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(42px, 6vw, 68px);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 1.02;
}

.hero-intro {
  max-width: 590px;
  margin: 22px 0 28px;
  color: #536863;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(18px, 2vw, 21px);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  gap: 9px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.button:not(:disabled):hover {
  transform: translateY(-1px);
}

.button-primary {
  color: #fff;
  background: var(--teal);
  box-shadow: 0 5px 14px rgba(23, 109, 102, 0.13);
}

.button-primary:not(:disabled):hover {
  background: var(--teal-dark);
}

.button-soft {
  color: var(--teal-dark);
  background: #e7f1ec;
  border-color: #d4e4dc;
}

.button-soft:not(:disabled):hover {
  background: #dcece4;
}

.button-quiet {
  color: #536863;
  background: transparent;
  border-color: var(--line);
}

.button-quiet:not(:disabled):hover {
  color: var(--teal-dark);
  background: var(--surface-soft);
}

.text-link,
.read-link,
.back-link {
  color: var(--teal-dark);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.text-link:hover,
.read-link:hover,
.back-link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.community-card {
  position: relative;
  overflow: hidden;
  padding: 26px 26px 23px;
  background: rgba(255, 254, 250, 0.88);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.community-card::after {
  position: absolute;
  right: -30px;
  bottom: -42px;
  width: 120px;
  height: 120px;
  border: 1px solid rgba(23, 109, 102, 0.15);
  border-radius: 50%;
  content: "";
  box-shadow: 0 0 0 14px rgba(23, 109, 102, 0.035), 0 0 0 30px rgba(23, 109, 102, 0.025);
}

.community-label {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.community-stat {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.community-stat strong {
  color: var(--ink-strong);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 39px;
  font-weight: 500;
  letter-spacing: -0.06em;
}

.community-stat span,
.community-foot {
  color: var(--muted);
  font-size: 13px;
}

.community-split {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 17px 0 14px;
  padding: 14px 0;
  color: #4d6963;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 650;
}

.community-split span:first-child {
  color: var(--teal-dark);
}

.community-split span:last-child {
  color: var(--rose);
}

.community-foot {
  margin: 0;
}

.browse-section {
  padding: 27px 0 68px;
  border-top: 1px solid var(--line);
}

.section-heading,
.results-heading,
.board-heading,
.admin-load-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.section-heading {
  margin-bottom: 22px;
}

.section-heading h2,
.results-heading h2,
.board-heading h2,
.admin-load-row h2 {
  margin: 0;
  color: var(--ink-strong);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.2;
}

.section-note,
.muted-copy {
  max-width: 455px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.filter-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(170px, 0.44fr) minmax(160px, 0.42fr) auto;
  gap: 10px;
  padding: 13px;
  background: rgba(255, 254, 250, 0.76);
  border: 1px solid var(--line);
  border-radius: 13px;
}

.search-field {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 13px;
  color: #71827d;
  font-family: Georgia, serif;
  font-size: 24px;
  line-height: 1;
  pointer-events: none;
}

.search-input,
.filter-select,
.publish-select,
.admin-token-input,
.comment-form input,
.comment-form textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--ink-strong);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-size: 14px;
}

.search-input {
  padding-left: 41px;
}

.search-input::placeholder,
.thought-input::placeholder,
.comment-form input::placeholder,
.comment-form textarea::placeholder {
  color: #8b9792;
}

.filter-select,
.publish-select {
  appearance: auto;
  padding-right: 12px;
}

.results-heading {
  align-items: baseline;
  margin: 31px 0 16px;
}

.results-heading h2 {
  font-size: 25px;
}

.results-heading p {
  margin: 0;
}

.thought-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 16px;
}

.thought-card,
.detail-thought,
.comment-card,
.policy-card,
.publish-card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 7px 24px rgba(22, 54, 48, 0.035);
}

.thought-card {
  display: flex;
  flex-direction: column;
  min-height: 240px;
  padding: 20px 20px 14px;
}

.thought-card-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.category-chip {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 4px 9px;
  color: #33665d;
  background: #e7f1ec;
  border: 1px solid #d9e9e0;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.035em;
  line-height: 1.25;
}

.category-chip-muted {
  color: var(--muted);
  background: #f0f2ee;
  border-color: #e5e9e4;
}

.timestamp {
  flex: 0 0 auto;
  color: var(--quiet);
  font-size: 11px;
  line-height: 1.5;
  text-align: right;
}

.thought-excerpt {
  display: -webkit-box;
  overflow: hidden;
  min-height: 74px;
  margin: 19px 0 9px;
  color: var(--ink-strong);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.48;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.read-link {
  align-self: flex-start;
  margin-bottom: 6px;
  font-size: 12px;
}

.reaction-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #edf0ec;
}

.reaction-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 35px;
  gap: 6px;
  padding: 6px 9px;
  color: #687772;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 650;
  text-decoration: none;
}

.reaction-button:not(:disabled):hover {
  color: var(--teal-dark);
  background: var(--surface-soft);
}

.reaction-button.is-selected {
  color: var(--teal-dark);
  background: var(--teal-wash);
  border-color: #cfe4da;
}

.reaction-button.is-selected.downvote {
  color: var(--rose);
  background: var(--rose-wash);
  border-color: #efd7d2;
}

.reaction-button.downvote:not(.is-selected) .reaction-glyph {
  color: #9d615c;
}

.reaction-glyph {
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}

.reaction-count {
  color: var(--ink-strong);
  font-variant-numeric: tabular-nums;
  font-weight: 750;
}

.comment-link {
  margin-left: auto;
}

.comment-link-content {
  display: contents;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}

.pagination-summary {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.about-strip {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 0 0 74px;
  padding: 23px 24px;
  background: #e8f1eb;
  border: 1px solid #d8e7de;
  border-radius: 14px;
}

.about-mark,
.note-mark {
  display: inline-grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--teal);
  background: #d6e9de;
  border-radius: 50%;
  font-size: 19px;
}

.about-strip h2 {
  margin: 0 0 4px;
  color: var(--ink-strong);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  font-weight: 500;
}

.about-strip p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.about-strip .text-link {
  flex: 0 0 auto;
  margin-left: auto;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 0 28px;
  color: var(--quiet);
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.footer-brand {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

.state-card,
.empty-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: 210px;
  margin: 24px 0;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.state-card {
  align-items: center;
  text-align: center;
}

.state-card .button {
  margin-top: 10px;
}

.state-error {
  border-color: #ecd8d2;
}

.state-error .state-title {
  margin: 5px 0 10px;
  font-size: 36px;
}

.state-kicker {
  color: var(--rose);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.state-copy {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.loading-dot {
  width: 22px;
  height: 22px;
  margin-bottom: 9px;
  border: 2px solid #d9e6df;
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.state-card .state-title {
  font-size: 18px;
  letter-spacing: 0;
}

.empty-card {
  grid-column: 1 / -1;
  align-items: center;
  min-height: 245px;
  text-align: center;
}

.empty-card h3,
.empty-comments h3 {
  margin: 4px 0 6px;
  color: var(--ink-strong);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
  font-weight: 500;
}

.empty-card p,
.empty-comments p {
  max-width: 430px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.empty-symbol {
  display: inline-grid;
  width: 42px;
  height: 42px;
  margin-bottom: 9px;
  place-items: center;
  color: var(--teal);
  background: var(--teal-wash);
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 24px;
}

.inline-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 14px 0;
  padding: 13px 15px;
  color: #824641;
  background: #fbefec;
  border: 1px solid #efdcd7;
  border-radius: 10px;
}

.inline-error p {
  margin: 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.back-link {
  display: inline-flex;
  margin: 8px 0 25px;
}

.detail-heading {
  margin-bottom: 24px;
}

.detail-heading h1 {
  margin-bottom: 11px;
  font-size: clamp(36px, 4.8vw, 51px);
}

.detail-thought-slot {
  margin-bottom: 42px;
}

.detail-thought {
  padding: clamp(22px, 4vw, 38px);
  box-shadow: var(--shadow);
}

.detail-body {
  margin: 25px 0 24px;
  color: var(--ink-strong);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(20px, 2.5vw, 26px);
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.detail-thought .reaction-row {
  margin-top: 0;
  padding-top: 17px;
}

.comment-board {
  margin: 0 0 68px;
}

.board-heading {
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--line);
}

.board-heading h2 {
  margin-bottom: 3px;
}

.board-heading .muted-copy {
  font-size: 12px;
}

.comment-state .state-card {
  min-height: 125px;
  margin: 0;
  padding: 18px;
}

.comment-list {
  display: grid;
  gap: 12px;
}

.comment-card {
  padding: 19px 21px;
  box-shadow: none;
}

.comment-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 10px;
}

.comment-author {
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.comment-body {
  margin: 0;
  color: #344944;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.empty-comments {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 36px 18px;
  background: rgba(255, 254, 250, 0.75);
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  text-align: center;
}

.comment-pagination {
  margin-top: 16px;
}

.publish-layout,
.admin-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.78fr) minmax(0, 1.22fr);
  align-items: start;
  gap: clamp(30px, 7vw, 86px);
  padding: 10px 0 72px;
}

.publish-intro,
.admin-intro {
  position: sticky;
  top: 30px;
  padding-top: 18px;
}

.publish-intro h1,
.admin-intro h1 {
  margin-bottom: 18px;
  font-size: clamp(39px, 5vw, 56px);
}

.publish-intro .section-note,
.admin-intro .section-note {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
}

.publish-side-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.side-note-mark {
  color: var(--teal);
  font-size: 19px;
}

.publish-side-note p {
  max-width: 210px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.publish-card {
  padding: clamp(22px, 4vw, 34px);
  box-shadow: var(--shadow);
}

.publish-card .card-kicker {
  margin-bottom: 22px;
}

.publish-form,
.comment-form-fields {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.field-label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 16px 0 8px;
  color: var(--ink-strong);
  font-size: 13px;
  font-weight: 750;
}

.field-label:first-child {
  margin-top: 0;
}

.field-hint {
  color: var(--quiet);
  font-size: 11px;
  font-weight: 450;
  line-height: 1.45;
}

.thought-input {
  width: 100%;
  min-height: 176px;
  resize: vertical;
  padding: 15px;
  color: var(--ink-strong);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.6;
}

.publish-select {
  min-height: 46px;
}

.publish-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 22px 0;
  padding: 14px;
  background: #edf4ef;
  border: 1px solid #dce9e0;
  border-radius: 10px;
}

.publish-note .note-mark {
  flex-basis: 28px;
  width: 28px;
  height: 28px;
  font-size: 14px;
}

.publish-note p {
  margin: 0;
  color: #47625a;
  font-size: 12px;
  line-height: 1.55;
}

.form-feedback {
  min-height: 1em;
  margin: 0 0 10px;
  color: var(--rose);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.publish-form > .button {
  width: 100%;
}

.admin-layout {
  position: relative;
  grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1.28fr);
}

.admin-intro {
  grid-column: 1;
  grid-row: 1 / span 3;
}

.admin-access,
.admin-status,
.admin-load-row,
.policy-area {
  grid-column: 2;
}

.admin-access {
  padding: 21px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
}

.admin-access .field-label {
  margin-top: 0;
}

.admin-access .button {
  margin-top: 14px;
}

.admin-token-input {
  display: block;
}

.preview-access {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.preview-dot {
  flex: 0 0 10px;
  width: 10px;
  height: 10px;
  margin-top: 5px;
  background: var(--teal);
  border-radius: 50%;
  box-shadow: 0 0 0 5px var(--teal-wash);
}

.preview-access strong {
  color: var(--teal-dark);
  font-size: 13px;
}

.preview-access p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.admin-status {
  min-height: 20px;
  margin: 5px 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.admin-load-row {
  align-items: end;
  margin: 10px 0 14px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}

.admin-load-row .eyebrow {
  margin-bottom: 4px;
}

.admin-load-row h2 {
  font-size: 25px;
}

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

.policy-toolbar .muted-copy {
  font-size: 12px;
}

.policy-list {
  display: grid;
  gap: 13px;
}

.policy-card {
  padding: 20px;
}

.policy-card-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 15px;
  padding-bottom: 13px;
  border-bottom: 1px solid #edf0ec;
}

.policy-card-heading .eyebrow {
  margin-bottom: 3px;
  font-size: 9px;
}

.policy-card-heading h3 {
  margin: 0;
  color: var(--ink-strong);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 500;
}

.policy-key {
  padding: 4px 7px;
  color: #687671;
  background: #f1f3f0;
  border-radius: 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
}

.policy-switches {
  margin: 0 0 12px;
}

.policy-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  border-bottom: 1px solid #edf0ec;
}

.switch-label {
  display: inline-block;
  margin-bottom: 2px;
  color: var(--ink-strong);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.toggle {
  position: relative;
  display: inline-flex;
  flex: 0 0 47px;
  width: 47px;
  height: 27px;
  align-items: center;
  cursor: pointer;
}

.toggle input {
  position: absolute;
  z-index: 1;
  width: 47px;
  height: 27px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.toggle-track {
  position: absolute;
  inset: 0;
  background: #d8dfd9;
  border: 1px solid #c8d2cb;
  border-radius: 20px;
  transition: background 140ms ease;
}

.toggle-track::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 19px;
  height: 19px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(12, 39, 32, 0.18);
  content: "";
  transition: transform 140ms ease;
}

.toggle input:checked + .toggle-track {
  background: var(--teal);
  border-color: var(--teal);
}

.toggle input:checked + .toggle-track::after {
  transform: translateX(20px);
}

.toggle input:focus-visible + .toggle-track {
  outline: 3px solid rgba(23, 109, 102, 0.4);
  outline-offset: 3px;
}

.toggle input:disabled {
  cursor: not-allowed;
}

.policy-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding-top: 4px;
}

.policy-row-status {
  color: var(--muted);
  font-size: 11px;
}

.composer-dialog {
  width: min(620px, calc(100% - 28px));
  max-width: 620px;
  max-height: min(90vh, 850px);
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  box-shadow: 0 26px 80px rgba(9, 31, 27, 0.24);
  overflow: auto;
}

.composer-dialog::backdrop {
  background: rgba(13, 36, 34, 0.48);
  backdrop-filter: blur(3px);
}

#composer-content {
  padding: clamp(21px, 4vw, 34px);
}

.composer-header {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 23px;
}

.composer-header h2 {
  margin: 0 0 7px;
  color: var(--ink-strong);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(25px, 4vw, 32px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.2;
}

.composer-intro {
  max-width: 470px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.icon-button {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 19px;
}

.icon-button::before {
  content: "×";
}

.comment-form input,
.comment-form textarea {
  display: block;
}

.comment-form textarea {
  min-height: 160px;
  resize: vertical;
  line-height: 1.55;
}

.comment-form select {
  min-height: 44px;
  padding: 9px 12px;
  color: var(--ink-strong);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-size: 13px;
}

.field-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 5px;
}

.thought-field-foot .field-hint {
  margin: 0;
}

.field-count {
  color: var(--quiet);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.field-count.over-limit {
  color: var(--rose);
  font-weight: 750;
}

.vote-attached-note {
  margin: 10px 0 3px;
  padding: 11px 13px;
  color: var(--teal-dark);
  background: var(--teal-wash);
  border: 1px solid #d3e8de;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 650;
}

.composer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 12px;
}

.toast-region {
  position: fixed;
  z-index: 30;
  right: 22px;
  bottom: 22px;
  display: grid;
  width: min(370px, calc(100% - 32px));
  gap: 9px;
  pointer-events: none;
}

.toast {
  padding: 13px 16px;
  color: #fff;
  background: #173d39;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(10, 35, 30, 0.22);
  font-size: 13px;
  animation: toast-in 180ms ease-out;
  pointer-events: auto;
}

.toast-error {
  background: #8d4540;
}

.toast-leaving {
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.sr-only {
  position: absolute !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 820px) {
  .site-shell {
    width: min(100% - 34px, 700px);
  }

  .site-header {
    min-height: 76px;
  }

  .main-nav {
    gap: 2px;
  }

  .main-nav a {
    padding: 9px 10px;
    font-size: 12px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(225px, 0.72fr);
    gap: 30px;
    padding: 42px 0 54px;
  }

  .community-card {
    padding: 21px;
  }

  .filter-panel {
    grid-template-columns: 1fr 1fr;
  }

  .filter-panel .search-field {
    grid-column: 1 / -1;
  }

  .filter-panel .button {
    grid-column: 1 / -1;
  }

  .thought-list {
    gap: 12px;
  }

  .thought-card {
    padding: 17px 16px 12px;
  }

  .reaction-row {
    gap: 0;
  }

  .reaction-button {
    gap: 4px;
    padding-inline: 7px;
    font-size: 10px;
  }

  .publish-layout,
  .admin-layout {
    grid-template-columns: minmax(190px, 0.66fr) minmax(0, 1.34fr);
    gap: 28px;
  }
}

@media (max-width: 900px) {
  .site-header {
    flex-wrap: wrap;
    row-gap: 11px;
    padding: 14px 0;
  }

  .main-nav {
    order: 3;
    flex: 1 0 100%;
    justify-content: flex-start;
  }

  .preview-marker {
    order: 2;
    margin-left: auto;
  }
}

@media (max-width: 620px) {
  .site-shell {
    width: min(100% - 28px, 520px);
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 11px;
    padding: 17px 0 12px;
  }

  .brand-mark {
    width: 31px;
    height: 31px;
  }

  .brand-name {
    font-size: 19px;
  }

  .main-nav {
    order: 3;
    width: 100%;
    justify-content: space-between;
  }

  .preview-marker {
    order: 2;
    margin-left: 0;
  }

  .main-nav a {
    padding: 8px 9px;
    font-size: 11px;
  }

  .notice-band {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 7px 9px;
    margin: 13px 0 17px;
    padding: 10px 11px;
    font-size: 11px;
  }

  .notice-icon {
    margin-top: 1px;
  }

  .notice-divider {
    display: none;
  }

  .notice-open {
    flex-basis: 100%;
    padding-left: 27px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 26px;
    padding: 35px 0 44px;
  }

  .hero h1 {
    max-width: 420px;
    font-size: clamp(43px, 13vw, 58px);
  }

  .hero-intro {
    margin: 17px 0 22px;
    font-size: 18px;
  }

  .community-card {
    max-width: 100%;
    padding: 19px 21px;
  }

  .community-split {
    margin: 12px 0 10px;
    padding: 11px 0;
  }

  .browse-section {
    padding: 22px 0 48px;
  }

  .section-heading,
  .results-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .section-heading h2 {
    font-size: 29px;
  }

  .section-note,
  .muted-copy {
    font-size: 12px;
  }

  .filter-panel {
    grid-template-columns: minmax(0, 1fr);
    padding: 10px;
  }

  .filter-panel .search-field,
  .filter-panel .button {
    grid-column: auto;
  }

  .thought-list {
    grid-template-columns: 1fr;
  }

  .thought-card {
    min-height: 220px;
  }

  .reaction-button {
    min-height: 38px;
    gap: 6px;
    padding-inline: 9px;
    font-size: 11px;
  }

  .pagination {
    flex-wrap: wrap;
    justify-content: center;
  }

  .pagination-summary {
    order: -1;
    flex: 0 0 100%;
  }

  .about-strip {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 48px;
    padding: 18px;
  }

  .about-strip h2 {
    font-size: 19px;
  }

  .about-strip > div {
    flex: 1 1 calc(100% - 56px);
  }

  .about-strip .text-link {
    margin-left: 54px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
    padding-bottom: 22px;
  }

  .detail-heading h1 {
    font-size: 39px;
  }

  .thought-card-heading {
    flex-wrap: wrap;
  }

  .detail-thought {
    padding: 21px 17px 15px;
  }

  .detail-body {
    margin: 19px 0;
    font-size: 20px;
  }

  .board-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .comment-card {
    padding: 16px;
  }

  .publish-layout,
  .admin-layout {
    display: flex;
    flex-direction: column;
    gap: 23px;
    padding-bottom: 48px;
  }

  .publish-intro,
  .admin-intro {
    position: static;
    padding-top: 4px;
  }

  .publish-intro h1,
  .admin-intro h1 {
    margin-bottom: 11px;
    font-size: 43px;
  }

  .publish-intro .section-note,
  .admin-intro .section-note {
    font-size: 16px;
  }

  .publish-side-note {
    display: none;
  }

  .publish-card {
    width: 100%;
    padding: 20px;
  }

  .admin-access,
  .admin-status,
  .admin-load-row,
  .policy-area {
    width: 100%;
  }

  .admin-access {
    padding: 16px;
  }

  .admin-load-row {
    align-items: flex-end;
  }

  .admin-load-row h2 {
    font-size: 22px;
  }

  .policy-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .policy-toolbar .button {
    width: 100%;
  }

  .policy-card {
    padding: 16px;
  }

  .policy-card-heading {
    flex-direction: column;
    gap: 7px;
  }

  .policy-switch-row {
    gap: 13px;
  }

  .switch-label {
    font-size: 12px;
  }

  .field-hint {
    font-size: 10px;
  }

  .composer-dialog {
    width: min(100% - 16px, 570px);
    max-height: 94vh;
    border-radius: 14px;
  }

  #composer-content {
    padding: 19px 16px 16px;
  }

  .composer-header {
    gap: 12px;
    margin-bottom: 16px;
  }

  .composer-header h2 {
    font-size: 25px;
  }

  .comment-form textarea {
    min-height: 130px;
  }

  .toast-region {
    right: 12px;
    bottom: 12px;
    width: calc(100% - 24px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
