:root {
  color-scheme: light;
  --ink: #141414;
  --muted: #62615d;
  --line: #dedbd2;
  --paper: #fbfaf7;
  --panel: #ffffff;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --gold: #b46b24;
  --red: #b43b42;
  --code: #1d1e1b;
  --soft: #f0eee7;
  --shadow: 0 22px 55px rgba(27, 25, 20, 0.12);
}

* {
  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;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 68px;
  padding: 0 40px;
  background: rgba(251, 250, 247, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 750;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #fff;
  background: var(--ink);
  border-radius: 7px;
  font-size: 12px;
  letter-spacing: 0;
}

.nav {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-left: auto;
  color: var(--muted);
  font-size: 14px;
}

.nav a:hover,
.nav-cta:hover {
  color: var(--ink);
}

.nav-cta {
  padding: 9px 14px;
  color: #fff;
  background: var(--accent);
  border-radius: 7px;
  font-weight: 700;
  font-size: 14px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(420px, 1.05fr);
  gap: 52px;
  align-items: center;
  min-height: calc(100vh - 68px);
  padding: 54px 40px 72px;
  max-width: 1240px;
  margin: 0 auto;
}

.hero-copy {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

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

h1 {
  margin: 0;
  font-size: clamp(52px, 8vw, 92px);
  line-height: 0.94;
  letter-spacing: 0;
  overflow-wrap: normal;
  word-break: normal;
}

h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.05;
  letter-spacing: 0;
}

h3 {
  margin: 0;
  font-size: 19px;
  line-height: 1.2;
  letter-spacing: 0;
}

.lead {
  max-width: 680px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 19px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-weight: 760;
  cursor: pointer;
}

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

.button.primary:hover,
.nav-cta:hover {
  background: var(--accent-strong);
}

.button.secondary:hover,
.button.plan-button:hover {
  border-color: var(--ink);
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 34px 0 0;
}

.quick-stats div {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.quick-stats dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.quick-stats dd {
  margin: 5px 0 0;
  font-weight: 760;
}

.console-panel {
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.console-head {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: var(--soft);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot.good {
  background: var(--accent);
}

.dot.warm {
  background: var(--gold);
}

.dot.off {
  background: var(--red);
}

.console-title {
  margin-left: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.route-map {
  padding: 24px;
}

.route-node {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 82px;
  padding: 16px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  background: #fff;
}

.route-node.gateway {
  border-left-color: var(--gold);
}

.route-node.stable {
  border-left-color: var(--red);
}

.node-label {
  font-weight: 820;
}

.node-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.route-line,
.branch-line {
  display: block;
  width: 2px;
  height: 28px;
  margin: 0 auto;
  background: var(--line);
}

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

.branch-line {
  height: 34px;
}

.terminal {
  margin: 0;
  padding: 22px 24px;
  color: #e9f2ef;
  background: var(--code);
  font-size: 13px;
  overflow: auto;
}

.agent-panel {
  min-width: 0;
}

.agent-shell {
  display: flex;
  flex-direction: column;
  height: min(680px, calc(100vh - 112px));
  min-height: 560px;
  overflow: hidden;
  color: #101413;
  background: #f7f9f8;
  border: 1px solid #cbd7d2;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(20, 29, 27, 0.18);
}

.agent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 64px;
  padding: 14px 16px;
  background: #ffffff;
  border-bottom: 1px solid #d8e1dd;
}

.agent-head > div:first-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.agent-head strong {
  font-size: 15px;
}

.agent-head span {
  color: #61706b;
  font-size: 12px;
  font-weight: 680;
}

.agent-modes {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(54px, 1fr));
  gap: 4px;
  padding: 4px;
  background: #e9efec;
  border: 1px solid #d3ddd9;
  border-radius: 8px;
}

.agent-modes button,
.agent-thinking,
.agent-prompts button,
.agent-stop,
.agent-send,
.agent-icon-button {
  font: inherit;
}

.agent-modes button {
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #53625d;
  cursor: pointer;
  font-size: 12px;
  font-weight: 760;
}

.agent-modes button.active {
  color: #ffffff;
  background: #202523;
}

.agent-thinking {
  height: 38px;
  padding: 0 12px;
  border: 1px solid #c9d6d1;
  border-radius: 8px;
  background: #f7fbfa;
  color: #33423f;
  cursor: pointer;
  font-size: 12px;
  font-weight: 820;
  white-space: nowrap;
}

.agent-thinking.active {
  color: #fff;
  background: #734b13;
  border-color: #734b13;
}

.agent-access-button {
  height: 38px;
  padding: 0 13px;
  border: 1px solid #202523;
  border-radius: 8px;
  background: #202523;
  color: #ffffff;
  font-size: 12px;
  font-weight: 820;
  white-space: nowrap;
}

.agent-messages {
  flex: 1;
  overflow-y: auto;
  padding: 22px 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.82), rgba(247,249,248,0.96)),
    #f7f9f8;
}

.agent-message {
  max-width: 86%;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid #d8e1dd;
  border-radius: 8px;
  background: #ffffff;
  color: #18201d;
  box-shadow: 0 8px 26px rgba(36, 48, 44, 0.06);
}

.agent-message.user {
  margin-left: auto;
  color: #ffffff;
  background: #1f3f3b;
  border-color: #1f3f3b;
}

.agent-message.is-loading {
  color: #3c4945;
  background: #ffffff;
}

.agent-message-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.agent-message-head strong {
  min-width: 0;
  font-size: 12px;
  letter-spacing: 0;
}

.agent-copy-button,
.agent-code-head button {
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid #cdd8d4;
  border-radius: 7px;
  background: #f7faf9;
  color: #31423e;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

.agent-message.user .agent-copy-button {
  border-color: rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.agent-message-content {
  display: grid;
  gap: 10px;
}

.agent-message-content p {
  margin: 0;
  white-space: pre-wrap;
}

.agent-message-content strong {
  font-weight: 780;
}

.agent-message-content em {
  color: #24302d;
  font-style: italic;
}

.agent-message-content a {
  color: #0f766e;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.agent-message-content p code,
.agent-message-content li code,
.agent-message-content td code,
.agent-message-content th code {
  padding: 1px 5px;
  border: 1px solid #d6e0dc;
  border-radius: 5px;
  background: #edf3f1;
  color: #18201d;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
}

.agent-message-content ul,
.agent-message-content ol {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 22px;
}

.agent-message-content li {
  padding-left: 2px;
}

.agent-loading {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 28px;
  color: #51605b;
  font-size: 14px;
  font-weight: 650;
}

.agent-loading-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.agent-loading-dots i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #0f766e;
  opacity: 0.35;
  animation: agent-loading-pulse 1.1s ease-in-out infinite;
}

.agent-loading-dots i:nth-child(2) {
  animation-delay: 0.14s;
}

.agent-loading-dots i:nth-child(3) {
  animation-delay: 0.28s;
}

@keyframes agent-loading-pulse {
  0%,
  80%,
  100% {
    opacity: 0.28;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

.agent-markdown-heading {
  margin: 4px 0 0;
  color: #18201d;
  font-weight: 800;
  line-height: 1.35;
}

.agent-markdown-heading-1 {
  font-size: 22px;
}

.agent-markdown-heading-2 {
  font-size: 18px;
}

.agent-markdown-heading-3,
.agent-markdown-heading-4 {
  font-size: 15px;
}

.agent-markdown-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid #d9e2de;
  border-radius: 8px;
  background: #ffffff;
  font-size: 14px;
}

.agent-markdown-table th,
.agent-markdown-table td {
  padding: 9px 11px;
  border-bottom: 1px solid #e4ebe8;
  border-right: 1px solid #e4ebe8;
  text-align: left;
  vertical-align: top;
}

.agent-markdown-table th {
  background: #edf3f1;
  font-weight: 820;
}

.agent-markdown-table tr:last-child td {
  border-bottom: 0;
}

.agent-markdown-table th:last-child,
.agent-markdown-table td:last-child {
  border-right: 0;
}

.agent-code-block {
  width: 100%;
  overflow: hidden;
  border: 1px solid #d9e2e7;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.agent-code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 52px;
  padding: 0 18px;
  border-bottom: 1px solid #dce6ec;
  background: #edf3f8;
}

.agent-code-head span {
  color: #24302d;
  font-size: 15px;
  font-weight: 760;
}

.agent-code-head button {
  border-color: #cbd8de;
  background: #f8fbfd;
  color: #263330;
}

.agent-code-copy::before,
.agent-code-copy.copied::before {
  content: none;
}

.agent-code-block pre {
  max-height: 520px;
  margin: 0;
  padding: 18px 20px;
  overflow: auto;
  background: #ffffff;
  color: #111827;
}

.agent-code-block code {
  color: #111827;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre;
}

.agent-code-block .token.keyword {
  color: #7c3aed;
  font-weight: 760;
}

.agent-code-block .token.string {
  color: #15803d;
}

.agent-code-block .token.comment {
  color: #6b7280;
  font-style: italic;
}

.agent-code-block .token.number {
  color: #b45309;
}

.agent-message-actions {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  margin-top: 12px;
}

.agent-message .agent-files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.agent-file-chip,
.agent-attachments span {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 26px;
  padding: 0 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #eaf2ef;
  color: #23443f;
  font-size: 12px;
  font-weight: 740;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-message.user .agent-file-chip {
  color: #e5f4ef;
  background: rgba(255, 255, 255, 0.16);
}

.agent-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px 0;
  background: #ffffff;
  border-top: 1px solid #d8e1dd;
}

.agent-prompts button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #c9d6d1;
  border-radius: 999px;
  background: #f6fbf9;
  color: #28433f;
  cursor: pointer;
  font-size: 12px;
  font-weight: 760;
}

.agent-compose {
  padding: 12px 16px 16px;
  background: #ffffff;
}

.agent-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.agent-attachments[hidden],
.agent-stop[hidden] {
  display: none;
}

.agent-compose textarea {
  width: 100%;
  min-height: 82px;
  max-height: 190px;
  resize: vertical;
  padding: 13px 14px;
  border: 1px solid #c9d6d1;
  border-radius: 8px;
  color: #151918;
  background: #fbfdfc;
  font: inherit;
  line-height: 1.45;
}

.agent-compose textarea:focus {
  outline: 2px solid rgba(15, 118, 110, 0.24);
  border-color: var(--accent);
}

.agent-compose-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
}

.agent-icon-button,
.agent-stop,
.agent-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 820;
}

.agent-icon-button {
  width: 38px;
  border: 1px solid #c9d6d1;
  background: #f5f8f7;
  color: #21302d;
  font-size: 21px;
}

.agent-icon-button input {
  display: none;
}

.agent-stop {
  margin-left: auto;
  padding: 0 14px;
  border: 1px solid #c84f57;
  background: #fff7f7;
  color: #9d2f37;
}

.agent-send {
  margin-left: auto;
  padding: 0 18px;
  border: 0;
  background: var(--accent);
  color: #ffffff;
}

.agent-stop:not([hidden]) + .agent-send {
  margin-left: 0;
}

.agent-send:disabled,
.agent-stop:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.band {
  background: #fff;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

section {
  padding: 82px 40px;
}

.section-head {
  max-width: 760px;
  margin: 0 auto 34px;
  text-align: center;
}

.section-head p:not(.eyebrow) {
  margin: 14px 0 0;
  color: var(--muted);
}

#pricing .section-head {
  margin-bottom: 24px;
}

.pricing-highlights {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 760px;
  margin: 18px auto 0;
}

.pricing-highlights span {
  padding: 6px 10px;
  border: 1px solid #d7e4df;
  border-radius: 999px;
  background: #eef8f5;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 820;
  line-height: 1.2;
}

.value-grid,
.setup-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  max-width: 1120px;
  margin: 0 auto;
}

