/* Integrations: two platform cards over the shared live scene. Each card carries
   its own --accent, the way the agent cards do. */
.integrations-main {
  padding-top: 30px;
}
.integrations-hero {
  min-height: auto;
}
.integrations-hero h1 {
  font-size: clamp(38px, 3.55vw, 60px);
  line-height: 1.06;
  letter-spacing: -1.7px;
  margin-top: 17px;
}
.integrations-hero .intro {
  max-width: 520px;
  font-size: 16px;
  margin-top: 18px;
  line-height: 1.5;
}
.value-strip {
  display: flex;
  align-items: center;
  gap: 26px;
  list-style: none;
  margin: 24px 0 24px;
  padding: 0;
  flex-wrap: wrap;
}
.value-strip li {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 12px;
  align-items: center;
}
.value-strip li + li {
  border-left: 1px solid #ffffff1f;
  padding-left: 26px;
}
.value-icon {
  grid-row: span 2;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid #ff8a1e4d;
  border-radius: 12px;
  background: #ff8a1e12;
  color: #ff9c3d;
}
.value-icon .icon {
  width: 21px;
}
.value-strip b {
  font-size: 13px;
  font-weight: 600;
  align-self: end;
}
.value-strip small {
  font-size: 12px;
  color: #a9bbc8;
  align-self: start;
}
.platform-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 8px;
}
.platform-card {
  --accent: #ff7300;
  position: relative;
  min-width: 0;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, #24353f);
  border-radius: 18px;
  padding: 22px 22px 20px;
  background:
    radial-gradient(
      ellipse at 4% 0%,
      color-mix(in srgb, var(--accent) var(--glow, 12%), transparent),
      transparent 52%
    ),
    linear-gradient(140deg, #0a1115f5, #040a0ded);
  box-shadow: 0 16px 45px #0005;
  animation:
    card-rise 0.5s ease-out backwards,
    card-glow 7s ease-in-out infinite alternate;
  transition:
    transform 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}
.platform-card.violet {
  --accent: #8b5cf6;
  animation-delay:
    0.1s,
    -3.5s;
}
.platform-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 70%, #24353f);
  box-shadow:
    0 22px 55px #0007,
    0 0 30px color-mix(in srgb, var(--accent) 16%, transparent);
}
/* The same sweep the agent cards use, so the two pages read as one system. */
.platform-card:after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    transparent 49.85%,
    color-mix(in srgb, var(--accent) 70%, transparent) 50%,
    transparent 50.15%
  );
  background-size: 100% 300%;
  animation: scan 6s linear infinite;
}
.platform-card.violet:after {
  animation-delay: -3s;
}
.platform-card:hover:after {
  animation-duration: 1.4s;
}
@keyframes scan {
  from {
    background-position: 0 85%;
  }
  to {
    background-position: 0 15%;
  }
}
@keyframes card-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes card-glow {
  from {
    --glow: 5%;
  }
  to {
    --glow: 18%;
  }
}
.platform-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}
.platform-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}
.platform-mark img {
  width: 38px;
  height: 34px;
  object-fit: contain;
}
.platform-name h2 {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.4px;
  margin: 0;
}
.platform-name p {
  margin: 3px 0 0;
  font-size: 12px;
  color: #a3b3bf;
}
.link-state {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #31d38b !important;
}
.link-state .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #31d38b;
  box-shadow: 0 0 10px #31d38b88;
  animation: link-pulse 1.8s ease-in-out infinite alternate;
}
@keyframes link-pulse {
  from {
    opacity: 0.45;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1.15);
  }
}
.pill {
  display: flex;
  align-items: center;
  gap: 8px;
  align-self: start;
  border: 1px solid #2f4a3e;
  border-radius: 30px;
  padding: 7px 14px;
  font-size: 12px;
  background: #0b1a14;
  color: #d6f4e6;
}
.pill:before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #31d38b;
  box-shadow: 0 0 10px #31d38b66;
}
.field-list {
  border-top: 1px solid #ffffff17;
}
.field {
  display: grid;
  grid-template-columns: 22px 118px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid #ffffff12;
  transition: background 0.2s ease;
}
.field:hover {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--accent) 9%, transparent),
    transparent
  );
}
.field > .icon {
  width: 17px;
  color: #93a6b3;
}
.field-label {
  font-size: 11px;
  color: #93a6b3;
  letter-spacing: 0.3px;
}
.field-value {
  font-size: 12px;
  color: #dde7ee;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.copy {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: #7f93a1;
  font-size: 13px;
  transition:
    color 0.2s ease,
    background 0.2s ease;
}
.copy:hover:not(:disabled) {
  color: var(--accent);
  background: #ffffff0d;
}
.platform-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.platform-actions button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--r-md);
  font-size: 13px;
  flex: 1 1 auto;
  transition:
    filter 0.18s ease,
    transform 0.18s ease,
    border-color 0.18s ease;
}
.platform-actions .icon {
  width: 17px;
}
.configure {
  border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent);
  background: linear-gradient(
    130deg,
    color-mix(in srgb, var(--accent) 92%, white),
    color-mix(in srgb, var(--accent) 85%, black)
  );
  color: #0d0d0d;
  font-weight: 600;
}
.violet .configure {
  color: #f4efff;
}
.ghost {
  border: 1px solid #33454f;
  border-radius: var(--r-md);
  background: #0a141aad;
  color: #d3dee6;
}
.platform-actions button:hover {
  transform: translateY(-2px);
  filter: brightness(1.12);
}
.ghost:hover {
  border-color: color-mix(in srgb, var(--accent) 60%, #33454f);
}
.test.ok {
  border-color: #31d38b88;
  color: #9df0cb;
}
.help-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
  padding: 16px 20px;
  border: 1px solid #ffffff1c;
  border-radius: 15px;
  background: linear-gradient(120deg, #0a1115da, #080d10ed);
}
.help-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  border: 1px solid #ffffff14;
  background: #ffffff08;
  color: #a9bbc8;
}
.help-icon .icon {
  width: 19px;
}
.help-bar b {
  display: block;
  font-size: 13px;
  font-weight: 600;
}
.help-bar small {
  font-size: 12px;
  color: #a3b3bf;
}
.help-bar .ghost {
  --accent: #ff8a1e;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--r-md);
  font-size: 13px;
}
.help-bar .ghost .icon {
  width: 16px;
}
.workspace-note {
  font-size: 11px;
  color: #8ea0ad;
  margin: 14px 0 0;
}
.canvas {
  background: #04090d;
}
/* This page's content is shorter than the viewport, so the bottom-pinned footer
   left a dead band above it. Let it follow the content instead. */
