:root {
  --bg: #07131b;
  --bg-deep: #0c2430;
  --surface: rgba(255, 251, 245, 0.92);
  --surface-strong: rgba(255, 255, 255, 0.98);
  --surface-dark: rgba(10, 24, 33, 0.76);
  --ink: #10202d;
  --muted: #5f7080;
  --muted-strong: #d8e4ee;
  --line: rgba(153, 173, 191, 0.26);
  --line-strong: rgba(82, 112, 138, 0.34);
  --teal: #0f8f73;
  --teal-strong: #0b6f59;
  --teal-soft: rgba(15, 143, 115, 0.12);
  --cobalt: #7fb6ff;
  --amber: #ffb24a;
  --rose: #dc6c57;
  --ok: #0f766e;
  --warn: #b45309;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --shadow-panel: 0 24px 80px rgba(3, 16, 24, 0.24);
  --shadow-card: 0 18px 44px rgba(10, 23, 36, 0.12);
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 12%, rgba(15, 143, 115, 0.34), transparent 28%),
    radial-gradient(circle at 82% 18%, rgba(255, 178, 74, 0.2), transparent 30%),
    linear-gradient(180deg, #102733 0%, #0b1e29 36%, var(--bg) 100%);
}

.bg-shape,
.bg-grid {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: -1;
}

.bg-shape {
  border-radius: 999px;
  filter: blur(100px);
  opacity: 0.42;
}

.bg-shape-a {
  width: 340px;
  height: 340px;
  left: -70px;
  top: -70px;
  background: #0db38e;
}

.bg-shape-b {
  width: 420px;
  height: 420px;
  right: -150px;
  top: 26%;
  background: #ffaf37;
}

.bg-grid {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.18), transparent 78%);
}

.app {
  width: min(1200px, 92vw);
  margin: 1.2rem auto 3.4rem;
  display: grid;
  gap: 1rem;
}

.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(202, 219, 233, 0.18);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(245, 250, 255, 0.88)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0));
  box-shadow: var(--shadow-panel);
  backdrop-filter: blur(18px);
}

.panel-intro {
  animation: panel-float 720ms var(--ease-out) both;
}

.panel-sticky {
  position: sticky;
  top: 1rem;
  z-index: 12;
  animation: panel-float 760ms 80ms var(--ease-out) both;
}

.panel-controls {
  animation: panel-float 820ms 120ms var(--ease-out) both;
}

.status-panel,
.empty-state,
.results-shell {
  animation: panel-float 900ms 160ms var(--ease-out) both;
}

.hero {
  padding: 1.2rem;
}

.hero::before {
  content: "";
  position: absolute;
  inset: auto 8% -100px auto;
  width: 260px;
  height: 260px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(127, 182, 255, 0.28), transparent 70%);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.9fr);
  gap: 1rem;
  align-items: stretch;
}

.hero-copy-wrap {
  display: grid;
  align-content: start;
  gap: 0.95rem;
}

.kicker,
.status-kicker,
.results-kicker,
.empty-kicker,
.hero-dash-kicker {
  margin: 0;
  font-family: "Sora", "Manrope", sans-serif;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-size: 0.74rem;
  font-weight: 700;
}

.kicker,
.hero-dash-kicker {
  color: var(--teal);
}

.hero h1,
.results-head h2,
.empty-copy h2 {
  margin: 0;
  font-family: "Sora", "Manrope", sans-serif;
  line-height: 1.02;
}

.hero h1 {
  max-width: 11ch;
  font-size: clamp(2.3rem, 4.5vw, 4.8rem);
  letter-spacing: -0.04em;
}

.hero-copy,
.hero-note,
.hero-dash-copy,
.queue-summary,
.results-meta,
.empty-text,
.empty-tip {
  margin: 0;
  color: var(--muted);
}

.hero-copy {
  max-width: 60ch;
  font-size: 1rem;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem 1rem;
}

.hero-cta,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 46px;
  padding: 0.7rem 1rem;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 180ms var(--ease-out),
    box-shadow 180ms var(--ease-out),
    background-color 180ms var(--ease-out),
    color 180ms var(--ease-out),
    border-color 180ms var(--ease-out),
    opacity 180ms ease;
}

.hero-cta {
  color: #fff;
  background: linear-gradient(135deg, var(--teal) 0%, #1e8468 100%);
  box-shadow: 0 14px 34px rgba(11, 111, 89, 0.28);
}

.hero-cta:hover,
.hero-cta:focus-visible,
button:hover:enabled,
button:focus-visible:enabled {
  transform: translateY(-1px);
}

.hero-cta:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid rgba(15, 143, 115, 0.32);
  outline-offset: 2px;
}

