/* ------------------------------------------------------------------ */
/* Tokens                                                              */
/* ------------------------------------------------------------------ */

:root {
  color-scheme: dark;
  --bg: #1b1c1a;
  --bg-deep: #161714;
  --panel: #20211e;
  --panel-soft: #242521;
  --panel-raised: #282924;
  --field: #242522;
  --field-hover: #272824;
  --line: #393a34;
  --line-strong: #4a4c44;
  --line-soft: #30312c;
  --ink: #f1eee5;
  --ink-soft: #d8d5cb;
  --muted: #999b92;
  --muted-dim: #73766e;
  --faint: #5c5f57;
  --accent: #2bc9b5;
  --accent-bright: #61e7d7;
  --accent-soft: rgba(43, 201, 181, 0.12);
  --accent-line: rgba(43, 201, 181, 0.32);
  --accent-ink: #092b27;
  --cream: #e9e3cf;
  --danger: #f0917f;
  --danger-soft: rgba(240, 145, 127, 0.1);
  --warning: #e8bf70;
  --radius-sm: 5px;
  --radius: 8px;
  --radius-lg: 13px;
  --shadow-lg: 0 26px 70px rgba(0, 0, 0, 0.34);
  --sans: "Inter", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --page: 1180px;
}

/* ------------------------------------------------------------------ */
/* Base                                                                */
/* ------------------------------------------------------------------ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  min-width: 300px;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open {
  overflow: hidden;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

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

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

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

[hidden] {
  display: none !important;
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  transform: translateY(-180%);
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 15px;
  font-weight: 700;
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.ambient {
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 560px at 17% -4%, rgba(43, 201, 181, 0.085), transparent 66%),
    radial-gradient(760px 520px at 96% 7%, rgba(233, 227, 207, 0.045), transparent 64%),
    linear-gradient(180deg, #1c1d1a 0%, #1b1c1a 55%, #181916 100%);
}

.ambient::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.45;
  background-image: radial-gradient(rgba(255, 255, 255, 0.13) 0.7px, transparent 0.7px);
  background-size: 22px 22px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.42), transparent 65%);
}

/* ------------------------------------------------------------------ */
/* Header                                                              */
/* ------------------------------------------------------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(24, 25, 22, 0.82);
  backdrop-filter: blur(16px) saturate(120%);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100% - 64px, var(--page));
  min-height: 70px;
  margin-inline: auto;
  gap: 28px;
}

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

.brand-mark {
  display: grid;
  grid-template-columns: repeat(2, 10px);
  grid-template-rows: repeat(2, 10px);
  gap: 3px;
  width: 23px;
  height: 23px;
  transition: transform 200ms ease;
}

.brand:hover .brand-mark {
  transform: rotate(6deg);
}

.brand-mark span {
  border: 1px solid var(--muted);
  border-radius: 2px;
  background: transparent;
}

.brand-mark span:nth-child(1) {
  background: var(--accent);
  border-color: var(--accent);
}

.brand-mark span:nth-child(4) {
  border-color: var(--muted-dim);
}

.brand-type {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-name {
  font-size: 14px;
  font-weight: 760;
  line-height: 1.2;
  letter-spacing: 0.095em;
}

.brand-sub {
  color: var(--muted-dim);
  font-family: var(--mono);
  font-size: 7.5px;
  font-weight: 600;
  letter-spacing: 0.17em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 5px;
}

.site-nav a {
  position: relative;
  padding: 9px 14px;
  border-radius: 5px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 550;
  transition: color 160ms ease, background 160ms ease;
}

.site-nav a:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.035);
}

.site-nav a.is-active {
  color: var(--ink);
}

.site-nav a.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateX(-50%);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 29px;
  padding: 0 11px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-dot {
  position: relative;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(43, 201, 181, 0.09);
}

.status-pill.is-offline .status-dot,
.sync-state.is-error .status-dot {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(240, 145, 127, 0.09);
}

.status-pill.is-connecting .status-dot {
  background: var(--warning);
  animation: pulse 1.4s ease-in-out infinite;
}

.status-dot-small {
  display: inline-block;
  width: 5px;
  height: 5px;
  box-shadow: none;
  vertical-align: 1px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  background: none;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: color 150ms ease;
}

.text-link:hover {
  color: var(--accent-bright);
}

.text-link .icon {
  width: 14px;
  height: 14px;
  opacity: 0.75;
}

.header-docs {
  padding: 8px 0;
}

.header-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  color: var(--muted);
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease;
}

.header-icon-link:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink-soft);
}

.header-icon-link.is-active {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
}

.header-icon-link .icon {
  width: 15px;
  height: 15px;
}

/* ------------------------------------------------------------------ */
/* Shared layout                                                       */
/* ------------------------------------------------------------------ */

main {
  width: min(100% - 64px, var(--page));
  margin-inline: auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.72fr);
  align-items: end;
  gap: clamp(32px, 6vw, 88px);
  padding: clamp(52px, 8vw, 92px) 0 54px;
  animation: intro-rise 560ms cubic-bezier(0.2, 0.8, 0.25, 1) both;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 22px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow-rule {
  width: 27px;
  height: 1px;
  background: var(--accent);
}

.eyebrow-version {
  color: var(--faint);
}

.hero h1 {
  max-width: 800px;
  color: var(--ink);
  font-size: clamp(46px, 6.1vw, 78px);
  font-weight: 540;
  line-height: 0.99;
  letter-spacing: -0.062em;
}

