html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

.api-page {
  width: min(1120px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 56px 0 48px;
  color: #1d1d1f;
  overflow-x: hidden;
}

.footer {
  margin-top: 0;
}

.api-hero {
  margin: 0 0 28px;
  padding-left: 24px;
}

.api-hero p {
  margin: 0 0 8px;
  color: #007aff;
  font-size: 14px;
  font-weight: 600;
}

.api-hero h1 {
  display: inline-block;
  margin: 0;
  background: linear-gradient(90deg, #0084ff 20%, #ff6600 60%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 70px rgba(255, 159, 64, 0.9);
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: 0;
}

.api-hero span {
  display: block;
  max-width: 680px;
  margin-top: 12px;
  color: #6e6e73;
  font-size: 17px;
  line-height: 1.45;
}

.api-section {
  margin-bottom: 36px;
}

.api-section h2 {
  margin-bottom: 18px;
  font-size: clamp(28px, 4vw, 40px);
  color: #1d1d1f;
}

.api-card,
.api-endpoints article {
  background: #fff;
  border-radius: 24px;
  min-width: 0;
  max-width: 100%;
}

.api-card {
  padding: 24px;
}

.api-config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.api-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.api-field.full {
  grid-column: 1 / -1;
}

.api-auth-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  grid-column: 1 / -1;
  flex-wrap: wrap;
}

.api-auth-actions button {
  min-height: 46px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: #007aff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.api-auth-actions button:hover {
  background: #0071e3;
}

.api-auth-actions button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.api-auth-actions p {
  margin: 0;
  color: #6e6e73;
  font-size: 14px;
  line-height: 1.4;
}

.api-google-note {
  grid-column: 1 / -1;
  padding: 12px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  color: #1d4ed8;
  background: #eff6ff;
  font-size: 14px;
  line-height: 1.5;
}

.api-google-note a {
  color: #005ecb;
  font-weight: 700;
  text-decoration: none;
}

.api-google-note a:hover {
  text-decoration: underline;
}

.api-login-required {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid #bfdbfe;
  border-radius: 18px;
  background: #eff6ff;
}

.api-login-required strong {
  color: #1d4ed8;
  font-size: 17px;
  line-height: 1.35;
}

.api-login-required p {
  margin: 0;
  color: #315079;
  font-size: 14px;
  line-height: 1.5;
}

.api-login-required a {
  justify-self: start;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  color: #fff;
  background: #007aff;
  font-size: 14px;
  font-weight: 700;
  line-height: 42px;
  text-decoration: none;
}

.api-login-required a:hover {
  background: #0071e3;
}

.api-field span,
.api-field label,
.api-callback-form label {
  color: #6e6e73;
  font-size: 13px;
  font-weight: 600;
}

.api-field strong {
  min-width: 0;
  color: #1d1d1f;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.api-field code,
.api-endpoints code,
.api-section pre code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: 0;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  font-variant-ligatures: none;
}

.api-field code {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  padding: 12px 14px;
  border-radius: 14px;
  color: #1d1d1f;
  background: #f5f5f7;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}

.api-field input,
.api-input-row input {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid #d2d2d7;
  border-radius: 14px;
  color: #1d1d1f;
  background: #fff;
  font: inherit;
  font-size: 15px;
  outline: none;
}

.api-field input:focus,
.api-input-row input:focus {
  border-color: #007aff;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.16);
}

.api-callback-form {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid #e5e5ea;
}

.api-callback-form label {
  display: block;
  margin-bottom: 8px;
}

.api-callback-form small {
  color: #86868b;
  font-weight: 400;
}

.api-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.api-input-row button {
  min-height: 46px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: #007aff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.api-input-row button:hover {
  background: #0071e3;
}

.api-input-row input:disabled,
.api-input-row button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.api-callback-form p,
.endpoint-details p {
  margin: 8px 0 0;
  color: #6e6e73;
  font-size: 14px;
  line-height: 1.5;
}

.api-alert {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 14px;
}

.api-alert.success {
  color: #0f5132;
  background: #d1e7dd;
}

.api-alert.error {
  color: #842029;
  background: #f8d7da;
}

.api-endpoints {
  display: grid;
  gap: 16px;
}

.api-status-card {
  padding: 20px;
  border-radius: 24px;
  background: #fff;
  min-width: 0;
  max-width: 100%;
}

.api-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.api-status-item {
  min-width: 0;
  padding: 14px;
  border: 1px solid #e5e5ea;
  border-radius: 18px;
  background: #f5f5f7;
}

.api-status-item.success {
  border-color: #b7e4c7;
  background: #ecfdf3;
}

.api-status-item.warning {
  border-color: #f6d365;
  background: #fff8db;
}

.api-status-item.danger {
  border-color: #ffb4b4;
  background: #fff1f1;
}

.api-status-item.server {
  border-color: #d8b4fe;
  background: #f7f0ff;
}

.api-status-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.api-status-head strong {
  color: #1d1d1f;
  font-size: 15px;
  line-height: 1.35;
}

.api-status-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: #fff;
  background: #1d1d1f;
  font-size: 12px;
  font-weight: 700;
}

.api-status-item.success .api-status-code {
  background: #16a34a;
}

.api-status-item.warning .api-status-code {
  color: #3f2f00;
  background: #facc15;
}

.api-status-item.danger .api-status-code {
  background: #dc2626;
}

.api-status-item.server .api-status-code {
  background: #7c3aed;
}

.api-status-item p,
.api-status-foot {
  margin: 10px 0 0;
  color: #6e6e73;
  font-size: 14px;
  line-height: 1.5;
}

.api-status-item pre {
  margin-top: 12px;
}

.api-status-item.success pre {
  background: #14532d;
}

.api-status-item.warning pre {
  color: #3f2f00;
  background: #fef3c7;
}

.api-status-item.danger pre {
  background: #7f1d1d;
}

.api-status-item.server pre {
  background: #3b0764;
}

.api-endpoints article {
  padding: 20px;
}

.endpoint-title {
  margin: 0 0 12px;
  color: #1d1d1f;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
}

.endpoint-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.endpoint-head code {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  color: #1d1d1f;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}

.endpoint-details {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e5e5ea;
}

.endpoint-details strong {
  color: #1d1d1f;
}

.endpoint-examples {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
  min-width: 0;
  max-width: 100%;
}

.endpoint-examples > div {
  min-width: 0;
  max-width: 100%;
}

.endpoint-examples h3 {
  margin: 0 0 8px;
  color: #1d1d1f;
  font-size: 14px;
  font-weight: 600;
}

.endpoint-curl {
  grid-column: 1 / -1;
  min-width: 0;
  max-width: 100%;
}

.api-method {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: #fff;
  background: #1d1d1f;
  font-size: 12px;
  font-weight: 700;
}

.api-method.post {
  background: #007aff;
}

.api-section pre {
  overflow-x: auto;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 15px;
  border-radius: 14px;
  color: #f5f5f7;
  background: #1d1d1f;
  -webkit-overflow-scrolling: touch;
}

.api-section pre code {
  display: block;
  width: max-content;
  min-width: 100%;
  max-width: none;
  white-space: pre;
}

@media (max-width: 720px) {
  .api-page {
    width: min(1120px, calc(100vw - 28px));
    padding-top: 34px;
  }

  .api-hero {
    padding-left: 12px;
  }

  .api-card,
  .api-endpoints article,
  .api-status-card {
    border-radius: 20px;
  }

  .api-card,
  .api-endpoints article,
  .api-status-card {
    padding: 18px;
  }

  .api-config-grid,
  .api-input-row,
  .endpoint-examples,
  .api-status-grid {
    grid-template-columns: 1fr;
  }

  .endpoint-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .api-input-row button {
    width: 100%;
  }

  .api-field code,
  .endpoint-head code,
  .api-section pre,
  .api-section pre code {
    font-size: 12px;
    line-height: 1.55;
  }
}