.hero-note {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.52rem 0.78rem;
  border-radius: 999px;
  background: rgba(12, 33, 45, 0.06);
  color: #435362;
  font-size: 0.88rem;
}

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 0.48rem;
  border-radius: 9px;
  border: 1px solid rgba(140, 158, 174, 0.4);
  background: rgba(255, 255, 255, 0.9);
  color: #203344;
  font-size: 0.78rem;
  font-weight: 800;
  box-shadow: inset 0 -2px 0 rgba(12, 33, 45, 0.08);
}

.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0.35rem 0.72rem;
  border-radius: 999px;
  background: rgba(12, 33, 45, 0.08);
  color: #1d3445;
  font-size: 0.86rem;
  font-weight: 700;
}

.hero-dash {
  position: relative;
  padding: 1rem;
  border-radius: 22px;
  border: 1px solid rgba(117, 151, 179, 0.18);
  background:
    linear-gradient(180deg, rgba(7, 23, 34, 0.88), rgba(11, 29, 41, 0.94)),
    radial-gradient(circle at top right, rgba(127, 182, 255, 0.2), transparent 44%);
  color: #f7fbff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.hero-dash-head {
  display: grid;
  gap: 0.25rem;
  margin-bottom: 0.9rem;
}

.hero-dash-copy {
  color: rgba(226, 238, 247, 0.72);
  font-size: 0.92rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.72rem;
}

.stat-card {
  padding: 0.88rem;
  border-radius: 18px;
  border: 1px solid rgba(154, 184, 206, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.stat-card-wide {
  grid-column: 1 / -1;
}

.stat-label,
.stat-note {
  display: block;
}

.stat-label {
  color: rgba(226, 238, 247, 0.72);
  font-size: 0.8rem;
  font-weight: 700;
}

.stat-card strong {
  display: block;
  margin-top: 0.38rem;
  font-family: "Sora", "Manrope", sans-serif;
  font-size: clamp(1.2rem, 2.6vw, 1.8rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.stat-note {
  margin-top: 0.32rem;
  color: rgba(208, 223, 235, 0.72);
  font-size: 0.76rem;
  line-height: 1.45;
}

.workflow-strip {
  padding: 0.95rem 1rem 1rem;
}

.workflow-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.workflow-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.72rem;
  padding: 0.78rem 0.86rem;
  border-radius: 18px;
  border: 1px solid rgba(159, 177, 194, 0.18);
  background: rgba(248, 251, 255, 0.74);
  transition:
    transform 220ms var(--ease-out),
    background-color 220ms var(--ease-out),
    border-color 220ms var(--ease-out),
    box-shadow 220ms var(--ease-out);
}

.workflow-step.is-active {
  transform: translateY(-1px);
  border-color: rgba(15, 143, 115, 0.26);
  background: linear-gradient(180deg, rgba(15, 143, 115, 0.12), rgba(255, 255, 255, 0.88));
  box-shadow: 0 16px 30px rgba(15, 143, 115, 0.08);
}

.workflow-step.is-done {
  border-color: rgba(12, 111, 89, 0.2);
  background: linear-gradient(180deg, rgba(15, 143, 115, 0.08), rgba(255, 255, 255, 0.8));
}

.workflow-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(12, 33, 45, 0.08);
  color: #21384a;
  font-family: "Sora", "Manrope", sans-serif;
  font-size: 0.86rem;
  font-weight: 700;
}

.workflow-step.is-active .workflow-index,
.workflow-step.is-done .workflow-index {
  background: rgba(15, 143, 115, 0.14);
  color: var(--teal-strong);
}

.workflow-title,
.guidance-title,
.field-title {
  margin: 0;
  font-weight: 800;
}

.workflow-copy,
.field-caption,
.guidance-copy,
.hint,
.card-hint,
.crop-help,
.crop-info,
.results-meta,
.queue-summary {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.5;
}

.progress-shell {
  margin-top: 0.9rem;
  display: grid;
  gap: 0.55rem;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.progress-label,
.progress-meta {
  margin: 0;
  font-weight: 700;
}

.progress-label {
  color: #21384a;
}

.progress-meta {
  color: var(--teal-strong);
}

.progress-track {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(165, 188, 207, 0.32), rgba(138, 165, 187, 0.18));
}

.progress-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal) 0%, var(--amber) 100%);
  box-shadow: 0 0 18px rgba(15, 143, 115, 0.28);
  transition: width 260ms var(--ease-out);
}

