.ig-rule {
  --ig-rule-ink: var(--black, #323232);
  --ig-rule-muted: var(--fontGray, #808080);
  --ig-rule-line: #ececec;
  --ig-rule-soft: #fafafa;
  --ig-rule-gold: #a67c00;
  --ig-rule-gold-soft: #fff7d6;
}

.ig-rule__intro {
  margin-bottom: 1.5rem;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ig-rule-ink);
}

.ig-rule__tabs {
  display: inline-flex;
  max-width: 100%;
  gap: .25rem;
  margin: 0 0 1.25rem;
  padding: .25rem;
  overflow-x: auto;
  background-color: #f3f3f3;
  border-radius: 12px;
  scrollbar-width: none;
}

.ig-rule__tabs::-webkit-scrollbar {
  display: none;
}

.ig-rule__tabs[hidden] {
  display: none;
}

.ig-rule__tab {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: .5rem;
  padding: .5rem .875rem .5rem .5rem;
  font-size: .9375rem;
  font-weight: 600;
  color: var(--ig-rule-muted);
  white-space: nowrap;
  cursor: pointer;
  background-color: transparent;
  border: 0;
  border-radius: 9px;
  transition: background-color .2s ease, color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.ig-rule__tab:hover {
  color: var(--ig-rule-ink);
}

.ig-rule__tab:focus-visible {
  outline: 2px solid #ffc302;
  outline-offset: 2px;
}

.ig-rule__tab.is-active {
  color: var(--ig-rule-ink);
  background-color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .1), 0 1px 2px rgba(0, 0, 0, .06);
}

.ig-rule__tab-img {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 7px;
  transition: transform .2s ease;
}

.ig-rule__tab.is-active .ig-rule__tab-img {
  transform: scale(1.08);
}

.ig-rule__panel {
  overflow: hidden;
  background-color: #fff;
  border: 1px solid var(--ig-rule-line);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
  animation: ig-rule-fade .25s ease-out backwards;
}

.ig-rule__panel + .ig-rule__panel {
  margin-top: 1.25rem;
}

.ig-rule.is-tabbed .ig-rule__panel + .ig-rule__panel {
  margin-top: 0;
}

.ig-rule__panel[hidden] {
  display: none;
}

.ig-rule__head {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--ig-rule-line);
}

.ig-rule__photo {
  flex: none;
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 12px;
}

.ig-rule__head-text {
  min-width: 0;
}

.ig-rule__title {
  margin: 0 0 .125rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ig-rule-ink);
}

.ig-rule__meta {
  margin: 0;
  font-size: .875rem;
  color: var(--ig-rule-muted);
}

.ig-rule__tablewrap {
  overflow-x: auto;
}

.ig-rule__table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9375rem;
}

.ig-rule__table thead th {
  padding: .75rem 1.5rem;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-align: left;
  text-transform: uppercase;
  color: var(--ig-rule-muted);
  background-color: var(--ig-rule-soft);
  border-bottom: 1px solid var(--ig-rule-line);
}

.ig-rule__table tbody th,
.ig-rule__table tbody td {
  padding: .875rem 1.5rem;
  border-bottom: 1px solid var(--ig-rule-line);
}

.ig-rule__table tbody tr:last-child th,
.ig-rule__table tbody tr:last-child td {
  border-bottom: 0;
}

.ig-rule__table tbody tr:nth-child(even) {
  background-color: #fcfcfc;
}

.ig-rule__table tbody tr {
  transition: background-color .15s ease;
}

.ig-rule__table tbody tr:hover {
  background-color: #fffbea;
}

.ig-rule__table tbody th {
  font-weight: 700;
  text-align: left;
  color: var(--ig-rule-ink);
  white-space: nowrap;
}

.ig-rule__table tbody th span {
  font-weight: 500;
  color: var(--ig-rule-muted);
}

.ig-rule__table thead th:first-child {
  width: 40%;
}

.ig-rule__table .ig-rule__num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.ig-rule__table tbody td {
  color: var(--ig-rule-ink);
}

.ig-rule__table tbody td:last-child {
  font-weight: 600;
  color: var(--ig-rule-gold);
}

.ig-rule__badge {
  display: inline-block;
  padding: .1875rem .625rem;
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .04em;
  border-radius: 999px;
}

.ig-rule__badge--basic {
  color: #52525b;
  background-color: #ececec;
}

.ig-rule__badge--gold {
  color: var(--ig-rule-gold);
  background-color: var(--ig-rule-gold-soft);
}

.ig-rule__tab-img--contain,
.ig-rule__photo--contain {
  object-fit: contain;
  background-color: #fff8db;
}

.ig-rule__tab-img--contain {
  padding: 3px;
}

.ig-rule__photo--contain {
  padding: 8px;
}

.ig-rule__table--fee thead th:first-child {
  width: auto;
}

.ig-rule__table .ig-rule__group th {
  padding-top: .625rem;
  padding-bottom: .625rem;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ig-rule-muted);
  background-color: var(--ig-rule-soft);
}

.ig-rule__table tbody .ig-rule__group:hover {
  background-color: var(--ig-rule-soft);
}

.ig-rule__table--fee tbody th {
  font-weight: 600;
  white-space: normal;
}

.ig-rule__table--fee tbody td:last-child {
  font-weight: 700;
  color: var(--ig-rule-ink);
}

.ig-rule__table--fee tbody th .ig-rule__method {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-weight: 600;
  color: var(--ig-rule-ink);
}

.ig-rule__logo {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 32px;
  padding: 3px;
  background-color: #fff;
  border: 1px solid var(--ig-rule-line);
  border-radius: 8px;
}

.ig-rule__logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.ig-rule__logo.is-empty img {
  display: none;
}

.ig-rule__strike {
  margin-right: .375rem;
  font-size: .8125rem;
  font-weight: 500;
  color: var(--ig-rule-muted);
}

.ig-rule__free {
  font-weight: 600;
  color: var(--ig-rule-muted);
}

.ig-rule__unique {
  display: block;
  font-weight: 700;
  color: var(--ig-rule-ink);
}

.ig-rule__note {
  display: block;
  font-size: .75rem;
  font-weight: 500;
  color: var(--ig-rule-muted);
}

.ig-rule__empty {
  padding: 2rem;
  text-align: center;
  color: var(--ig-rule-muted);
  background-color: var(--ig-rule-soft);
  border-radius: 14px;
}

@keyframes ig-rule-fade {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

@media (max-width: 575.98px) {
  .ig-rule__tabs {
    display: flex;
  }

  .ig-rule__head {
    padding: 1rem;
  }

  .ig-rule__photo {
    width: 48px;
    height: 48px;
    border-radius: 10px;
  }

  .ig-rule__title {
    font-size: 1.0625rem;
  }

  .ig-rule__table {
    font-size: .875rem;
  }

  .ig-rule__table thead th,
  .ig-rule__table tbody th,
  .ig-rule__table tbody td {
    padding-right: .75rem;
    padding-left: .75rem;
  }

  .ig-rule__table thead th:first-child,
  .ig-rule__table tbody th {
    padding-left: 1rem;
  }

  .ig-rule__table .ig-rule__num:last-child {
    padding-right: 1rem;
  }

  .ig-rule__badge {
    padding: .125rem .5rem;
    font-size: .625rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ig-rule__panel {
    animation: none;
  }

  .ig-rule__tab,
  .ig-rule__tab-img,
  .ig-rule__table tbody tr {
    transition: none;
  }

  .ig-rule__tab.is-active .ig-rule__tab-img {
    transform: none;
  }
}
