.billing-submit {
  position: sticky;
  bottom: 12px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 8px -8px -8px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  box-shadow: 0 12px 32px color-mix(in srgb, var(--copy) 12%, transparent);
  backdrop-filter: blur(18px);
}

.billing-submit > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.billing-submit strong {
  font-size: 13px;
  overflow-wrap: anywhere;
}

.billing-submit span {
  color: var(--muted);
  font-size: 10px;
}

.billing-submit .billing-primary {
  flex: 0 0 auto;
}

.billing-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 160px;
  border-color: var(--primary);
  background: var(--primary);
  color: var(--primary-ink);
  white-space: nowrap;
}

.billing-primary:hover {
  background: var(--primary-bright);
}

.billing-products input:checked + span {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.billing-products small {
  color: var(--primary);
}

.billing-field input,
.billing-custom {
  background: var(--bg);
  color: var(--copy);
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.table-wrap table {
  min-width: 620px;
}

.token-name {
  position: relative;
  display: inline-block;
  padding-right: 22px;
}

.rename-trigger {
  position: absolute;
  right: -4px;
  bottom: 2px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--subtle);
  cursor: pointer;
}

.rename-trigger:hover,
.rename-trigger:focus-visible {
  background: var(--hover);
  color: var(--copy);
}

.rename-trigger:focus-visible,
.rename-dialog button:focus-visible,
.rename-field input:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.rename-trigger svg,
.rename-dialog-close svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rename-dialog {
  width: min(440px, calc(100% - 28px));
  max-width: none;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0;
  background: color-mix(in srgb, var(--bg) 96%, transparent);
  color: var(--copy);
  box-shadow: 0 24px 80px var(--shadow);
  backdrop-filter: blur(20px);
}

.rename-dialog::backdrop {
  background: color-mix(in srgb, var(--copy) 28%, transparent);
  backdrop-filter: blur(5px);
}

.rename-dialog[open] {
  animation: rename-dialog-in 160ms ease-out;
}

.rename-dialog form {
  display: grid;
  gap: 22px;
  padding: 24px;
}

.rename-dialog-head,
.rename-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rename-dialog-head > span {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .16em;
}

.rename-dialog-close {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.rename-dialog-close:hover {
  background: var(--hover);
  color: var(--copy);
}

.rename-dialog h2,
.rename-dialog p {
  margin: 0;
}

.rename-dialog h2 {
  font-size: 24px;
}

.rename-dialog p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.rename-field {
  display: grid;
  gap: 8px;
}

.rename-field span {
  color: var(--muted);
  font-size: 10px;
}

.rename-field input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--secondary);
  color: var(--copy);
  padding: 0 12px;
}

.rename-dialog-actions {
  justify-content: flex-end;
  gap: 8px;
}

.rename-dialog-actions button {
  min-height: 40px;
  border-radius: 5px;
  padding: 0 15px;
  cursor: pointer;
}

.rename-cancel {
  border: 1px solid var(--line);
  background: var(--secondary);
  color: var(--muted);
}

.rename-confirm {
  border: 1px solid var(--primary);
  background: var(--primary);
  color: var(--primary-ink);
  font-weight: 650;
}

.rename-confirm:hover {
  background: var(--primary-bright);
}

@keyframes rename-dialog-in {
  from { opacity: 0; transform: translateY(6px) scale(.985); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 560px) {
  .dashboard-head {
    flex-direction: column;
  }

  .status-pill {
    white-space: nowrap;
  }

  .rename-dialog form {
    padding: 20px;
  }

  .rename-dialog-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .rename-dialog-actions button {
    width: 100%;
  }

  .billing-form {
    padding-bottom: 8px;
  }

  .billing-submit {
    bottom: 8px;
    margin-right: -10px;
    margin-left: -10px;
    padding: 12px;
  }

  .billing-submit .billing-primary {
    min-width: 132px;
    padding: 0 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rename-dialog[open] {
    animation: none;
  }
}