.controls {
  padding: 1rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.95rem;
}

.field {
  display: grid;
  gap: 0.48rem;
}

.field-full {
  grid-column: 1 / -1;
}

.field-upload {
  gap: 0.72rem;
}

.field-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 0.8rem;
}

.field-caption {
  color: var(--muted);
}

.field-title,
label {
  color: #122434;
  font-size: 0.92rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.upload-dropzone {
  position: relative;
  display: grid;
  place-items: center;
  gap: 0.42rem;
  min-height: 152px;
  padding: 1.2rem;
  border: 1.5px dashed rgba(79, 142, 255, 0.5);
  border-radius: 22px;
  background:
    radial-gradient(circle at top, rgba(127, 182, 255, 0.18), transparent 50%),
    linear-gradient(145deg, rgba(243, 248, 255, 0.98), rgba(231, 248, 242, 0.9));
  text-align: center;
  cursor: pointer;
  transition:
    transform 180ms var(--ease-out),
    border-color 180ms var(--ease-out),
    box-shadow 180ms var(--ease-out),
    background-color 180ms var(--ease-out);
}

.upload-dropzone::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.44);
  pointer-events: none;
}

.upload-dropzone:hover,
.upload-dropzone.drag-active {
  transform: translateY(-2px);
  border-color: rgba(15, 143, 115, 0.54);
  box-shadow: 0 22px 34px rgba(15, 143, 115, 0.14);
}

.upload-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--teal), #1da17d);
  color: #fff;
  font-size: 1.4rem;
  font-weight: 800;
  box-shadow: 0 12px 24px rgba(15, 143, 115, 0.24);
}

.upload-headline {
  font-family: "Sora", "Manrope", sans-serif;
  font-size: clamp(1rem, 2vw, 1.3rem);
}

.upload-subline {
  max-width: 58ch;
  color: var(--muted);
  font-size: 0.9rem;
}

input[type="number"],
input[type="range"],
select {
  width: 100%;
}

input[type="number"],
select {
  min-height: 46px;
  padding: 0.7rem 0.82rem;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.preset-chip {
  min-height: 38px;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  background: rgba(12, 33, 45, 0.06);
  color: #1f3445;
  box-shadow: none;
}

.preset-chip.is-active {
  background: linear-gradient(135deg, var(--teal) 0%, #1b8368 100%);
  color: #fff;
  box-shadow: 0 10px 20px rgba(11, 111, 89, 0.18);
}

.guidance-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.72rem;
}

.guidance-card {
  padding: 0.86rem;
  border-radius: 18px;
  border: 1px solid rgba(153, 173, 191, 0.18);
  background: rgba(248, 251, 255, 0.72);
}

.guidance-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-bottom: 0.55rem;
  border-radius: 999px;
  background: rgba(15, 143, 115, 0.14);
  color: var(--teal-strong);
  font-size: 0.82rem;
  font-weight: 800;
}