.value-grid article,
.setup-grid article,
.plan {
  min-width: 0;
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.value-grid p,
.plan p,
.family-head p {
  color: var(--muted);
}

.privacy-strip {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  max-width: 1120px;
  margin: 18px auto 0;
  padding: 18px 22px;
  border: 1px solid #cfe3dc;
  border-radius: 8px;
  background: #edf8f4;
}

.privacy-strip strong {
  color: var(--accent-strong);
  font-size: 14px;
  line-height: 1.35;
}

.privacy-strip p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.capabilities {
  background: var(--paper);
}

.capability-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  max-width: 1180px;
  margin: 0 auto;
}

.capability-grid article {
  min-width: 0;
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.capability-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-bottom: 14px;
  padding: 0 8px;
  color: var(--accent-strong);
  background: #edf7f3;
  border: 1px solid #d4e6df;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 820;
}

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

.pricing {
  max-width: 1220px;
  margin: 0 auto;
}

.pricing-groups {
  display: grid;
  gap: 30px;
}

.plan-family {
  border-top: 1px solid var(--line);
  padding-top: 24px;
}

.plan-family.starter {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff8ed;
}

.family-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.family-head p {
  max-width: 520px;
  margin: 0;
}

.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 18px;
}

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

.starter-plans {
  grid-template-columns: minmax(0, 1fr);
}

