* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

:root {
  --text: #fff;
  --card-bg: rgba(0, 0, 0, 0.62);
  --card-border: rgba(255, 255, 255, 0.32);
  --soft-border: rgba(255, 255, 255, 0.28);
  --field-bg: rgba(255, 255, 255, 0.08);
  --muted-bg: rgba(255, 255, 255, 0.04);
  --accent-warm-1: #ef4d6d;
  --accent-warm-2: #f9b233;
  --accent-warm-3: #ff7e5f;
}

body {
  min-height: 100svh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #02040a;
  color: var(--text);
}

.lucide-icon {
  display: block;
}

.premium-scene {
  --storm: 0.22;
  position: fixed;
  inset: 0;
  z-index: -6;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 52% 0%, rgba(76, 115, 250, 0.22), transparent 50%),
    radial-gradient(90% 80% at 16% 8%, rgba(40, 211, 255, 0.11), transparent 58%),
    radial-gradient(80% 74% at 88% 14%, rgba(153, 91, 255, 0.12), transparent 56%),
    linear-gradient(180deg, #060c1f 0%, #040914 44%, #02030b 100%);
}

.premium-gl {
  position: absolute;
  inset: 0;
  z-index: 1;
  transform: translate3d(0, 0, 0);
}

.premium-gl canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.space-grain {
  position: absolute;
  inset: -10%;
  z-index: 3;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.16) 0 1px, transparent 2px),
    radial-gradient(circle at 48% 66%, rgba(173, 226, 255, 0.16) 0 1px, transparent 2px),
    radial-gradient(circle at 84% 34%, rgba(199, 176, 255, 0.15) 0 1px, transparent 2px),
    repeating-linear-gradient(
      11deg,
      rgba(255, 255, 255, 0.025) 0px,
      rgba(255, 255, 255, 0.025) 1px,
      transparent 3px,
      transparent 8px
    );
  background-size: 260px 260px, 280px 280px, 320px 320px, auto;
  mix-blend-mode: screen;
  opacity: 0.36;
  animation: grainDrift 8s steps(12, end) infinite;
}

.premium-vignette {
  position: absolute;
  inset: 0;
  z-index: 7;
  pointer-events: none;
  background:
    radial-gradient(110% 72% at 50% 50%, transparent 48%, rgba(0, 0, 0, 0.58) 100%),
    linear-gradient(180deg, rgba(6, 10, 22, 0.14), rgba(0, 0, 0, 0.5));
}

body.fx-frost-disabled .frost-overlay {
  opacity: 0 !important;
}

body.fx-frost-enabled .frost-overlay {
  opacity: calc(0.22 + var(--storm) * 0.44);
}

.winter-scene {
  --storm: 0;
  position: fixed;
  inset: 0;
  z-index: -6;
  overflow: hidden;
  background:
    radial-gradient(130% 90% at 50% -10%, rgba(40, 84, 152, 0.3), transparent 50%),
    radial-gradient(90% 70% at 82% 8%, rgba(56, 72, 140, 0.18), transparent 56%),
    linear-gradient(180deg, #112040 0%, #081327 42%, #050a16 70%, #020306 100%);
}

.winter-gl {
  position: absolute;
  inset: 0;
  z-index: 1;
  transform: translate3d(0, 0, 0);
}

.winter-gl canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.aurora-haze {
  position: absolute;
  inset: -12%;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(60% 30% at 20% 12%, rgba(100, 245, 190, 0.08), transparent 70%),
    radial-gradient(48% 25% at 74% 9%, rgba(99, 175, 255, 0.1), transparent 72%),
    radial-gradient(40% 24% at 52% 6%, rgba(180, 115, 255, 0.1), transparent 74%);
  mix-blend-mode: screen;
  filter: blur(28px);
  opacity: calc(0.35 + var(--storm) * 0.22);
  animation: auroraBreath 10s ease-in-out infinite alternate;
}

.moon-glow {
  position: absolute;
  width: min(34vw, 360px);
  aspect-ratio: 1;
  left: clamp(14px, 8vw, 120px);
  top: clamp(24px, 7vh, 90px);
  z-index: 3;
  pointer-events: none;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(234, 246, 255, 0.94) 0 14%, rgba(185, 214, 255, 0.44) 16%, rgba(132, 178, 238, 0.18) 35%, rgba(116, 159, 227, 0.08) 52%, rgba(60, 96, 168, 0.02) 65%, transparent 78%);
  filter: blur(0.6px);
  opacity: 0.72;
}

.frost-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  opacity: calc(0.34 + var(--storm) * 0.4);
}

.frost-overlay::before,
.frost-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
}

.frost-overlay::before {
  background:
    radial-gradient(120% 60% at 50% -8%, rgba(214, 237, 255, 0.3), transparent 65%),
    radial-gradient(120% 60% at 50% 108%, rgba(214, 237, 255, 0.26), transparent 65%),
    radial-gradient(64% 44% at -6% 50%, rgba(220, 240, 255, 0.25), transparent 70%),
    radial-gradient(64% 44% at 106% 50%, rgba(220, 240, 255, 0.25), transparent 70%);
  filter: blur(10px);
}

.frost-overlay::after {
  background-image:
    repeating-conic-gradient(
      from 0deg at 12% 8%,
      rgba(240, 250, 255, 0.22) 0deg 4deg,
      rgba(162, 208, 255, 0.08) 5deg 8deg,
      transparent 8deg 18deg
    ),
    repeating-conic-gradient(
      from 0deg at 88% 12%,
      rgba(240, 250, 255, 0.16) 0deg 4deg,
      rgba(162, 208, 255, 0.06) 5deg 8deg,
      transparent 8deg 18deg
    ),
    radial-gradient(40% 50% at 8% 88%, rgba(220, 242, 255, 0.2), transparent 80%),
    radial-gradient(40% 50% at 92% 88%, rgba(220, 242, 255, 0.2), transparent 80%);
  background-size: 260px 210px, 280px 230px, 100% 100%, 100% 100%;
  mix-blend-mode: screen;
  opacity: 0.68;
  filter: blur(0.6px);
}

.winter-vignette {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  background:
    radial-gradient(115% 75% at 50% 50%, transparent 50%, rgba(0, 0, 0, 0.55) 100%),
    linear-gradient(180deg, rgba(4, 8, 16, 0.15) 0%, rgba(0, 0, 0, 0.42) 100%);
}

@keyframes auroraBreath {
  from {
    transform: translate3d(-1.4%, -1.2%, 0) scale(1);
    opacity: calc(0.28 + var(--storm) * 0.22);
  }
  to {
    transform: translate3d(1.3%, 0.8%, 0) scale(1.04);
    opacity: calc(0.42 + var(--storm) * 0.26);
  }
}

.rain-scene {
  --rx: 0px;
  --ry: 0px;
  position: fixed;
  inset: 0;
  z-index: -6;
  overflow: hidden;
  background:
    radial-gradient(140% 110% at 52% -8%, rgba(160, 182, 224, 0.22), transparent 46%),
    radial-gradient(120% 100% at 20% 20%, rgba(40, 59, 96, 0.2), transparent 56%),
    radial-gradient(120% 100% at 84% 24%, rgba(28, 48, 82, 0.2), transparent 56%),
    linear-gradient(180deg, #0f1728 0%, #0b1020 42%, #070a13 72%, #020306 100%);
}

.rain-scene::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(110% 76% at 50% 55%, transparent 48%, rgba(0, 0, 0, 0.6) 100%),
    linear-gradient(180deg, rgba(5, 7, 14, 0.08), rgba(0, 0, 0, 0.35));
  z-index: 1;
}

.rain-scene::after {
  content: "";
  position: absolute;
  inset: -5%;
  pointer-events: none;
  background:
    radial-gradient(circle at 30% 24%, rgba(182, 216, 255, 0.14), transparent 40%),
    radial-gradient(circle at 72% 14%, rgba(148, 190, 255, 0.12), transparent 46%),
    radial-gradient(circle at 52% 76%, rgba(106, 154, 222, 0.14), transparent 48%);
  mix-blend-mode: screen;
  filter: blur(28px);
  opacity: 0.74;
  animation: glowSweep 18s ease-in-out infinite alternate;
  z-index: 2;
}

.city-blur {
  position: absolute;
  inset: -9%;
  background:
    radial-gradient(38% 70% at 50% 18%, rgba(219, 232, 255, 0.58), transparent 62%),
    linear-gradient(
      90deg,
      transparent 0%,
      transparent 8%,
      rgba(15, 22, 36, 0.72) 8%,
      rgba(15, 22, 36, 0.72) 14%,
      transparent 14%,
      transparent 18%,
      rgba(16, 30, 48, 0.74) 18%,
      rgba(16, 30, 48, 0.74) 24%,
      transparent 24%,
      transparent 33%,
      rgba(14, 27, 44, 0.74) 33%,
      rgba(14, 27, 44, 0.74) 39%,
      transparent 39%,
      transparent 46%,
      rgba(19, 36, 58, 0.76) 46%,
      rgba(19, 36, 58, 0.76) 53%,
      transparent 53%,
      transparent 65%,
      rgba(14, 30, 49, 0.72) 65%,
      rgba(14, 30, 49, 0.72) 71%,
      transparent 71%,
      transparent 78%,
      rgba(12, 24, 38, 0.7) 78%,
      rgba(12, 24, 38, 0.7) 86%,
      transparent 86%
    ),
    linear-gradient(180deg, rgba(35, 57, 96, 0.2), rgba(7, 15, 28, 0.82));
  filter: blur(14px) saturate(1.1);
  transform: translate3d(calc(var(--rx) * -0.32), calc(var(--ry) * -0.22), 0) scale(1.14);
  will-change: transform;
}

.mist-overlay {
  position: absolute;
  inset: -18%;
  background:
    radial-gradient(circle at 50% 20%, rgba(212, 226, 255, 0.19), transparent 44%),
    radial-gradient(circle at 16% 60%, rgba(66, 109, 179, 0.18), transparent 50%),
    radial-gradient(circle at 84% 62%, rgba(38, 77, 145, 0.18), transparent 52%);
  filter: blur(38px);
  transform: translate3d(calc(var(--rx) * 0.46), calc(var(--ry) * 0.34), 0) scale(1.1);
  opacity: 0.82;
  animation: mistPulse 12s ease-in-out infinite alternate;
  will-change: transform, opacity;
}

