:root {
  --void: #020812;
  --deep: #040e1e;
  --surface: #071426;
  --card: #081830;
  --card-hover: #0c2040;
  --border: rgba(32, 120, 200, 0.18);
  --border-glow: rgba(56, 189, 248, 0.35);
  --cyan: #38bdf8;
  --cyan-bright: #7dd3fc;
  --cyan-dim: #0ea5e9;
  --neon: #00f0ff;
  --neon-soft: rgba(0, 240, 255, 0.12);
  --neon-glow:
    0 0 20px rgba(0, 240, 255, 0.4), 0 0 60px rgba(0, 240, 255, 0.15);
  --text: #e2f0ff;
  --text-dim: #7eb4d4;
  --text-muted: #3a6080;
  --accent: #0f3558;
  --green: #10b981;
  --green-glow: 0 0 15px rgba(16, 185, 129, 0.4);
  --font-display: "Poppins", sans-serif;
  --font-body: "Poppins", sans-serif;
  --footer-bg: rgba(4, 14, 30, 0.4);
}

[data-theme="light"] {
  --void: #f0f5ff;
  --deep: #e4ecf7;
  --surface: #dce6f5;
  --card: #ffffff;
  --card-hover: #eef3fc;
  --border: rgba(14, 100, 180, 0.15);
  --border-glow: rgba(14, 120, 200, 0.35);
  --cyan: #0077cc;
  --cyan-bright: #005fa3;
  --cyan-dim: #0ea5e9;
  --neon: #0090cc;
  --neon-soft: rgba(0, 144, 204, 0.1);
  --neon-glow:
    0 0 20px rgba(0, 144, 204, 0.25), 0 0 60px rgba(0, 144, 204, 0.1);
  --text: #0d1f35;
  --text-dim: #2a5070;
  --text-muted: #7a9ab8;
  --accent: #cfe0f5;
  --green: #059669;
  --green-glow: 0 0 15px rgba(5, 150, 105, 0.2);
  --footer-bg: rgba(14, 100, 180, 0.06);
}
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--void);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 300;
  min-height: 100vh;
  overflow-x: hidden;
  cursor: default;
  transition:
    background-color 0.3s,
    color 0.3s;
  display: flex;
  flex-direction: column;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  background-size: 256px;
  opacity: 0.5;
  pointer-events: none;
}

.ambient {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
}
.ambient-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(
    circle,
    rgba(0, 120, 200, 0.18) 0%,
    transparent 70%
  );
  top: -200px;
  left: -150px;
  animation: drift1 18s ease-in-out infinite alternate;
}
.ambient-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(
    circle,
    rgba(0, 240, 255, 0.1) 0%,
    transparent 70%
  );
  bottom: -100px;
  right: -100px;
  animation: drift2 22s ease-in-out infinite alternate;
}

@keyframes drift1 {
  from {
    transform: translate(0, 0);
  }
  to {
    transform: translate(60px, 40px);
  }
}
@keyframes drift2 {
  from {
    transform: translate(0, 0);
  }
  to {
    transform: translate(-50px, -60px);
  }
}

.wrapper {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

nav {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 18px 0;
  background: rgba(2, 8, 18, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition:
    background-color 0.3s,
    border-color 0.3s;
}
[data-theme="light"] nav {
  background: rgba(240, 245, 255, 0.75);
  border-bottom-color: rgba(14, 100, 180, 0.12);
}
nav .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 100%;
  padding: 0 24px;
}
.logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: default;
  user-select: none;
  transition: filter 0.3s ease;
}
.logo:hover {
  filter: drop-shadow(0 0 12px var(--neon)) brightness(1.2);
}
.logo span {
  color: var(--cyan);
}
.logo-mark {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--cyan-dim), var(--neon));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--void);
  box-shadow: var(--neon-glow);
  flex-shrink: 0;
}

.node-item {
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 6px;
  background: rgba(8, 24, 48, 0.15);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}
