:root {
  --ink: #111936;
  --ink-2: #243150;
  --green: #416f37;
  --green-2: #2f572b;
  --teal: #4f9a96;
  --mint: #e5f3f0;
  --paper: #ffffff;
  --soft: #f4f7f5;
  --line: #d9e4df;
  --muted: #60706b;
  --gold: #b89642;
  --shadow: 0 18px 54px rgba(17, 25, 54, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--soft);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

body * {
  min-width: 0;
}

p,
h1,
h2,
h3,
small,
strong,
span,
summary,
dd {
  overflow-wrap: anywhere;
}

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

button,
input {
  min-width: 0;
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto auto;
  gap: 22px;
  align-items: center;
  min-height: 76px;
  padding: 12px clamp(18px, 4vw, 56px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark,
.rail-mark,
.agent-avatar {
  display: grid;
  place-items: center;
  color: var(--paper);
  background: var(--ink);
  border: 2px solid var(--teal);
  border-radius: 50%;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 900;
}

.brand-mark {
  width: 50px;
  height: 50px;
  flex: 0 0 auto;
}

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

.brand strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.08rem;
}

.brand small {
  color: var(--green);
  font-size: 0.75rem;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  color: var(--ink-2);
  font-size: 0.94rem;
}

.nav-links a {
  padding: 8px 0;
  border-bottom: 2px solid transparent;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--green);
  border-bottom-color: var(--green);
}

.primary-btn,
.secondary-btn,
.top-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-weight: 900;
  text-align: center;
}

.primary-btn,
.top-action-link {
  color: var(--paper);
  background: var(--green);
}

.primary-btn:hover,
.top-action-link:hover {
  background: var(--green-2);
}

.secondary-btn {
  color: var(--ink);
  background: var(--paper);
  border-color: var(--line);
}

.secondary-btn:hover {
  border-color: var(--teal);
}

.workspace {
  min-height: calc(100vh - 76px);
  padding: clamp(28px, 5vw, 56px) clamp(14px, 4vw, 56px) clamp(42px, 5vw, 64px);
  background:
    linear-gradient(180deg, rgba(229, 243, 240, 0.72), rgba(244, 247, 245, 0.95) 42%, rgba(244, 247, 245, 1)),
    linear-gradient(115deg, rgba(17, 25, 54, 0.08), transparent 34%, rgba(79, 154, 150, 0.12));
}

.workspace-heading {
  max-width: 860px;
  margin: 0 auto 24px;
  text-align: center;
}

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

