:root {
  --cream: #f7efe2;
  --paper: #fffaf1;
  --brick: #b9573f;
  --brick-dark: #8d382b;
  --brown: #503520;
  --brown-soft: #76573b;
  --sage: #748059;
  --olive: #4f5f3c;
  --beige-brick: #d7ad82;
  --line: rgba(80, 53, 32, 0.16);
  --shadow: 0 18px 48px rgba(80, 53, 32, 0.14);
  color: var(--brown);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--cream);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(90deg, rgba(177, 78, 53, 0.06) 1px, transparent 1px) 0 0 / 72px 72px,
    linear-gradient(180deg, #fbf5ea 0%, #f2e3cf 100%);
}

a {
  color: inherit;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

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

button {
  cursor: pointer;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px clamp(16px, 4vw, 44px);
  border-bottom: 1px solid var(--line);
  background: rgba(247, 239, 226, 0.92);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  color: #fffaf1;
  background: linear-gradient(135deg, var(--brick), var(--brown));
  font-weight: 800;
  letter-spacing: 0;
}

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

.brand strong {
  font-size: 1rem;
  line-height: 1.1;
}

.brand small {
  color: var(--brown-soft);
  font-size: 0.78rem;
}

.top-nav {
  display: none;
  gap: 18px;
  align-items: center;
  font-size: 0.95rem;
}

.top-nav a {
  text-decoration: none;
}

.post-button,
.primary-action {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  color: #fffaf1;
  background: var(--brick);
  box-shadow: 0 8px 18px rgba(177, 78, 53, 0.22);
  font-weight: 750;
}

main {
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
}

.intro {
  display: grid;
  gap: 22px;
  align-items: end;
  min-height: 250px;
  padding: 34px 0 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--olive);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 720px;
  margin: 0;
  color: var(--brown);
  font-size: clamp(2.3rem, 11vw, 5.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(1.45rem, 4vw, 2.4rem);
  line-height: 1.05;
  letter-spacing: 0;
}

h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.25;
}

.intro-copy {
  max-width: 620px;
  margin: 16px 0 0;
  color: var(--brown-soft);
  font-size: 1.08rem;
  line-height: 1.55;
}

.mini-map {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: min(100%, 360px);
}

.mini-map span {
  min-height: 64px;
  border: 1px solid rgba(80, 53, 32, 0.18);
  border-radius: 8px;
  background: var(--paper);
}

.mini-map span:nth-child(1),
.mini-map span:nth-child(4) {
  background: linear-gradient(145deg, var(--sage), #a6ad7f);
}

.mini-map span:nth-child(2) {
  background: linear-gradient(145deg, var(--beige-brick), #efd1aa);
}

.mini-map span:nth-child(3) {
  background: linear-gradient(145deg, var(--brick), var(--brick-dark));
}

.feed-shell,
.section-block {
  margin: 20px 0 34px;
  padding: clamp(16px, 3vw, 26px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.82);
  box-shadow: var(--shadow);
}

.feed-head,
.section-title {
  display: grid;
  gap: 16px;
}

.feed-head p,
.section-title p,
.form-note {
  margin: 6px 0 0;
  color: var(--brown-soft);
  line-height: 1.45;
}

.search-box {
  display: grid;
  gap: 6px;
  color: var(--brown-soft);
  font-size: 0.85rem;
  font-weight: 700;
}

.search-box input,
.form-card input,
.form-card textarea,
.form-card select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--brown);
  background: #fffdf7;
  outline-color: var(--sage);
}

.filters,
.useful-toolbar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 18px 0 4px;
}

.filter,
.useful-filter {
  flex: 0 0 auto;
  min-height: 38px;
  border: 1px solid rgba(80, 53, 32, 0.18);
  border-radius: 999px;
  padding: 0 14px;
  color: var(--brown);
  background: rgba(255, 255, 255, 0.54);
  font-weight: 760;
}