footer {
  margin-top: 18px;
  padding-top: 0;
}
@media (max-width: 1150px) {
  .platform-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .value-strip li + li {
    border-left: 0;
    padding-left: 0;
  }
}
@media (max-width: 700px) {
  .platform-actions button {
    flex: 1 1 100%;
  }
  .field {
    grid-template-columns: 22px minmax(0, 1fr) 32px;
    row-gap: 2px;
  }
  .field-label {
    grid-column: 2;
  }
  .field-value {
    grid-column: 2;
  }
  .help-bar {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .help-bar .ghost {
    grid-column: 2;
  }
}
@media (prefers-reduced-motion: reduce) {
  .platform-card,
  .platform-card:after,
  .link-state .dot {
    animation: none;
  }
}

/* ---- API key entry ---------------------------------------------------- */
.section-label {
  margin: 30px 0 12px;
}
.ai-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 30px 0 12px;
}
.ai-picker .section-label {
  margin: 0;
}
.platform-card.ai {
  --accent: var(--ice);
  grid-column: 1 / -1;
}
/* The AI dropdown shows one card, except while the search box is in use. */
body:not(.is-searching) .platform-card.is-unselected {
  display: none;
}
.platform-mark .icon {
  width: 26px;
  color: var(--accent);
}
.cred-actions [hidden] {
  display: none;
}
/* Controls that need a backend stay in place, inert. */
.platform-actions button:disabled,
.copy:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.platform-actions button:disabled:hover {
  transform: none;
  filter: none;
}
.ghost:disabled:hover {
  border-color: var(--edge-strong);
}
.link-state.is-off,
.link-state.is-unknown {
  color: var(--muted) !important;
}
.link-state.is-off .dot,
.link-state.is-unknown .dot {
  background: var(--ink-subtle);
  box-shadow: none;
  animation: none;
}
.pill {
  max-width: 100%;
  overflow-wrap: anywhere;
}
.pill.is-ok {
  border-color: color-mix(in srgb, var(--jade) 45%, transparent);
  background: color-mix(in srgb, var(--jade) 12%, transparent);
  color: var(--text);
}
.pill.is-ok:before {
  background: var(--jade);
  box-shadow: none;
}
.pill.is-off,
.pill.is-unknown {
  border-color: var(--edge);
  background: color-mix(in srgb, var(--text) 5%, transparent);
  color: var(--muted);
}
.pill.is-off:before,
.pill.is-unknown:before {
  background: var(--ink-subtle);
  box-shadow: none;
}
#credential-dialog form[hidden] {
  display: none;
}
.cred-field {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
}
.cred-field input,
.cred-field select {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--edge-strong);
  border-radius: var(--r-md);
  background: var(--surface-deep);
  color: var(--text);
  color-scheme: dark;
  font: inherit;
}
.cred-field input:focus-visible,
.cred-field select:focus-visible,
#credential-dialog button:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 2px;
}
#credential-dialog .cred-help {
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--ink-subtle);
}
#credential-dialog .cred-error {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--danger);
  overflow-wrap: anywhere;
}
.cred-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}
.cred-actions button {
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--r-md);
  font-size: 13px;
}
#credential-dialog .cred-actions .primary {
  margin-top: 0;
  color: var(--on-ember);
}

/* "Remove key" is added by credentials.js and shown only for a saved key while signed in. */
.platform-actions .remove-key[hidden] {
  display: none;
}
