.gbg-btc,
.gbg-btc * {
  box-sizing: border-box;
}

.gbg-btc {
  --gbg-btc-bg: #fff7f8;
  --gbg-btc-card: #ffffff;
  --gbg-btc-ink: #1f2937;
  --gbg-btc-muted: #657083;
  --gbg-btc-line: #efd4dc;
  --gbg-btc-accent: #c91f45;
  --gbg-btc-accent-dark: #9f1734;
  --gbg-btc-accent-soft: #fde5ea;
  --gbg-btc-blue-soft: #eaf2ff;
  --gbg-btc-blue: #2f6fd6;
  --gbg-btc-green-soft: #e9f8ef;
  --gbg-btc-green: #177245;
  --gbg-btc-red-soft: #fff0f1;
  --gbg-btc-radius: 22px;
  color: var(--gbg-btc-ink);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.45;
  margin: 1.25rem 0;
}

.gbg-btc__card {
  background: linear-gradient(145deg, var(--gbg-btc-card), var(--gbg-btc-bg));
  border: 1px solid var(--gbg-btc-line);
  border-radius: var(--gbg-btc-radius);
  box-shadow: 0 18px 45px rgba(153, 32, 58, 0.12);
  overflow: hidden;
  padding: clamp(0.9rem, 2vw, 1.35rem);
}

.gbg-btc__header {
  align-items: center;
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.gbg-btc__drop {
  align-items: center;
  background: var(--gbg-btc-accent-soft);
  border-radius: 18px;
  color: var(--gbg-btc-accent);
  display: flex;
  flex: 0 0 56px;
  height: 56px;
  justify-content: center;
  width: 56px;
}

.gbg-btc__drop svg {
  fill: currentColor;
  height: 34px;
  width: 34px;
}

.gbg-btc__title {
  color: var(--gbg-btc-ink);
  font-size: clamp(1.2rem, 2.4vw, 1.55rem);
  line-height: 1.15;
  margin: 0 0 0.25rem;
}

.gbg-btc__subtitle,
.gbg-btc__assumption,
.gbg-btc__disclaimer,
.gbg-btc__compat-note {
  color: var(--gbg-btc-muted);
  font-size: 0.89rem;
  line-height: 1.55;
  margin: 0;
}

.gbg-btc__form {
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--gbg-btc-line);
  border-radius: 18px;
  padding: 0.85rem;
}