.filter.is-active,
.useful-filter.is-active {
  border-color: var(--olive);
  color: #fffaf1;
  background: var(--olive);
}

.feed {
  display: grid;
  gap: 12px;
  padding-top: 16px;
}

.feed-card,
.useful-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fffaf1;
}

.feed-card.important {
  border-color: rgba(177, 78, 53, 0.46);
  background: linear-gradient(180deg, #fffaf1, #fff2e0);
}

.card-top {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.tag,
.source {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 0.78rem;
  font-weight: 800;
}

.tag {
  color: #fffaf1;
  background: var(--brick);
}

.source {
  color: var(--olive);
  background: rgba(116, 128, 89, 0.13);
}

.feed-card p,
.useful-card p {
  margin: 0;
  color: var(--brown-soft);
  line-height: 1.45;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--brown-soft);
  font-size: 0.84rem;
}

.card-action {
  justify-self: start;
  min-height: 38px;
  border: 1px solid rgba(80, 53, 32, 0.18);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--brown);
  background: #fffdf7;
  font-weight: 800;
  text-decoration: none;
}

.card-action.external {
  color: #fffaf1;
  background: var(--brown);
}

.useful-grid {
  display: grid;
  gap: 10px;
  padding-top: 16px;
}

.useful-card strong {
  color: var(--brown);
}

.editorial-text {
  display: grid;
  gap: 12px;
  max-width: 760px;
  padding-top: 18px;
}

.editorial-text p {
  margin: 0;
  font-size: 1.03rem;
  line-height: 1.7;
}

.form-card {
  display: grid;
  gap: 12px;
  width: 100%;
}

.form-card label {
  display: grid;
  gap: 6px;
  color: var(--brown-soft);
  font-size: 0.9rem;
  font-weight: 750;
}

.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-section {
  margin-bottom: 56px;
}

.moderation-section[hidden] {
  display: none;
}

.moderation-list {
  display: grid;
  gap: 12px;
  padding-top: 18px;
}

.moderation-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fffaf1;
}

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

.secondary-action,
.danger-action {
  min-height: 38px;
  border-radius: 8px;
  padding: 0 12px;
  font-weight: 800;
}

.secondary-action {
  border: 1px solid var(--olive);
  color: #fffaf1;
  background: var(--olive);
}

.danger-action {
  border: 1px solid rgba(141, 56, 43, 0.34);
  color: var(--brick-dark);
  background: #fff7ef;
}

.contact-section .form-card {
  margin-top: 18px;
}

dialog {
  width: min(560px, calc(100% - 26px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  color: var(--brown);
  background: var(--paper);
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(55, 35, 20, 0.42);
  backdrop-filter: blur(3px);
}

.icon-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--brown);
  background: #fffaf1;
  font-size: 1.4rem;
  line-height: 1;
}

.dialog-title {
  padding-right: 32px;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 40;
  max-width: min(360px, calc(100% - 32px));
  transform: translateY(130%);
  border-radius: 8px;
  padding: 12px 14px;
  color: #fffaf1;
  background: var(--brown);
  box-shadow: var(--shadow);
  opacity: 0;
  transition: 0.22s ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.empty {
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--brown-soft);
  background: rgba(255, 250, 241, 0.66);
}

@media (min-width: 760px) {
  .site-header {
    grid-template-columns: 1fr auto auto;
  }

  .top-nav {
    display: flex;
  }

  .intro {
    grid-template-columns: 1fr 360px;
    min-height: 340px;
    padding-top: 58px;
  }

  .feed-head {
    grid-template-columns: 1fr minmax(260px, 360px);
    align-items: end;
  }

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

  .feed-card.important {
    grid-column: span 2;
  }

  .useful-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 460px) {
  .site-header {
    grid-template-columns: 1fr;
  }

  .post-button {
    width: 100%;
  }

  .brand strong {
    font-size: 0.96rem;
  }
}