.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 342px;
}

.plan.limited {
  min-height: 0;
  background: #fffdf8;
  border-color: #d9b984;
}

.plan.featured {
  border-color: var(--accent);
  box-shadow: 0 16px 42px rgba(15, 118, 110, 0.13);
}

.plan.flash {
  border-color: var(--gold);
  background: #fffdf8;
  box-shadow: 0 14px 34px rgba(169, 114, 42, 0.13);
}

.plan.sold-out {
  opacity: 0.72;
}

.plan.sold-out .plan-button {
  color: var(--ink);
  background: #fff;
  border-color: var(--gold);
}

.plan-status {
  align-self: flex-start;
  margin-bottom: 10px;
  padding: 5px 8px;
  border: 1px solid #d7e4df;
  border-radius: 999px;
  background: #eef8f5;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 820;
}

.sold-out .plan-status {
  border-color: #ead4ae;
  background: #fff7e8;
  color: #8b551c;
}

.duration {
  display: block;
  margin-bottom: 6px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 820;
  line-height: 1.25;
  text-transform: uppercase;
}

.plan h3 {
  margin-bottom: 10px;
  line-height: 1.3;
}

.price-stack {
  display: grid;
  justify-items: start;
  gap: 4px;
  margin-top: 8px;
}

.regular-price {
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
  text-decoration: line-through;
}

