.ibg-wrap,
.ibg-wrap * {
  box-sizing: border-box;
}

.ibg-wrap {
  --ibg-brand: #8b5cf6;
  --ibg-text: #171717;
  --ibg-muted: #666;
  --ibg-border: #ece9f5;
  --ibg-bg: #fff;
  --ibg-soft: #fbf9ff;
  max-width: 980px;
  margin: 28px auto;
  color: var(--ibg-text);
  font-family: inherit;
}

.ibg-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px;
  border: 1px solid var(--ibg-border);
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--ibg-brand) 20%, transparent), transparent 34%),
    linear-gradient(135deg, #fff, #fbf7ff);
  box-shadow: 0 18px 45px rgba(24, 12, 47, 0.07);
}

.ibg-eyebrow {
  display: inline-flex;
  margin: 0 0 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--ibg-brand);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.ibg-hero h2 {
  margin: 0 0 10px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
}

.ibg-hero p:last-child {
  margin: 0;
  color: var(--ibg-muted);
  font-size: 17px;
  line-height: 1.6;
}

.ibg-hero-badge {
  min-width: 130px;
  padding: 18px;
  border-radius: 20px;
  background: #fff;
  text-align: center;
  border: 1px solid var(--ibg-border);
  box-shadow: 0 12px 30px rgba(24, 12, 47, 0.07);
}

.ibg-hero-badge span,
.ibg-hero-badge strong {
  display: block;
}

.ibg-hero-badge span {
  color: var(--ibg-muted);
  font-size: 13px;
}

.ibg-hero-badge strong {
  margin-top: 3px;
  color: var(--ibg-brand);
  font-size: 20px;
}

.ibg-tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 16px 2px 8px;
  scrollbar-width: thin;
}

.ibg-tab {
  flex: 0 0 auto;
  border: 1px solid var(--ibg-border);
  border-radius: 999px;
  background: #fff;
  color: var(--ibg-text);
  padding: 10px 15px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.ibg-tab:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--ibg-brand) 35%, var(--ibg-border));
}

.ibg-tab.is-active {
  background: var(--ibg-brand);
  border-color: var(--ibg-brand);
  color: #fff;
}

.ibg-panel {
  margin-top: 14px;
  padding: 26px;
  border: 1px solid var(--ibg-border);
  border-radius: 24px;
  background: var(--ibg-bg);
  box-shadow: 0 14px 38px rgba(24, 12, 47, 0.055);
}

.ibg-panel[hidden] {
  display: none !important;
}

.ibg-panel-head {
  margin-bottom: 20px;
}

.ibg-panel-head h3 {
  margin: 0 0 8px;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.2;
}

.ibg-panel-head p {
  margin: 0;
  color: var(--ibg-muted);
  line-height: 1.6;
}

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

.ibg-field {
  display: grid;
  gap: 8px;
}

.ibg-field.ibg-full {
  grid-column: 1 / -1;
}

.ibg-field span {
  font-weight: 800;
  font-size: 14px;
}

.ibg-field input,
.ibg-field textarea,
.ibg-field select {
  width: 100%;
  border: 1px solid #ded9ec;
  border-radius: 16px;
  background: #fff;
  color: var(--ibg-text);
  padding: 13px 14px;
  font: inherit;
  line-height: 1.4;
  outline: none;
  box-shadow: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.ibg-field textarea {
  min-height: 122px;
  resize: vertical;
}

.ibg-field input:focus,
.ibg-field textarea:focus,
.ibg-field select:focus {
  border-color: var(--ibg-brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ibg-brand) 14%, transparent);
}

.ibg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.ibg-generate-btn,
.ibg-clear-btn,
.ibg-copy-one,
.ibg-copy-all {
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.16s ease, opacity 0.16s ease, background 0.16s ease;
}

.ibg-generate-btn,
.ibg-copy-all {
  background: var(--ibg-brand);
  color: #fff;
}

.ibg-generate-btn {
  min-width: 150px;
  padding: 13px 22px;
}