.action-row {
  align-items: center;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

button {
  background: rgba(12, 33, 45, 0.08);
  color: #17293a;
  box-shadow: inset 0 -1px 0 rgba(12, 33, 45, 0.04);
}

button:disabled {
  opacity: 0.46;
  cursor: not-allowed;
  transform: none;
}

#compressBtn,
.download-btn {
  color: #fff;
  background: linear-gradient(135deg, var(--teal) 0%, #1c8368 100%);
  box-shadow: 0 14px 28px rgba(11, 111, 89, 0.2);
}

#compressBtn:hover:enabled,
.download-btn:hover:enabled {
  background: linear-gradient(135deg, var(--teal-strong) 0%, #146b55 100%);
}

#downloadAllBtn {
  background: rgba(255, 178, 74, 0.16);
  color: #7c4302;
}

#clearBtn,
.remove-btn {
  background: rgba(220, 108, 87, 0.14);
  color: #8f2f20;
}

.status-panel {
  padding: 0.95rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.status-copy {
  display: grid;
  gap: 0.18rem;
}

.status-kicker {
  color: var(--teal);
}

#statusText {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}

.queue-summary {
  max-width: 60ch;
  text-align: right;
}

.empty-state {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.1rem;
}

.empty-state[hidden],
.results-shell[hidden] {
  display: none;
}

.empty-art {
  position: relative;
  min-height: 220px;
}

.empty-core,
.empty-orbit {
  position: absolute;
  inset: 50% auto auto 50%;
  border-radius: 999px;
  transform: translate(-50%, -50%);
}

.empty-core {
  width: 88px;
  height: 88px;
  background: linear-gradient(135deg, rgba(15, 143, 115, 0.22), rgba(127, 182, 255, 0.36));
  box-shadow: 0 0 0 20px rgba(255, 255, 255, 0.2), 0 16px 48px rgba(12, 33, 45, 0.16);
}

.empty-orbit-a {
  width: 170px;
  height: 170px;
  border: 1px solid rgba(15, 143, 115, 0.24);
  animation: orbit-spin 16s linear infinite;
}

.empty-orbit-b {
  width: 220px;
  height: 220px;
  border: 1px dashed rgba(127, 182, 255, 0.34);
  animation: orbit-spin 22s linear infinite reverse;
}

.empty-copy {
  display: grid;
  gap: 0.72rem;
}

.empty-kicker {
  color: var(--teal);
}

.empty-copy h2 {
  font-size: clamp(1.6rem, 3vw, 2.5rem);
  letter-spacing: -0.035em;
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1rem;
  align-items: center;
}

.results-shell {
  display: grid;
  gap: 1rem;
}

.results-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  color: #f8fbff;
}

.results-kicker {
  color: rgba(241, 248, 255, 0.7);
}

.results-head h2 {
  font-size: clamp(1.5rem, 2.4vw, 2.2rem);
  letter-spacing: -0.03em;
}

.results-meta {
  max-width: 48ch;
  color: rgba(222, 234, 244, 0.78);
  text-align: right;
}

.results {
  display: grid;
  gap: 1rem;
  --tile-min-width: 300px;
  --stage-ratio: 16 / 10;
}

.results.size-small {
  --tile-min-width: 250px;
  --stage-ratio: 16 / 8.5;
}

.results.size-medium {
  --tile-min-width: 320px;
  --stage-ratio: 16 / 10;
}

.results.size-large {
  --tile-min-width: 380px;
  --stage-ratio: 16 / 12;
}

.results.tile-mode {
  grid-template-columns: repeat(auto-fill, minmax(var(--tile-min-width), 1fr));
  align-items: start;
}

.card {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 250, 255, 0.94));
  border: 1px solid rgba(215, 224, 234, 0.76);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition:
    transform 220ms var(--ease-out),
    border-color 220ms var(--ease-out),
    box-shadow 220ms var(--ease-out),
    background-color 220ms var(--ease-out);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 46px rgba(10, 23, 36, 0.16);
}

.card[data-state="done"] {
  border-color: rgba(15, 143, 115, 0.26);
}

.card[data-state="cropped"] {
  border-color: rgba(255, 178, 74, 0.28);
}

.card-header {
  padding: 0.94rem 1rem 0.7rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.card-header-right {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.file-name {
  margin: 0;
  font-size: 1.02rem;
  word-break: break-all;
}

.meta-line {
  margin: 0.26rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.target-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(12, 33, 45, 0.08);
  color: #334155;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.target-badge.ok {
  background: rgba(15, 143, 115, 0.14);
  color: var(--ok);
}

.target-badge.warn {
  background: rgba(255, 178, 74, 0.18);
  color: var(--warn);
}

.remove-btn {
  min-width: 32px;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 800;
}

.compare-shell {
  padding: 0 1rem 1rem;
}

.compare-stage {
  position: relative;
  border-radius: 16px;
  border: 1px solid rgba(180, 194, 208, 0.5);
  overflow: hidden;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.56), transparent 48%),
    linear-gradient(180deg, rgba(242, 247, 251, 0.98), rgba(229, 238, 247, 0.92));
  aspect-ratio: var(--stage-ratio);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: transform 220ms var(--ease-out), border-color 220ms var(--ease-out);
}

.card:hover .compare-stage {
  transform: scale(1.01);
  border-color: rgba(12, 111, 89, 0.24);
}

.preview-compressed,
.preview-original,
.crop-modal-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
  background-image:
    linear-gradient(45deg, #eef3f8 25%, #dfe7f0 25%, #dfe7f0 50%, #eef3f8 50%, #eef3f8 75%, #dfe7f0 75%, #dfe7f0 100%);
  background-size: 18px 18px;
}

.before-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  clip-path: inset(0 calc(100% - var(--split)) 0 0);
}