.discount-badge {
  padding: 4px 7px;
  border: 1px solid #d7e4df;
  border-radius: 999px;
  background: #eef8f5;
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 820;
  text-transform: uppercase;
}

.plan strong {
  margin-top: 8px;
  font-size: 28px;
}

.price-stack strong {
  margin-top: 0;
}

.plan ul {
  display: grid;
  gap: 8px;
  margin: 12px 0 22px;
  padding-left: 18px;
  color: var(--muted);
}

.plan-note {
  margin: 0 0 18px;
  padding: 11px 12px;
  border: 1px solid #ead4ae;
  border-radius: 7px;
  background: #fff7e8;
  color: #73512b;
  font-size: 13px;
}

.plan-button {
  margin-top: auto;
}

.setup-grid article {
  background: var(--panel);
}

pre {
  max-width: 100%;
  margin: 16px 0 0;
  padding: 16px;
  color: #f2f0e7;
  background: var(--code);
  border-radius: 8px;
  overflow: auto;
  font-size: 13px;
}

.status {
  max-width: 920px;
  margin: 0 auto;
}

.status-table {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.status-table div {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(0, 1.2fr);
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.status-table div:last-child {
  border-bottom: 0;
}

.status-table span {
  color: var(--muted);
}

.support {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.support > div {
  max-width: 760px;
}

.support p:not(.eyebrow) {
  color: var(--muted);
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 40px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.language-switch {
  position: fixed;
  left: auto;
  right: 18px;
  top: 78px;
  bottom: auto;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: 360px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 30px rgba(27, 25, 20, 0.12);
}

.language-switch a {
  padding: 4px 7px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.language-switch a.active {
  color: #fff;
  background: var(--accent);
}

.support-widget {
  position: fixed;
  left: 18px;
  right: auto;
  top: 84px;
  bottom: auto;
  z-index: 40;
  display: grid;
  justify-items: start;
  gap: 10px;
  padding: 0;
}

.support-toggle {
  display: grid;
  gap: 2px;
  min-width: 136px;
  padding: 12px 15px;
  border: 1px solid #cddbd6;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 16px 34px rgba(27, 25, 20, 0.18);
  cursor: pointer;
  font: inherit;
  font-weight: 840;
  text-align: left;
}

.support-toggle small {
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 720;
}

.support-panel {
  width: min(390px, calc(100vw - 32px));
  max-height: min(680px, calc(100vh - 112px));
  display: grid;
  grid-template-rows: auto auto minmax(160px, 1fr) auto auto auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 62px rgba(27, 25, 20, 0.2);
}

.support-panel[hidden] {
  display: none;
}

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

.support-panel-head div {
  display: grid;
  gap: 3px;
}

.support-panel-head span,
.support-note,
.support-email {
  color: var(--muted);
  font-size: 12px;
}

.support-panel-head button {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.support-hours {
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: #eef8f5;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 760;
}

.support-messages {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px 16px;
  overflow: auto;
  background: #fbfaf6;
}

.support-message {
  max-width: 88%;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.support-message.user {
  justify-self: end;
  border-color: #cddbd6;
  background: #eef8f5;
}

.support-message.human {
  border-color: #ead4ae;
  background: #fff7e8;
}

.support-email {
  display: grid;
  gap: 5px;
  padding: 10px 16px 0;
}

.support-email input,
.support-compose textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

.support-email input {
  padding: 9px 10px;
}

.support-compose {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px 16px;
}

.support-compose textarea {
  min-height: 48px;
  max-height: 120px;
  padding: 10px;
  resize: vertical;
}

.support-compose button {
  align-self: end;
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 840;
}

.support-note {
  margin: 0;
  padding: 0 16px 14px;
}

body.agent-app-body {
  min-height: 100vh;
  overflow: hidden;
  background: #f4f6f4;
}

.agent-entry-body {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background: #f4f6f4;
}

.agent-entry {
  display: grid;
  justify-items: center;
  gap: 14px;
  max-width: 520px;
  text-align: center;
}

.agent-entry h1 {
  margin: 0;
  font-size: 48px;
}

.agent-entry p {
  margin: 0 0 6px;
  color: #5e6965;
}

.agent-app {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  height: 100vh;
  color: #121716;
  background: #f4f6f4;
}

.agent-sidebar {
  min-width: 0;
  overflow: auto;
  background: #ffffff;
  border-color: #d9dfdc;
}

.agent-sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100vh;
  padding: 18px 14px;
  border-right: 1px solid #d9dfdc;
}

.agent-app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  font-weight: 820;
}

.agent-sidebar-language {
  display: none;
  align-self: flex-start;
}

.agent-new-chat,
.agent-account-actions button,
.agent-history button,
.agent-auth-actions button,
.agent-auth-close,
.agent-access-button,
.agent-settings-head button {
  font: inherit;
  cursor: pointer;
}

.agent-new-chat {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: #18201d;
  color: #ffffff;
  font-weight: 820;
}

.agent-account-card {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding: 13px;
  border: 1px solid #d9dfdc;
  border-radius: 8px;
  background: #f8faf8;
}

.agent-account-card strong,
.agent-account-card span,
.agent-history-item strong,
.agent-history-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-account-card span,
.agent-history-head,
.agent-history p,
.agent-settings p,
.agent-settings span,
.agent-app-topbar span {
  color: #66716d;
  font-size: 12px;
}

.agent-account-actions {
  display: flex;
  gap: 8px;
}

.agent-account-actions button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid #cad3cf;
  border-radius: 7px;
  background: #ffffff;
  color: #17201d;
  font-weight: 760;
}

.agent-account-actions button[hidden] {
  display: none;
}

.agent-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  font-weight: 820;
  text-transform: uppercase;
}

.agent-history {
  display: grid;
  align-content: start;
  gap: 6px;
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.agent-history p {
  margin: 4px 2px;
}

.agent-history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  align-items: stretch;
  gap: 4px;
  min-height: 54px;
  border: 1px solid transparent;
  border-radius: 8px;
}

.agent-history-item:hover,
.agent-history-item.active {
  border-color: #d4ddd9;
  background: #eef4f2;
}

.agent-history-open {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px 0 0 8px;
  background: transparent;
  color: #17201d;
  text-align: left;
}

.agent-history-delete {
  align-self: center;
  justify-self: center;
  width: 52px;
  height: 24px;
  padding: 0 7px;
  border: 1px solid #cad3cf;
  border-radius: 6px;
  background: #ffffff;
  color: #66716d;
  font-size: 11px;
  font-weight: 820;
  line-height: 1;
  text-align: center;
  opacity: 1;
}

.agent-history-delete:hover {
  border-color: #9aa8a3;
  color: #17201d;
}

.agent-workspace {
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  padding: 0;
}

.agent-sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #cad3cf;
  border-radius: 7px;
  background: #ffffff;
  color: #17201d;
  font: inherit;
  font-weight: 780;
  cursor: pointer;
}

.agent-app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
  padding: 0 24px;
  border-bottom: 1px solid #d9dfdc;
  background: rgba(244, 246, 244, 0.92);
  backdrop-filter: blur(14px);
}

.agent-sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 38;
  display: none;
  background: rgba(16, 20, 18, 0.28);
}