.rain-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.92;
  z-index: 3;
}

.lens-bloom {
  position: absolute;
  inset: -8%;
  pointer-events: none;
  background:
    radial-gradient(40% 24% at 50% 2%, rgba(228, 239, 255, 0.3), transparent 74%),
    radial-gradient(28% 36% at 12% 74%, rgba(99, 160, 255, 0.2), transparent 80%),
    radial-gradient(26% 30% at 88% 30%, rgba(94, 137, 246, 0.16), transparent 82%);
  mix-blend-mode: screen;
  filter: blur(22px);
  opacity: 0.65;
  transform: translate3d(calc(var(--rx) * 0.22), calc(var(--ry) * 0.18), 0);
  animation: bloomPulse 11s ease-in-out infinite alternate;
  z-index: 4;
}

.glass-noise {
  position: absolute;
  inset: -12%;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 14% 22%, rgba(255, 255, 255, 0.13) 0 1px, transparent 2px),
    radial-gradient(circle at 44% 66%, rgba(255, 255, 255, 0.12) 0 1px, transparent 2px),
    radial-gradient(circle at 78% 35%, rgba(255, 255, 255, 0.1) 0 1px, transparent 2px),
    repeating-linear-gradient(
      8deg,
      rgba(255, 255, 255, 0.03) 0px,
      rgba(255, 255, 255, 0.03) 1px,
      transparent 3px,
      transparent 7px
    );
  background-size: 280px 280px, 260px 260px, 300px 300px, auto;
  mix-blend-mode: soft-light;
  opacity: 0.4;
  transform: translate3d(calc(var(--rx) * 0.18), calc(var(--ry) * 0.15), 0);
  animation: grainDrift 6.5s steps(12, end) infinite;
  z-index: 5;
}

.film-bars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.62) 0%,
      rgba(0, 0, 0, 0.18) 8%,
      transparent 14%,
      transparent 86%,
      rgba(0, 0, 0, 0.18) 92%,
      rgba(0, 0, 0, 0.62) 100%
    );
  z-index: 6;
}

body.perf-lite .mist-overlay {
  filter: blur(22px);
  opacity: 0.64;
  animation: none;
}

body.perf-lite .lens-bloom {
  filter: blur(14px);
  opacity: 0.36;
  animation: none;
}

body.perf-lite .glass-noise {
  display: none;
}

body.perf-lite .rain-scene::after {
  filter: blur(14px);
  opacity: 0.44;
  animation: none;
}

body.perf-lite .city-blur {
  filter: blur(8px);
}

body.perf-lite .film-bars {
  opacity: 0.72;
}

body.perf-lite .rain-canvas {
  opacity: 0.84;
}

body.scroll-perf .mist-overlay,
body.scroll-perf .lens-bloom,
body.scroll-perf .rain-scene::after {
  animation: none !important;
}

body.scroll-perf .glass-noise {
  display: none;
}

body.scroll-perf .mist-overlay {
  filter: blur(14px);
  opacity: 0.42;
}

body.scroll-perf .lens-bloom {
  filter: blur(10px);
  opacity: 0.28;
}

body.scroll-perf .rain-scene::after {
  filter: blur(10px);
  opacity: 0.34;
}

body.scroll-perf .city-blur {
  filter: blur(7px) saturate(1.02);
}

@media (prefers-reduced-motion: reduce) {
  .rain-scene::after,
  .mist-overlay,
  .lens-bloom,
  .glass-noise {
    animation: none !important;
  }
}

@media (max-width: 900px) {
  .mist-overlay {
    filter: blur(26px);
    opacity: 0.72;
  }

  .lens-bloom {
    filter: blur(14px);
    opacity: 0.46;
  }

  .rain-scene::after {
    filter: blur(16px);
    opacity: 0.56;
  }

  .glass-noise {
    opacity: 0.22;
    animation-duration: 10s;
  }

  .card,
  .side-toggle-btn,
  .side-menu,
  .side-backdrop {
    backdrop-filter: none;
  }
}

@media (max-width: 640px) {
  .glass-noise {
    display: none;
  }

  .film-bars {
    opacity: 0.7;
  }
}

/* Glass Finish Theme (split page) */
body.split-tool-page {
  background: #0b1018 !important;
  color: #eef3ff !important;
}

body.split-tool-page .rain-scene {
  display: none !important;
}

body.split-tool-page .side-toggle-btn,
body.split-tool-page .side-menu,
body.split-tool-page .brand-link,
body.split-tool-page .split-card,
body.split-tool-page .split-upload-box,
body.split-tool-page .split-meta-item,
body.split-tool-page .split-option-pill span,
body.split-tool-page .split-small-btn,
body.split-tool-page .split-main-btn,
body.split-tool-page .split-thumb-card,
body.split-tool-page .split-processing-wrap,
body.split-tool-page .split-result-wrap,
body.split-tool-page .split-output-item,
body.split-tool-page .split-output-download {
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.24) !important;
  color: #eef3ff !important;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.34) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

body.split-tool-page .subtitle,
body.split-tool-page .status,
body.split-tool-page .split-meta-label,
body.split-tool-page .tick-hint,
body.split-tool-page .split-progress-percent {
  color: #c5cedf !important;
}

body.split-tool-page .split-main-btn,
body.split-tool-page .download,
body.split-tool-page .split-output-download {
  background: rgba(255, 255, 255, 0.16) !important;
}

body.split-tool-page .split-card,
body.split-tool-page .split-upload-box,
body.split-tool-page .split-meta-item,
body.split-tool-page .split-options,
body.split-tool-page .split-thumb-item,
body.split-tool-page .split-main-btn,
body.split-tool-page .split-small-btn,
body.split-tool-page .split-output-download {
  transition:
    transform var(--motion-fast) var(--motion-ease),
    box-shadow var(--motion-fast) var(--motion-ease),
    border-color var(--motion-fast) var(--motion-ease),
    background var(--motion-base) var(--motion-ease);
}

@keyframes sceneDrift {
  from {
    transform: scale(1) translate3d(-0.6%, -0.4%, 0);
  }
  to {
    transform: scale(1.06) translate3d(0.9%, 0.7%, 0);
  }
}

@keyframes glowSweep {
  from {
    transform: translate3d(-1.4%, -1.2%, 0);
    opacity: 0.58;
  }
  to {
    transform: translate3d(1.8%, 1.1%, 0);
    opacity: 0.82;
  }
}

@keyframes mistPulse {
  from {
    opacity: 0.64;
  }
  to {
    opacity: 0.82;
  }
}

@keyframes bloomPulse {
  from {
    opacity: 0.48;
    filter: blur(20px);
  }
  to {
    opacity: 0.72;
    filter: blur(28px);
  }
}

@keyframes grainDrift {
  0% {
    transform: translate3d(0, 0, 0);
  }
  25% {
    transform: translate3d(-1.2%, 0.7%, 0);
  }
  50% {
    transform: translate3d(1%, -1.1%, 0);
  }
  75% {
    transform: translate3d(-0.8%, -0.6%, 0);
  }
  100% {
    transform: translate3d(0, 0, 0);
  }
}

.container {
  width: min(620px, 100%);
  text-align: center;
  color: var(--text);
  position: relative;
  z-index: 1;
  margin: 18px 0;
  max-height: calc(100svh - 24px);
}

.topbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  position: fixed;
  top: 14px;
  right: 16px;
  z-index: 22;
  pointer-events: none;
}

.topbar .brand-link {
  pointer-events: auto;
}

.fx-panel {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.03));
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.38);
}

.fx-chip {
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(240, 247, 255, 0.84);
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  padding: 6px 9px;
  border-radius: 999px;
  min-height: auto;
  width: auto;
  flex: 0 0 auto;
}

.fx-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.34);
}

.fx-chip.active {
  border-color: rgba(160, 216, 255, 0.56);
  background: linear-gradient(135deg, rgba(72, 176, 255, 0.34), rgba(134, 93, 255, 0.3));
  color: #f3f8ff;
  box-shadow: 0 0 22px rgba(79, 170, 255, 0.32);
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #f4f8ff;
  padding: 7px 14px 7px 8px;
  border-radius: 999px;
  border: 1px solid rgba(224, 241, 255, 0.3);
  background: linear-gradient(120deg, rgba(20, 34, 56, 0.8), rgba(15, 27, 44, 0.55));
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.brand-link:hover {
  transform: translateY(-1px);
  border-color: rgba(235, 246, 255, 0.5);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.34);
}

.brand-icon {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(160deg, #2cc9ff 0%, #3473ff 56%, #194dd7 100%);
  color: #eef9ff;
  font-weight: 800;
  font-size: 21px;
  display: grid;
  place-items: center;
  position: relative;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.24),
    0 6px 14px rgba(8, 20, 46, 0.38);
  text-shadow: 0 1px 3px rgba(2, 10, 22, 0.4);
}

.brand-icon::before {
  content: none;
}

.brand-word {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
}

.brand-word strong {
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand-word em {
  font-style: normal;
  font-size: 1.18rem;
  font-weight: 400;
  opacity: 0.9;
}

.theme-toggle.moon .sun-icon {
  display: none;
}

.theme-toggle.moon .moon-icon {
  display: inline;
}

.hero {
  animation: heroRise 0.9s ease both;
}

h1 {
  font-size: clamp(1.9rem, 5vw, 2.9rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.subtitle {
  margin-top: 10px;
  opacity: 0.85;
  font-weight: 300;
}

.card {
  position: relative;
  margin-top: 30px;
  padding: 28px;
  border-radius: 22px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12) inset,
    0 26px 60px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  max-height: min(76svh, 880px);
  overflow-y: auto;
}

.success-burst {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  opacity: 0;
}

.card.success-pop .success-burst {
  animation: successPulse 0.9s ease;
}

.card.file-selected {
  animation: selectedPulse 1.1s ease;
}

@keyframes selectedPulse {
  0% {
    transform: scale(1);
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.12) inset,
      0 26px 60px rgba(0, 0, 0, 0.6);
  }
  45% {
    transform: scale(1.02);
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.12) inset,
      0 0 48px rgba(255, 255, 255, 0.5),
      0 22px 50px rgba(0, 0, 0, 0.75);
  }
  100% {
    transform: scale(1);
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.12) inset,
      0 26px 60px rgba(0, 0, 0, 0.6);
  }
}