.node-html5:hover {
  border-color: #e34f26 !important;
  color: #e34f26 !important;
  background: rgba(227, 79, 38, 0.05);
  filter: drop-shadow(0 0 8px rgba(227, 79, 38, 0.4));
}
.node-css3:hover {
  border-color: #1572b6 !important;
  color: #1572b6 !important;
  background: rgba(21, 114, 182, 0.05);
  filter: drop-shadow(0 0 8px rgba(21, 114, 182, 0.4));
}
.node-javascript:hover {
  border-color: #f7df1e !important;
  color: #f7df1e !important;
  background: rgba(247, 223, 30, 0.05);
  filter: drop-shadow(0 0 8px rgba(247, 223, 30, 0.4));
}
.node-firebase:hover {
  border-color: #ffca28 !important;
  color: #ffca28 !important;
  background: rgba(255, 202, 40, 0.05);
  filter: drop-shadow(0 0 8px rgba(255, 202, 40, 0.4));
}
.node-github:hover {
  border-color: var(--text) !important;
  color: var(--text) !important;
  background: rgba(255, 255, 255, 0.05);
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.3));
}

[data-theme="light"] .unified-input-wrapper {
  background: #f8fafc;
  border-color: rgba(14, 100, 180, 0.25);
}
[data-theme="light"] .unified-static-label {
  background: #f1f5f9;
  color: var(--text-dim);
  border-right-color: rgba(14, 100, 180, 0.25);
}
[data-theme="light"] .unified-select-menu {
  background: #f8fafc;
  color: var(--text);
  border-left-color: rgba(14, 100, 180, 0.25);
}
[data-theme="light"] .btn-submit-compress {
  background: #f1f5f9;
  color: var(--text-dim);
  border-color: rgba(14, 100, 180, 0.25);
}
[data-theme="light"] .btn-submit-compress.file-ready {
  background: var(--cyan);
  color: #ffffff;
  border-color: transparent;
}
[data-theme="light"] .btn-submit-compress.file-ready:hover {
  background: var(--cyan-bright);
}
[data-theme="light"] .node-item {
  background: #ffffff;
  border-color: rgba(14, 100, 180, 0.35);
  color: #0d1f35;
}
[data-theme="light"] .node-github:hover {
  border-color: #0f172a !important;
  color: #0f172a !important;
  background: rgba(15, 23, 42, 0.05);
  filter: drop-shadow(0 0 8px rgba(15, 23, 42, 0.2));
}
[data-theme="light"] footer p {
  color: #2a5070 !important;
}
[data-theme="light"] .batch-item-override {
  background: #f8fafc;
  border-color: rgba(14, 100, 180, 0.25);
}
[data-theme="light"] .batch-item-override select {
  background: #f8fafc;
  color: var(--text);
  border-left-color: rgba(14, 100, 180, 0.25);
}
.file-upload-block.error-active {
  border: 2px solid #ef4444 !important;
  background: rgba(239, 68, 68, 0.04) !important;
  padding: 12px;
  border-radius: 8px;
}

.privacy-trigger-link {
  color: var(--cyan);
  text-decoration: none;
  font-size: 0.72rem;
  margin-left: 8px;
  cursor: pointer;
  transition: color 0.2s;
}
.privacy-trigger-link:hover {
  color: var(--neon);
  text-decoration: underline;
}
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 8, 18, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.privacy-modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  padding: 32px;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  transform: scale(0.95);
  transition: transform 0.3s ease;
}
[data-theme="light"] .privacy-modal {
  background: #ffffff;
  border-color: rgba(14, 100, 180, 0.2);
  box-shadow: 0 20px 40px rgba(14, 100, 180, 0.1);
}
.modal-overlay.active .privacy-modal {
  transform: scale(1);
}
.modal-close-btn {
  position: absolute;
  top: 24px;
  right: 24px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}
