:root {
  --ink: #17201b;
  --muted: #66736c;
  --line: #dde5df;
  --paper: #fbfcfa;
  --soft: #eef5f0;
  --green: #1d6b46;
  --green-dark: #12452e;
  --gold: #b98224;
  --blue: #2d5f82;
  --white: #ffffff;
  --shadow: 0 18px 50px rgba(20, 40, 28, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 252, 250, 0.92);
  padding: 14px clamp(18px, 5vw, 64px);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--green-dark);
  color: var(--white);
  font-weight: 800;
}

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

.brand small {
  color: var(--muted);
}

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

.topnav a,
.button,
.filter {
  border-radius: 8px;
  text-decoration: none;
}

.topnav a {
  padding: 8px 10px;
  color: var(--muted);
  font-size: 14px;
}

.topnav a:hover {
  color: var(--ink);
  background: var(--soft);
}

.site-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  gap: clamp(18px, 3vw, 32px);
  align-items: start;
  padding: clamp(24px, 5vw, 64px);
}

main {
  display: grid;
  gap: clamp(34px, 6vw, 76px);
  min-width: 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: clamp(24px, 5vw, 56px);
  align-items: stretch;
}

.hero-copy {
  display: grid;
  align-content: center;
  min-height: 420px;
  padding: clamp(26px, 5vw, 56px);
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(29, 107, 70, 0.08), rgba(45, 95, 130, 0.08)), var(--white);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 760px;
  margin-bottom: 16px;
  font-size: clamp(36px, 6vw, 68px);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 18px;
}

.hero-copy p {
  max-width: 700px;
  color: var(--muted);
  font-size: 18px;
}

.hero-actions,
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.button,
.filter {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 10px 14px;
}

.button.primary,
.filter.active {
  border-color: var(--green-dark);
  background: var(--green-dark);
  color: var(--white);
}

.button.secondary:hover,
.filter:hover {
  border-color: var(--green);
}

.hero-panel {
  display: grid;
  gap: 14px;
}

.hero-panel > div {
  display: grid;
  align-content: center;
  min-height: 128px;
  border: 1px solid var(--line);
  background: var(--white);
  padding: 22px;
  box-shadow: 0 12px 30px rgba(20, 40, 28, 0.06);
}

.metric {
  display: block;
  color: var(--green);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 850;
  line-height: 1;
}

.notice,
.post-sale {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 1.1fr);
  gap: 24px;
  border: 1px solid var(--line);
  background: var(--green-dark);
  color: var(--white);
  padding: clamp(22px, 4vw, 36px);
}

.notice p,
.post-sale p {
  color: rgba(255, 255, 255, 0.78);
}

.notice ul,
.post-sale ol {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 22px;
}

.workspace,
.responses,
.prices {
  display: grid;
  gap: 22px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.section-head.compact {
  align-items: start;
}

.search {
  display: grid;
  gap: 6px;
  min-width: min(100%, 340px);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.search input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  padding: 12px 14px;
  outline: none;
}

.search input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(29, 107, 70, 0.12);
}

.project-grid,
.response-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.card,
.response-grid article {
  border: 1px solid var(--line);
  background: var(--white);
  box-shadow: 0 12px 30px rgba(20, 40, 28, 0.05);
}

.card {
  display: grid;
  gap: 16px;
  min-height: 100%;
  padding: 18px;
}

.card.is-hidden {
  display: none;
}

.card-visual {
  height: 112px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(29, 107, 70, 0.75), rgba(45, 95, 130, 0.8)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.18) 0 1px, transparent 1px 18px);
}

.card-head {
  display: grid;
  gap: 8px;
}

.tag {
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
  padding: 4px 8px;
}

.card p {
  color: var(--muted);
}

.facts {
  display: grid;
  gap: 8px;
  margin: 0;
}

.facts div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.facts dt {
  color: var(--muted);
  font-weight: 700;
}

.facts dd {
  margin: 0;
}

.rules {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
}

.rules li {
  color: var(--muted);
}

.response-grid article {
  display: grid;
  align-content: start;
  padding: 20px;
}

.response-grid p {
  color: var(--muted);
}

.price-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.price-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  background: var(--white);
  box-shadow: 0 12px 30px rgba(20, 40, 28, 0.05);
  padding: 18px;
}

.price-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.price-card-head small {
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.price-table-wrap {
  overflow-x: auto;
}

.price-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.price-table th,
.price-table td {
  border-top: 1px solid var(--line);
  padding: 9px 8px;
  text-align: left;
  vertical-align: top;
}

.price-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.price-table td:nth-child(2),
.price-table td:nth-child(3),
.price-table td:nth-child(4) {
  white-space: nowrap;
}

.price-table td span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.post-sale {
  background: var(--blue);
}

.knowledge-chat {
  position: sticky;
  top: 88px;
  display: grid;
  grid-template-rows: auto minmax(280px, 1fr) auto auto;
  gap: 14px;
  height: calc(100vh - 112px);
  min-height: 0;
  border: 1px solid var(--line);
  background: var(--white);
  box-shadow: var(--shadow);
  padding: 18px;
}

.chat-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.chat-head h2 {
  margin-bottom: 0;
  font-size: 26px;
}

.chat-status {
  border-radius: 999px;
  background: rgba(29, 107, 70, 0.1);
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
  padding: 5px 9px;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding-right: 4px;
}

.chat-message {
  width: fit-content;
  max-width: 92%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  white-space: pre-wrap;
}

.chat-message p {
  margin: 0;
}

.chat-message.assistant {
  align-self: flex-start;
  background: var(--soft);
}

.chat-message.user {
  align-self: flex-end;
  border-color: rgba(29, 107, 70, 0.3);
  background: var(--green-dark);
  color: var(--white);
}

.chat-suggestions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.chat-suggestions button {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  padding: 9px 10px;
  text-align: left;
}

.chat-suggestions button:hover {
  border-color: var(--green);
  background: var(--soft);
}

.chat-form {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.chat-form label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.chat-form textarea {
  width: 100%;
  min-height: 86px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  padding: 11px 12px;
  outline: none;
}

.chat-form textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(29, 107, 70, 0.12);
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 22px clamp(18px, 5vw, 64px);
}

@media (max-width: 980px) {
  .site-shell,
  .hero,
  .notice,
  .post-sale,
  .project-grid,
  .response-grid,
  .price-grid {
    grid-template-columns: 1fr;
  }

  .knowledge-chat {
    position: static;
    height: auto;
    min-height: 560px;
  }

  .section-head {
    align-items: start;
    flex-direction: column;
  }
}

@media (min-width: 981px) and (max-width: 1380px) {
  .hero {
    grid-template-columns: 1fr;
  }

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

  .hero-panel > div {
    min-height: 112px;
  }
}

@media (max-width: 640px) {
  .topbar,
  .footer {
    align-items: flex-start;
    flex-direction: column;
  }

  main {
    padding: 0;
  }

  .site-shell {
    padding: 18px;
  }

  .hero-copy {
    min-height: 360px;
  }

  .facts div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}