.gbg-btc__parents {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gbg-btc__field {
  display: block;
  margin: 0;
}

.gbg-btc__label {
  align-items: center;
  color: var(--gbg-btc-ink);
  display: flex;
  font-weight: 700;
  gap: 0.45rem;
  margin-bottom: 0.35rem;
  font-size: 0.95rem;
}

.gbg-btc__parent-icon,
.gbg-btc__summary-icon,
.gbg-btc__axis-icon {
  display: inline-block;
  flex: 0 0 auto;
  height: 22px;
  vertical-align: middle;
  width: 22px;
}

.gbg-btc__summary-icon,
.gbg-btc__axis-icon {
  height: 20px;
  margin-right: 0.3rem;
  width: 20px;
}

.gbg-btc__select {
  appearance: none;
  background: #ffffff url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 7.5 10 12.5 15 7.5' fill='none' stroke='%23657083' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 0.85rem center;
  border: 1px solid #d7c2ca;
  border-radius: 14px;
  color: var(--gbg-btc-ink);
  font: inherit;
  min-height: 42px;
  padding: 0.55rem 2.2rem 0.55rem 0.75rem;
  width: 100%;
}

.gbg-btc__select:focus {
  border-color: var(--gbg-btc-accent);
  box-shadow: 0 0 0 3px rgba(201, 31, 69, 0.16);
  outline: none;
}

.gbg-btc__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.gbg-btc__btn {
  align-items: center;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 700;
  justify-content: center;
  min-height: 38px;
  padding: 0.5rem 0.95rem;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.gbg-btc__btn:hover {
  transform: translateY(-1px);
}

.gbg-btc__btn--primary {
  background: var(--gbg-btc-accent);
  box-shadow: 0 10px 22px rgba(201, 31, 69, 0.2);
  color: #ffffff;
}

.gbg-btc__btn--primary:hover,
.gbg-btc__btn--primary:focus {
  background: var(--gbg-btc-accent-dark);
  color: #ffffff;
}

.gbg-btc__btn--ghost {
  background: #ffffff;
  border: 1px solid var(--gbg-btc-line);
  color: var(--gbg-btc-accent-dark);
}

.gbg-btc__message {
  background: #fff6da;
  border: 1px solid #eed27f;
  border-radius: 14px;
  color: #755200;
  font-weight: 700;
  margin-top: 1rem;
  padding: 0.8rem 1rem;
}

.gbg-btc__results {
  margin-top: 1.2rem;
}

.gbg-btc__result-block h3 {
  font-size: 1.12rem;
  margin: 0 0 0.8rem;
}

.gbg-btc__summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.gbg-btc__summary span {
  align-items: center;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--gbg-btc-line);
  border-radius: 999px;
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.45rem 0.72rem;
}

.gbg-btc__grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gbg-btc__panel {
  background: #ffffff;
  border: 1px solid var(--gbg-btc-line);
  border-radius: 18px;
  padding: 0.85rem;
}

.gbg-btc__panel--wide {
  grid-column: 1 / -1;
}

.gbg-btc__panel h4 {
  color: var(--gbg-btc-ink);
  font-size: 0.98rem;
  margin: 0 0 0.8rem;
}

.gbg-btc__prob-row + .gbg-btc__prob-row {
  margin-top: 0.78rem;
}

.gbg-btc__prob-top {
  align-items: center;
  display: flex;
  font-size: 0.89rem;
  justify-content: space-between;
  margin-bottom: 0.3rem;
}

.gbg-btc__prob-top strong {
  color: var(--gbg-btc-accent-dark);
}

.gbg-btc__bar {
  background: #f0e4e8;
  border-radius: 999px;
  height: 11px;
  overflow: hidden;
}

.gbg-btc__bar span {
  background: linear-gradient(90deg, var(--gbg-btc-accent), #eb7188);
  border-radius: inherit;
  display: block;
  height: 100%;
  min-width: 0;
}

.gbg-btc__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.gbg-btc__pill {
  align-items: center;
  background: var(--gbg-btc-accent-soft);
  border: 1px solid #f5bdca;
  border-radius: 999px;
  color: var(--gbg-btc-accent-dark);
  display: inline-flex;
  gap: 0.5rem;
  padding: 0.48rem 0.7rem;
}

.gbg-btc__pill span {
  font-weight: 700;
}

.gbg-btc__pill strong {
  background: #ffffff;
  border-radius: 999px;
  color: var(--gbg-btc-ink);
  padding: 0.14rem 0.46rem;
}

.gbg-btc__details {
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid var(--gbg-btc-line);
  border-radius: 18px;
  margin-top: 1rem;
  padding: 0.3rem 1rem;
}

.gbg-btc__details summary {
  cursor: pointer;
  font-weight: 800;
  padding: 0.85rem 0;
}

.gbg-btc__compat-note {
  margin-bottom: 0.8rem;
}

.gbg-btc__table-wrap {
  overflow-x: auto;
  padding-bottom: 0.25rem;
  width: 100%;
}

.gbg-btc__punnett,
.gbg-btc__compat {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 560px;
  width: 100%;
}

.gbg-btc__punnett th,
.gbg-btc__punnett td,
.gbg-btc__compat th,
.gbg-btc__compat td {
  border-bottom: 1px solid #eadbe1;
  border-right: 1px solid #eadbe1;
  padding: 0.65rem;
  text-align: center;
  vertical-align: middle;
}

.gbg-btc__punnett th:first-child,
.gbg-btc__punnett td:first-child,
.gbg-btc__compat th:first-child,
.gbg-btc__compat td:first-child {
  border-left: 1px solid #eadbe1;
}

.gbg-btc__punnett thead th,
.gbg-btc__compat thead th {
  background: var(--gbg-btc-accent-soft);
  border-top: 1px solid #eadbe1;
  color: var(--gbg-btc-accent-dark);
  font-size: 0.9rem;
}

.gbg-btc__punnett thead th:first-child,
.gbg-btc__compat thead th:first-child {
  border-top-left-radius: 12px;
}

.gbg-btc__punnett thead th:last-child,
.gbg-btc__compat thead th:last-child {
  border-top-right-radius: 12px;
}

.gbg-btc__punnett tbody th,
.gbg-btc__compat tbody th {
  background: #fffafb;
  color: var(--gbg-btc-ink);
  font-size: 0.92rem;
}

.gbg-btc__punnett td {
  background: #ffffff;
  min-width: 150px;
}

.gbg-btc__cell-type {
  color: var(--gbg-btc-accent-dark);
  display: block;
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.gbg-btc__punnett td span:not(.gbg-btc__cell-type) {
  color: var(--gbg-btc-muted);
  display: block;
  font-size: 0.88rem;
  line-height: 1.35;
}

.gbg-btc__gamete-heading {
  align-items: center;
  display: inline-flex;
  gap: 0.3rem;
  justify-content: center;
}

.gbg-btc__gamete-heading strong,
.gbg-btc__gamete-heading small,
.gbg-btc__axis-parent {
  display: block;
  line-height: 1.2;
}

.gbg-btc__axis-parent,
.gbg-btc__gamete-heading small {
  color: var(--gbg-btc-muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.gbg-btc__compat td span {
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 800;
  justify-content: center;
  min-width: 44px;
  padding: 0.25rem 0.42rem;
}

.gbg-btc__compat td.is-compatible span {
  background: var(--gbg-btc-green-soft);
  color: var(--gbg-btc-green);
}

.gbg-btc__compat td.is-not-compatible span {
  background: var(--gbg-btc-red-soft);
  color: #a73740;
}

.gbg-btc__assumption,
.gbg-btc__disclaimer {
  margin-top: 1rem;
}

.gbg-btc__disclaimer {
  border-top: 1px solid var(--gbg-btc-line);
  padding-top: 0.85rem;
}

@media (max-width: 760px) {
  .gbg-btc__header {
    align-items: flex-start;
  }

  .gbg-btc__parents,
  .gbg-btc__grid {
    grid-template-columns: 1fr;
  }

  .gbg-btc__btn {
    width: 100%;
  }

  .gbg-btc__summary span {
    width: 100%;
  }
}
