.unsubscribe-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(24, 24, 24, 0.48);
  backdrop-filter: blur(7px);
}

.unsubscribe-modal-overlay.is-open {
  display: flex;
}

.unsubscribe-modal {
  position: relative;
  width: min(500px, calc(100vw - 32px));
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(19, 15, 38, 0.24);
  padding: 62px 40px 40px;
  text-align: center;
}

.unsubscribe-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: #b8b8b8;
  cursor: pointer;
  font-size: 32px;
  line-height: 24px;
  transition: color 160ms ease;
}

.unsubscribe-modal-close:hover {
  color: #686868;
}

.unsubscribe-modal-title {
  margin: 0;
  color: #1f1f26;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.72;
  letter-spacing: -0.02em;
}

.unsubscribe-modal-copy {
  max-width: 390px;
  margin: 16px auto 40px;
  color: #9a9a9a;
  font-size: 15px;
  line-height: 1.55;
}

.unsubscribe-modal-actions {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.unsubscribe-modal-action {
  min-width: 200px;
  border: 0;
  border-radius: 999px;
  padding: 15px 22px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.unsubscribe-modal-action:hover:not(:disabled) {
  transform: translateY(-1px);
}

.unsubscribe-modal-action:disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

.unsubscribe-retain {
  color: #ffffff;
  background: linear-gradient(90deg, #8f16ff 0%, #bd3cff 100%);
  box-shadow: 0 12px 28px rgba(143, 60, 255, 0.25);
}

.unsubscribe-confirm {
  color: #4f4d5d;
  background: #eef0f3;
}

.subscription-history-modal {
  position: relative;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: min(880px, calc(100vw - 32px));
  height: min(620px, calc(100vh - 48px));
  max-height: calc(100vh - 48px);
  min-height: 0;
  overflow: hidden;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(19, 15, 38, 0.24);
  padding: 42px 30px 48px;
}

.subscription-history-back {
  position: absolute;
  top: 24px;
  left: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: #17171f;
  cursor: pointer;
  transition: color 160ms ease;
}

.subscription-history-back:hover {
  color: #686868;
}

.subscription-history-title {
  margin: 0 48px 40px;
  color: #17171f;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  letter-spacing: -0.04em;
}

.subscription-history-tableWrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.subscription-history-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  color: #20212b;
  font-size: 14px;
  line-height: 1.2;
}

.subscription-history-table thead tr {
  background: #eceef1;
}

.subscription-history-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eceef1;
  padding: 14px 20px;
  color: #4f4d5d;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
}

.subscription-history-table th:first-child {
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
}

.subscription-history-table th:last-child {
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
}

.subscription-history-table td {
  border-bottom: 1px solid #e8e9ed;
  padding: 12px 20px;
  vertical-align: middle;
  white-space: nowrap;
}

.subscription-history-provider {
  color: #5e48ff;
  font-weight: 800;
}

.subscription-history-provider-paypal {
  color: #1f4488;
  font-style: italic;
}

.subscription-history-action {
  min-width: 92px;
  border: 0;
  border-radius: 999px;
  padding: 8px 15px;
  color: #ffffff;
  background: #151515;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 160ms ease, opacity 160ms ease;
}

.subscription-history-action:hover:not(:disabled) {
  background: #000000;
}

.subscription-history-action:disabled,
.subscription-history-action.is-disabled {
  cursor: not-allowed;
  background: #c8c8c8;
  color: #ffffff;
}

.subscription-history-state {
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8d8d96;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
}

.legal-toast {
  position: fixed;
  top: 82px;
  right: 24px;
  z-index: 90;
  display: none;
  max-width: min(360px, calc(100vw - 32px));
  border: 1px solid rgba(143, 60, 255, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 50px rgba(19, 15, 38, 0.16);
  padding: 14px 18px;
  color: #1f1f26;
  font-size: 14px;
  font-weight: 700;
  transform: translateY(-8px);
  opacity: 0;
  transition: opacity 180ms ease, transform 180ms ease;
}

.legal-toast.is-open {
  display: block;
  transform: translateY(0);
  opacity: 1;
}

.legal-toast.is-error {
  border-color: rgba(220, 38, 38, 0.2);
}

.legal-toast span {
  display: block;
  margin-top: 4px;
  color: #6d6a78;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}

@media (max-width: 640px) {
  .subscription-history-modal {
    height: min(560px, calc(100vh - 32px));
    max-height: calc(100vh - 32px);
    padding: 56px 18px 28px;
  }

  .subscription-history-title {
    margin-bottom: 28px;
    font-size: 24px;
  }

  .subscription-history-back {
    top: 18px;
    left: 18px;
  }

  .unsubscribe-modal {
    padding: 56px 22px 28px;
  }

  .unsubscribe-modal-title {
    font-size: 21px;
    line-height: 1.55;
  }

  .unsubscribe-modal-actions {
    flex-direction: column;
    gap: 12px;
  }

  .unsubscribe-modal-action {
    width: 100%;
    min-width: 0;
  }

  .legal-toast {
    top: 72px;
    right: 16px;
    left: 16px;
    max-width: none;
  }
}