.hero h1 span {
  color: var(--cream);
  font-family: var(--serif);
  font-size: 1.055em;
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.055em;
}

.hero-lede {
  max-width: 560px;
  margin-top: 24px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.hero-aside {
  position: relative;
  align-self: end;
  padding: 17px 18px 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(44, 46, 40, 0.68), rgba(31, 32, 29, 0.4));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
}

.hero-aside::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 18px;
  width: 30px;
  height: 1px;
  background: var(--accent);
}

.aside-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted-dim);
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.ready-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
}

.ready-label i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.4s ease-in-out infinite;
}

.aside-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 15px 0;
}

.aside-stats > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.aside-number {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 19px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.05em;
}

.aside-label {
  color: var(--faint);
  font-size: 9.5px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.mini-endpoint {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding-top: 13px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.mini-endpoint code {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-endpoint-dot {
  width: 14px;
  height: 1px;
  margin-left: auto;
  background: var(--line-strong);
}

.method-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 20px;
  padding: 0 6px;
  border: 1px solid var(--accent-line);
  border-radius: 3px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
}

.method-get {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
}

.app-section {
  scroll-margin-top: 95px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 17px;
}

.section-heading-main {
  display: flex;
  align-items: flex-start;
  gap: 15px;
}

.section-number {
  padding-top: 2px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.section-kicker {
  margin-bottom: 2px;
  color: var(--muted-dim);
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section-heading h2 {
  color: var(--ink-soft);
  font-size: 25px;
  font-weight: 550;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.section-heading-tools {
  display: flex;
  align-items: center;
  gap: 13px;
}

.schema-meta,
.preview-meta,
.mono-note {
  color: var(--muted-dim);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.015em;
  white-space: nowrap;
}

/* ------------------------------------------------------------------ */
/* Buttons                                                             */
/* ------------------------------------------------------------------ */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 680;
  letter-spacing: 0.045em;
  line-height: 1;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.button .icon {
  width: 15px;
  height: 15px;
}

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

.button:active {
  transform: translateY(1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

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

.button-primary:hover {
  border-color: var(--accent-bright);
  background: var(--accent-bright);
  color: var(--accent-ink);
}

.button-secondary {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.018);
  color: var(--ink-soft);
}

.button-secondary:hover {
  border-color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
}

.button-quiet {
  border-color: var(--line-soft);
  color: var(--muted);
  font-size: 10px;
}

.button-quiet:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink-soft);
}

.button.icon-leading {
  gap: 7px;
}

.button.icon-only {
  width: 39px;
  min-height: 39px;
  padding: 0;
}

.button.is-busy .icon {
  animation: spin 900ms linear infinite;
}

.reset-button {
  height: 32px;
  min-height: 32px;
  padding-inline: 11px;
  font-size: 9.5px;
}

/* ------------------------------------------------------------------ */
/* Builder                                                             */
/* ------------------------------------------------------------------ */

.builder-section {
  animation: intro-rise 600ms 80ms cubic-bezier(0.2, 0.8, 0.25, 1) both;
}

.builder-panel {
  position: relative;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent 120px),
    var(--panel);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.035),
    0 20px 60px rgba(0, 0, 0, 0.13);
}

.field-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.field-row {
  display: grid;
  grid-template-columns: 23px minmax(150px, 1fr) minmax(190px, 1.13fr) auto 42px 32px;
  align-items: center;
  gap: 9px;
  min-width: 0;
  border-radius: 6px;
  transition: opacity 140ms ease;
}

.field-row.is-dragging {
  opacity: 0.35;
}

.field-row.drop-before::before,
.field-row.drop-after::after {
  content: "";
  position: absolute;
  right: 0;
  left: 0;
  height: 1px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-line);
}

.field-row {
  position: relative;
}

.field-row.drop-before::before {
  top: -6px;
}

.field-row.drop-after::after {
  bottom: -6px;
}

.drag-handle {
  display: grid;
  grid-template-columns: repeat(2, 3px);
  grid-auto-rows: 3px;
  place-content: center;
  gap: 3px;
  width: 23px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  cursor: grab;
  touch-action: none;
}

.drag-handle:hover {
  background: rgba(255, 255, 255, 0.035);
}

.drag-handle:active {
  cursor: grabbing;
}

.drag-handle i {
  display: block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--muted-dim);
  transition: background 150ms ease;
}

.drag-handle:hover i {
  background: var(--muted);
}

.field-key,
.control,
.seed-input {
  width: 100%;
  height: 46px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: 0;
  background: var(--field);
  color: var(--ink-soft);
  transition:
    border-color 150ms ease,
    background 150ms ease,
    box-shadow 150ms ease;
}

.field-key:hover,
.control:hover,
.seed-input:hover {
  border-color: #484a42;
  background: var(--field-hover);
}

.field-key:focus,
.control:focus,
.seed-input:focus,
.prompt-input:focus,
.modal-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(43, 201, 181, 0.1);
}

.field-key {
  padding: 0 14px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 450;
  letter-spacing: -0.015em;
}

.field-key.is-duplicate {
  border-color: var(--danger);
  color: #f3c0b8;
}

.field-key::placeholder {
  color: var(--faint);
}

.select-shell {
  position: relative;
  display: inline-flex;
  min-width: 0;
  width: 100%;
}

.select-control {
  appearance: none;
  padding: 0 38px 0 14px;
  font-weight: 620;
  cursor: pointer;
}

.field-type {
  font-size: 14px;
  letter-spacing: -0.012em;
}