.modal-close-btn:hover {
  color: var(--text);
}
.privacy-content-group {
  margin-bottom: 20px;
}
.privacy-content-group:last-child {
  margin-bottom: 0;
}
.privacy-content-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.privacy-content-body {
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.6;
}
[data-theme="light"] .privacy-content-body {
  color: #334155;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}
@media (max-width: 820px) {
  .nav-links {
    gap: 16px;
  }
}
@media (max-width: 600px) {
  nav .inner {
    flex-direction: column;
    gap: 12px;
  }
  .nav-right {
    width: 100%;
    justify-content: space-between;
  }
}
.nav-link-item {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
  cursor: pointer;
  user-select: none;
}
.nav-link-item:hover {
  color: var(--cyan);
  text-shadow: 0 0 8px var(--neon-soft);
}
.nav-link-item.active {
  color: var(--text);
  text-shadow: 0 0 10px var(--neon-soft);
}
.bulb-container {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  transition: all 0.2s ease;
}
.nav-link-item:hover .bulb-container {
  color: #ffca28;
  filter: drop-shadow(0 0 8px rgba(255, 202, 40, 0.7));
}

.nav-links {
  margin: 0;
}

@media (max-width: 600px) {
  .minimal-box {
    padding: 20px;
  }
  .unified-action-bar {
    gap: 10px;
  }
  .unified-input-wrapper {
    width: 100%;
  }
  .btn-submit-compress {
    width: 100%;
    height: 38px;
  }
  .preset-links-row {
    gap: 10px;
  }
  .preset-trigger-btn {
    font-size: 0.8rem;
  }
}

.nav-link-item,
.preset-trigger-btn,
.btn-choose-action,
.btn-submit-compress,
.node-item {
  touch-action: manipulation;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.nav-badge {
  font-family: var(--font-body);
  font-size: 0.68rem;
  color: var(--cyan-dim);
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.25);
  padding: 4px 10px;
  border-radius: 100px;
  letter-spacing: 0.05em;
}

#theme-toggle {
  background: var(--card);
  border: 2px solid var(--cyan);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--cyan);
  transition: all 0.2s ease;
  outline: none;
}
#theme-toggle:hover {
  border-color: var(--neon);
  color: var(--neon);
  transform: scale(1.05);
  box-shadow: 0 0 10px var(--neon-soft);
}
[data-theme="light"] #theme-toggle {
  color: #ef4444;
  border-color: #ef4444;
}
[data-theme="light"] #theme-toggle:hover {
  color: #b91c1c;
  border-color: #b91c1c;
}

.header-section {
  text-align: center;
  padding: 60px 0 30px;
}
.eyebrow {
  font-size: 0.75rem;
  color: var(--cyan);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.eyebrow span {
  display: inline-block;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  padding: 6px 16px;
  border-radius: 100px;
}
.header-section h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}
.header-section h1 span {
  background: linear-gradient(
    90deg,
    var(--cyan-bright),
    var(--neon),
    var(--cyan-dim)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 30px rgba(0, 240, 255, 0.3));
}

.main-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  margin-bottom: 60px;
}
@media (min-width: 992px) {
  .main-grid {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

.card-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 30px;
  transition:
    border-color 0.3s,
    box-shadow 0.3s,
    background-color 0.3s;
  position: relative;
  overflow: hidden;
}
.card-box:hover {
  border-color: var(--border-glow);
}

.dropzone {
  border: 2px dashed rgba(56, 189, 248, 0.3);
  border-radius: 16px;
  padding: 45px 20px;
  text-align: center;
  cursor: pointer;
  background: rgba(8, 24, 48, 0.3);
  transition: all 0.3s ease;
  position: relative;
}
.dropzone:hover,
.dropzone.dragover {
  border-color: var(--neon);
  background: rgba(0, 240, 255, 0.04);
  box-shadow: inset 0 0 20px rgba(0, 240, 255, 0.05);
}
.dropzone-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  display: inline-block;
  transition: transform 0.3s ease;
}
.dropzone:hover .dropzone-icon {
  transform: translateY(-5px);
}
.dropzone p {
  font-size: 0.95rem;
  color: var(--text-dim);
  line-height: 1.6;
}
.dropzone p strong {
  color: var(--cyan-bright);
  font-weight: 600;
}
.dropzone span {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 8px;
}
#file-input {
  display: none;
}

.control-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--cyan-bright);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Tab Switchers */
.tab-container {
  display: flex;
  background: rgba(4, 14, 30, 0.6);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 20px;
}
.tab-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}
.tab-btn.active {
  background: linear-gradient(135deg, var(--cyan), var(--neon));
  color: var(--void);
  box-shadow: 0 4px 15px rgba(0, 240, 255, 0.25);
}

