/* Credits center: authoritative product rules and touch-safe section controls. */
.credits-mode-tabs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.credits-mode-tabs button,
.credits-product-tabs button {
  min-height: 44px;
  min-width: 0;
  letter-spacing: 0;
}

.credits-rules-pane {
  width: min(960px, 100%);
  margin: 0 auto;
  padding: 8px 0 calc(96px + env(safe-area-inset-bottom, 0px));
}

.credits-rules-heading {
  max-width: 680px;
  margin-bottom: 22px;
}

.credits-rules-heading h2 {
  margin: 4px 0 8px;
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 3vw, 2.25rem);
  line-height: 1.15;
}

.credits-rules-heading p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.credits-product-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  width: min(520px, 100%);
  margin-bottom: 20px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 84%, transparent);
}

.credits-product-tabs button {
  padding: 8px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  line-height: 1.25;
  white-space: normal;
}

.credits-product-tabs button.is-active {
  background: var(--gold);
  color: #fff;
  box-shadow: 0 7px 18px rgba(128, 92, 54, 0.14);
}

.credits-rules-feedback {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
}

.credits-rules-status {
  margin: 0;
  color: var(--muted);
}

.credits-rules-retry {
  min-height: 44px;
}

.credits-rules-retry[hidden],
.credits-product-pane[hidden] {
  display: none;
}

.credits-product-pane {
  min-width: 0;
}

.credits-rule-section-title {
  margin: 22px 0 8px;
  font-size: 1rem;
  line-height: 1.4;
}

.credits-rule-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  -webkit-overflow-scrolling: touch;
}

.credits-rule-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  table-layout: fixed;
}

.credits-rule-table th,
.credits-rule-table td {
  padding: 13px 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  text-align: right;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.credits-rule-table tr:last-child th,
.credits-rule-table tr:last-child td {
  border-bottom: 0;
}

.credits-rule-table th:first-child,
.credits-rule-table td:first-child {
  width: 44%;
  text-align: left;
}

.credits-rule-table thead th {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.credits-rule-table tbody th {
  color: var(--ink);
  font-weight: 700;
}

.credits-rule-table tbody td {
  color: var(--gold-text);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.credits-rule-benefits {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.credits-rule-benefit {
  position: relative;
  margin: 0;
  padding: 12px 12px 12px 26px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  color: var(--muted);
  line-height: 1.65;
}

.credits-rule-benefit::before {
  content: "";
  position: absolute;
  top: 20px;
  left: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}

html[data-theme="night"] .credits-product-tabs {
  background: rgba(255, 255, 255, 0.04);
}

@media (max-width: 560px) {
  .credits-mode-tabs {
    width: 100%;
    gap: 3px;
    padding: 4px;
  }

  .credits-mode-tabs button,
  .credits-product-tabs button {
    padding-inline: 6px;
    font-size: 0.86rem;
  }

  .credits-rules-heading h2 {
    font-size: 1.55rem;
  }

  .credits-rule-table-wrap {
    overflow-x: hidden;
    -webkit-overflow-scrolling: auto;
  }

  .credits-rule-table {
    width: 100%;
    min-width: 0;
  }

  .credits-rule-table th,
  .credits-rule-table td {
    padding: 11px 6px;
    overflow-wrap: break-word;
    word-break: normal;
    white-space: normal;
  }

  .credits-rule-table th:first-child,
  .credits-rule-table td:first-child {
    width: 40%;
  }

  .credits-rule-table th:nth-child(2),
  .credits-rule-table td:nth-child(2),
  .credits-rule-table th:nth-child(3),
  .credits-rule-table td:nth-child(3) {
    width: 30%;
  }
}