.upload-box {
  display: block;
  border: 2px dashed var(--soft-border);
  padding: 34px 20px;
  border-radius: 15px;
  cursor: pointer;
  transition: 0.3s;
  background: var(--field-bg);
}

.upload-box input {
  display: none;
}

.upload-glyph {
  width: 52px;
  height: 52px;
  margin: 0 auto 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.upload-glyph .lucide-icon {
  width: 22px;
  height: 22px;
  stroke-width: 2.2;
}

.upload-box:hover {
  border-color: var(--text);
  background: rgba(255, 255, 255, 0.12);
}

.upload-box.dragover {
  border-color: var(--text);
  background: rgba(255, 255, 255, 0.16);
  animation: dropzoneBlast 0.7s ease;
}

@keyframes dropzoneBlast {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(255, 255, 255, 0);
  }
  35% {
    transform: scale(1.03);
    box-shadow: 0 0 40px rgba(255, 255, 255, 0.75);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(255, 255, 255, 0);
  }
}

#fileInfo {
  font-weight: 500;
}

.camera-block {
  margin-top: 16px;
  text-align: left;
}

.camera-panel {
  margin-top: 10px;
  border: 1px solid var(--soft-border);
  border-radius: 12px;
  padding: 10px;
  background: var(--muted-bg);
  animation: panelReveal 0.35s ease;
  display: grid;
  gap: 12px;
}

@keyframes panelReveal {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.scan-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.scan-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.scan-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 12px;
  font-weight: 600;
}

.scan-count {
  opacity: 0.85;
}

.scan-toolbar-actions {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.scan-mini-btn {
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  padding: 7px 11px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.scan-mini-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.scan-mini-btn.active {
  background: rgba(80, 220, 170, 0.2);
  border-color: rgba(110, 250, 190, 0.68);
}

.scan-mini-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.scan-stage {
  display: grid;
  gap: 10px;
}

.scan-live-wrap,
.scan-source-wrap,
.scan-preview-wrap {
  position: relative;
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: #080a0f;
  overflow: hidden;
}

.scan-live-wrap {
  min-height: 200px;
}

.scan-live-wrap video,
#scanSourceCanvas,
#scanEditOverlay,
#scanPreviewCanvas {
  width: 100%;
  display: block;
}

.scan-live-wrap video {
  max-height: 360px;
  object-fit: contain;
  background: #020202;
}

.camera-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.scan-hint {
  font-size: 0.88rem;
  opacity: 0.82;
}

.scan-hint strong {
  color: #ffffff;
}

.scan-queue-panel {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  padding: 10px;
  display: grid;
  gap: 8px;
}

.scan-queue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  opacity: 0.9;
}

.scan-queue-meta {
  font-weight: 600;
}

.scan-queue-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.scan-queue-list::-webkit-scrollbar {
  height: 6px;
}

.scan-queue-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
}

.scan-queue-empty {
  font-size: 12px;
  opacity: 0.8;
  padding: 4px 0;
}

.scan-queue-item {
  flex: 0 0 auto;
  width: 84px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.38);
  overflow: hidden;
  display: grid;
  gap: 4px;
  padding-bottom: 6px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.scan-queue-item img {
  width: 100%;
  height: 58px;
  object-fit: cover;
  display: block;
}

.scan-queue-item span {
  font-size: 11px;
  text-align: center;
  opacity: 0.88;
}

.scan-queue-item.is-editing {
  border-color: rgba(255, 255, 255, 0.75);
  transform: translateY(-1px);
}

.scan-edit-progress {
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  width: fit-content;
  padding: 4px 10px;
  font-size: 12px;
  opacity: 0.95;
}

.scan-source-wrap {
  max-height: 56vh;
}

.scan-source-wrap.rotation-anim {
  animation: rotatePulse 0.26s ease;
}

@keyframes rotatePulse {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(0.985);
  }
  100% {
    transform: scale(1);
  }
}

#scanSourceCanvas {
  background: #0b0d12;
}

#scanEditOverlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.scan-handles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.scan-corner {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  background: rgba(0, 0, 0, 0.92);
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.28);
}

.scan-corner:active {
  cursor: grabbing;
  transform: translate(-50%, -50%) scale(1.08);
}

.scan-control-grid {
  display: grid;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
}

.scan-mode-toggle {
  width: fit-content;
}

.scan-mode-hint {
  margin: -2px 0 0 34px;
  font-size: 12px;
  opacity: 0.82;
}

.scan-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.scan-rotate-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.scan-rotate-toolbar .scan-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.scan-filter-btn {
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s ease;
}

.scan-filter-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.scan-filter-btn.active {
  border-color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.2);
}

.scan-sliders {
  display: grid;
  gap: 8px;
}

.scan-sliders label {
  font-size: 0.83rem;
  display: grid;
  gap: 5px;
}

.scan-sliders input[type="range"] {
  width: 100%;
}

.scan-preview-wrap {
  max-height: 56vh;
  overflow: auto;
  background: #ffffff;
}

#scanPreviewCanvas {
  transform-origin: 0 0;
}

.scan-zoom {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
}

.scan-zoom input[type="range"] {
  width: min(260px, 58vw);
}

.scan-processing {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  padding: 6px 12px;
  font-size: 12px;
  width: fit-content;
}

.scan-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  animation: scanSpin 0.8s linear infinite;
}

@keyframes scanSpin {
  to {
    transform: rotate(360deg);
  }
}

.camera-actions {
  margin-top: 2px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.size-section {
  margin-top: 22px;
  text-align: left;
}

.max-compression {
  margin-top: 14px;
}

.tick-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.tick-toggle input {
  display: none;
}

.tick-box {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.65);
  border-radius: 6px;
  position: relative;
  transition: all 0.22s ease;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.6);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0));
}

.tick-box::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 7px;
  width: 7px;
  height: 12px;
  border: solid #0f0;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.18s ease;
}

.tick-toggle input:checked + .tick-box {
  background: linear-gradient(135deg, #ff5f6d, #ffc371);
  border-color: transparent;
  box-shadow: 0 0 12px 3px rgba(255, 95, 109, 0.35);
  animation: tickPulse 0.5s ease;
}

.tick-toggle input:checked + .tick-box::after {
  transform: rotate(45deg) scale(1);
}

.tick-label {
  font-weight: 600;
}

.tick-hint {
  margin: 6px 0 0 34px;
  font-size: 12px;
  opacity: 0.75;
}

.light-mode .tick-box {
  border-color: rgba(0, 0, 0, 0.7);
}

.light-mode .tick-toggle input:checked + .tick-box {
  box-shadow: 0 0 12px 3px rgba(255, 95, 109, 0.35);
}

@keyframes tickPulse {
  0% {
    transform: scale(0.96);
    box-shadow: 0 0 0 0 rgba(255, 95, 109, 0.35);
  }
  55% {
    transform: scale(1.05);
    box-shadow: 0 0 16px 4px rgba(255, 95, 109, 0.3);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 12px 3px rgba(255, 95, 109, 0.35);
  }
}

.size-input {
  display: flex;
  margin-top: 10px;
}

.size-input input,
.size-input select {
  border: 1px solid rgba(255, 255, 255, 0.5);
  padding: 10px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  min-width: 0;
}

.size-input input:focus,
.size-input select:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4);
}

.size-input input {
  flex: 1;
  border-right: 0;
  border-radius: 10px 0 0 10px;
}

.size-input select {
  border-radius: 0 10px 10px 0;
}

.buttons {
  margin-top: 26px;
  display: flex;
  gap: 14px;
}

.preview-controls {
  margin-top: 10px;
  display: flex;
  justify-content: flex-start;
}

.preview-toggle {
  flex: 0 0 auto;
  min-height: auto;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.82rem;
}

.preview-wrap {
  margin-top: 12px;
  border: 1px solid var(--soft-border);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid var(--soft-border);
  font-size: 0.86rem;
}

.preview-close {
  flex: 0 0 auto;
  min-height: auto;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.08);
}

#previewFrame {
  width: 100%;
  height: 380px;
  border: 0;
  background: #fff;
}

.loading-wrap {
  margin-top: 14px;
  padding: 10px 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--soft-border);
  background: var(--muted-bg);
}

.loading-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  opacity: 0.95;
}

.loading-track {
  margin-top: 8px;
  width: 100%;
  height: 18px;
  border-radius: 10px;
  overflow: hidden;
  background: #f2f2f2;
  border: 1px solid rgba(255, 255, 255, 0.55);
  position: relative;
}

.loading-bar {
  height: 100%;
  width: 0%;
  border-radius: 10px 0 0 10px;
  background: linear-gradient(90deg, #ab002b, #e00043, #ab002b);
  background-size: 180% 100%;
  box-shadow: 0 0 12px rgba(224, 0, 67, 0.4);
  transition: width 0.25s ease;
  animation: loadingStripe 1.2s linear infinite;
}

.loading-head {
  position: absolute;
  top: -18px;
  left: 0%;
  width: 20px;
  height: 20px;
  transform: translateX(-50%);
  transition: left 0.25s ease;
}

.loading-head::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d50042;
}

.loading-head::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 6px;
  width: 16px;
  height: 12px;
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
  background: #d50042;
  filter: drop-shadow(0 2px 4px rgba(224, 0, 67, 0.55));
}

.loading-end {
  position: absolute;
  top: -16px;
  right: -2px;
  width: 24px;
  height: 16px;
}

.loading-end::before {
  content: "";
  position: absolute;
  right: 10px;
  top: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
}

