*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

html,
body {
  height: 100%;
}

body {
  background: var(--bg-base);
  color: var(--text-heading);
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-regular);
  line-height: 1.45;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Dark theme scrollbars (page, modals, lists, PDF preview, etc.) */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

*::-webkit-scrollbar {
  width: var(--scrollbar-size);
  height: var(--scrollbar-size);
}

*::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 999px;
  border: 2px solid var(--scrollbar-track);
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
  border: 2px solid var(--scrollbar-track);
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:active {
  background: var(--scrollbar-thumb-active);
  border: 2px solid var(--scrollbar-track);
  background-clip: padding-box;
}

*::-webkit-scrollbar-corner {
  background: var(--scrollbar-corner);
}

*::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  background: none;
  border: 0;
}

input,
select,
textarea {
  font: inherit;
  color: var(--text-heading);
  background: var(--bg-elevation-2);
  border: 1px solid var(--border-secondary);
  border-radius: var(--textfield-radius);
  padding: var(--textfield-pad-y-regular) var(--textfield-pad-x-regular);
  width: 100%;
  outline: none;
  min-height: var(--textfield-height-regular);
  font-size: var(--textfield-value-font-size);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-placeholder);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--border-brand-default);
  box-shadow: 0 0 0 3px rgba(121, 98, 213, 0.28);
}

input:disabled,
select:disabled,
textarea:disabled {
  background: var(--button-disable);
  border-color: var(--border-tertiary);
  color: var(--text-heading);
  opacity: 1;
}

textarea {
  resize: vertical;
  min-height: 54px;
}

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-body) 50%),
    linear-gradient(135deg, var(--text-body) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 28px;
}

label {
  display: block;
  font-size: var(--textfield-label-font-size);
  color: var(--text-heading);
  margin-bottom: var(--textfield-gap);
  font-weight: var(--font-weight-regular);
}

label i {
  color: var(--text-error);
  font-style: normal;
}

:focus-visible {
  outline: 2px solid var(--bg-brand);
  outline-offset: 2px;
}

a {
  color: var(--text-brand-default);
}

.spark-skeleton {
  background: linear-gradient(
    90deg,
    var(--skeleton-base) 0%,
    var(--skeleton-shine) 50%,
    var(--skeleton-base) 100%
  );
  background-size: 200% 100%;
  animation: spark-shimmer 1.2s ease-in-out infinite;
  border-radius: 8px;
}

@keyframes spark-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

@media print {
  .top,
  .tabs {
    display: none;
  }
}