.select-chevron {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 15px;
  height: 15px;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.select-shell.is-disabled {
  opacity: 0.42;
  pointer-events: none;
}

.blank-group {
  display: flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
}

.blank-label {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
}

.blank-shell {
  position: relative;
  width: 77px;
  flex: 0 0 auto;
}

.blank-input {
  width: 100%;
  height: 46px;
  padding: 0 25px 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: 0;
  background: var(--field);
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 12px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
  appearance: textfield;
  -moz-appearance: textfield;
}

.blank-input::-webkit-outer-spin-button,
.blank-input::-webkit-inner-spin-button,
.rows-control::-webkit-outer-spin-button,
.rows-control::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.blank-input:hover {
  border-color: #484a42;
}

.blank-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(43, 201, 181, 0.1);
}

.blank-input.is-invalid,
.rows-control.is-invalid {
  border-color: var(--danger);
}

.blank-suffix {
  position: absolute;
  top: 50%;
  right: 10px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
  pointer-events: none;
  transform: translateY(-50%);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 46px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition:
    color 150ms ease,
    border-color 150ms ease,
    background 150ms ease;
}

.field-stats {
  border-color: var(--line);
  background: var(--field);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1;
}

.field-stats:hover {
  border-color: var(--line-strong);
  background: var(--field-hover);
  color: var(--accent);
}

.field-delete {
  width: 32px;
  font-size: 24px;
  font-weight: 300;
  line-height: 1;
}

.field-delete:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.field-delete .icon {
  width: 17px;
  height: 17px;
}

.field-skeleton {
  position: relative;
  height: 46px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.018);
}

.field-skeleton::after,
.skeleton-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.04), transparent);
  animation: shimmer 1.35s infinite;
}

.field-row.is-new {
  animation: row-arrive 300ms cubic-bezier(0.2, 0.8, 0.25, 1) both;
}

.builder-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.tool-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 47px;
  padding: 0 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.075em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    color 150ms ease;
}

.tool-button .icon {
  width: 16px;
  height: 16px;
}

.tool-button:hover {
  border-color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
}

.tool-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.tool-button:disabled:hover {
  border-color: var(--line);
  background: transparent;
  color: var(--ink-soft);
}

.tool-button-muted {
  border-color: var(--line-soft);
  color: var(--muted);
}

.tool-button-muted .icon {
  color: var(--accent);
}

.tool-button-muted:hover {
  color: var(--ink-soft);
}

.tool-button-link {
  text-decoration: none;
}

.tool-button-link .icon {
  color: var(--accent);
}

.tool-button-ai {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
}

.tool-button-ai:hover {
  border-color: var(--accent);
  background: rgba(43, 201, 181, 0.16);
  color: var(--accent-bright);
}

.tool-button-ai:disabled {
  opacity: 0.5;
}

.tool-button-ai:disabled:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
}

.drag-hint {
  margin-left: auto;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.03em;
}

.drag-hint span {
  color: var(--muted-dim);
  font-size: 12px;
}

.panel-divider {
  height: 1px;
  margin: 21px 0;
  background: var(--line-soft);
}

.settings-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 17px 25px;
}

.setting {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.setting-label {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
}

.setting-rows .rows-control {
  width: 114px;
  height: 46px;
  padding: 0 12px;
  font-family: var(--mono);
  font-size: 12px;
  text-align: left;
}

.setting-format .compact-select {
  width: 102px;
}

.setting-ending .ending-select {
  width: 196px;
}

.setting-ending .select-control {
  font-size: 12px;
  font-weight: 550;
}

.setting-format .select-control {
  font-weight: 620;
}

.setting-include {
  margin-left: auto;
}

.check-group {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 46px;
  padding: 0 2px;
}

.check-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.check-label:hover {
  color: var(--ink-soft);
}

.checkbox {
  position: absolute;
  width: 17px;
  height: 17px;
  opacity: 0;
  pointer-events: none;
}

.checkbox-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: var(--field);
  transition: background 150ms ease, border-color 150ms ease;
}

.checkbox-mark::after {
  content: "";
  width: 8px;
  height: 4px;
  border-bottom: 1.8px solid var(--accent-ink);
  border-left: 1.8px solid var(--accent-ink);
  opacity: 0;
  transform: translateY(-1px) rotate(-45deg) scale(0.65);
  transition: opacity 120ms ease, transform 120ms ease;
}

.checkbox:checked + .checkbox-mark {
  border-color: var(--accent);
  background: var(--accent);
}

.checkbox:checked + .checkbox-mark::after {
  opacity: 1;
  transform: translateY(-1px) rotate(-45deg) scale(1);
}

.checkbox:focus-visible + .checkbox-mark {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.checkbox:disabled + .checkbox-mark {
  opacity: 0.38;
}

.setting-include.is-disabled {
  opacity: 0.42;
  pointer-events: none;
}

.run-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-top: 22px;
  margin-top: 21px;
  border-top: 1px solid var(--line-soft);
}

.seed-block {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.seed-label {
  color: var(--muted);
  font-size: 12.5px;
}

.seed-control {
  display: flex;
  align-items: center;
}

.seed-input {
  width: 129px;
  height: 35px;
  padding: 0 10px;
  border-radius: 5px 0 0 5px;
  border-right: 0;
  font-family: var(--mono);
  font-size: 10px;
}

.seed-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 35px;
  height: 35px;
  border: 1px solid var(--line);
  border-radius: 0 5px 5px 0;
  background: var(--field);
  color: var(--muted);
  cursor: pointer;
  transition: color 150ms ease, background 150ms ease;
}