.loading-end::after {
  content: "";
  position: absolute;
  right: 0;
  top: 6px;
  width: 24px;
  height: 9px;
  border-radius: 4px;
  background:
    linear-gradient(#fff, #fff) right 0 top 0 / 12px 2px no-repeat,
    linear-gradient(#fff, #fff) right 5px top 2px / 7px 7px no-repeat,
    linear-gradient(#fff, #fff) right 14px top 2px / 5px 7px no-repeat,
    linear-gradient(#fff, #fff) right 20px top 2px / 2px 7px no-repeat;
  opacity: 0.95;
}

.loading-caption {
  margin-top: 8px;
  font-size: 0.76rem;
  color: #ff3867;
  letter-spacing: 0.02em;
  text-align: center;
}

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

button,
.download {
  flex: 1;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--soft-border);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
  color: var(--text);
  text-align: center;
  text-decoration: none;
  background: #111;
}

.btn-with-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  stroke-width: 2.15;
}

.mini-icon {
  width: 16px;
  height: 16px;
}

.btn-text {
  line-height: 1.1;
}

.convert {
  position: relative;
  overflow: hidden;
  background: linear-gradient(120deg, #ffffff, #d9d9d9, #ffffff);
  background-size: 220% 220%;
  color: #000;
  animation: convertFlow 2.3s ease-in-out infinite;
}

.convert::before {
  content: "";
  position: absolute;
  inset: -40% -80%;
  background: linear-gradient(
    110deg,
    transparent 35%,
    rgba(255, 255, 255, 0.95) 50%,
    transparent 65%
  );
  transform: translateX(-120%) skewX(-20deg);
  animation: convertShine 2.2s linear infinite;
}

.download {
  background: linear-gradient(120deg, #2b2b2b, #000);
  color: #fff;
}

#openCameraBtn {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(240, 249, 255, 0.55);
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.06) 42%, rgba(255, 255, 255, 0.12) 100%),
    linear-gradient(140deg, rgba(106, 195, 255, 0.26), rgba(255, 226, 161, 0.16));
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 12px 28px rgba(11, 22, 43, 0.42),
    0 0 22px rgba(115, 192, 255, 0.18);
}

#openCameraBtn::before {
  content: "";
  position: absolute;
  inset: -2px;
  background: linear-gradient(
    105deg,
    transparent 18%,
    rgba(255, 255, 255, 0.45) 48%,
    transparent 78%
  );
  transform: translateX(-130%);
  animation: cameraGlassSweep 2.8s ease-in-out infinite;
  pointer-events: none;
}

#openCameraBtn .btn-icon {
  width: 20px;
  height: 20px;
  padding: 6px;
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.14));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 6px 14px rgba(8, 19, 38, 0.35);
}

#openCameraBtn:hover {
  border-color: rgba(255, 255, 255, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 16px 34px rgba(8, 18, 36, 0.5),
    0 0 30px rgba(122, 199, 255, 0.3);
}

@keyframes cameraGlassSweep {
  0% {
    transform: translateX(-130%);
  }
  70%,
  100% {
    transform: translateX(130%);
  }
}

.download.pending {
  pointer-events: none;
  opacity: 0.6;
}

button:hover,
.download:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 10px 24px rgba(255, 255, 255, 0.25);
}

button:active,
.download:active {
  transform: scale(0.98);
}

button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

button[disabled]:hover {
  transform: none;
  box-shadow: none;
}

button.convert[disabled] {
  animation: none;
}

button.convert[disabled]::before {
  display: none;
}

.light-mode .convert {
  background: linear-gradient(135deg, var(--accent-warm-1), var(--accent-warm-2));
  color: #fff;
  box-shadow: 0 10px 24px rgba(249, 178, 51, 0.35);
}

.light-mode .convert::before {
  background: linear-gradient(
    110deg,
    transparent 35%,
    rgba(255, 255, 255, 0.9) 50%,
    transparent 65%
  );
}

.light-mode .download {
  background: linear-gradient(120deg, #f3f3f3, #e5e5e5);
  color: #0f0f0f;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

@keyframes convertFlow {
  0% {
    background-position: 0% 50%;
    box-shadow: 0 0 0 rgba(255, 255, 255, 0.2);
  }
  50% {
    background-position: 100% 50%;
    box-shadow: 0 0 22px rgba(255, 255, 255, 0.35);
  }
  100% {
    background-position: 0% 50%;
    box-shadow: 0 0 0 rgba(255, 255, 255, 0.2);
  }
}

@keyframes convertShine {
  0% {
    transform: translateX(-120%) skewX(-20deg);
  }
  100% {
    transform: translateX(120%) skewX(-20deg);
  }
}

.status {
  margin-top: 14px;
  font-size: 0.92rem;
  color: var(--text);
  opacity: 0.95;
  text-align: left;
  min-height: 1.4em;
}

.hidden {
  display: none;
}


@keyframes heroRise {
  from {
    transform: translateY(14px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes successPulse {
  0% {
    opacity: 0;
  }
  30% {
    opacity: 1;
    box-shadow:
      0 0 0 2px rgba(255, 255, 255, 0.8) inset,
      0 0 40px rgba(255, 255, 255, 0.55);
  }
  100% {
    opacity: 0;
  }
}

@media (max-width: 860px) {
  .fx-panel {
    max-width: calc(100vw - 92px);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .fx-panel::-webkit-scrollbar {
    height: 0;
  }

  .fx-chip {
    font-size: 0.64rem;
    padding: 6px 8px;
  }

  .moon-glow {
    width: min(48vw, 290px);
    top: 18px;
    left: 14px;
    opacity: 0.62;
  }

  .frost-overlay {
    opacity: calc(0.26 + var(--storm) * 0.34);
  }

  body {
    align-items: flex-start;
    padding: 18px;
  }

  .container {
    width: min(700px, 100%);
    margin: 0 auto;
    max-height: none;
  }

  .card {
    max-height: none;
    overflow-y: visible;
  }
}

@media (max-width: 540px) {
  .topbar {
    gap: 8px;
  }

  .fx-panel {
    gap: 4px;
    padding: 4px;
  }

  .fx-chip {
    font-size: 0.6rem;
    padding: 5px 7px;
  }

  .aurora-haze {
    filter: blur(20px);
  }

  .moon-glow {
    width: min(56vw, 220px);
    top: 10px;
    left: 8px;
    opacity: 0.55;
  }

  .frost-overlay {
    opacity: calc(0.2 + var(--storm) * 0.28);
  }

  .size-input {
    flex-direction: column;
    gap: 8px;
  }

  .size-input input,
  .size-input select {
    width: 100%;
    border-radius: 10px;
  }

  body {
    padding: 12px;
  }

  h1 {
    font-size: clamp(1.45rem, 8vw, 2rem);
    letter-spacing: 0.01em;
  }

  .subtitle {
    font-size: 0.9rem;
  }

  .card {
    margin-top: 18px;
    padding: 16px;
    border-radius: 16px;
    max-height: none;
    overflow-y: visible;
  }

  .upload-box {
    padding: 22px 14px;
  }

  .size-section {
    margin-top: 16px;
  }

  .size-input input,
  .size-input select {
    min-height: 44px;
    font-size: 16px;
  }

  .camera-panel {
    padding: 10px;
  }

  .scan-live-wrap {
    min-height: 52svh;
  }

  .scan-live-wrap video {
    max-height: 58svh;
  }

  .scan-hint {
    font-size: 0.93rem;
  }

  .scan-toolbar {
    align-items: flex-start;
  }

  .scan-toolbar-actions {
    width: 100%;
  }

  .scan-filter-row {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }

  .scan-rotate-toolbar {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }

  .buttons {
    flex-direction: column;
    gap: 10px;
  }

  .camera-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    position: sticky;
    bottom: 6px;
    z-index: 6;
    padding: 8px;
    border-radius: 14px;
    background: rgba(6, 11, 20, 0.84);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  #captureBtn {
    grid-column: 1 / -1;
    min-height: 62px;
    border-radius: 18px;
    font-size: 1.06rem;
    font-weight: 700;
    box-shadow: 0 12px 30px rgba(20, 112, 255, 0.32);
  }

  #captureBtn .btn-icon {
    width: 22px;
    height: 22px;
  }

  #previewFrame {
    height: 300px;
  }

  button,
  .download {
    width: 100%;
    min-height: 46px;
    font-size: 0.98rem;
  }
}

/* Landscape phones / short-height screens */
@media (max-height: 560px) and (orientation: landscape) {
  body {
    align-items: flex-start;
    padding: 8px 14px;
  }

  .container {
    width: min(900px, 100%);
    margin: 0 auto;
  }

  h1 {
    font-size: clamp(1.15rem, 3.2vw, 1.5rem);
  }

  .subtitle {
    margin-top: 6px;
    font-size: 0.8rem;
  }

  .card {
    margin-top: 10px;
    padding: 12px;
    max-height: calc(100svh - 84px);
    overflow-y: auto;
  }

  .upload-box {
    padding: 14px 12px;
  }

  .size-section {
    margin-top: 10px;
  }

  .buttons {
    margin-top: 14px;
  }

  .scan-live-wrap video {
    max-height: 130px;
  }
}

.info-section {
  margin-top: 26px;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid var(--soft-border);
  background: var(--muted-bg);
  text-align: left;
}

.info-section h2 {
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.faq-list {
  list-style: disc;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  font-size: 0.95rem;
}

.faq-list strong {
  color: var(--text);
}

.contact-copy {
  margin: 6px 0 12px;
  opacity: 0.9;
}

.contact-card {
  display: block;
  border-radius: 14px;
  padding: 16px;
  border: 1px solid var(--soft-border);
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  color: var(--text);
  text-decoration: none;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.contact-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.5);
}

.contact-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.contact-pill {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

.contact-cta {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.contact-arrow {
  font-size: 1.1rem;
}

body.side-menu-open {
  overflow: hidden;
}

.side-toggle-btn {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 25;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 1px solid rgba(197, 227, 255, 0.5);
  background: linear-gradient(145deg, rgba(12, 21, 35, 0.88), rgba(8, 13, 22, 0.7));
  backdrop-filter: blur(11px);
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 0;
  cursor: pointer;
  transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
  box-shadow: 0 12px 26px rgba(1, 6, 16, 0.56);
  overflow: hidden;
}

.side-toggle-btn::before {
  content: "";
  position: absolute;
  inset: -1px;
  background: conic-gradient(
    from 0deg,
    rgba(87, 180, 255, 0.2),
    rgba(148, 223, 255, 0.45),
    rgba(255, 219, 122, 0.22),
    rgba(87, 180, 255, 0.2)
  );
  opacity: 0;
  transition: opacity 0.25s ease;
}

.side-toggle-btn:hover {
  transform: translateY(-1px) scale(1.02);
  border-color: rgba(213, 236, 255, 0.78);
  box-shadow: 0 14px 30px rgba(2, 9, 24, 0.62), 0 0 26px rgba(106, 177, 255, 0.22);
}

.side-toggle-btn:hover::before {
  opacity: 1;
}

.menu-line {
  display: block;
  width: 19px;
  height: 2px;
  border-radius: 2px;
  background: rgba(236, 245, 255, 0.94);
  z-index: 1;
  transition: transform 0.24s ease, width 0.24s ease;
}

.menu-line:nth-child(2) {
  width: 14px;
}

.menu-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 215, 115, 0.95);
  box-shadow: 0 0 10px rgba(255, 217, 123, 0.72);
  z-index: 1;
  transition: transform 0.24s ease, box-shadow 0.24s ease;
}

.side-toggle-btn:hover .menu-line:nth-child(1) {
  transform: translateX(1px);
}

.side-toggle-btn:hover .menu-line:nth-child(2) {
  width: 17px;
}

.side-toggle-btn:hover .menu-dot {
  transform: scale(1.22);
  box-shadow: 0 0 14px rgba(255, 216, 119, 0.9);
}

.side-menu {
  position: fixed;
  top: 0;
  left: 0;
  height: 100dvh;
  width: min(320px, 86vw);
  z-index: 30;
  padding: 20px 16px;
  background:
    linear-gradient(160deg, rgba(10, 18, 32, 0.92), rgba(5, 8, 15, 0.95)),
    radial-gradient(circle at 0% 0%, rgba(99, 176, 255, 0.22), transparent 42%),
    radial-gradient(circle at 100% 26%, rgba(255, 223, 145, 0.1), transparent 46%);
  border-right: 1px solid rgba(186, 220, 255, 0.32);
  transform: translateX(calc(-100% - 12px));
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
  box-shadow: 20px 0 54px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  isolation: isolate;
}

.side-menu::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(130deg, transparent 0%, rgba(255, 255, 255, 0.09) 40%, transparent 70%),
    radial-gradient(circle at 20% 12%, rgba(126, 196, 255, 0.2), transparent 42%);
  mix-blend-mode: screen;
  opacity: 0.56;
  transform: translateX(-12%);
  animation: sideSheen 6s ease-in-out infinite;
  pointer-events: none;
  z-index: -1;
}

.side-menu::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -52px;
  bottom: -72px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(88, 160, 255, 0.22), transparent 70%);
  filter: blur(8px);
  animation: sideOrbFloat 7s ease-in-out infinite;
  pointer-events: none;
  z-index: -1;
}