.ibg-clear-btn {
  padding: 13px 20px;
  background: #f1eef8;
  color: var(--ibg-text);
}

.ibg-generate-btn:hover,
.ibg-clear-btn:hover,
.ibg-copy-one:hover,
.ibg-copy-all:hover {
  transform: translateY(-1px);
}

.ibg-generate-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.ibg-results {
  margin-top: 22px;
}

.ibg-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.ibg-results-head strong {
  font-size: 18px;
}

.ibg-copy-all {
  padding: 9px 15px;
  font-size: 14px;
}

.ibg-result-card {
  position: relative;
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
  padding: 18px;
  border: 1px solid var(--ibg-border);
  border-radius: 18px;
  background: var(--ibg-soft);
}

.ibg-result-card p {
  margin: 0;
  color: var(--ibg-text);
  line-height: 1.65;
  white-space: normal;
}

.ibg-result-meta {
  min-height: 1px;
}

.ibg-length-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--ibg-border);
  color: var(--ibg-muted);
  font-size: 12px;
  font-weight: 800;
}

.ibg-copy-one {
  justify-self: start;
  padding: 9px 14px;
  background: #fff;
  color: var(--ibg-brand);
  border: 1px solid color-mix(in srgb, var(--ibg-brand) 22%, var(--ibg-border));
}

.ibg-copy-one.is-copied,
.ibg-copy-all.is-copied {
  background: #18a957;
  color: #fff;
}

.ibg-loading,
.ibg-alert {
  padding: 18px;
  border-radius: 18px;
  background: var(--ibg-soft);
  border: 1px solid var(--ibg-border);
}

.ibg-loading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ibg-loading span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ibg-brand);
  animation: ibg-bounce 1s infinite ease-in-out;
}

.ibg-loading span:nth-child(2) {
  animation-delay: 0.14s;
}

.ibg-loading span:nth-child(3) {
  animation-delay: 0.28s;
}

.ibg-loading p {
  margin: 0 0 0 8px;
  color: var(--ibg-muted);
}

@keyframes ibg-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
  40% { transform: translateY(-5px); opacity: 1; }
}

.ibg-alert-error {
  background: #fff4f4;
  border-color: #ffd2d2;
  color: #a62020;
}

.ibg-bio-preview {
  margin-top: 18px;
  padding: 18px;
  border: 1px dashed color-mix(in srgb, var(--ibg-brand) 35%, var(--ibg-border));
  border-radius: 18px;
  background: var(--ibg-soft);
}

.ibg-bio-preview strong {
  display: block;
  margin-bottom: 8px;
}

.ibg-bio-preview p {
  margin: 0;
  line-height: 1.6;
  color: var(--ibg-text);
}

.ibg-counter-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.ibg-counter-grid div {
  padding: 16px 12px;
  border: 1px solid var(--ibg-border);
  border-radius: 18px;
  background: #fff;
  text-align: center;
}

.ibg-counter-grid strong,
.ibg-counter-grid span {
  display: block;
}

.ibg-counter-grid strong {
  color: var(--ibg-brand);
  font-size: 26px;
  line-height: 1;
}

.ibg-counter-grid span {
  margin-top: 7px;
  color: var(--ibg-muted);
  font-size: 13px;
  font-weight: 700;
}

.ibg-limit-note {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f8f5ff;
  color: var(--ibg-muted);
  line-height: 1.55;
}

.ibg-limit-note.is-warning {
  background: #fff8e6;
  color: #7a5200;
}

@media (max-width: 760px) {
  .ibg-wrap {
    margin: 18px auto;
  }

  .ibg-hero {
    display: block;
    padding: 22px;
    border-radius: 20px;
  }

  .ibg-hero-badge {
    margin-top: 18px;
    width: 100%;
  }

  .ibg-panel {
    padding: 20px;
    border-radius: 20px;
  }

  .ibg-form-grid,
  .ibg-counter-grid {
    grid-template-columns: 1fr;
  }

  .ibg-tabs {
    padding-bottom: 10px;
  }
}