/* Input Forms */
.group-fields {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.field-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field-label {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-weight: 500;
  display: flex;
  justify-content: space-between;
}
.field-label span.value-badge {
  color: var(--neon);
  font-weight: 700;
}
.input-control {
  width: 100%;
  background: rgba(4, 14, 30, 0.8);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text);
  outline: none;
  transition:
    border-color 0.3s,
    box-shadow 0.3s;
}
.input-control:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.15);
}
[data-theme="light"] .input-control {
  background: #ffffff;
}

/* Specific sizing selection switcher */
.unit-selector {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.unit-btn {
  flex: 1;
  background: rgba(4, 14, 30, 0.4);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}
.unit-btn.active {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(56, 189, 248, 0.1);
}

/* Slider Style customization */
.slider-control {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(32, 120, 200, 0.2);
  outline: none;
  margin: 10px 0;
}
.slider-control::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--neon);
  cursor: pointer;
  box-shadow: 0 0 10px var(--neon);
  transition: transform 0.1s;
}
.slider-control::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Aspect ratio toggle switch */
.switch-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(4, 14, 30, 0.3);
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.switch-label {
  font-size: 0.82rem;
  color: var(--text-dim);
}
.switch-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 22px;
}
.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider-toggle {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border);
  transition: 0.3s;
  border-radius: 34px;
}
.slider-toggle:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}
input:checked + .slider-toggle {
  background-color: var(--cyan-dim);
}
input:checked + .slider-toggle:before {
  transform: translateX(22px);
}

.panel-results {
  display: none; /* Shown dynamically when image is loaded */
  flex-direction: column;
  gap: 20px;
}
.panel-results.active {
  display: flex;
}

.compare-box {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 576px) {
  .compare-box {
    grid-template-columns: 1fr 1fr;
  }
}

.preview-image-wrapper {
  background: rgba(4, 14, 30, 0.5);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  min-height: 200px;
}
.preview-image-wrapper h4 {
  font-size: 0.78rem;
  font-family: var(--font-body);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
  align-self: flex-start;
}
.image-container-view {
  width: 100%;
  height: 180px;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: radial-gradient(
    rgba(255, 255, 255, 0.05) 1px,
    transparent 0
  );
  background-size: 16px 16px;
  position: relative;
}
[data-theme="light"] .image-container-view {
  background-image: radial-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 0);
}
.image-container-view img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Stats summary cards */
.stats-badge-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-top: 10px;
  font-size: 0.8rem;
}
.stat-file-size {
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--text);
}
.stat-resolution {
  color: var(--text-muted);
}

.saving-meter-card {
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--green-glow);
}
.saving-info h5 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 2px;
}
.saving-info p {
  font-size: 0.75rem;
  color: var(--text-dim);
}
.saving-pct {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--green);
  font-family: var(--font-display);
}

/* Compression action buttons styles */
.action-row {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}
.btn-primary {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--void);
  background: linear-gradient(135deg, var(--cyan), var(--neon));
  border: none;
  border-radius: 12px;
  padding: 14px 24px;
  cursor: pointer;
  transition:
    filter 0.2s,
    transform 0.2s,
    box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(0, 240, 255, 0.25);
}
.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 240, 255, 0.4);
}
.btn-primary:active {
  transform: translateY(0);
}
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  background: rgba(4, 14, 30, 0.4);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 20px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--text-muted);
}
[data-theme="light"] .btn-outline {
  background: #ffffff;
}

.loader-container {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(2, 8, 18, 0.85);
  z-index: 10;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  backdrop-filter: blur(4px);
}
.loader-container.active {
  display: flex;
}
[data-theme="light"] .loader-container {
  background: rgba(240, 245, 255, 0.9);
}
.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(56, 189, 248, 0.1);
  border-top-color: var(--neon);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.1);
  margin-bottom: 16px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.loader-text {
  font-size: 0.9rem;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-weight: 500;
}