.side-menu.open {
  transform: translateX(0);
}

.side-menu-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(209, 229, 255, 0.26);
}

.side-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #f4f8ff;
  padding: 5px 10px 5px 6px;
  border-radius: 999px;
  border: 1px solid rgba(217, 236, 255, 0.28);
  background: linear-gradient(130deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  transition: transform 0.2s ease, opacity 0.2s ease, border-color 0.2s ease;
}

.side-logo:hover {
  transform: translateX(1px);
  opacity: 1;
  border-color: rgba(226, 242, 255, 0.42);
}

.side-logo-word {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  line-height: 1;
}

.side-logo-word strong {
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.side-logo-word em {
  font-style: normal;
  font-size: 1.08rem;
  font-weight: 400;
  opacity: 0.9;
}

.side-logo-orb {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background:
    linear-gradient(165deg, #13ccff 0%, #2575fc 52%, #0f4de1 100%);
  border: 1px solid rgba(225, 241, 255, 0.35);
  box-shadow: 0 6px 12px rgba(23, 52, 112, 0.4);
  position: relative;
  animation: none;
}

.side-logo-orb::before {
  content: "N";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 16px;
  color: rgba(236, 248, 255, 0.95);
  text-shadow: 0 1px 3px rgba(2, 8, 19, 0.48);
}

.side-logo-orb::after {
  content: none;
}

.side-close-btn {
  position: relative;
  flex: 0 0 auto;
  min-height: auto;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(215, 234, 255, 0.35);
  padding: 0;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(140, 176, 222, 0.08));
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.side-close-btn span {
  position: absolute;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: rgba(241, 248, 255, 0.95);
}

.side-close-btn span:nth-child(1) {
  transform: rotate(45deg);
}

.side-close-btn span:nth-child(2) {
  transform: rotate(-45deg);
}

.side-close-btn:hover {
  transform: scale(1.04);
  border-color: rgba(236, 246, 255, 0.72);
}

.side-nav {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 12px;
  border-radius: 14px;
  text-decoration: none;
  color: rgba(238, 247, 255, 0.95);
  background: linear-gradient(130deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(196, 223, 255, 0.2);
  transition:
    transform 0.24s ease,
    background 0.24s ease,
    border-color 0.24s ease,
    box-shadow 0.24s ease;
  position: relative;
  overflow: hidden;
}

.side-link::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.12) 45%, transparent 80%);
  transform: translateX(-120%);
  transition: transform 0.5s ease;
}

.side-link:hover {
  transform: translateY(-1px) translateX(2px);
  background: linear-gradient(130deg, rgba(117, 188, 255, 0.2), rgba(255, 221, 133, 0.08));
  border-color: rgba(211, 233, 255, 0.62);
  box-shadow: 0 10px 20px rgba(2, 8, 20, 0.42);
}

.side-link:hover::before {
  transform: translateX(120%);
}

.side-link.active {
  background: linear-gradient(130deg, rgba(95, 177, 255, 0.34), rgba(255, 218, 125, 0.2));
  border-color: rgba(220, 237, 255, 0.7);
  box-shadow: 0 12px 24px rgba(2, 10, 24, 0.44), 0 0 20px rgba(122, 191, 255, 0.24);
}

.side-link-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.18), rgba(148, 198, 255, 0.07));
  border: 1px solid rgba(215, 235, 255, 0.3);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  flex: 0 0 auto;
}

.side-link-icon svg {
  width: 18px;
  height: 18px;
}

.side-link-icon .lucide-icon {
  width: 18px;
  height: 18px;
  stroke-width: 2.05;
}

.side-link-icon svg path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linejoin: round;
}

.side-link-text {
  flex: 1;
  white-space: normal;
  line-height: 1.2;
  font-size: 0.95rem;
}

.side-link-arrow {
  opacity: 0.76;
  transition: transform 0.2s ease;
}

.side-link:hover .side-link-arrow {
  transform: translateX(2px);
}

.side-settings {
  margin-top: 14px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(205, 228, 255, 0.25);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
}

.side-settings-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.94rem;
  letter-spacing: 0.01em;
  margin-bottom: 10px;
}

.side-setting-group + .side-setting-group {
  margin-top: 10px;
}

.side-setting-label {
  display: block;
  font-size: 0.78rem;
  opacity: 0.86;
  margin-bottom: 6px;
}

.theme-pills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.theme-pill {
  min-height: auto;
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(205, 228, 255, 0.28);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(240, 247, 255, 0.95);
  font-size: 0.76rem;
  padding: 8px 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-shadow: none;
  transform: none;
}

.theme-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(4, 9, 20, 0.32);
}

.theme-pill.active {
  border-color: rgba(226, 241, 255, 0.8);
  background: linear-gradient(120deg, rgba(95, 181, 255, 0.36), rgba(255, 215, 117, 0.2));
}

.side-select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(205, 228, 255, 0.3);
  padding: 8px 9px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(241, 247, 255, 0.95);
  outline: none;
}

.side-select:focus {
  border-color: rgba(229, 242, 255, 0.72);
  box-shadow: 0 0 0 2px rgba(115, 190, 255, 0.25);
}

.side-foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(194, 219, 246, 0.22);
  font-size: 0.92rem;
  opacity: 0.8;
  letter-spacing: 0.01em;
}

.side-backdrop {
  position: fixed;
  inset: 0;
  z-index: 24;
  background: radial-gradient(circle at 12% 20%, rgba(80, 130, 200, 0.1), rgba(0, 0, 0, 0.62));
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.side-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

@keyframes sidePulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 16px rgba(122, 193, 255, 0.35);
  }
  50% {
    transform: scale(1.06);
    box-shadow: 0 0 24px rgba(152, 210, 255, 0.52);
  }
}

@keyframes sideSheen {
  0% {
    transform: translateX(-20%);
  }
  50% {
    transform: translateX(4%);
  }
  100% {
    transform: translateX(-20%);
  }
}

@keyframes sideOrbFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

.split-card {
  display: grid;
  gap: 12px;
}

.split-mode-select {
  width: 100%;
  border-radius: 10px;
}

.custom-range-wrap {
  margin-top: 12px;
}

.custom-range-input {
  width: 100%;
  margin-top: 8px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 10px;
  padding: 10px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.custom-range-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.36);
}