.agent-app-topbar > div:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.agent-top-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.agent-language-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid #d1dbd7;
  border-radius: 999px;
  background: #ffffff;
}

.agent-language-switch button {
  min-height: 28px;
  padding: 0 9px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #4d5b57;
  font: inherit;
  font-size: 12px;
  font-weight: 820;
  cursor: pointer;
}

.agent-language-switch button.active {
  background: #18201d;
  color: #ffffff;
}

.agent-app-topbar .agent-access-button {
  border-color: #d1dbd7;
  background: #ffffff;
  color: #22302c;
  box-shadow: 0 8px 22px rgba(31, 42, 38, 0.06);
}

.agent-top-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 8px;
  color: #4d5b57;
  font-size: 13px;
  font-weight: 720;
}

.agent-top-link:hover {
  color: #17201d;
}

.agent-main-window {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  min-width: 0;
  min-height: 0;
  width: 100%;
  margin: 0;
  padding: 0;
}

.agent-app:not(.has-conversation) .agent-main-window {
  padding-bottom: clamp(120px, 26vh, 220px);
}

.agent-app-messages {
  order: 1;
  min-height: 0;
  padding: 42px clamp(32px, 4.2vw, 88px) 24px;
  border: 0;
  border-radius: 0;
  background: #f4f6f4;
}

