:root {
  --bg: #f5f7fa;
  --ink: #17202a;
  --muted: #637083;
  --line: #dfe5ec;
  --panel: #ffffff;
  --accent: #217c7e;
  --accent-2: #d99035;
  --good: #218a5a;
  --warn: #9a651a;
  --shadow: 0 20px 48px rgba(24, 35, 50, 0.09);
}

* {
  box-sizing: border-box;
}

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

a {
  color: inherit;
}

.top {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 900;
  text-decoration: none;
}

.ai-icon {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #101820;
  color: #ffffff;
  font-size: 14px;
  font-weight: 950;
  box-shadow: inset 0 -3px 0 rgba(33, 124, 126, 0.6);
}

nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

nav a,
.link-button {
  color: var(--muted);
  text-decoration: none;
  font-weight: 750;
}

nav form {
  margin: 0;
}

button,
.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 850;
  padding: 0 16px;
  text-decoration: none;
}

.button.small {
  min-height: 36px;
}

.button.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.button.google {
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--ink);
}

.button.google::before {
  content: "G";
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 9px;
  border-radius: 50%;
  background: #4285f4;
  color: #fff;
  font-weight: 900;
}

.button.full {
  width: 100%;
  margin: 18px 0 10px;
}

.link-button {
  min-height: auto;
  background: transparent;
  color: var(--muted);
  padding: 0;
}

.page {
  width: min(1120px, calc(100vw - 32px));
  margin: 34px auto;
}

.hero {
  min-height: 420px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  align-items: center;
  gap: 30px;
}

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

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(34px, 6vw, 58px);
  line-height: 1.03;
}

h2 {
  font-size: 24px;
}

.lead {
  max-width: 640px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.6;
}

.actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.summary,
.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.summary {
  padding: 24px;
}

.summary span {
  color: var(--muted);
  font-weight: 750;
}

.summary strong {
  display: block;
  margin-top: 8px;
  font-size: 48px;
}

.card {
  padding: 24px;
}

.form-card {
  width: min(480px, 100%);
  margin: 0 auto;
}

.wide-form {
  width: min(720px, 100%);
}

.form-note {
  color: var(--muted);
  line-height: 1.55;
  margin: 12px 0 18px;
}

form {
  display: grid;
  gap: 14px;
}

.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  margin: 4px 0 12px;
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  padding: 0 12px;
}

textarea {
  width: 100%;
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  line-height: 1.5;
  padding: 12px;
  resize: vertical;
}

select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 0 12px;
}

.config-preview {
  display: grid;
  gap: 6px;
  margin-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  padding-top: 14px;
}

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

.wide {
  grid-column: 1 / -1;
}

.plans {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.plan {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.plan strong {
  color: var(--accent);
  font-size: 22px;
}

.flash {
  margin-bottom: 16px;
  border-radius: 8px;
  padding: 12px 14px;
  background: #edf3f7;
  color: var(--muted);
  font-weight: 750;
}

.flash.success {
  background: #e8f6ef;
  color: var(--good);
}

.flash.warning {
  background: #fff4df;
  color: var(--warn);
}

.chat-shell {
  display: grid;
  min-height: calc(100vh - 140px);
}

.chat-panel {
  display: grid;
  grid-template-rows: auto auto minmax(300px, 1fr) auto;
  min-height: 620px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 24px;
}

.chat-status {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafc;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 14px;
  padding: 10px 12px;
}

.gateway-checklist {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.check-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 8px;
  align-items: center;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.check-item > span {
  grid-row: 1 / span 2;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: #a8b3c2;
}

.check-item strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.check-item small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.check-item.ok {
  border-color: rgba(33, 138, 90, 0.28);
  background: #f2fbf6;
}

.check-item.ok > span {
  background: var(--good);
}

.check-item.fail {
  border-color: rgba(154, 101, 26, 0.32);
  background: #fff8ed;
}

.check-item.fail > span {
  background: var(--warn);
}

.chat-log {
  display: grid;
  align-content: start;
  gap: 12px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 16px;
}

.chat-message {
  display: grid;
  gap: 6px;
  max-width: min(720px, 88%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px 14px;
}

.chat-message.user {
  justify-self: end;
  border-color: rgba(33, 124, 126, 0.28);
  background: #eaf6f6;
}

.chat-message strong {
  font-size: 12px;
  color: var(--accent);
  text-transform: uppercase;
}

.chat-message p {
  white-space: pre-wrap;
  line-height: 1.55;
}

.chat-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.chat-images a {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.chat-images img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
}

.chat-message.loading {
  width: fit-content;
  min-width: 132px;
}

.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
}

.typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
  animation: typing-pulse 1s ease-in-out infinite;
  opacity: 0.32;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.16s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes typing-pulse {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.32;
  }

  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

.chat-form {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  margin-top: 14px;
}

.chat-form button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  padding: 7px 10px;
}

.path-list {
  display: grid;
  gap: 8px;
  justify-items: end;
  max-width: min(520px, 100%);
}

.path-list .pill {
  max-width: 100%;
  overflow-wrap: anywhere;
  text-align: right;
}

.json-paths {
  display: grid;
  gap: 5px;
  min-width: 260px;
  max-width: 420px;
}

.json-paths span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.row-actions form {
  display: block;
}

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

table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
}

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

@media (max-width: 760px) {
  .top,
  nav,
  .actions,
  .section-head,
  .path-list {
    align-items: flex-start;
    flex-direction: column;
    justify-items: start;
  }

  .path-list .pill {
    text-align: left;
  }

  .hero,
  .grid,
  .plans,
  .chat-form,
  .gateway-checklist {
    grid-template-columns: 1fr;
  }

  .chat-panel {
    min-height: 560px;
    padding: 16px;
  }

  .chat-message {
    max-width: 100%;
  }
}