@media (max-width: 640px) {
  .topbar {
    top: 10px;
    right: 10px;
  }

  .side-toggle-btn {
    top: 12px;
    left: 12px;
    width: 40px;
    height: 40px;
  }

  .brand-link {
    padding: 5px 7px;
    gap: 10px;
  }

  .brand-icon {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .brand-word strong,
  .brand-word em {
    font-size: 1.04rem;
  }

  .side-logo-word strong,
  .side-logo-word em {
    font-size: 0.98rem;
  }

  .theme-pills {
    grid-template-columns: 1fr;
  }
}

body.light-mode {
  color: #1a2333;
  background: #ecf2f8;
}

body.light-mode .rain-scene {
  filter: saturate(0.65) brightness(1.28);
}

body.light-mode .card,
body.light-mode .info-section,
body.light-mode .contact-card,
body.light-mode .split-options,
body.light-mode .split-meta-item,
body.light-mode .split-thumb-grid,
body.light-mode .split-result-wrap,
body.light-mode .split-processing-wrap {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(16, 40, 72, 0.16);
  color: #142034;
}

body.light-mode .upload-box,
body.light-mode .split-upload-box,
body.light-mode .split-thumb-item {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(16, 40, 72, 0.2);
  color: #142034;
}

body.light-mode .subtitle,
body.light-mode .status,
body.light-mode .tick-hint,
body.light-mode .split-meta-label,
body.light-mode .split-thumb-page {
  color: rgba(20, 32, 52, 0.8);
}

body.light-mode .side-menu {
  background:
    linear-gradient(160deg, rgba(244, 248, 255, 0.96), rgba(230, 238, 250, 0.96)),
    radial-gradient(circle at 0% 0%, rgba(89, 168, 255, 0.18), transparent 44%),
    radial-gradient(circle at 100% 26%, rgba(255, 208, 120, 0.16), transparent 48%);
  border-right-color: rgba(73, 113, 166, 0.22);
  color: #142034;
}

body.light-mode .side-logo,
body.light-mode .side-link,
body.light-mode .side-foot,
body.light-mode .side-settings-title,
body.light-mode .side-setting-label {
  color: #142034;
}

body.light-mode .side-link,
body.light-mode .side-settings,
body.light-mode .side-select,
body.light-mode .theme-pill {
  border-color: rgba(72, 111, 163, 0.24);
  background: rgba(255, 255, 255, 0.74);
}

body.light-mode .theme-pill.active {
  border-color: rgba(65, 108, 164, 0.55);
  background: linear-gradient(120deg, rgba(87, 172, 255, 0.25), rgba(255, 206, 112, 0.32));
}

.split-tool-page .container.split-page-container {
  width: min(980px, 100%);
}

.split-tool-page .hero {
  margin-left: 20px;
  margin-right: 20px;
}

.split-upload-box {
  text-align: center;
}

.split-upload-icon {
  position: relative;
  width: 52px;
  height: 52px;
  margin: 0 auto 10px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  animation: splitIconPulse 1.8s ease-in-out infinite;
}

.split-upload-icon .lucide-icon {
  width: 24px;
  height: 24px;
  stroke-width: 2.2;
}

@keyframes splitIconPulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(255, 255, 255, 0);
  }
  50% {
    transform: scale(1.06);
    box-shadow: 0 0 18px rgba(255, 255, 255, 0.35);
  }
}

.split-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.split-meta-item {
  border: 1px solid var(--soft-border);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.06);
}

.split-meta-label {
  display: block;
  font-size: 0.75rem;
  opacity: 0.78;
}

.split-meta-value {
  display: block;
  margin-top: 4px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.split-options {
  border: 1px solid var(--soft-border);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
}

.split-option-title {
  font-weight: 600;
  margin-bottom: 10px;
}

.split-option-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.split-option-pill {
  position: relative;
  cursor: pointer;
}

.split-option-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.split-option-pill span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.84rem;
  transition: all 0.2s ease;
}

.split-option-pill input:checked + span {
  background: linear-gradient(120deg, rgba(77, 171, 255, 0.4), rgba(255, 212, 107, 0.26));
  border-color: rgba(199, 225, 255, 0.66);
}

.split-range-wrap {
  margin-top: 12px;
}

.split-page-tools {
  display: flex;
  gap: 10px;
}

.split-small-btn {
  flex: 0 0 auto;
  min-height: auto;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.82rem;
}

.split-thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 12px;
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--soft-border);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.split-thumb-item {
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.04);
  display: grid;
  gap: 6px;
  cursor: pointer;
}

.split-thumb-item input {
  justify-self: end;
}

.split-thumb-canvas-wrap {
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
  min-height: 108px;
  display: grid;
  place-items: center;
}

.split-thumb-canvas-wrap canvas {
  width: 100%;
  height: auto;
  display: block;
}

.split-thumb-page {
  font-size: 0.78rem;
  text-align: center;
  opacity: 0.88;
}

.split-processing-wrap {
  border: 1px solid var(--soft-border);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.06);
}

.split-processing-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.split-spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.split-progress-track {
  margin-top: 8px;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.16);
}

.split-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #37b6ff, #ffd272);
  transition: width 0.2s ease;
}

.split-progress-percent {
  margin-top: 8px;
  font-size: 0.8rem;
  text-align: right;
  opacity: 0.84;
}

.split-buttons {
  align-items: stretch;
}

.split-main-btn {
  min-height: 48px;
  font-size: 1rem;
}

.split-result-wrap {
  border: 1px solid var(--soft-border);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.06);
}

.split-success-msg {
  color: #bcffd2;
  font-weight: 600;
}

.split-output-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.split-output-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.split-output-name {
  font-size: 0.84rem;
  overflow-wrap: anywhere;
}

.split-output-download {
  flex: 0 0 auto;
  min-height: auto;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.78rem;
}

.merge-file-list {
  display: grid;
  gap: 8px;
}

.merge-file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
}

.merge-file-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.merge-file-order {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  flex: 0 0 auto;
}

.merge-file-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.merge-file-name {
  font-weight: 600;
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.merge-file-meta {
  font-size: 0.76rem;
  opacity: 0.8;
}

.merge-file-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.merge-icon-btn {
  flex: 0 0 auto;
  min-height: auto;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s ease;
}

.merge-icon-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.merge-icon-btn.remove {
  color: #ffc8d3;
}

.merge-empty {
  padding: 12px;
  border-radius: 10px;
  border: 1px dashed rgba(255, 255, 255, 0.3);
  text-align: center;
  opacity: 0.82;
  font-size: 0.84rem;
}

@media (max-width: 860px) {
  .split-tool-page .container.split-page-container {
    width: min(760px, 100%);
  }
}

@media (max-width: 640px) {
  .split-meta-grid {
    grid-template-columns: 1fr;
  }

  .split-option-row {
    flex-direction: column;
  }

  .split-option-pill span {
    width: 100%;
    justify-content: center;
  }

  .split-page-tools {
    flex-direction: column;
  }

  .split-thumb-grid {
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    max-height: 280px;
  }

  .split-output-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .merge-file-row {
    flex-direction: column;
    align-items: stretch;
  }

  .merge-file-actions {
    justify-content: flex-end;
  }
}

/* Mobile responsiveness hardening */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

img,
video,
canvas,
iframe {
  max-width: 100%;
}

body {
  padding-top: max(24px, env(safe-area-inset-top));
  padding-right: max(24px, env(safe-area-inset-right));
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  padding-left: max(24px, env(safe-area-inset-left));
}

.container {
  width: min(620px, 100%);
  padding-top: 64px;
}

.split-tool-page .container.split-page-container {
  padding-top: 64px;
}

.brand-link {
  max-width: min(86vw, 360px);
}

.brand-word {
  min-width: 0;
}

#fileInfo,
#splitFileInfo,
#status,
#splitStatus,
#splitSuccessMsg,
.loading-meta,
.preview-header {
  overflow-wrap: anywhere;
}

.loading-meta {
  flex-wrap: wrap;
  row-gap: 6px;
}

.loading-meta span:last-child {
  margin-left: auto;
}

.preview-header {
  gap: 8px;
}

@media (max-width: 860px) {
  body {
    padding-top: max(18px, env(safe-area-inset-top));
    padding-right: max(16px, env(safe-area-inset-right));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    padding-left: max(16px, env(safe-area-inset-left));
  }

  .container,
  .split-tool-page .container.split-page-container {
    padding-top: 58px;
  }

  .topbar {
    top: 12px;
    right: 12px;
  }

  .side-toggle-btn {
    top: 12px;
    left: 12px;
  }

  .info-section {
    margin-top: 18px;
    padding: 16px;
  }
}

@media (max-width: 640px) {
  body {
    padding-top: max(10px, env(safe-area-inset-top));
    padding-right: max(10px, env(safe-area-inset-right));
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    padding-left: max(10px, env(safe-area-inset-left));
  }

  .container,
  .split-tool-page .container.split-page-container {
    width: 100%;
    padding-top: 54px;
  }

  .topbar {
    top: 8px;
    right: 8px;
  }

  .brand-link {
    max-width: min(76vw, 280px);
    padding: 4px 8px 4px 6px;
    gap: 8px;
  }

  .brand-icon {
    width: 32px;
    height: 32px;
    font-size: 16px;
    border-radius: 9px;
  }

  .brand-word strong,
  .brand-word em {
    font-size: 0.94rem;
  }

  .brand-word em {
    display: none;
  }

  .side-menu {
    width: min(320px, 92vw);
    padding: 16px 12px;
  }

  .side-menu-head {
    padding-bottom: 10px;
  }

  .side-close-btn {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .side-link {
    padding: 11px 10px;
  }

  .tick-toggle {
    align-items: flex-start;
  }

  .tick-hint {
    margin-left: 0;
  }

  .loading-wrap {
    padding: 10px;
  }

  .loading-track {
    height: 16px;
  }

  .preview-close {
    margin-left: auto;
  }

  .split-small-btn,
  .split-output-download {
    width: 100%;
  }

  .split-output-download {
    text-align: center;
  }
}

/* Accessibility + modern UI polish */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  left: 14px;
  top: 10px;
  z-index: 70;
  transform: translateY(-200%);
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(205, 230, 255, 0.62);
  background: rgba(7, 14, 27, 0.95);
  color: #f3f9ff;
  text-decoration: none;
  font-size: 0.82rem;
}

.skip-link:focus-visible {
  transform: translateY(0%);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid rgba(134, 198, 255, 0.92);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Glass Finish Theme (homepage only) */
:root {
  --glass-text: #eef3ff;
  --glass-muted: #c5cedf;
  --glass-border: rgba(255, 255, 255, 0.24);
  --glass-fill: rgba(255, 255, 255, 0.1);
  --glass-fill-strong: rgba(255, 255, 255, 0.16);
  --glass-shadow: 0 20px 44px rgba(0, 0, 0, 0.34);
  --motion-fast: 220ms;
  --motion-base: 360ms;
  --motion-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

body:not(.split-tool-page) {
  background: #0b1018 !important;
  color: var(--glass-text) !important;
  min-height: 100vh;
}

body:not(.split-tool-page) .vanta-bg {
  position: fixed;
  inset: 0;
  z-index: -3;
  opacity: 0.92;
}

body:not(.split-tool-page) .vanta-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 360px at 50% -40px, rgba(255, 255, 255, 0.14), transparent 65%),
    linear-gradient(180deg, rgba(9, 12, 18, 0.46), rgba(9, 12, 18, 0.74));
  pointer-events: none;
}

body.split-tool-page .vanta-bg {
  position: fixed;
  inset: 0;
  z-index: -3;
  opacity: 0.92;
}

body.split-tool-page .vanta-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 360px at 50% -40px, rgba(255, 255, 255, 0.14), transparent 65%),
    linear-gradient(180deg, rgba(9, 12, 18, 0.46), rgba(9, 12, 18, 0.74));
  pointer-events: none;
}