.seed-button:hover {
  background: var(--field-hover);
  color: var(--accent);
}

.seed-button .icon {
  width: 15px;
  height: 15px;
}

.seed-hint {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.run-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.run-actions .button {
  min-height: 46px;
  padding-inline: 18px;
  font-size: 10.5px;
}

.run-actions .button-primary {
  min-width: 145px;
}

.inline-error {
  margin-top: 15px;
  padding: 11px 13px;
  border: 1px solid rgba(240, 145, 127, 0.3);
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: #f0b5aa;
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.6;
}

/* ------------------------------------------------------------------ */
/* Preview                                                             */
/* ------------------------------------------------------------------ */

.preview-section {
  margin-top: 76px;
  animation: intro-rise 600ms 150ms cubic-bezier(0.2, 0.8, 0.25, 1) both;
}

.preview-heading-tools {
  gap: 10px;
}

.sync-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-right: 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.025em;
  white-space: nowrap;
}

.sync-state.is-loading .status-dot {
  background: var(--warning);
  animation: pulse 1.1s ease-in-out infinite;
}

.sync-state.is-error {
  color: #e0a89f;
}

.preview-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
}

.preview-panel::before {
  content: "";
  position: absolute;
  z-index: 3;
  top: 0;
  left: -30%;
  width: 30%;
  height: 1px;
  opacity: 0;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  transition: opacity 150ms ease;
}

.preview-panel.is-loading::before {
  opacity: 1;
  animation: loading-sweep 1.1s ease-in-out infinite;
}

.preview-topbar {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 18px;
  min-height: 49px;
  padding: 0 17px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.012);
}

.view-tabs {
  display: flex;
  align-items: stretch;
  gap: 21px;
}

.view-tab {
  position: relative;
  padding: 1px 0 0;
  border: 0;
  background: transparent;
  color: var(--muted-dim);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 150ms ease;
}

.view-tab:hover {
  color: var(--ink-soft);
}

.view-tab.is-active {
  color: var(--ink);
}

.view-tab.is-active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 1px;
  background: var(--accent);
}

.view-tab span {
  margin-left: 3px;
  color: var(--faint);
  font-size: 8px;
}

.view-tab.is-active span {
  color: var(--accent);
}

.preview-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  min-width: 0;
  font-size: 9px;
  color: var(--muted-dim);
}

.preview-meta .truncate {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meta-separator {
  color: var(--faint);
}

.preview-stage {
  position: relative;
  min-height: 160px;
}

.preview-panel.is-loading .preview-stage {
  opacity: 0.55;
  transition: opacity 150ms ease;
}

.table-scroll {
  max-height: 425px;
  overflow: auto;
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-width: thin;
}

.table-scroll::-webkit-scrollbar,
.raw-output::-webkit-scrollbar,
.modal-body::-webkit-scrollbar,
.code-output::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

.table-scroll::-webkit-scrollbar-thumb,
.raw-output::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb,
.code-output::-webkit-scrollbar-thumb {
  border: 3px solid var(--panel);
  border-radius: 999px;
  background: var(--line-strong);
}

.preview-table {
  width: 100%;
  border-spacing: 0;
  border-collapse: separate;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.4;
}

.preview-table th {
  position: sticky;
  z-index: 2;
  top: 0;
  padding: 11px 17px;
  border-bottom: 1px solid var(--line-soft);
  background: #252622;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: left;
  white-space: nowrap;
}

.preview-table td {
  max-width: 310px;
  padding: 11px 17px;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  color: var(--ink-soft);
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.preview-table tbody tr {
  transition: background 100ms ease;
}

.preview-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

.preview-table td.is-number {
  color: #c9d3ce;
  font-variant-numeric: tabular-nums;
}

.preview-table td.is-boolean {
  color: var(--accent);
}

.preview-table td.is-empty {
  color: var(--faint);
}

.preview-table td.is-empty::before {
  content: "—";
}

.skeleton-line {
  position: relative;
  display: block;
  width: 68px;
  height: 7px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--line-soft);
}

.skeleton-line.short {
  width: 34px;
}

.preview-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 250px;
  padding: 34px;
  text-align: center;
}

.empty-glyph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-bottom: 13px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted-dim);
  font-family: var(--mono);
  font-size: 18px;
}

.preview-empty h3 {
  margin-bottom: 4px;
  color: var(--ink-soft);
  font-size: 16px;
  font-weight: 600;
}

.preview-empty p {
  margin-bottom: 17px;
  color: var(--muted);
  font-size: 12px;
}

.raw-pane {
  max-height: 425px;
  overflow: auto;
  background: #1b1c19;
}

.raw-output {
  min-height: 240px;
  margin: 0;
  padding: 18px 21px;
  overflow: auto;
  color: #c9cdc3;
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.75;
  tab-size: 2;
}

.raw-output code {
  font: inherit;
}

.preview-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 46px;
  padding: 0 17px;
  border-top: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.012);
}

.preview-foot-copy {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 8.5px;
}

.preview-foot-link {
  font-size: 9.5px;
  letter-spacing: 0.015em;
  text-transform: uppercase;
}

.preview-foot-link .icon {
  width: 13px;
  height: 13px;
}

/* ------------------------------------------------------------------ */
/* API section                                                         */
/* ------------------------------------------------------------------ */

.api-section {
  margin-top: 94px;
  animation: intro-rise 600ms 210ms cubic-bezier(0.2, 0.8, 0.25, 1) both;
}

.api-heading-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 15px;
}

