.gpt-tool-tabs {
  position: sticky;
  top: 72px;
  z-index: 8;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 0 22px;
  padding: 10px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(20px);
}

.gpt-tool-tabs a {
  flex: 0 0 auto;
  padding: 9px 13px;
  border-radius: 999px;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}

.gpt-tool-tabs a:hover {
  background: #eef6ff;
  color: #0878d1;
}

.gpt-credential-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 13px;
}

.gpt-credential-modes span {
  padding: 6px 10px;
  border: 1px solid #dbe6f2;
  border-radius: 999px;
  background: #f8fbff;
  color: #46647f;
  font-size: 0.74rem;
  font-weight: 700;
}

.gpt-tool-subpanel {
  margin-top: 22px;
  padding: 22px;
  border: 1px solid rgba(15, 23, 42, 0.09);
  border-radius: 22px;
  background: #fbfdff;
}

.gpt-payment-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid #dbe6f2;
  border-radius: 18px;
  background: #fff;
}

.gpt-payment-entry strong {
  display: block;
  color: #14243a;
  font-size: 0.95rem;
}

.gpt-payment-entry p {
  margin: 5px 0 0;
  color: #66778c;
  font-size: 0.8rem;
}

.gpt-payment-entry .gpt-tool-submit {
  width: auto;
  min-width: 200px;
  margin: 0;
}

.gpt-payment-entry .gpt-tool-submit:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.gpt-payment-dialog {
  width: min(620px, calc(100vw - 28px));
  max-height: min(780px, calc(100vh - 28px));
  overflow: auto;
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: #fff;
  color: #14243a;
  box-shadow: 0 32px 90px rgba(15, 31, 50, 0.25);
}

.gpt-payment-dialog::backdrop {
  background: rgba(15, 23, 42, 0.46);
  backdrop-filter: blur(8px);
}

.gpt-payment-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 24px 18px;
  border-bottom: 1px solid #e6edf5;
}

.gpt-payment-dialog__header h3 {
  margin: 5px 0 7px;
  font-size: clamp(1.3rem, 3vw, 1.75rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.gpt-payment-dialog__header p {
  margin: 0;
  color: #65768b;
  font-size: 0.82rem;
  line-height: 1.6;
}

.gpt-dialog-close {
  display: grid;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #f1f5f9;
  color: #41536a;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.gpt-payment-dialog form {
  padding: 22px 24px 24px;
}

.gpt-payment-dialog__fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.gpt-payment-dialog__fields label,
.gpt-payment-url-label {
  display: grid;
  gap: 8px;
  color: #334155;
  font-size: 0.8rem;
  font-weight: 750;
}

.gpt-payment-dialog__fields select {
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid #d7e1ec;
  border-radius: 12px;
  background: #fff;
  color: #0f172a;
  font: inherit;
}

.gpt-payment-dialog .gpt-team-plan-fields {
  margin-top: 14px;
}

.gpt-payment-dialog__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.gpt-generate-link,
.gpt-dialog-cancel,
.gpt-payment-result__actions button,
.gpt-payment-result__actions a {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 0 15px;
  border: 1px solid #1686dc;
  border-radius: 12px;
  background: #1686dc;
  color: #fff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 760;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.gpt-dialog-cancel {
  border-color: #d6e0ea;
  background: #fff;
  color: #41536a;
}

.gpt-generate-link:disabled {
  cursor: wait;
  opacity: 0.65;
}

.gpt-payment-result-dialog {
  width: min(560px, calc(100vw - 28px));
}

.gpt-payment-url-label {
  margin: 22px 24px 8px;
}

.gpt-payment-result-dialog textarea {
  display: block;
  width: calc(100% - 48px);
  margin: 0 24px;
  padding: 14px;
  resize: none;
  border: 1px solid #d6e0ea;
  border-radius: 14px;
  background: #f8fbff;
  color: #23364d;
  font: 0.76rem/1.6 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  word-break: break-all;
}

.gpt-payment-result__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 18px 24px 24px;
}

.gpt-payment-result__actions button {
  border-color: #d6e0ea;
  background: #fff;
  color: #23364d;
}

.gpt-payment-result__actions button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.gpt-payment-result-error {
  margin: 12px 24px 0;
}

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

.gpt-field-grid label,
.gpt-team-plan-fields label,
.gpt-team-actions label {
  display: grid;
  gap: 8px;
  color: #334155;
  font-size: 0.8rem;
  font-weight: 700;
}

.gpt-field-grid select,
.gpt-team-plan-fields input,
.gpt-team-actions input {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid #d8e1eb;
  border-radius: 12px;
  background: white;
  color: #0f172a;
  font: inherit;
}

.gpt-team-plan-fields {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
  margin: 0 0 18px;
  padding: 16px;
  border-radius: 16px;
  background: #f1f7fd;
}

.gpt-team-plan-fields[hidden] {
  display: none;
}

.gpt-secondary-action {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid #cbd8e6;
  border-radius: 12px;
  background: white;
  color: #17263a;
  font-weight: 750;
  cursor: pointer;
}

.gpt-secondary-action:hover {
  border-color: #1686dc;
  color: #0878d1;
}

.gpt-team-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 14px;
  margin-top: 16px;
}

.gpt-team-actions form {
  display: flex;
  flex: 1 1 440px;
  align-items: end;
  gap: 10px;
}

.gpt-team-actions form label {
  flex: 1;
}

.gpt-team-result {
  margin-top: 15px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #eff9f1;
  color: #235b35;
  font-size: 0.86rem;
}

.gpt-team-result ul {
  margin: 10px 0 0;
  padding-left: 18px;
}

.gpt-converter-output {
  max-height: 360px;
  overflow: auto;
  margin: 14px 0;
  padding: 16px;
  border-radius: 15px;
  background: #10141b;
  color: #d8f6e4;
  font-size: 0.76rem;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-all;
}

@media (max-width: 760px) {
  .gpt-tool-tabs {
    top: 58px;
    margin-inline: -8px;
  }

  .gpt-field-grid,
  .gpt-team-plan-fields {
    grid-template-columns: 1fr;
  }

  .gpt-tool-subpanel {
    padding: 17px;
  }

  .gpt-payment-entry {
    align-items: stretch;
    flex-direction: column;
  }

  .gpt-payment-entry .gpt-tool-submit {
    width: 100%;
  }

  .gpt-payment-dialog__fields,
  .gpt-payment-dialog__actions,
  .gpt-payment-result__actions {
    grid-template-columns: 1fr;
  }

  .gpt-payment-dialog__header,
  .gpt-payment-dialog form {
    padding-right: 18px;
    padding-left: 18px;
  }

  .gpt-payment-url-label {
    margin-right: 18px;
    margin-left: 18px;
  }

  .gpt-payment-result-dialog textarea {
    width: calc(100% - 36px);
    margin-right: 18px;
    margin-left: 18px;
  }

  .gpt-payment-result__actions {
    padding-right: 18px;
    padding-left: 18px;
  }

  .gpt-team-actions,
  .gpt-team-actions form {
    align-items: stretch;
    flex-direction: column;
  }
}