body:not(.split-tool-page) .container {
  width: min(1120px, calc(100% - 40px)) !important;
  margin: 0 auto !important;
  padding-top: 0 !important;
  position: relative;
  max-height: none !important;
  overflow: visible !important;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

body:not(.split-tool-page) .topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 0;
  position: static !important;
  top: auto !important;
  right: auto !important;
  pointer-events: auto !important;
  z-index: 5;
}

body:not(.split-tool-page) .brand-link,
body:not(.split-tool-page) .topbar-link {
  border: 1px solid var(--glass-border) !important;
  background: var(--glass-fill) !important;
  box-shadow: var(--glass-shadow) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--glass-text) !important;
  text-decoration: none;
}

body:not(.split-tool-page) .hero {
  text-align: center;
  margin: 8px 0 12px !important;
  animation: aiFadeUp 0.62s var(--motion-ease) both;
}

body:not(.split-tool-page) .hero-kicker {
  margin: 0;
  color: var(--glass-muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

body:not(.split-tool-page) .hero h1 {
  color: var(--glass-text) !important;
  font-size: clamp(2rem, 5.8vw, 3.45rem) !important;
  letter-spacing: -0.035em !important;
  line-height: 1.06 !important;
  margin-top: 8px !important;
}

body:not(.split-tool-page) .hero-title span {
  display: inline-block;
  padding: 0.08em 0.26em;
  border-radius: 0.35em;
  background: linear-gradient(150deg, #ffffff, #d8deec, #f3f7ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
  text-shadow: 0 10px 24px rgba(255, 255, 255, 0.16);
}

/* Unified Nova lockup logo (header + side menu) */
.brand-link,
.side-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 7px 18px 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(202, 219, 255, 0.35);
  background:
    linear-gradient(130deg, rgba(56, 74, 118, 0.56), rgba(40, 54, 92, 0.44)),
    rgba(22, 34, 66, 0.48);
  text-decoration: none;
  color: #eaf0ff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 10px 24px rgba(7, 13, 31, 0.42);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.brand-link:hover,
.side-logo:hover {
  transform: translateY(-1px);
  border-color: rgba(226, 236, 255, 0.54);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    0 14px 28px rgba(7, 13, 31, 0.48);
}

.brand-icon,
.side-logo-orb {
  position: relative;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(215, 232, 255, 0.48);
  background: linear-gradient(160deg, #27bbff 0%, #2f6bff 58%, #1e46d8 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 8px 16px rgba(11, 39, 112, 0.4);
  color: #eef6ff;
  font-weight: 800;
  font-size: 23px;
  display: grid;
  place-items: center;
  text-shadow: 0 2px 4px rgba(8, 19, 51, 0.4);
}

.brand-icon::after,
.side-logo-orb::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 14px;
  border: 1px solid rgba(123, 183, 255, 0.46);
  pointer-events: none;
}

.side-logo-orb::before {
  content: "N";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 23px;
  color: #eef6ff;
  text-shadow: 0 2px 4px rgba(8, 19, 51, 0.4);
}

.brand-word,
.side-logo-word {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
  line-height: 1;
}

.brand-word strong,
.side-logo-word strong {
  font-size: 1.03rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand-word em,
.side-logo-word em {
  font-style: normal;
  font-size: 1.03rem;
  font-weight: 400;
  opacity: 0.92;
}

@media (max-width: 640px) {
  .brand-link,
  .side-logo {
    min-height: 44px;
    padding: 6px 12px 6px 8px;
    gap: 9px;
  }

  .brand-icon,
  .side-logo-orb {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 18px;
  }

  .side-logo-orb::before {
    font-size: 18px;
  }

  .brand-word strong,
  .brand-word em,
  .side-logo-word strong,
  .side-logo-word em {
    font-size: 0.9rem;
  }

  .brand-word em,
  .side-logo-word em {
    display: inline;
  }
}

/* Image logo mode (uses assets/logos/nova-logo.png) */
.brand-logo-image,
.side-logo-image {
  display: block;
  width: auto;
  height: 56px;
  max-width: min(88vw, 355px);
  object-fit: contain;
  filter: drop-shadow(0 10px 22px rgba(8, 15, 36, 0.35));
}

.side-logo-image {
  height: 48px;
  max-width: 230px;
}

.brand-link.brand-logo-only,
.side-logo.side-logo-only {
  padding: 0;
  gap: 0;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  min-height: auto;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.brand-link.brand-logo-only:hover,
.side-logo.side-logo-only:hover {
  transform: translateY(-1px) scale(1.01);
  border: 0 !important;
  box-shadow: none !important;
}

.brand-link.brand-logo-only .brand-icon,
.brand-link.brand-logo-only .brand-word,
.side-logo.side-logo-only .side-logo-orb,
.side-logo.side-logo-only .side-logo-word {
  display: none !important;
}

.brand-link:not(.brand-logo-only) .brand-logo-image,
.side-logo:not(.side-logo-only) .side-logo-image {
  display: none;
}

@media (max-width: 640px) {
  .brand-logo-image {
    height: 46px;
    max-width: min(80vw, 300px);
  }

  .side-logo-image {
    height: 42px;
    max-width: 210px;
  }
}

body:not(.split-tool-page) .subtitle {
  color: var(--glass-muted) !important;
  font-size: clamp(1rem, 2.3vw, 1.16rem) !important;
  max-width: 740px;
  margin: 12px auto 0 !important;
}

body:not(.split-tool-page) .hero-graphics {
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

body:not(.split-tool-page) .hero-graphic-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass-fill);
  color: var(--glass-text);
  font-size: 0.8rem;
  font-weight: 600;
  backdrop-filter: blur(10px);
}

body:not(.split-tool-page) .hero-graphic-chip .lucide-icon {
  width: 15px;
  height: 15px;
}

body:not(.split-tool-page) .workflow-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  margin: 18px auto 24px;
  flex-wrap: wrap;
}

body:not(.split-tool-page) .workflow-step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 15px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: var(--glass-fill);
  color: var(--glass-muted);
  font-weight: 600;
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(10px);
  transition:
    transform var(--motion-fast) var(--motion-ease),
    box-shadow var(--motion-fast) var(--motion-ease),
    background var(--motion-fast) var(--motion-ease),
    border-color var(--motion-fast) var(--motion-ease);
}

body:not(.split-tool-page) .workflow-step .lucide-icon {
  width: 16px;
  height: 16px;
}

body:not(.split-tool-page) .workflow-step.is-active {
  color: #ffffff;
  background: var(--glass-fill-strong);
  border-color: rgba(255, 255, 255, 0.42);
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.34);
}

body:not(.split-tool-page) .workflow-divider {
  width: 38px;
  height: 1px;
  background: rgba(255, 255, 255, 0.3);
}

body:not(.split-tool-page) .card,
body:not(.split-tool-page) .camera-panel,
body:not(.split-tool-page) .scan-toolbar,
body:not(.split-tool-page) .scan-control-grid,
body:not(.split-tool-page) .scan-queue-panel,
body:not(.split-tool-page) .scan-live-wrap,
body:not(.split-tool-page) .scan-source-wrap,
body:not(.split-tool-page) .scan-preview-wrap,
body:not(.split-tool-page) .info-section,
body:not(.split-tool-page) .loading-wrap {
  background: var(--glass-fill) !important;
  border: 1px solid var(--glass-border) !important;
  box-shadow: var(--glass-shadow) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

body:not(.split-tool-page) .card {
  border-radius: 24px !important;
  padding: clamp(18px, 2.45vw, 28px) !important;
  overflow: visible !important;
  max-height: none !important;
  margin: 0;
  animation: aiFadeUp 0.72s var(--motion-ease) both;
}

body:not(.split-tool-page) .card-intro {
  text-align: center;
  margin-bottom: 14px;
}

body:not(.split-tool-page) .card-intro h2,
body:not(.split-tool-page) .tools-section h2,
body:not(.split-tool-page) .size-section label,
body:not(.split-tool-page) .tick-label,
body:not(.split-tool-page) #fileInfo {
  color: var(--glass-text) !important;
}

body:not(.split-tool-page) .card-intro p,
body:not(.split-tool-page) .scan-hint,
body:not(.split-tool-page) .scan-mode-hint,
body:not(.split-tool-page) .tick-hint,
body:not(.split-tool-page) .status,
body:not(.split-tool-page) .supports-label,
body:not(.split-tool-page) .tool-card p,
body:not(.split-tool-page) .loading-caption,
body:not(.split-tool-page) .subtitle {
  color: var(--glass-muted) !important;
}

body:not(.split-tool-page) .primary-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

body:not(.split-tool-page) .upload-box {
  border: 2px dashed rgba(255, 255, 255, 0.34) !important;
  border-radius: 18px !important;
  background: var(--glass-fill) !important;
  color: var(--glass-text) !important;
  min-height: 220px;
  display: grid;
  place-content: center;
  text-align: center;
  backdrop-filter: blur(12px);
  transition:
    border-color var(--motion-base) var(--motion-ease),
    box-shadow var(--motion-base) var(--motion-ease),
    transform var(--motion-base) var(--motion-ease),
    background var(--motion-base) var(--motion-ease);
}

body:not(.split-tool-page) .upload-box:hover,
body:not(.split-tool-page) .upload-box.dragover {
  border-color: rgba(255, 255, 255, 0.62) !important;
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
}

body:not(.split-tool-page) .upload-glyph {
  width: 56px;
  height: 56px;
  margin-inline: auto;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  background: var(--glass-fill);
  display: grid;
  place-items: center;
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
}

body:not(.split-tool-page) .supports-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 12px 0 16px;
}

body:not(.split-tool-page) .support-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass-fill);
  color: var(--glass-text);
  font-size: 0.82rem;
  font-weight: 600;
}

