:root {
  --bg: #eef7f8;
  --surface: #ffffff;
  --ink: #152a2f;
  --muted: #607982;
  --line: rgba(78, 129, 143, 0.16);
  --primary: #2aa889;
  --primary-dark: #176f67;
  --blue: #497fa3;
  --blue-soft: #e4f1f6;
  --amber: #5c9f9a;
  --amber-soft: #e5f6f0;
  --danger: #8d2f37;
  --danger-soft: #ffe7e7;
  --shadow: 0 18px 42px rgba(34, 83, 94, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", Arial, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(73, 127, 163, 0.14), transparent 26rem),
    linear-gradient(180deg, #f9fdfd 0%, var(--bg) 52%, #e8f7f2 100%);
  line-height: 1.55;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  color: inherit;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(42, 168, 137, 0.3);
  outline-offset: 3px;
}

.text-button:hover {
  color: var(--primary-dark);
}

.forum-hero {
  max-width: 1220px;
  min-height: 560px;
  margin: 0 auto;
  padding: 74px 20px 42px;
  display: grid;
  grid-template-columns: minmax(0, 1.14fr) minmax(320px, 0.86fr);
  gap: 32px;
  align-items: center;
}

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

.forum-hero h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(2.5rem, 5.5vw, 5.1rem);
  line-height: 0.98;
}

.forum-hero p,
.security-panel p,
.compose-card p,
.post-card p,
.sidebar-block p,
.footer p {
  color: var(--muted);
}

.forum-hero > div > p:not(.eyebrow) {
  max-width: 660px;
  font-size: 1.08rem;
}

.hero-actions,
.security-actions,
.compose-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease;
}

.button:hover,
.account-button:hover,
.category-button:hover {
  transform: translateY(-2px);
}

.primary {
  background: var(--primary);
  color: #fff;
}

.primary:hover {
  background: var(--primary-dark);
}

.secondary {
  background: var(--blue-soft);
  color: var(--blue);
}

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

.full {
  width: 100%;
}

.security-panel,
.sidebar-block,
.compose-card,
.post-card,
.toolbar,
.modal-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.security-panel {
  padding: 26px;
}

.security-top {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--primary-dark);
  font-weight: 900;
}

.status-light {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--amber);
}

.status-light.signed-in {
  background: var(--primary);
}

.security-panel h2 {
  margin: 16px 0 6px;
  font-size: 2rem;
  line-height: 1.08;
}

.security-actions .button {
  flex: 1 1 150px;
}

.note {
  margin-bottom: 0;
  font-size: 0.9rem;
}

.forum-shell {
  max-width: 1220px;
  margin: 0 auto;
  padding: 28px 20px 78px;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 86px;
  display: grid;
  gap: 16px;
}

.sidebar-block {
  padding: 18px;
}

.category-button {
  width: 100%;
  min-height: 42px;
  margin-top: 8px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  text-align: left;
  font-weight: 900;
  cursor: pointer;
}

.category-button.active {
  background: var(--primary);
  color: #fff;
}

.safety-card {
  background: var(--danger-soft);
}

.safety-card h2 {
  margin: 0;
  font-size: 1.35rem;
}

.forum-main {
  min-width: 0;
}

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

label {
  display: block;
  color: var(--ink);
  font-weight: 900;
}

.toolbar label span {
  display: block;
  margin-bottom: 7px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(78, 129, 143, 0.18);
  border-radius: 8px;
  padding: 12px 13px;
  background: #fff;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(42, 168, 137, 0.2);
  outline-offset: 0;
  border-color: var(--primary);
}

.compose-card {
  margin-top: 18px;
  padding: 22px;
}

.compose-head,
.latest-head,
.post-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.compose-head h2,
.latest-head h2 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.45rem);
  line-height: 1.08;
}

#composeLock {
  padding: 6px 9px;
  border-radius: 8px;
  background: var(--amber-soft);
  color: #2f6662;
  font-weight: 900;
}

#composeLock.ready {
  background: #d8f4ec;
  color: var(--primary-dark);
}

.form-grid {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.form-status {
  min-height: 24px;
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 800;
}

.form-status.error {
  color: var(--danger);
}

.store-status {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 800;
}

.latest-head {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.text-button,
.close-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
  cursor: pointer;
}

.post-list {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.post-card {
  padding: 20px;
}

.post-card h3 {
  margin: 0;
  font-size: 1.25rem;
}

.post-card p {
  margin-bottom: 0;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.category-pill {
  padding: 5px 8px;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.post-action {
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--primary-dark);
  font-weight: 900;
  cursor: pointer;
}

.post-action:hover {
  background: var(--amber-soft);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(18, 31, 28, 0.58);
}

.modal-card {
  position: relative;
  width: min(100%, 480px);
  padding: 28px;
}

.modal-card h2 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.08;
}

.close-button {
  position: absolute;
  top: 14px;
  right: 16px;
  font-size: 1.1rem;
}

.hidden {
  display: none !important;
}

.footer {
  padding: 28px 20px;
  text-align: center;
  background: #e7f4f6;
}

@media (max-width: 940px) {
  .forum-hero,
  .forum-shell,
  .toolbar {
    grid-template-columns: 1fr;
  }

  .forum-hero {
    min-height: auto;
    padding-top: 58px;
  }

  .sidebar {
    position: static;
  }
}

@media (max-width: 560px) {
  .forum-nav {
    grid-template-columns: 1fr auto;
  }

  .account-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .forum-hero h1 {
    font-size: 2.35rem;
  }

  .hero-actions .button,
  .security-actions .button,
  .compose-actions .button {
    width: 100%;
  }

  .compose-head,
  .latest-head,
  .post-top {
    flex-direction: column;
  }
}
