img[alt="Image"] {
  object-fit: contain !important;
  width: min(70%, 520px) !important;
  height: auto !important;
  top: 50% !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  transform: translate(-50%, -50%) !important;
}

#ka-terms-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(8px);
}

.ka-terms-modal {
  display: grid;
  grid-template-columns: minmax(320px, 520px) minmax(0, 42vw);
  width: min(1100px, calc(100vw - 48px));
  min-height: min(76vh, 720px);
  border-radius: 22px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
}

.ka-terms-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 32px;
  background:
    radial-gradient(circle at top left, rgba(11, 121, 192, 0.12), transparent 40%),
    linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
}

.ka-terms-title {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 700;
  color: #0f172a;
}

.ka-terms-copy,
.ka-terms-status {
  margin: 0;
  line-height: 1.6;
  color: #334155;
}

.ka-terms-link {
  align-self: flex-start;
  color: #0b79c0;
  font-weight: 600;
  text-decoration: none;
}

.ka-terms-link:hover {
  text-decoration: underline;
}

.ka-terms-actions {
  display: flex;
  gap: 12px;
  margin-top: auto;
}

.ka-terms-button {
  border: 0;
  border-radius: 999px;
  padding: 12px 20px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.ka-terms-button:hover {
  transform: translateY(-1px);
}

.ka-terms-button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
}

.ka-terms-button--accept {
  color: #ffffff;
  background: linear-gradient(135deg, #0b79c0 0%, #095f98 100%);
  box-shadow: 0 12px 24px rgba(11, 121, 192, 0.28);
}

.ka-terms-button--reject {
  color: #0f172a;
  background: #e2e8f0;
}

.ka-terms-viewer {
  display: flex;
  flex-direction: column;
  border-left: 1px solid #dbe4ee;
  background: #eef3f8;
}

.ka-terms-viewer[hidden] {
  display: none;
}

.ka-terms-viewer-header {
  padding: 16px 18px;
  font-weight: 600;
  color: #0f172a;
  border-bottom: 1px solid #dbe4ee;
  background: rgba(255, 255, 255, 0.92);
}

.ka-terms-frame {
  width: 100%;
  height: 100%;
  min-height: 420px;
  border: 0;
  background: #ffffff;
}

@media (max-width: 960px) {
  .ka-terms-modal {
    grid-template-columns: 1fr;
    width: min(720px, calc(100vw - 24px));
    min-height: auto;
    max-height: calc(100vh - 24px);
  }

  .ka-terms-content {
    padding: 24px;
  }

  .ka-terms-viewer {
    min-height: 50vh;
    border-left: 0;
    border-top: 1px solid #dbe4ee;
  }
}