.api-raw-link {
  color: var(--muted-dim);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.api-raw-link:hover {
  color: var(--accent);
}

.api-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(34px, 6vw, 72px);
  padding-top: 15px;
}

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

.api-lede {
  max-width: 480px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.endpoint-list {
  margin-top: 24px;
  border-top: 1px solid var(--line-soft);
}

.endpoint-row {
  display: grid;
  grid-template-columns: 45px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-height: 46px;
  border-bottom: 1px solid var(--line-soft);
}

.endpoint-path {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: -0.02em;
}

.endpoint-desc {
  color: var(--faint);
  font-size: 10.5px;
  text-align: right;
  white-space: nowrap;
}

.api-base {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 19px;
  padding: 9px 11px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  color: var(--faint);
  font-size: 9.5px;
  letter-spacing: 0.02em;
}

.api-base > span {
  flex: 0 0 auto;
  font-family: var(--sans);
}

.api-base code {
  flex: 1 1 auto;
  overflow: hidden;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--muted-dim);
  cursor: pointer;
  transition: color 150ms ease, background 150ms ease, border-color 150ms ease;
}

.copy-icon-button:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink-soft);
}

.copy-icon-button .icon {
  width: 14px;
  height: 14px;
}

.api-notes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 18px;
}

.api-note {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--faint);
  font-size: 10.5px;
}

.api-note .icon {
  width: 14px;
  height: 14px;
  color: var(--muted-dim);
}

.code-card {
  align-self: start;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #171815;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.18),
    inset 0 1px rgba(255, 255, 255, 0.03);
}

.code-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 45px;
  padding: 0 11px 0 15px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.018);
}

.code-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  align-self: stretch;
}

.code-tab {
  position: relative;
  padding: 0 9px;
  border: 0;
  background: transparent;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.025em;
  cursor: pointer;
  transition: color 150ms ease;
}

.code-tab:hover {
  color: var(--muted);
}

.code-tab.is-active {
  color: var(--ink-soft);
}

.code-tab.is-active::after {
  content: "";
  position: absolute;
  right: 8px;
  bottom: -1px;
  left: 8px;
  height: 1px;
  background: var(--accent);
}

.code-copy {
  width: 29px;
  height: 29px;
}

.code-output {
  min-height: 296px;
  max-height: 390px;
  margin: 0;
  padding: 20px 20px 22px;
  overflow: auto;
  color: #c5cbc0;
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.8;
  tab-size: 2;
}

.code-output code {
  font: inherit;
  white-space: pre;
}

.code-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 41px;
  padding: 0 16px;
  border-top: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.014);
  color: var(--faint);
  font-family: var(--mono);
  font-size: 8.5px;
}

.code-card-foot > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.code-card-foot strong {
  color: var(--muted);
  font-weight: 500;
}

.code-card-foot .text-link {
  color: var(--muted-dim);
  font-family: var(--sans);
  font-size: 9.5px;
}

.code-card-foot .text-link:hover {
  color: var(--accent);
}

/* ------------------------------------------------------------------ */
/* Footer                                                              */
/* ------------------------------------------------------------------ */

.site-footer {
  margin-top: 96px;
  border-top: 1px solid var(--line-soft);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(100% - 64px, var(--page));
  min-height: 94px;
  margin-inline: auto;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.brand-mark-small {
  grid-template-columns: repeat(2, 7px);
  grid-template-rows: repeat(2, 7px);
  gap: 2px;
  width: 16px;
  height: 16px;
}

.brand-mark-small span {
  border-radius: 1px;
}

.footer-muted {
  color: var(--faint);
  font-weight: 400;
  letter-spacing: 0.03em;
}

.footer-note {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 8.5px;
}

.footer-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 17px;
}

.footer-links a {
  color: var(--muted-dim);
  font-size: 10.5px;
  transition: color 150ms ease;
}

.footer-links a:hover {
  color: var(--ink-soft);
}

/* ------------------------------------------------------------------ */
/* Modals                                                              */
/* ------------------------------------------------------------------ */

.modal {
  width: min(100% - 32px, 650px);
  max-width: none;
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: transparent;
  color: var(--ink);
  overflow: visible;
}

.modal::backdrop {
  background: rgba(8, 9, 7, 0.72);
  backdrop-filter: blur(5px);
}

.modal[open] {
  animation: modal-in 190ms cubic-bezier(0.2, 0.8, 0.25, 1) both;
}

.modal-shell {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 32px);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-lg);
}

.add-field-modal {
  width: 100%;
}

.suggest-modal {
  width: 100%;
}

.inspect-modal {
  width: min(100%, 560px);
  margin-inline: auto;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  padding: 22px 22px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.modal-kicker {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.modal-head h2 {
  color: var(--ink);
  font-size: 24px;
  font-weight: 550;
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.modal-description {
  max-width: 440px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease;
}

.modal-close:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink);
}

.modal-close .icon {
  width: 15px;
  height: 15px;
}

.modal-search {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 15px 22px 0;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--field);
}

.modal-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(43, 201, 181, 0.1);
}

.modal-search .icon {
  width: 15px;
  height: 15px;
  color: var(--muted-dim);
}

.modal-search input {
  width: 100%;
  height: 42px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 12px;
}

.modal-search input::placeholder {
  color: var(--faint);
}

.search-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9px;
}

.modal-body {
  padding: 18px 22px 22px;
  overflow-y: auto;
}

.catalog-body {
  max-height: min(53vh, 470px);
  padding-top: 20px;
}

.catalog-group + .catalog-group {
  margin-top: 22px;
}