.workspace-heading h1,
.section-heading h2 {
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.06;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.workspace-heading h1 {
  font-size: clamp(2.1rem, 4.8vw, 4.25rem);
  word-break: normal;
}

.workspace-heading p:last-child,
.section-heading > p:last-child {
  max-width: 720px;
  margin: 14px auto 0;
  color: var(--muted);
  font-size: 1.04rem;
  width: 100%;
}

.app-grid {
  display: grid;
  grid-template-columns: minmax(230px, 0.72fr) minmax(0, 1.35fr) minmax(280px, 0.86fr);
  gap: 16px;
  max-width: 1400px;
  margin: 0 auto;
  align-items: start;
}

.app-grid > * {
  min-width: 0;
}

.service-rail,
.sales-chat,
.conversation-summary,
.feature-card,
.faq-list details {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.service-rail,
.conversation-summary {
  padding: 18px;
}

.rail-brand {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.rail-mark {
  width: 54px;
  height: 54px;
}

.rail-brand h2,
.panel-heading h2,
.sales-chat-header h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.28rem;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.rail-brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.service-actions {
  display: grid;
  gap: 10px;
}

.service-actions a {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 74px;
  padding: 12px;
  background: #f8fbf9;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.service-actions a:hover,
.service-actions a:focus-visible {
  border-color: var(--teal);
  box-shadow: inset 4px 0 0 var(--teal);
}

.service-actions span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--green);
  background: var(--mint);
  border-radius: 50%;
  font-size: 0.82rem;
  font-weight: 900;
}

.service-actions strong,
.service-actions small {
  display: block;
  grid-column: 2;
  overflow-wrap: anywhere;
}

.service-actions small {
  color: var(--muted);
  font-size: 0.78rem;
}

.ethics-note {
  margin-top: 16px;
  padding: 14px;
  color: var(--ink-2);
  background: #eff6ef;
  border-left: 4px solid var(--green);
  border-radius: 7px;
}

.ethics-note strong {
  display: block;
  margin-bottom: 4px;
}

.ethics-note p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.sales-chat {
  overflow: hidden;
}

.sales-chat-header {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 18px;
  color: var(--paper);
  background:
    linear-gradient(115deg, var(--ink), #1d2946 70%, #244339),
    linear-gradient(90deg, rgba(79, 154, 150, 0.2), transparent);
}

.agent-avatar {
  width: 54px;
  height: 54px;
  background: var(--green);
  border-color: rgba(229, 243, 240, 0.9);
}

.sales-chat-header .eyebrow {
  color: #b8d7cf;
}

.sales-chat-header span {
  display: block;
  margin-top: 4px;
  color: #dbe8e5;
  font-size: 0.86rem;
  font-weight: 800;
}

.reset-chat-btn {
  min-height: 38px;
  padding: 0 12px;
  color: var(--paper);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 7px;
  font-weight: 800;
}

.sales-chat-stream {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 470px;
  max-height: 560px;
  padding: 20px;
  overflow: auto;
  background:
    linear-gradient(180deg, rgba(229, 243, 240, 0.64), rgba(255, 255, 255, 0.98)),
    repeating-linear-gradient(135deg, rgba(79, 154, 150, 0.05) 0 1px, transparent 1px 18px);
}

.message {
  max-width: min(82%, 620px);
  padding: 12px 14px;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(17, 25, 54, 0.08);
}

.message span {
  display: block;
  margin-bottom: 4px;
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.message p {
  margin: 0;
}

.message.assistant {
  color: var(--ink);
  background: var(--paper);
  border-bottom-left-radius: 4px;
}

.message.user {
  justify-self: end;
  color: var(--paper);
  background: var(--ink-2);
  border-bottom-right-radius: 4px;
}

.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 62px;
  padding: 14px 18px;
  background: #fbfcfb;
  border-top: 1px solid var(--line);
}

.quick-replies:empty {
  display: none;
}

.quick-replies button {
  min-height: 38px;
  padding: 0 13px;
  color: var(--ink-2);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 800;
  white-space: normal;
}

.quick-replies button:hover,
.quick-replies button:focus-visible {
  color: var(--paper);
  background: var(--green);
  border-color: var(--green);
}

.chat-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 16px 18px 18px;
  background: var(--paper);
  border-top: 1px solid var(--line);
}

.chat-input-row input {
  min-height: 46px;
  padding: 0 13px;
  color: var(--ink);
  background: #f8faf9;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: none;
}

.chat-input-row input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(79, 154, 150, 0.16);
}

.chat-input-row input:disabled,
.chat-input-row button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.conversation-summary {
  position: sticky;
  top: 92px;
}

.progress-box {
  display: grid;
  gap: 8px;
  margin: 16px 0;
  padding: 12px;
  background: #f7faf8;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.progress-track {
  height: 9px;
  overflow: hidden;
  background: #e1ebe7;
  border-radius: 999px;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--teal));
  border-radius: inherit;
  transition: width 180ms ease;
}

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