.compare-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--split);
  width: 2px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 0 0 1px rgba(2, 6, 23, 0.14);
  transform: translateX(-1px);
  pointer-events: none;
}

.compare-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.2);
}

.compare-knob::before,
.compare-knob::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 6px;
  height: 2px;
  background: #334155;
}

.compare-knob::before {
  left: 7px;
  transform: translateY(-50%);
}

.compare-knob::after {
  right: 7px;
  transform: translateY(-50%);
}

.compare-range {
  position: absolute;
  inset: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
}

.compare-tag {
  position: absolute;
  top: 0.72rem;
  padding: 0.26rem 0.56rem;
  border-radius: 999px;
  background: rgba(10, 24, 33, 0.76);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  pointer-events: none;
}

.before-tag {
  left: 0.72rem;
}

.after-tag {
  right: 0.72rem;
}

.card-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.9rem;
  align-items: center;
  padding: 0.84rem 1rem 1rem;
  border-top: 1px solid rgba(215, 224, 234, 0.78);
}

.card-copy {
  display: grid;
  gap: 0.3rem;
}

.size-summary {
  margin: 0;
  color: #334155;
  line-height: 1.5;
  font-size: 0.92rem;
}

.card-hint {
  color: #6a7a88;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.crop-btn,
.clear-crop-btn {
  background: rgba(127, 182, 255, 0.18);
  color: #163655;
}

.crop-btn:hover:enabled,
.clear-crop-btn:hover:enabled {
  background: rgba(127, 182, 255, 0.28);
}

.crop-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(7, 19, 27, 0.74);
  z-index: 40;
  backdrop-filter: blur(12px);
}

.crop-modal[hidden] {
  display: none;
}

.crop-dialog {
  width: min(1040px, 96vw);
  max-height: 92vh;
  overflow: auto;
  padding: 1rem;
}

.crop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.crop-header h3 {
  margin: 0;
  font-family: "Sora", "Manrope", sans-serif;
  font-size: 1.08rem;
}

.crop-close-btn {
  min-width: 34px;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 999px;
}

.crop-canvas-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
  margin-top: 0.8rem;
  touch-action: none;
  user-select: none;
}

.crop-modal-image {
  max-width: min(920px, 92vw);
  max-height: 68vh;
  border-radius: 16px;
  border: 1px solid rgba(180, 194, 208, 0.52);
}

.crop-selection {
  position: absolute;
  border: 2px solid #22c55e;
  border-radius: 8px;
  box-shadow: 0 0 0 200vmax rgba(2, 6, 23, 0.54);
  pointer-events: none;
}

.results.tile-mode .card-header {
  padding: 0.8rem 0.82rem 0.58rem;
}

.results.tile-mode .compare-shell {
  padding: 0 0.82rem 0.82rem;
}

.results.tile-mode .card-footer {
  grid-template-columns: 1fr;
  padding: 0.72rem 0.82rem 0.82rem;
}

.results.tile-mode .card-actions {
  justify-content: flex-start;
}

.results.tile-mode .target-badge {
  font-size: 0.72rem;
}

.results.tile-mode .file-name {
  font-size: 0.94rem;
}

.results.tile-mode .meta-line,
.results.tile-mode .size-summary,
.results.tile-mode .card-hint {
  font-size: 0.8rem;
}

.results.tile-mode .compare-tag {
  font-size: 0.68rem;
}

body.is-compressing .workflow-strip {
  box-shadow: 0 24px 90px rgba(15, 143, 115, 0.16);
}

body.is-compressing .progress-fill {
  animation: progress-breathe 1.6s ease-in-out infinite;
}

@keyframes panel-float {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes orbit-spin {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes progress-breathe {
  0%,
  100% {
    filter: saturate(1);
  }
  50% {
    filter: saturate(1.15);
  }
}

@media (max-width: 1040px) {
  .hero-grid,
  .empty-state {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    max-width: 13ch;
  }

  .controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .guidance-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .app {
    width: min(94vw, 1200px);
    margin-top: 0.9rem;
  }

  .panel-sticky {
    position: relative;
    top: auto;
  }

  .workflow-steps,
  .controls {
    grid-template-columns: 1fr;
  }

  .status-panel,
  .results-head,
  .field-head {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: flex-start;
  }

  .card-footer {
    grid-template-columns: 1fr;
  }

  .queue-summary,
  .results-meta {
    text-align: left;
  }

  .card-actions {
    justify-content: flex-start;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