footer {
  border-top: 1px solid var(--border);
  background: linear-gradient(to top, rgba(4, 14, 30, 0.4), transparent);
  padding: 60px 0 30px;
  margin-top: 60px;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
}
.footer-brand span {
  color: var(--cyan);
}
.footer-inner p {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.back-hub-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--cyan-bright);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid rgba(56, 189, 248, 0.25);
  background: rgba(56, 189, 248, 0.05);
  padding: 8px 16px;
  border-radius: 100px;
  transition: all 0.2s;
  margin-bottom: 10px;
}
.back-hub-btn:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: var(--cyan);
  transform: translateX(-4px);
}

#toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(8, 24, 48, 0.95);
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: var(--cyan-bright);
  font-family: var(--font-body);
  font-size: 0.85rem;
  padding: 12px 24px;
  border-radius: 100px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.5),
    var(--neon-glow);
  z-index: 999;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
}
#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
[data-theme="light"] #toast {
  background: #ffffff;
  border-color: rgba(14, 100, 180, 0.3);
  color: var(--cyan);
  box-shadow: 0 8px 24px rgba(14, 100, 180, 0.15);
}

.minimal-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  position: relative;
  margin-bottom: 40px;
  transition: all 0.3s ease;
}
[data-theme="light"] .minimal-box {
  background: #ffffff;
  border-color: rgba(14, 100, 180, 0.15);
  box-shadow: 0 4px 30px rgba(14, 100, 180, 0.03);
}
.tool-description {
  font-size: 0.92rem;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 24px;
}
.file-upload-block {
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.btn-choose-action {
  background: var(--card);
  border: 1px solid rgba(14, 100, 180, 0.3);
  color: var(--text);
  padding: 8px 16px;
  font-family: var(--font-body);
  font-size: 0.88rem;
  border-radius: 4px;
  cursor: pointer;
  transition:
    background 0.2s,
    border-color 0.2s;
}
[data-theme="dark"] .btn-choose-action {
  border-color: rgba(255, 255, 255, 0.2);
}
.btn-choose-action:hover {
  border-color: var(--cyan);
  background: rgba(0, 240, 255, 0.03);
}
.file-status-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.inline-section-header {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin: 52px 0 28px 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.preset-links-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 36px;
}
.preset-trigger-btn {
  background: none;
  border: none;
  color: var(--cyan);
  text-decoration: underline;
  font-family: var(--font-body);
  font-size: 0.88rem;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s;
}
.preset-trigger-btn:hover {
  color: var(--neon);
}
.unified-action-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.unified-input-wrapper {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: rgba(4, 14, 30, 0.2);
  height: 38px;
  overflow: hidden;
  width: 260px;
}
.unified-static-label {
  background: rgba(255, 255, 255, 0.03);
  border-right: 1px solid var(--border);
  padding: 0 14px;
  display: flex;
  align-items: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  user-select: none;
}
.unified-number-field {
  flex: 1;
  background: transparent;
  border: none;
  padding: 0 10px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  width: 100%;
  -moz-appearance: textfield;
  appearance: textfield;
}
.unified-number-field::-webkit-outer-spin-button,
.unified-number-field::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.unified-select-menu {
  background: var(--card);
  border: none;
  border-left: 1px solid var(--border);
  padding: 0 8px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
}
.btn-submit-compress {
  height: 38px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.88rem;
  padding: 0 20px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-submit-compress.file-ready {
  background: var(--card);
  border-color: var(--text-dim);
  color: var(--text);
}
.btn-submit-compress.file-ready:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

/* === COMPRESSION MODE SELECTOR === */
.file-info-bar {
  display: none;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
}
.file-info-bar.visible {
  display: flex;
}
.file-info-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(56, 189, 248, 0.06);
  border: 1px solid rgba(56, 189, 248, 0.15);
  padding: 3px 10px;
  border-radius: 100px;
  color: var(--cyan-bright);
  font-weight: 500;
  font-size: 0.78rem;
}
.mode-recommendation {
  display: none;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 16px 0 24px 0;
  padding: 8px 12px;
  background: rgba(0, 240, 255, 0.03);
  border-left: 2px solid var(--cyan-dim);
  border-radius: 0 4px 4px 0;
  max-width: 650px;
  width: 100%;
}
.mode-recommendation.visible {
  display: block;
}
.mode-recommendation strong {
  color: var(--cyan);
}
.mode-selector-row {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  max-width: 650px;
  margin: 0;
  width: 100%;
}
.mode-btn {
  flex: 1;
  background: rgba(4, 14, 30, 0.4);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 6px;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  line-height: 1.3;
  white-space: nowrap;
}
.mode-btn span {
  display: block;
  font-size: 0.62rem;
  font-weight: 400;
  margin-top: 1px;
  opacity: 0.6;
}
.mode-btn.active {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(56, 189, 248, 0.08);
}
.mode-btn.mode-recommended {
  border-color: rgba(0, 240, 255, 0.35);
}
[data-theme="light"] .mode-btn {
  background: #f8fafc;
  color: var(--text-dim);
}
[data-theme="light"] .mode-btn.active {
  background: rgba(0, 119, 204, 0.08);
  color: var(--cyan);
}
@media (max-width: 600px) {
  .mode-selector-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    flex-wrap: wrap;
  }
  .mode-btn {
    white-space: normal;
    padding: 8px 6px;
  }
  .batch-item {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    position: relative;
    padding-right: 40px;
  }
  .batch-item-size-info {
    text-align: left;
    min-width: auto;
  }
  .batch-item-override {
    width: 100%;
  }
  .batch-item-btn-remove {
    position: absolute;
    top: 12px;
    right: 12px;
  }
}
.batch-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 24px;
}
.batch-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(4, 14, 30, 0.4);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  transition: border-color 0.2s;
  flex-wrap: wrap;
}
[data-theme="light"] .batch-item {
  background: #f8fafc;
}
.batch-item:hover {
  border-color: var(--border-glow);
}
.batch-item-name {
  flex: 1;
  font-size: 0.88rem;
  color: var(--text);
  font-weight: 500;
  min-width: 120px;
  word-break: break-all;
}
.batch-item-size-info {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 100px;
  text-align: right;
}
.batch-item-size-info.done {
  color: var(--green);
}
.batch-item-size-info.error {
  color: #ef4444;
}
.batch-item-override {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: rgba(4, 14, 30, 0.2);
  height: 30px;
  overflow: hidden;
  width: 160px;
  flex-shrink: 0;
}
.batch-item-override input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 0 8px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.82rem;
  outline: none;
  width: 100%;
  -moz-appearance: textfield;
  appearance: textfield;
}
.batch-item-override input::-webkit-outer-spin-button,
.batch-item-override input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.batch-item-override select {
  background: var(--card);
  border: none;
  border-left: 1px solid var(--border);
  padding: 0 6px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.78rem;
  outline: none;
  cursor: pointer;
}
.batch-item-status {
  font-size: 0.75rem;
  padding: 2px 10px;
  border-radius: 100px;
  white-space: nowrap;
  font-weight: 600;
  flex-shrink: 0;
}
.batch-item-status.waiting {
  background: none;
  border: none;
  color: var(--green);
  padding: 2px 0;
}
.batch-item-status.processing {
  background: rgba(56, 189, 248, 0.1);
  color: var(--cyan);
  border: 1px solid rgba(56, 189, 248, 0.25);
}
.batch-item-status.done {
  background: rgba(16, 185, 129, 0.1);
  color: var(--green);
  border: 1px solid rgba(16, 185, 129, 0.25);
}
.batch-item-status.error {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.25);
}
.batch-item-btn-dl {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: var(--green);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
  display: none;
}
.batch-item-btn-dl:hover {
  background: rgba(16, 185, 129, 0.18);
}
.batch-item-btn-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.2s;
  flex-shrink: 0;
  line-height: 1;
}
.batch-item-btn-remove:hover {
  color: #ef4444;
}
.batch-bottom-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.batch-bottom-bar.visible {
  display: flex;
}
.batch-progress-info {
  font-size: 0.85rem;
  color: var(--text-dim);
}
.btn-dl-zip {
  display: none;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--green);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-dl-zip:hover {
  background: rgba(16, 185, 129, 0.18);
}
.btn-dl-zip.visible {
  display: inline-flex;
}