.agent-app:not(.has-conversation) .agent-app-messages {
  display: grid;
  place-items: end center;
  padding: 0 clamp(24px, 4vw, 72px) 22px;
  overflow: hidden;
}

.agent-empty-state {
  display: grid;
  justify-items: center;
  gap: 8px;
  max-width: 760px;
  text-align: center;
}

.agent-empty-state span {
  color: #4f5d59;
  font-size: 18px;
  font-weight: 720;
}

.agent-empty-state h1 {
  margin: 0;
  color: #1f2624;
  font-size: clamp(34px, 3.2vw, 54px);
  font-weight: 760;
  line-height: 1.08;
}

.agent-app-messages .agent-message {
  max-width: min(1120px, 78%);
  box-shadow: none;
}

.agent-app-messages .agent-message.assistant {
  background: #ffffff;
}

.agent-app-messages .agent-message.user {
  max-width: min(980px, 70%);
}

.agent-app-prompts {
  order: 3;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  width: min(820px, calc(100% - 64px));
  margin: 0 auto 12px;
  padding: 0;
  border: 0;
  background: transparent;
}

.agent-app-prompts button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: #ffffff;
  color: #18201d;
  text-align: center;
  box-shadow: 0 8px 22px rgba(32, 41, 38, 0.04);
}

.agent-app-prompts button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #2d3935;
  font-size: 13px;
  font-weight: 720;
}

.agent-app.has-conversation .agent-app-prompts {
  display: none;
}

.agent-app-compose {
  order: 2;
  width: calc(100% - 64px);
  margin: 0 auto 24px;
  padding: 10px 12px 12px;
  border: 1px solid #d9dfdc;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(31, 42, 38, 0.10);
}

.agent-app:not(.has-conversation) .agent-app-compose {
  width: min(860px, calc(100% - 64px));
  margin-bottom: 14px;
}

.agent-app:not(.has-conversation) .agent-app-compose textarea {
  height: 46px;
  min-height: 46px;
  max-height: 120px;
}

.agent-app-compose textarea {
  min-height: 68px;
  padding: 8px 2px 10px;
  border: 0;
  background: #ffffff;
  resize: none;
}

.agent-app-compose textarea:focus {
  outline: 0;
}

.agent-app-compose .agent-compose-bar {
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.agent-app-compose .agent-modes {
  margin-left: 2px;
}

.agent-app-compose .agent-thinking {
  height: 34px;
}

.agent-app-compose .agent-icon-button,
.agent-app-compose .agent-stop,
.agent-app-compose .agent-send {
  height: 34px;
}

.agent-settings-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  background: rgba(16, 20, 18, 0.22);
}

.agent-app.settings-open .agent-settings-backdrop {
  display: block;
}

.agent-settings {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 60;
  display: grid;
  align-content: start;
  gap: 14px;
  width: min(380px, calc(100vw - 24px));
  height: 100vh;
  padding: 18px 16px 28px;
  overflow: auto;
  border-left: 1px solid #d9dfdc;
  background: #ffffff;
  box-shadow: -18px 0 48px rgba(20, 29, 27, 0.16);
  transform: translateX(104%);
  transition: transform 180ms ease;
}

