:root {
  --bg: #f6f7f8;
  --card: #ffffff;
  --card-soft: #f1f3f5;
  --border: #d8dde3;
  --text: #1f2328;
  --muted: #64707d;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --orange: #ff7a18;
  --red: #dc2626;
  --green: #15803d;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

body.modal-open { overflow: hidden; }

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

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

button { cursor: pointer; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.topbar__inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
  font-weight: 850;
}

.brand__logo {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), #60a5fa);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.14);
}

.nav {
  display: flex;
  gap: 14px;
  color: var(--muted);
  font-size: 14px;
  flex: 1;
}

.nav a:hover { color: var(--blue); }

.mobile-menu {
  display: none;
  border: 1px solid var(--border);
  background: var(--card-soft);
  border-radius: 10px;
  padding: 7px 10px;
}

.top-stats {
  display: flex;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.top-stats span {
  background: var(--card-soft);
  border-radius: 999px;
  padding: 6px 10px;
}

.page {
  max-width: 1240px;
  margin: 0 auto;
  padding: 22px 18px 40px;
}

.hero {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 18px;
  margin-bottom: 18px;
}

.hero__content,
.hero__activity,
.post,
.topic-card,
.sidebar-card,
.consultation {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.hero__content,
.hero__activity { padding: 22px; }

.eyebrow,
.hero__activity span {
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 850;
  font-size: 12px;
}

.hero h1 {
  margin: 8px 0 10px;
  font-size: clamp(27px, 4vw, 42px);
  line-height: 1.1;
}

.hero p,
.hero__activity small,
.sidebar-card p,
.disclaimer { color: var(--muted); }

.hero__activity {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.hero__activity strong { font-size: 24px; }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.feed { display: flex; flex-direction: column; gap: 18px; }

.post {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  overflow: hidden;
}

.post--pinned { border-color: rgba(37, 99, 235, .33); }

.vote-column {
  background: var(--card-soft);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 14px 8px;
}

.vote-column button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
}

.vote-column button:hover { color: var(--orange); }

.post__body { padding: 18px; }

.post__meta,
.topic-meta,
.comment__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #e8eefc;
  color: var(--blue-dark);
  padding: 3px 8px;
  font-weight: 750;
  font-size: 12px;
}

.badge--pin { background: #fff3e8; color: #b64c00; }

.post h2,
.topic-card h3 { margin: 10px 0 8px; line-height: 1.24; }

.post p,
.topic-card p { color: #374151; }

.post__actions,
.topic-actions,
.comment__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 14px;
}

.post__actions button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0;
}

.post__actions button:hover { color: var(--blue); }

.comments { display: flex; flex-direction: column; gap: 12px; }

.comments--preview { margin-top: 18px; }

.comment {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
}

.comment--reply {
  margin-left: 36px;
  padding-left: 16px;
  border-left: 2px solid var(--border);
}

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

.comment__content {
  min-width: 0;
  background: var(--card-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
}

.comment__content p { margin: 7px 0 8px; word-wrap: break-word; overflow-wrap: anywhere; }

.inline-cta {
  border: 1px solid rgba(37, 99, 235, .28);
  color: var(--blue-dark);
  background: #eff6ff;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 750;
  margin: 2px 0 8px;
}

.inline-cta:hover { background: #dbeafe; }

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 2px 0 12px;
}

.section-title h2 { margin: 0; }

.section-title span { color: var(--muted); font-size: 14px; }

.topic-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  padding: 16px;
  margin-bottom: 12px;
}

.topic-votes { color: var(--muted); text-align: center; font-size: 13px; }
.topic-votes strong { display: block; color: var(--text); font-size: 18px; }

.sidebar {
  position: sticky;
  top: 76px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sidebar-card { padding: 16px; }
.sidebar-card h3 { margin: 0 0 12px; }

.stats-list,
.link-list { list-style: none; padding: 0; margin: 0; }

.stats-list li {
  display: flex;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}

.stats-list li:last-child { border-bottom: 0; }
.stats-list span,
.link-list li,
.mini-message span { color: var(--muted); }

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

.tags span {
  background: var(--card-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 13px;
}

.link-list li {
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}

.mini-message {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.consultation {
  display: grid;
  grid-template-columns: .92fr 1.08fr;
  gap: 20px;
  padding: 22px;
  scroll-margin-top: 90px;
}

.consultation h2 { margin: 8px 0 10px; font-size: 30px; }
.consultation__info p { color: var(--muted); }

.checklist {
  margin-top: 18px;
  padding: 16px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.checklist h3 { margin: 0 0 8px; }
.checklist ul { margin: 0; padding-left: 20px; color: #374151; }

.lead-form { display: flex; flex-direction: column; gap: 12px; }

.lead-form label,
.lead-form fieldset {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #374151;
  font-weight: 750;
}

.lead-form input,
.lead-form textarea,
.lead-form select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 13px;
  background: white;
}

.lead-form input:focus,
.lead-form textarea:focus,
.lead-form select:focus {
  outline: 3px solid rgba(37, 99, 235, .18);
  border-color: var(--blue);
}

.lead-form fieldset {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
}

.lead-form legend { padding: 0 4px; font-weight: 850; }

.radio,
.consent {
  flex-direction: row !important;
  align-items: flex-start;
  font-weight: 500 !important;
  color: var(--text) !important;
}

.radio input,
.consent input { width: auto; margin-top: 4px; }
.consent a { color: var(--blue); font-weight: 850; }

.disclaimer { margin: 0; font-size: 13px; }

.submit-btn,
.ghost-btn {
  border-radius: 14px;
  padding: 14px 18px;
  font-weight: 850;
  font-size: 16px;
}

.submit-btn {
  border: 0;
  background: var(--blue);
  color: #fff;
}

.submit-btn:hover { background: var(--blue-dark); }
.submit-btn:active,
.ghost-btn:active { transform: translateY(1px); }
.submit-btn:disabled { opacity: .75; cursor: not-allowed; }

.ghost-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
}

.ghost-btn:hover { background: var(--card-soft); color: var(--text); }

.form-message {
  display: none;
  padding: 12px;
  border-radius: 12px;
  font-weight: 750;
}

.form-message.is-error { display: block; background: #fee2e2; color: #991b1b; }
.form-message.is-success { display: block; background: #dcfce7; color: #166534; }

.input-error { border-color: var(--red) !important; outline: 3px solid rgba(220, 38, 38, .12) !important; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.modal.is-visible { display: flex; }

.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .58);
  backdrop-filter: blur(6px);
}

.modal__window {
  position: relative;
  z-index: 1;
  width: min(100%, 560px);
  max-height: calc(100vh - 36px);
  overflow: auto;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .3);
  padding: 22px;
}

.modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--card-soft);
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
}

.modal__close:hover { background: #e5e7eb; color: var(--text); }

.modal h2 { margin: 8px 34px 8px 0; }
.modal__subtitle { color: var(--muted); margin: 0 0 14px; }

.footer {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 18px 38px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 14px;
}

.footer a { color: var(--blue); }
.footer__note { width: 100%; font-size: 13px; }

@media (max-width: 1040px) {
  .topbar__inner { flex-wrap: wrap; }
  .nav { order: 3; width: 100%; overflow-x: auto; padding-bottom: 2px; }
  .layout,
  .hero { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .consultation { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .page { padding: 14px 10px 28px; }
  .topbar__inner { padding: 10px; gap: 10px; }
  .brand__name { font-size: 14px; }
  .brand__logo { width: 34px; height: 34px; }
  .mobile-menu { display: inline-flex; margin-left: auto; }
  .nav { display: none; flex-direction: column; }
  .nav.is-open { display: flex; }
  .top-stats { width: 100%; flex-wrap: wrap; }
  .hero__content,
  .hero__activity,
  .post__body,
  .sidebar-card,
  .consultation,
  .modal__window { padding: 14px; }
  .post,
  .topic-card { grid-template-columns: 1fr; }
  .vote-column {
    flex-direction: row;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    justify-content: flex-start;
  }
  .comment--reply { margin-left: 12px; padding-left: 10px; }
  .comment { grid-template-columns: 30px minmax(0, 1fr); }
  .avatar { width: 30px; height: 30px; font-size: 13px; }
  .hero h1 { font-size: 28px; }
  .consultation h2 { font-size: 25px; }
  .modal { padding: 10px; }
  .modal__window { max-height: calc(100vh - 20px); }
}


/* Thank-you page */
.thank-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 60px 18px 70px;
  min-height: calc(100vh - 160px);
  display: grid;
  place-items: center;
}

.thank-card {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: clamp(24px, 5vw, 46px);
  box-shadow: var(--shadow);
  text-align: center;
}

.thank-icon {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  background: #dcfce7;
  color: #166534;
  font-size: 42px;
  font-weight: 900;
}

.thank-card h1 {
  margin: 8px 0 12px;
  font-size: clamp(32px, 6vw, 52px);
  line-height: 1.05;
}

.thank-text {
  max-width: 650px;
  margin: 0 auto 22px;
  color: var(--muted);
  font-size: 18px;
}

.thank-next {
  max-width: 620px;
  margin: 22px auto;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #f8fafc;
  text-align: left;
}

.thank-next h2 {
  margin: 0 0 10px;
  font-size: 20px;
}

.thank-next ul {
  margin: 0;
  padding-left: 20px;
  color: #374151;
}

.thank-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 22px 0 14px;
}

.thank-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(37, 99, 235, 0.28);
  color: var(--blue-dark);
  background: #eff6ff;
  border-radius: 14px;
  padding: 14px 18px;
  font-weight: 850;
}

.secondary-btn:hover {
  background: #dbeafe;
}

@media (max-width: 640px) {
  .thank-page {
    padding: 28px 10px 44px;
    align-items: start;
  }

  .thank-card {
    border-radius: 18px;
  }

  .thank-actions {
    flex-direction: column;
  }

  .thank-btn,
  .secondary-btn {
    width: 100%;
  }
}

/* Clickable topic pages */
.topic-title-link{color:inherit}.topic-title-link:hover{color:var(--blue)}.topic-link-list{display:flex;flex-direction:column;gap:8px}.topic-link-list a{display:block;padding:10px 11px;border:1px solid var(--border);border-radius:12px;background:var(--card-soft);color:var(--text);font-weight:750}.topic-link-list a:hover{border-color:rgba(37,99,235,.38);color:var(--blue-dark);background:#eff6ff}.topic-page{max-width:1240px;margin:0 auto;padding:22px 18px 40px}.topic-shell{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:18px;align-items:start}.topic-main{display:flex;flex-direction:column;gap:18px}.back-link{display:inline-flex;width:fit-content;color:var(--blue-dark);font-weight:800;background:#eff6ff;border:1px solid rgba(37,99,235,.25);border-radius:999px;padding:9px 13px}.back-link:hover{background:#dbeafe}.topic-full h1{margin:10px 0 8px;line-height:1.15;font-size:clamp(26px,4vw,40px)}.topic-comments-block{background:var(--card);border:1px solid var(--border);border-radius:16px;box-shadow:var(--shadow);padding:18px}.topic-nav{display:flex;justify-content:space-between;gap:12px}.topic-nav a{display:inline-flex;align-items:center;justify-content:center;min-height:42px;padding:10px 14px;border-radius:12px;background:var(--card);border:1px solid var(--border);color:var(--blue-dark);font-weight:850;box-shadow:var(--shadow)}.topic-nav a:hover{background:#eff6ff}.topic-consultation{margin-top:0}@media(max-width:1040px){.topic-shell{grid-template-columns:1fr}.topic-sidebar{position:static}}@media(max-width:640px){.topic-page{padding:14px 10px 28px}.topic-comments-block{padding:14px}.topic-nav{flex-direction:column}}


/* ch-forum.com brand update */
:root { --orange-accent: #ff5a00; }
.brand__logo--image { overflow: hidden; background: var(--orange-accent) !important; padding: 0; }
.brand__logo--image img { width: 100%; height: 100%; display: block; object-fit: cover; border-radius: 50%; }
.submit-btn, .popup-submit, button[type="submit"] { background: var(--orange-accent); }
.submit-btn:hover, .popup-submit:hover, button[type="submit"]:hover { background: #e65100; }
.inline-cta { border-color: rgba(255,90,0,.28); color: #b34200; background: #fff3e8; }
.inline-cta:hover { background: #ffe3cc; }
.topic-link-list a:hover, .topic-title-link:hover, .nav a:hover, .consent a, .footer a { color: #e65100; }
.lead-form input[type="email"] { direction: ltr; }