.catalog-group-title {
  margin-bottom: 8px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

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

.type-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.012);
  color: var(--ink-soft);
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}

.type-option:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.type-option-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.type-option:hover .type-option-mark {
  border-color: var(--accent-line);
  color: var(--accent);
}

.type-option-text {
  min-width: 0;
}

.type-option-label {
  display: block;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.type-option-desc {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--faint);
  font-size: 9.5px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-empty {
  padding: 34px 10px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 61px;
  padding: 11px 22px;
  border-top: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.012);
  color: var(--faint);
  font-size: 9.5px;
}

.modal-foot .button {
  min-height: 35px;
  padding-inline: 12px;
  font-size: 9.5px;
}

/* Suggest modal */

.local-badge {
  display: inline-flex;
  align-items: center;
  height: 16px;
  padding: 0 5px;
  margin-left: 3px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.08em;
}

.mini-sparkle {
  color: var(--accent);
  font-size: 11px;
}

.suggest-modal .modal-body {
  padding-top: 18px;
}

.prompt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 17px;
}

.prompt-chip {
  padding: 6px 9px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8.5px;
  cursor: pointer;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}

.prompt-chip:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--ink-soft);
}

.prompt-label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 550;
}

.prompt-input {
  display: block;
  width: 100%;
  min-height: 85px;
  padding: 12px 13px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: 0;
  background: var(--field);
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.6;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.prompt-input::placeholder {
  color: var(--faint);
}

.prompt-meta {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 6px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 8px;
}

.prompt-error {
  margin-top: 8px;
  color: #e0a89f;
  font-family: var(--mono);
  font-size: 9px;
}

.suggest-results {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}

.suggest-results-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.result-kicker {
  color: var(--muted-dim);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.suggest-results-head p {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 12px;
}

.suggest-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line-soft);
}

.suggest-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 37px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
}

.suggest-item:hover {
  background: rgba(255, 255, 255, 0.02);
}

.suggest-item .checkbox-mark {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.suggest-item .checkbox-mark::after {
  width: 7px;
  height: 3.5px;
}

.suggest-key {
  width: 120px;
  flex: 0 0 auto;
  overflow: hidden;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggest-type {
  color: var(--faint);
  font-size: 10px;
}

.suggest-blank {
  margin-left: auto;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 8px;
}

.suggest-foot {
  align-items: center;
}

.replace-check {
  font-family: var(--sans);
  font-size: 10px;
}

.modal-foot-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* AI generator modal */

.ai-modal .modal-body {
  padding-top: 19px;
}

.ai-callout {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 17px;
  border: 1px solid var(--accent-line);
  border-radius: 7px;
  background: var(--accent-soft);
}

.ai-callout-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 33px;
  height: 33px;
  flex: 0 0 auto;
  border: 1px solid var(--accent-line);
  border-radius: 5px;
  color: var(--accent);
}

.ai-callout-mark .icon {
  width: 16px;
  height: 16px;
}

.ai-callout h3 {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 600;
}

.ai-callout p {
  max-width: 460px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.ai-callout .button {
  margin-top: 12px;
  min-height: 34px;
  font-size: 9px;
}

.ai-checking {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
}

.ai-checking-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--warning);
  animation: pulse 1.1s ease-in-out infinite;
}

.ai-provider-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 34px;
  padding: 6px 9px;
  margin-bottom: 15px;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.016);
  color: var(--faint);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.02em;
}

.ai-provider-strip strong {
  color: var(--muted);
  font-weight: 500;
}

.ai-provider-strip code {
  overflow: hidden;
  max-width: 210px;
  color: var(--muted);
  font-family: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-provider-divider {
  width: 1px;
  height: 10px;
  margin: 0 2px;
  background: var(--line);
}

.ai-change-link {
  margin-left: auto;
  font-family: var(--sans);
  font-size: 9px;
}

.ai-prompt-input {
  min-height: 104px;
}

.ai-results {
  margin-top: 17px;
}

.ai-result-description {
  margin: 3px 0 10px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.55;
}

.ai-field-list {
  border-top: 1px solid var(--line-soft);
}

.ai-field-item {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 6px 3px;
  border-bottom: 1px solid var(--line-soft);
}

.ai-field-index {
  width: 22px;
  flex: 0 0 auto;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 7.5px;
}

.ai-field-key {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-type-chip {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 20px;
  padding: 0 6px;
  border: 1px solid var(--accent-line);
  border-radius: 3px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 7.5px;
  white-space: nowrap;
}

.ai-field-blank {
  flex: 0 0 auto;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 7.5px;
  white-space: nowrap;
}

.ai-results .local-badge {
  max-width: 190px;
  overflow: hidden;
  color: var(--muted-dim);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-modal .suggest-foot {
  align-items: center;
}

.ai-modal .modal-foot-actions .button.is-busy {
  opacity: 0.68;
  cursor: wait;
}

/* Inspector */

.inspect-description {
  margin-bottom: 17px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
}

.inspect-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.inspect-stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 70px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.016);
}

.inspect-stat-label {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.02em;
}

.inspect-stat strong {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 500;
}

.sample-block {
  margin-top: 19px;
}

.sample-heading {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
}

.sample-heading span {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 400;
}

.sample-list {
  display: flex;
  flex-direction: column;
  max-height: 190px;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--field);
}

.sample-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: 10px;
}

.sample-row:last-child {
  border-bottom: 0;
}

.sample-index {
  width: 23px;
  flex: 0 0 auto;
  color: var(--faint);
  font-size: 8px;
}