.summary-grid div {
  min-height: 68px;
  padding: 10px;
  background: #f8fbf9;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.summary-grid span,
.summary-grid strong {
  display: block;
}

.summary-grid span,
.quote-list dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.summary-grid strong {
  margin-top: 4px;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.quote-list {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.quote-list div {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.quote-list dd {
  margin: 4px 0 0;
  font-weight: 900;
}

.summary-preview {
  min-height: 108px;
  max-height: 180px;
  padding: 12px;
  overflow: auto;
  color: var(--muted);
  background: #fbfcfb;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.85rem;
  white-space: pre-line;
}

.full-width {
  width: 100%;
  margin-top: 10px;
}

.disabled-link {
  opacity: 0.58;
}

.content-section,
.areas-section,
.faq-section {
  padding: clamp(48px, 6vw, 82px) clamp(14px, 4vw, 56px);
}

.content-section,
.faq-section {
  background: var(--paper);
}

.areas-section {
  background: var(--soft);
}

.section-heading {
  max-width: 820px;
  margin: 0 0 28px;
}

.section-heading h2 {
  font-size: clamp(1.85rem, 3.2vw, 2.75rem);
}

.feature-grid,
.area-grid,
.faq-list {
  display: grid;
  gap: 14px;
}

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

.feature-card {
  min-height: 230px;
  padding: 22px;
}

.feature-card span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--paper);
  background: var(--ink);
  border-radius: 50%;
  font-weight: 900;
}

.feature-card h3 {
  margin: 18px 0 10px;
  font-size: 1.18rem;
}

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

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

.area-grid span {
  min-height: 58px;
  padding: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 5px solid var(--green);
  border-radius: 8px;
  font-weight: 900;
}

.faq-list {
  max-width: 900px;
}

.faq-list details {
  box-shadow: none;
}

.faq-list summary {
  min-height: 58px;
  padding: 17px 18px;
  font-weight: 900;
  cursor: pointer;
}

.faq-list p {
  margin: 0;
  padding: 0 18px 18px;
  color: var(--muted);
}

.floating-chat-button {
  position: fixed;
  right: clamp(16px, 3vw, 28px);
  bottom: clamp(16px, 3vw, 28px);
  z-index: 30;
  min-height: 48px;
  padding: 0 18px;
  color: var(--paper);
  background: var(--green);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  box-shadow: 0 14px 34px rgba(17, 25, 54, 0.26);
  font-weight: 900;
}

.site-footer {
  display: grid;
  place-items: center;
  min-height: 76px;
  padding: 22px clamp(18px, 5vw, 68px);
  color: var(--paper);
  background: #0b1023;
  border-top: 4px solid var(--teal);
  text-align: center;
}

.site-footer p {
  margin: 0;
  color: #b8d7cf;
  font-weight: 900;
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .nav-links {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .app-grid {
    grid-template-columns: minmax(240px, 0.82fr) minmax(0, 1.18fr);
  }

  .conversation-summary {
    grid-column: 1 / -1;
    position: static;
  }

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

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

@media (max-width: 820px) {
  .topbar {
    position: static;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .nav-links {
    grid-column: auto;
    grid-row: auto;
  }

  .top-action-link {
    width: 100%;
  }

  .workspace-heading {
    text-align: left;
  }

  .workspace-heading h1 {
    max-width: 10.5em;
    font-size: clamp(2rem, 8.2vw, 3rem);
    line-height: 1.04;
  }

  .app-grid,
  .feature-grid,
  .area-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .sales-chat {
    order: 1;
  }

  .service-rail {
    order: 2;
  }

  .conversation-summary {
    order: 3;
  }

  .sales-chat-header,
  .chat-input-row {
    grid-template-columns: 1fr;
  }

  .sales-chat-stream {
    min-height: 380px;
    max-height: 520px;
    padding: 16px;
  }

  .message {
    max-width: 94%;
  }

  .quick-replies button,
  .chat-input-row .primary-btn {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .topbar,
  .workspace,
  .content-section,
  .areas-section,
  .faq-section {
    width: 100%;
    max-width: 100%;
    padding-left: 14px;
    padding-right: 14px;
  }

  .workspace-heading h1 {
    max-width: 9.2em;
    font-size: clamp(1.82rem, 8.8vw, 2.25rem);
  }

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

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

  .brand small {
    font-size: 0.7rem;
  }

  .service-rail,
  .conversation-summary {
    padding: 14px;
  }

  .service-actions a {
    grid-template-columns: 36px 1fr;
  }

  .sales-chat-header {
    padding: 16px;
  }

  .sales-chat-stream {
    min-height: 340px;
    max-height: 460px;
  }

  .floating-chat-button {
    left: 14px;
    right: 14px;
    width: auto;
  }
}
