* {
  box-sizing: border-box;
  scrollbar-color: var(--line) #000;
  scrollbar-width: thin;
}

[hidden] {
  display: none !important;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #000;
}

::-webkit-scrollbar-thumb {
  background: var(--line);
  border: 2px solid #000;
  border-radius: 0px;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  --app-background-image: url(assets/liverylab_background_01.jpg);
  background: #000;
  background-image: var(--app-background-image, url(assets/background.jpg));
  background-size: cover;
  background-position: center;
}

body[data-app-background="1"] {
  --app-background-image: url(assets/liverylab_background_01.jpg);
}

body[data-app-background="2"] {
  --app-background-image: url(assets/liverylab_background_02.jpg);
}

body[data-app-background="3"] {
  --app-background-image: url(assets/liverylab_background_03.jpg);
}

body[data-app-background="4"] {
  --app-background-image: url(assets/liverylab_background_04.jpg);
}

body[data-app-background="5"] {
  --app-background-image: url(assets/liverylab_background_05.jpg);
}

.startup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 7000;
  pointer-events: none;
  background: #020407 url("assets/splash.png") center / cover no-repeat;
  opacity: 0;
  visibility: hidden;
  transition: opacity 650ms ease, visibility 650ms ease;
}

body.startup-backdrop-active .startup-backdrop {
  opacity: 1;
  visibility: visible;
}

h1,
h2,
h3,
.panel-head h1,
.panel-head h2,
.my-skin-section-title,
.overview-copy h2,
.status-modal-title {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
}

.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: transparent;
  opacity: 1;
  transition: opacity 650ms ease, visibility 650ms ease;

  .splash-fallback {
    position: absolute;
    left: 50%;
    bottom: calc(6vh + 80px);
    width: min(560px, calc(100vw - 48px));
    padding: 16px 18px 14px;
    display: grid;
    gap: 10px;
    transform: translateX(-50%);
    border: var(--border-width) solid rgba(240, 71, 63, 0.95);
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.08em;

    strong {
      font-size: clamp(32px, 5vw, 76px);
      font-style: italic;
      line-height: 1;
      text-shadow: 0 12px 32px rgba(0, 0, 0, 0.8);
    }

    span {
      color: #c8d0d8;
      font-size: clamp(12px, 1.2vw, 20px);
    }

    .splash-progress-track {
      width: 100%;
      height: 5px;
      border: var(--border-width) solid rgba(255, 255, 255, 0.38);
      background: rgba(0, 0, 0, 0.68);
      overflow: hidden;
      box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
    }

    .splash-progress-bar {
      display: block;
      width: 0%;
      height: 100%;
      background: #f0473f;
      transition: width 220ms ease;
    }

    .splash-progress-text {
      width: 100%;
      min-height: 18px;
      color: #eef3f7;
      font-size: 13px;
      line-height: 1.25;
      text-shadow: 0 8px 24px rgba(0, 0, 0, 0.9);
    }
  }

  &.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}

button,
input,
select {
  font: inherit;
}

input.path-drop-target {
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;

  &.is-drag-over {
    border-color: var(--accent-3);
    background: rgba(23, 195, 178, 0.08);
    box-shadow: 0 0 0 1px rgba(23, 195, 178, 0.35);
  }
}

button {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  text-transform: uppercase;
  border: var(--border-width) solid var(--line);
  background: #000;
  color: var(--ink);
  border-radius: 0px;
  min-height: 34px;
  padding: 0 12px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);

  &:hover {
    border-color: var(--accent-2);
    background: rgba(var(--accent-2-rgb), 0.1);
  }

  &.primary {
    background: var(--accent-2);
    border-color: var(--accent-2-border);
    color: #fff;
    font-weight: 700;

    &:hover {
      background: var(--accent-2-hover);
    }
  }

  &.danger {
    background: #a91518;
    border-color: #ff4d55;
    color: #fff;
    font-weight: 700;

    &:hover {
      background: #c51f24;
      border-color: #ff7077;
    }
  }

  &.danger-outline {
    background: #000;
    border-color: #ff4d55;
    color: #fff;

    &:hover {
      background: rgba(255, 77, 85, 0.12);
      border-color: #ff7077;
    }
  }

  &.preview {
    background: #145ea8;
    border-color: #58a8ff;
    color: #fff;
    font-weight: 700;

    &:hover {
      background: #1c74cc;
      border-color: #83c0ff;
    }
  }

  &.orange {
    background: #af4e27;
    border-color: #cc6239;
    color: #fff;
    font-weight: 700;

    &:hover {
    background: #d84e0e;
    border-color: #dd6c38;
    }
  }

  &.magenta {
    background: #b60a82;
    border-color: #cf39a2;
    color: #fff;
    font-weight: 700;

    &:hover {
    background: #ee04a8;
    border-color: #db47af;
    }
  }
  &.icon-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
  }

  &:disabled {
    cursor: not-allowed;
    opacity: 0.58;
  }

  &[aria-busy="true"],
  &.is-working {
    cursor: wait;
    opacity: 0.92;
  }

  &[aria-busy="true"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }
}

.button-icon {
  display: inline-flex;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  color: currentColor;

  svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
  }
}