.agent-app.settings-open .agent-settings {
  transform: translateX(0);
}

.agent-settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #d9dfdc;
}

.agent-settings-head > div {
  display: grid;
  gap: 2px;
}

.agent-settings-head button {
  width: 34px;
  height: 34px;
  border: 1px solid #d9dfdc;
  border-radius: 8px;
  background: #ffffff;
  color: #4d5a56;
  font-weight: 820;
}

.agent-settings section {
  display: grid;
  gap: 6px;
  padding: 0 0 14px;
  border-bottom: 1px solid #e6ebe8;
}

.agent-settings section:last-child {
  border-bottom: 0;
}

.agent-settings-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.agent-settings-links a {
  min-height: 32px;
  padding: 8px 10px;
  border: 1px solid #d9dfdc;
  border-radius: 8px;
  background: #f8faf8;
  color: #25332f;
  font-size: 12px;
  font-weight: 760;
}

.agent-settings strong {
  font-size: 14px;
}

.agent-settings p {
  margin: 0;
  line-height: 1.45;
}

.agent-plan-list,
.agent-key-panel,
.agent-key-list {
  display: grid;
  gap: 8px;
}

.agent-plan-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #d9dfdc;
  border-radius: 8px;
  background: #f8faf8;
}

.agent-plan-card > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.agent-plan-card p,
.agent-key-panel p {
  font-size: 12px;
}

.agent-plan-card button,
.agent-key-panel button {
  min-height: 34px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 820;
}

.agent-key-list span {
  min-width: 0;
  padding: 7px 8px;
  overflow: hidden;
  border: 1px solid #d9dfdc;
  border-radius: 7px;
  background: #ffffff;
  color: #44514d;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-key-output {
  max-height: 150px;
  margin: 0;
  padding: 10px;
  border-radius: 8px;
  white-space: pre-wrap;
  word-break: break-all;
}

.agent-settings .button {
  width: 100%;
  min-height: 38px;
  margin-top: 4px;
}

.agent-auth-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(19, 24, 22, 0.38);
}

.agent-auth-modal[hidden] {
  display: none;
}

.agent-auth-card {
  position: relative;
  width: min(420px, 100%);
  padding: 24px;
  border: 1px solid #d9dfdc;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(20, 29, 27, 0.22);
}

.agent-auth-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 1px solid #d9dfdc;
  border-radius: 8px;
  background: #fff;
  color: #4e5955;
  font-weight: 820;
}

.agent-auth-card h2 {
  padding-right: 34px;
  font-size: 26px;
}

.agent-auth-card p {
  margin: 10px 0 18px;
  color: #66716d;
}

.agent-auth-card form {
  display: grid;
  gap: 10px;
}

.agent-auth-card input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #cad3cf;
  border-radius: 8px;
  font: inherit;
}

.agent-auth-card input:focus {
  outline: 2px solid rgba(15, 118, 110, 0.22);
  border-color: var(--accent);
}

.agent-auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.agent-auth-actions button {
  min-height: 42px;
  border: 1px solid #cad3cf;
  border-radius: 8px;
  background: #ffffff;
  color: #17201d;
  font-weight: 820;
}