.sample-value {
  overflow: hidden;
  color: var(--ink-soft);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sample-value.is-empty {
  color: var(--faint);
  font-style: italic;
}

.sample-empty {
  padding: 18px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  text-align: center;
}

.mono-note {
  font-size: 8.5px;
}

/* ------------------------------------------------------------------ */
/* Toasts                                                              */
/* ------------------------------------------------------------------ */

.toast-region {
  position: fixed;
  z-index: 200;
  right: 22px;
  bottom: 22px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  width: min(360px, calc(100vw - 44px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  max-width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #292a25;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.45;
  animation: toast-in 220ms cubic-bezier(0.2, 0.8, 0.25, 1) both;
  pointer-events: auto;
}

.toast.is-leaving {
  animation: toast-out 160ms ease both;
}

.toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}

.toast-icon .icon {
  width: 11px;
  height: 11px;
}

.toast-error {
  border-color: rgba(240, 145, 127, 0.35);
}

.toast-error .toast-icon {
  background: var(--danger-soft);
  color: var(--danger);
}

/* ------------------------------------------------------------------ */
/* Motion                                                              */
/* ------------------------------------------------------------------ */

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.45;
    transform: scale(0.8);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shimmer {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

@keyframes intro-rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes row-arrive {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(5px);
  }
}

@keyframes loading-sweep {
  0% {
    left: -30%;
  }
  60%,
  100% {
    left: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 1040px) {
  .hero {
    grid-template-columns: minmax(0, 1.5fr) minmax(250px, 0.72fr);
    gap: 38px;
  }

  .hero h1 {
    font-size: clamp(43px, 6.4vw, 68px);
  }

  .field-row {
    grid-template-columns: 22px minmax(140px, 1fr) minmax(175px, 1.08fr) auto 42px 32px;
    gap: 8px;
  }

  .blank-label {
    font-size: 11.5px;
  }

  .blank-shell {
    width: 72px;
  }

  .setting-include {
    margin-left: 0;
  }

  .settings-bar {
    gap: 14px 21px;
  }

  .api-layout {
    gap: 35px;
  }
}

@media (max-width: 860px) {
  .header-inner,
  main,
  .footer-inner {
    width: min(100% - 40px, var(--page));
  }

  .header-docs {
    display: none;
  }

  .header-nav {
    gap: 0;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: 55px;
    padding-bottom: 43px;
  }

  .hero-aside {
    max-width: 440px;
  }

  .hero h1 {
    font-size: clamp(44px, 8vw, 66px);
  }

  .hero-lede {
    max-width: 540px;
  }

  .section-heading {
    align-items: flex-start;
  }

  .section-heading-tools {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .field-row {
    grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1.1fr) 42px 32px;
    grid-template-areas:
      "handle key type stats delete"
      "handle blank blank blank blank";
    row-gap: 8px;
    padding-bottom: 1px;
  }

  .drag-handle {
    grid-area: handle;
    height: 46px;
  }

  .field-key {
    grid-area: key;
  }

  .field-row > .select-shell {
    grid-area: type;
  }

  .blank-group {
    grid-area: blank;
  }

  .field-stats {
    grid-area: stats;
  }

  .field-delete {
    grid-area: delete;
  }

  .field-skeleton {
    height: 100px;
  }

  .drag-hint {
    display: none;
  }

  .api-layout {
    grid-template-columns: 1fr;
    gap: 29px;
  }

  .api-lede {
    max-width: 600px;
  }

  .code-card {
    max-width: 680px;
  }

  .footer-note {
    display: none;
  }
}

@media (max-width: 700px) {
  .header-inner {
    min-height: 62px;
    gap: 14px;
  }

  .site-nav,
  .header-docs {
    display: none;
  }

  .header-actions {
    gap: 10px;
  }

  .brand-name {
    font-size: 13px;
  }

  .hero {
    padding-top: 44px;
    padding-bottom: 37px;
  }

  .eyebrow {
    margin-bottom: 17px;
    font-size: 8.5px;
  }

  .hero h1 {
    font-size: clamp(41px, 11vw, 60px);
    letter-spacing: -0.065em;
  }

  .hero h1 span {
    font-size: 1.04em;
  }

  .hero-lede {
    margin-top: 19px;
    font-size: 13.5px;
  }

  .hero-aside {
    padding: 14px;
  }

  .aside-number {
    font-size: 17px;
  }

  .aside-label {
    font-size: 8.5px;
  }

  .section-heading {
    gap: 14px;
  }

  .section-heading h2 {
    font-size: 22px;
  }

  .section-heading-tools {
    gap: 7px;
  }

  .schema-meta {
    display: none;
  }

  .builder-panel {
    padding: 12px;
    border-radius: 10px;
  }

  .field-row {
    grid-template-columns: 20px minmax(0, 1fr) minmax(0, 1fr) 42px;
    grid-template-areas:
      "handle key key delete"
      "handle type type stats"
      "handle blank blank blank";
    gap: 7px;
    padding: 7px;
    border: 1px solid var(--line-soft);
    background: rgba(255, 255, 255, 0.012);
  }

  .drag-handle {
    height: 46px;
  }

  .field-key,
  .control,
  .blank-input,
  .icon-button {
    height: 43px;
  }

  .field-stats {
    width: 42px;
    height: 43px;
  }

  .field-delete {
    width: 30px;
    height: 43px;
    justify-self: end;
  }

  .blank-group {
    padding-top: 1px;
  }

  .blank-shell {
    width: 76px;
  }

  .builder-tools {
    margin-top: 13px;
    gap: 7px;
  }

  .tool-button {
    height: 43px;
    padding: 0 12px;
    font-size: 9px;
  }

  .tool-button .icon {
    width: 14px;
    height: 14px;
  }

  .panel-divider {
    margin: 18px 0;
  }

  .settings-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 16px 12px;
  }

  .setting {
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
    align-items: start;
  }

  .setting-rows .rows-control,
  .setting-format .compact-select,
  .setting-ending .ending-select {
    width: 100%;
  }

  .setting-include {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .check-group {
    height: 38px;
    padding: 0;
  }

  .run-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 17px;
    padding-top: 17px;
    margin-top: 18px;
  }

  .seed-block {
    gap: 7px;
  }

  .seed-hint {
    margin-left: auto;
  }

  .run-actions {
    width: 100%;
  }

  .run-actions .button {
    flex: 1 1 auto;
    min-height: 45px;
  }

  .run-actions .button-primary {
    min-width: 0;
  }

  .preview-section,
  .api-section {
    margin-top: 60px;
  }

  .preview-heading-tools .button-quiet {
    display: none;
  }

  .preview-heading-tools .button.icon-only {
    display: inline-flex;
    min-height: 35px;
    height: 35px;
  }

  .sync-state {
    margin-right: 0;
  }

  .preview-topbar {
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 0;
    padding: 0 13px;
  }

  .view-tabs {
    min-height: 45px;
    gap: 19px;
  }

  .preview-meta {
    justify-content: flex-start;
    padding: 0 0 10px;
    font-size: 8px;
  }

  .preview-meta .truncate {
    max-width: 160px;
  }

  .preview-table th,
  .preview-table td {
    padding: 9px 13px;
  }

  .preview-foot {
    min-height: 48px;
    padding: 0 13px;
  }

  .preview-foot-copy {
    max-width: 175px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .preview-foot-link {
    font-size: 8.5px;
  }

  .api-layout {
    padding-top: 5px;
  }

  .endpoint-row {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 4px 10px;
    padding: 8px 0;
  }

  .endpoint-desc {
    grid-column: 2;
    font-size: 9px;
    text-align: left;
  }

  .code-card-head {
    padding: 0 8px 0 9px;
  }

  .code-tab {
    padding: 0 7px;
    font-size: 8.5px;
  }

  .code-output {
    min-height: 260px;
    padding: 16px;
    font-size: 9.5px;
  }

  .code-card-foot {
    padding: 0 12px;
    font-size: 7.5px;
  }

  .code-card-foot .text-link {
    font-size: 8.5px;
  }

  .site-footer {
    margin-top: 66px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 11px;
    min-height: 104px;
  }

  .footer-links {
    gap: 14px;
  }

  .modal-head {
    padding: 18px 17px 15px;
  }

  .modal-body {
    padding: 16px 17px 18px;
  }

  .modal-search {
    margin: 13px 17px 0;
  }

  .modal-foot {
    padding: 10px 17px;
    flex-wrap: wrap;
    gap: 9px;
  }

  .modal-foot > span {
    display: none;
  }

  .catalog-grid {
    grid-template-columns: 1fr;
  }

  .catalog-body {
    max-height: 54vh;
  }

  .modal-head h2 {
    font-size: 21px;
  }

  .suggest-foot {
    align-items: flex-start;
  }

  .suggest-foot .modal-foot-actions {
    width: 100%;
  }

  .suggest-foot .modal-foot-actions .button {
    flex: 1 1 auto;
  }

  .ai-modal .modal-foot-actions {
    flex-wrap: wrap;
  }

  .ai-modal .modal-foot-actions .button-quiet {
    flex: 0 0 auto;
  }

  .ai-modal #aiApplyButton {
    flex: 1 1 100%;
  }

  .ai-provider-strip code {
    max-width: 155px;
  }

  .ai-field-blank {
    display: none;
  }

  .ai-modal .modal-description {
    font-size: 11.5px;
  }

  .inspect-stats {
    gap: 6px;
  }

  .inspect-stat {
    padding: 10px;
  }

  .inspect-stat strong {
    font-size: 14px;
  }

  .inspect-stat-label {
    font-size: 7px;
  }

  .suggest-key {
    width: 100px;
  }

  .toast-region {
    right: 14px;
    bottom: 14px;
    width: min(360px, calc(100vw - 28px));
  }
}

@media (max-width: 420px) {
  .header-inner,
  main,
  .footer-inner {
    width: min(100% - 28px, var(--page));
  }

  .status-pill {
    height: 27px;
    padding: 0 8px;
    font-size: 8px;
  }

  .brand {
    gap: 9px;
  }

  .brand-sub {
    font-size: 6.5px;
  }

  .hero h1 {
    font-size: 39px;
  }

  .hero-lede {
    font-size: 13px;
  }

  .section-heading {
    flex-wrap: wrap;
  }

  .section-heading-tools {
    width: auto;
  }

  .builder-tools {
    flex-direction: column;
    align-items: stretch;
  }

  .tool-button {
    width: 100%;
    justify-content: flex-start;
  }

  .tool-button span,
  .tool-button-muted span {
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  .preview-heading-tools {
    display: none;
  }

  .preview-foot-copy {
    display: none;
  }

  .preview-foot {
    justify-content: flex-end;
  }

  .suggest-key {
    width: 86px;
  }

  .suggest-blank {
    display: none;
  }

  .modal-foot-actions {
    gap: 6px;
  }
}
