#billing-root [hidden] {
  display: none !important;
}
.billing-section {
  margin-top: 24px;
  padding: 24px;
}
.billing-section h2 {
  font-size: 18px;
  margin: 0 0 16px;
}
.billing-section p {
  line-height: 1.8;
}
.billing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0;
}
.billing-consent {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  line-height: 1.8;
  margin: 20px 0;
}
.billing-consent input {
  margin-top: 7px;
}
.billing-plan-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid #e5e7eb;
}
#billing-notice {
  margin: 16px 0;
  line-height: 1.8;
}
#billing-notice[data-error="true"] {
  color: #b42318;
}
:is(#billing-invoices, #billing-event-purchases) {
  overflow-x: auto;
  margin-top: 16px;
}
#billing-root button {
  min-height: 40px;
}
:is(#billing-invoices, #billing-event-purchases) table {
  width: 100%;
  border-collapse: collapse;
}
:is(#billing-invoices, #billing-event-purchases) :is(th, td) {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
  white-space: nowrap;
}
:is(#billing-invoices, #billing-event-purchases) th {
  background: #f8f9fa;
  font-size: 13px;
}
:is(#billing-invoices, #billing-event-purchases) a {
  margin-right: 12px;
}
@media (max-width: 768px) {
  .billing-section {
    padding: 20px;
  }
  .billing-actions > * {
    width: 100%;
  }
}

.billing-coupon-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.billing-coupon-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.billing-coupon-form :is(input, select),
#billing-coupon-code {
  min-height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 8px 12px;
  background: #fff;
  color: #1f2937;
  font: inherit;
  min-width: 0;
}
#billing-coupon-create summary {
  cursor: pointer;
  margin-top: 20px;
}
#billing-coupons {
  overflow-x: auto;
}
#billing-coupons table {
  width: 100%;
  border-collapse: collapse;
}
#billing-coupons :is(th, td) {
  padding: 12px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}
@media (max-width: 768px) {
  .billing-coupon-form {
    grid-template-columns: 1fr;
  }
  #billing-coupon-code {
    width: 100%;
  }
}

.billing-section h3 {
  margin: 24px 0 12px;
  font-size: 16px;
}
/* Pass catalog and immutable purchase/use history share the billing page. */
.event-pass-table {
  overflow-x: auto;
  margin: 16px 0;
}
.event-pass-table table {
  width: 100%;
  min-width: 640px;
}
.event-pass-table td,
.event-pass-table th {
  padding: 12px;
  text-align: left;
  vertical-align: top;
}
.event-pass-table code {
  display: block;
  white-space: nowrap;
  font-size: 13px;
}
.event-pass-table button {
  margin: 6px 8px 0 0;
}
.event-pass-dialog {
  margin: auto;
  padding: 28px;
  border: 0;
  border-radius: 12px;
  width: min(92vw, 520px);
  max-height: 90vh;
  overflow: auto;
}
.event-pass-dialog::backdrop {
  background: rgb(0 0 0 / 35%);
}
.event-pass-dialog h2 {
  font-size: 22px;
  margin: 0 0 16px;
}
.event-pass-dialog p {
  line-height: 1.8;
  margin: 12px 0;
}
.event-pass-dialog label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0;
}
.event-pass-dialog :is(input:not([type="checkbox"]), select) {
  display: block;
  width: 100%;
  height: 42px;
  min-height: 42px;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #d8dce2;
  border-radius: 6px;
  margin: 0;
  font: inherit;
  line-height: 1.5;
}
.event-pass-dialog button {
  margin: 12px 12px 0 0;
}
.billing-legacy {
  margin: 24px 0;
}

.event-pass-expiring,
.event-pass-expiring a {
  color: #b42318;
  font-weight: 600;
}
#event-pass-inventory [role="tabpanel"] > select {
  margin: 8px 0;
  padding: 8px;
  max-width: 100%;
}

.event-pass-tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid #d8dce2;
  margin: 20px 0 16px;
  overflow-x: auto;
}
.event-pass-tabs [role="tab"] {
  appearance: none;
  flex: none;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  padding: 12px 2px;
  color: #667085;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.event-pass-tabs [role="tab"][aria-selected="true"] {
  color: #222b38;
  border-bottom-color: #e78025;
}
.event-pass-tabs [role="tab"]:focus-visible {
  outline: 2px solid #e78025;
  outline-offset: -2px;
}
[role="tabpanel"][hidden] {
  display: none;
}
.event-pass-list table {
  min-width: 820px;
}
.event-pass-list th:nth-child(2),
.event-pass-list td:nth-child(2) {
  white-space: nowrap;
}
.event-pass-list td:nth-child(4) {
  min-width: 120px;
}
.event-pass-expiring td,
.event-pass-expiring td a {
  color: #b42318;
}

.event-pass-issue {
  padding: 4px 0 24px;
  border-bottom: 1px solid #e4e7ec;
  margin-bottom: 20px;
}
.event-pass-issue label {
  display: block;
  margin: 16px 0;
}
.event-pass-issue select {
  display: block;
  min-width: 240px;
}

.event-pass-demo-note {
  margin: 16px 24px;
  color: #667085;
  font-size: 13px;
  line-height: 1.8;
}

/* パス・クーポンはコード、名称、状態を途中で折り返さない。 */
.event-pass-table :is(th, td) {
  white-space: nowrap;
}

.event-pass-table td p {
  display: inline-block;
  margin: 0 0 0 8px;
}

/* 購入価格を主役に、個別購入との比較と割引率を控えめに添える。 */
.event-pass-regular-price {
  display: block;
  margin-bottom: 4px;
  color: #667085;
  font-size: 12px;
  line-height: 1.5;
}
.event-pass-sale-price {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
.event-pass-sale-price strong {
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.event-pass-discount {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 4px;
  background: #fff1e6;
  color: #984914;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}
.event-pass-price-note {
  margin: 12px 0;
  color: #667085;
  font-size: 12px;
  line-height: 1.6;
}

#billing-notice:empty {
  display: none;
}

/* 状態ラベルと合わせ、停止済みコードを視覚的にも区別する。 */
.entitlement-inactive { background: #f8f9fb; }
.entitlement-inactive :is(td, code) { color: #667085 !important; }