.agent-auth-actions button:last-child {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

[data-agent-auth-error] {
  min-height: 18px;
  color: #a5343d;
  font-size: 13px;
}

@media (max-width: 900px) {
  .topbar {
    padding: 0 20px;
  }

  .nav {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 46px 20px 58px;
  }

  section {
    padding: 58px 20px;
  }

  .quick-stats,
  .value-grid,
  .setup-grid,
  .capability-grid,
  .plans,
  .plans.two {
    grid-template-columns: 1fr;
  }

  .route-branches {
    grid-template-columns: 1fr;
  }

  .agent-shell {
    height: 680px;
    min-height: 540px;
  }

  .privacy-strip {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .family-head,
  .support,
  .footer {
    align-items: flex-start;
    flex-direction: column;
  }

  body.agent-app-body {
    overflow: auto;
    overflow-x: hidden;
  }

  .agent-app {
    grid-template-columns: 1fr;
    width: 100vw;
    max-width: 100vw;
    height: auto;
    min-height: 100vh;
    overflow-x: hidden;
  }

  .agent-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: min(86vw, 340px);
    max-width: 340px;
    height: 100dvh;
    padding: 16px 14px;
    border-right: 1px solid #d9dfdc;
    border-bottom: 0;
    box-shadow: 18px 0 44px rgba(20, 29, 27, 0.16);
    transform: translateX(-104%);
    transition: transform 180ms ease;
    overflow-x: hidden;
  }

  .agent-app.sidebar-open .agent-sidebar {
    transform: translateX(0);
  }

  .agent-app.sidebar-open .agent-sidebar-backdrop {
    display: block;
  }

  .agent-sidebar-toggle {
    display: inline-flex;
    flex: 0 0 auto;
  }

  .agent-app-brand span:last-child {
    display: inline;
  }

  .agent-sidebar-language {
    display: inline-flex;
  }

  .agent-account-card {
    margin-top: auto;
    min-width: 0;
    padding: 9px;
  }

  .agent-workspace {
    min-height: calc(100vh - 66px);
    grid-template-rows: auto minmax(0, 1fr);
  }

  .agent-app-topbar {
    align-items: center;
    flex-direction: row;
    justify-content: flex-start;
    padding: 12px;
  }

  .agent-top-controls {
    align-items: center;
    min-width: 0;
    margin-left: auto;
  }

  .agent-main-window {
    width: 100%;
    min-height: calc(100vh - 204px);
    padding: 0;
  }

  .agent-app-messages {
    padding: 24px 14px 16px;
  }

  .agent-app-prompts,
  .agent-app-compose {
    width: calc(100% - 24px);
  }

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

  .agent-settings {
    width: min(390px, calc(100vw - 16px));
  }
}

@media (max-width: 520px) {
  .brand span:last-child {
    display: none;
  }

  .nav-cta {
    margin-left: auto;
  }

  h1 {
    font-size: 50px;
  }

  .lead {
    font-size: 17px;
  }

  .console-panel {
    margin-inline: -6px;
  }

  .agent-panel {
    margin-inline: -6px;
  }

  .agent-shell {
    height: 620px;
    min-height: 520px;
  }

  .agent-head {
    align-items: stretch;
    flex-direction: column;
  }

  .agent-thinking {
    width: 100%;
  }

  .agent-message {
    max-width: 94%;
  }

  .status-table div {
    grid-template-columns: 1fr;
  }

  .language-switch {
    left: auto;
    right: 10px;
    top: 78px;
    bottom: auto;
    max-width: none;
  }

  .support-widget {
    left: 10px;
    right: auto;
    top: 78px;
    bottom: auto;
  }

  .support-toggle {
    min-width: 118px;
  }

  .agent-sidebar {
    width: min(88vw, 330px);
    max-width: 330px;
  }

  .agent-new-chat {
    min-width: 0;
    min-height: 38px;
  }

  .agent-account-card {
    grid-column: 1 / -1;
  }

  .agent-top-controls {
    display: flex;
    gap: 6px;
    margin-left: auto;
  }

  .agent-top-link,
  .agent-app-topbar .agent-access-button {
    display: none;
  }

  .agent-workspace,
  .agent-main-window,
  .agent-app-topbar,
  .agent-app-messages {
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
  }

  .agent-empty-state {
    max-width: calc(100vw - 32px);
  }

  .agent-empty-state h1 {
    max-width: 310px;
    font-size: 28px;
    line-height: 1.12;
    text-wrap: balance;
    overflow-wrap: break-word;
  }

  .agent-app-messages .agent-message,
  .agent-app-messages .agent-message.user {
    max-width: 94%;
  }

  .agent-app:not(.has-conversation) .agent-app-compose,
  .agent-app-compose,
  .agent-app-prompts {
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
  }

  .agent-app-compose .agent-compose-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .agent-app-compose .agent-send {
    grid-column: 1;
    grid-row: 4;
    justify-self: stretch;
    margin-left: 0;
    min-width: 74px;
    width: 100%;
  }

  .agent-app-compose .agent-icon-button {
    grid-column: 1;
    justify-self: start;
  }

  .agent-app-prompts button {
    min-width: 0;
    width: 100%;
  }

  .agent-app-prompts {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    overflow: visible;
  }

  .agent-app-compose .agent-modes {
    order: 3;
    grid-column: 1 / -1;
    width: min(100%, 330px);
    margin-left: 0;
  }

  .agent-app-compose .agent-thinking {
    order: 4;
    grid-column: 1 / -1;
  }

  .agent-auth-card {
    padding: 20px;
  }
}