body:not(.split-tool-page) .size-input input,
body:not(.split-tool-page) .size-input select,
body:not(.split-tool-page) .scan-sliders input[type="range"] {
  border-color: var(--glass-border) !important;
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--glass-text) !important;
}

body:not(.split-tool-page) .buttons {
  margin-top: 16px;
  display: grid !important;
  grid-template-columns: 1fr;
  gap: 10px;
}

body:not(.split-tool-page) .download-section {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

body:not(.split-tool-page) .btn-with-icon,
body:not(.split-tool-page) button,
body:not(.split-tool-page) .download {
  border-radius: 14px !important;
  border: 1px solid var(--glass-border) !important;
  min-height: 50px;
  background: var(--glass-fill) !important;
  color: var(--glass-text) !important;
  backdrop-filter: blur(10px);
  transition:
    transform var(--motion-fast) var(--motion-ease),
    box-shadow var(--motion-fast) var(--motion-ease),
    filter var(--motion-fast) var(--motion-ease),
    background var(--motion-base) var(--motion-ease),
    border-color var(--motion-fast) var(--motion-ease);
}

body:not(.split-tool-page) .convert {
  background: var(--glass-fill-strong) !important;
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.3);
  animation: none !important;
}

body:not(.split-tool-page) .convert::before {
  display: none !important;
}

body:not(.split-tool-page) .convert:hover,
body:not(.split-tool-page) .download:hover,
body:not(.split-tool-page) .tool-card:hover,
body:not(.split-tool-page) .workflow-step:hover {
  transform: translateY(-2px);
}

body:not(.split-tool-page) .loading-track {
  background: rgba(255, 255, 255, 0.14) !important;
}

body:not(.split-tool-page) .loading-bar {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.95), rgba(235, 240, 255, 0.6)) !important;
}

body:not(.split-tool-page) .loading-wrap {
  margin-bottom: 10px;
}

body:not(.split-tool-page) .tools-section {
  margin-top: 0;
  position: relative;
  z-index: 2;
}

body:not(.split-tool-page) .tools-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

body:not(.split-tool-page) .tools-section h2 {
  margin: 0 0 14px;
}

body:not(.split-tool-page) .tool-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: inherit;
  text-align: center;
  padding: 15px 14px;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  background: var(--glass-fill);
  box-shadow: var(--glass-shadow);
  min-height: 184px;
  backdrop-filter: blur(14px);
  transition:
    transform var(--motion-fast) var(--motion-ease),
    box-shadow var(--motion-fast) var(--motion-ease),
    border-color var(--motion-fast) var(--motion-ease);
  opacity: 0;
  animation: glassRise 680ms var(--motion-ease) forwards;
}

body:not(.split-tool-page) .tool-card:nth-child(1) { animation-delay: 40ms; }
body:not(.split-tool-page) .tool-card:nth-child(2) { animation-delay: 90ms; }
body:not(.split-tool-page) .tool-card:nth-child(3) { animation-delay: 140ms; }
body:not(.split-tool-page) .tool-card:nth-child(4) { animation-delay: 190ms; }
body:not(.split-tool-page) .tool-card:nth-child(5) { animation-delay: 240ms; }

body:not(.split-tool-page) .tool-image {
  width: 100%;
  max-width: 200px;
  height: 112px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  margin: 0 auto 12px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.24);
  filter: grayscale(1) brightness(1.14) contrast(1.06);
  transition:
    transform var(--motion-base) var(--motion-ease),
    filter var(--motion-base) var(--motion-ease);
}

body:not(.split-tool-page) .tool-card:hover .tool-image {
  transform: translateY(-2px) scale(1.02);
  filter: grayscale(0.75) brightness(1.18) contrast(1.08);
}

body:not(.split-tool-page) .tool-card h3 {
  margin-top: 0;
  margin-bottom: 4px;
  font-size: 0.98rem;
  color: var(--glass-text);
}

body:not(.split-tool-page) .status {
  margin: 10px 0 0;
  font-size: 0.95rem !important;
  text-align: center !important;
}

body:not(.split-tool-page) .hero,
body:not(.split-tool-page) .workflow-section,
body:not(.split-tool-page) .tools-section,
body:not(.split-tool-page) .info-section {
  margin: 0;
}

body:not(.split-tool-page) .camera-actions {
  position: sticky;
  bottom: 8px;
  z-index: 8;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 8px;
  backdrop-filter: blur(10px);
}

.ripple-surface {
  position: relative;
  overflow: hidden;
}

.ripple-wave {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  transform: scale(0);
  animation: rippleWave 0.5s var(--motion-ease) forwards;
  pointer-events: none;
}

@keyframes aiFadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes glassRise {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes rippleWave {
  to {
    transform: scale(1);
    opacity: 0;
  }
}

@media (max-width: 1120px) {
  body:not(.split-tool-page) .tools-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  body:not(.split-tool-page) .download-section {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  body:not(.split-tool-page) .primary-actions {
    grid-template-columns: 1fr;
  }

  body:not(.split-tool-page) .workflow-divider {
    display: none;
  }

  body:not(.split-tool-page) .workflow-section {
    justify-content: flex-start;
  }

  body:not(.split-tool-page) .tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  body:not(.split-tool-page) .container {
    width: min(100%, calc(100% - 22px)) !important;
  }

  body:not(.split-tool-page) .topbar {
    justify-content: center;
  }

  body:not(.split-tool-page) .topbar-link {
    display: none;
  }

  body:not(.split-tool-page) .hero h1 {
    font-size: clamp(1.75rem, 9vw, 2.3rem) !important;
  }

  body:not(.split-tool-page) .tools-grid {
    grid-template-columns: 1fr;
  }

  body:not(.split-tool-page) .camera-actions {
    position: static;
    padding: 0;
    border: none;
    background: transparent;
    backdrop-filter: none;
  }
}

/* Mobile smoothness pass */
.vanta-lite .vanta-bg {
  opacity: 1 !important;
  background:
    radial-gradient(120% 90% at 20% 10%, rgba(0, 229, 255, 0.22), transparent 55%),
    radial-gradient(110% 86% at 80% 15%, rgba(108, 99, 255, 0.24), transparent 58%),
    radial-gradient(100% 90% at 50% 95%, rgba(0, 255, 255, 0.14), transparent 62%),
    linear-gradient(180deg, #091124 0%, #070d1d 42%, #040913 74%, #03060d 100%);
  background-size: 120% 120%, 120% 120%, 120% 120%, 100% 100%;
  animation: mobileBgDrift 14s ease-in-out infinite alternate;
}

.vanta-lite .vanta-bg::after {
  background:
    radial-gradient(900px 360px at 50% -40px, rgba(255, 255, 255, 0.14), transparent 65%),
    linear-gradient(180deg, rgba(9, 12, 18, 0.38), rgba(9, 12, 18, 0.74));
}

@keyframes mobileBgDrift {
  0% {
    background-position: 0% 0%, 100% 0%, 50% 100%, 50% 50%;
  }
  100% {
    background-position: 18% 12%, 82% 8%, 50% 88%, 50% 50%;
  }
}

@media (hover: none) and (pointer: coarse) {
  button:hover,
  .download:hover,
  .tool-card:hover,
  .workflow-step:hover,
  .upload-box:hover {
    transform: none !important;
    box-shadow: none !important;
    filter: none !important;
  }

  .split-upload-icon {
    animation-duration: 2.8s;
  }
}

@media (max-width: 820px) {
  body {
    align-items: flex-start;
    overscroll-behavior-y: contain;
  }

  .container,
  .split-tool-page .container.split-page-container {
    width: min(100%, calc(100vw - 14px));
    padding-top: 56px;
  }

  .card,
  .split-card {
    margin-top: 14px;
    padding: 14px;
    border-radius: 16px;
  }

  .hero-graphics {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }

  .hero-graphic-chip {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  .workflow-section {
    gap: 8px;
  }

  .workflow-step {
    min-height: 40px;
    padding: 8px 10px;
  }

  .scan-toolbar {
    gap: 8px;
  }

  .scan-toolbar-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .scan-mini-btn {
    justify-content: center;
  }

  .scan-live-wrap {
    min-height: 48svh;
  }

  .scan-live-wrap video {
    max-height: 54svh;
  }

  .scan-source-wrap,
  .scan-preview-wrap {
    max-height: 54svh;
  }
}

@media (max-width: 640px) {
  .topbar {
    justify-content: center;
  }

  .brand-logo-image {
    height: 42px;
    max-width: min(82vw, 300px);
  }

  .side-logo-image {
    height: 40px;
    max-width: 210px;
  }

  body:not(.split-tool-page) .workflow-section {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding-bottom: 2px;
  }

  body:not(.split-tool-page) .workflow-section::-webkit-scrollbar {
    height: 0;
  }

  body:not(.split-tool-page) .workflow-step {
    flex: 0 0 auto;
    min-width: 110px;
    scroll-snap-align: start;
  }

  body:not(.split-tool-page) .primary-actions,
  body:not(.split-tool-page) .download-section,
  body:not(.split-tool-page) .buttons {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px;
  }

  .size-input {
    flex-direction: column;
    gap: 8px;
  }

  .size-input input,
  .size-input select {
    width: 100%;
    border-radius: 10px;
    border-right: 1px solid rgba(255, 255, 255, 0.5);
  }

  body:not(.split-tool-page) .tool-card {
    min-height: 164px;
    padding: 12px;
  }

  body:not(.split-tool-page) .tool-image {
    height: 96px;
    max-width: 100%;
  }

  .scan-filter-row,
  .scan-rotate-toolbar {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .scan-filter-row::-webkit-scrollbar,
  .scan-rotate-toolbar::-webkit-scrollbar {
    display: none;
  }

  .camera-actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px;
    position: sticky;
    bottom: max(6px, env(safe-area-inset-bottom));
  }

  #captureBtn {
    min-height: 58px;
  }
}

@media (max-width: 420px) {
  .upload-box {
    min-height: 188px;
    padding: 16px 10px;
  }

  .camera-panel {
    padding: 8px;
  }

  .scan-toolbar-actions {
    grid-template-columns: 1fr;
  }
}
