:root {
  --bg: #f5f5f7;
  --bg-deep: #e9ecf2;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #fbfbfd;
  --surface-soft: rgba(255, 255, 255, 0.52);
  --surface-hover: rgba(255, 255, 255, 0.86);
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --quiet: #8e8e93;
  --line: rgba(60, 60, 67, 0.16);
  --line-strong: rgba(60, 60, 67, 0.28);
  --accent: #007aff;
  --accent-strong: #0057d9;
  --accent-soft: rgba(0, 122, 255, 0.12);
  --success: #34c759;
  --danger: #ff3b30;
  --warning: #ff9500;
  --shadow: 0 28px 70px rgba(31, 35, 45, 0.14);
  --shadow-soft: 0 12px 34px rgba(31, 35, 45, 0.08);
  --radius: 22px;
  --radius-control: 12px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  font-family: var(--font);
  background:
    radial-gradient(circle at 18% 8%, rgba(0, 122, 255, 0.16), transparent 28%),
    radial-gradient(circle at 84% 0%, rgba(52, 199, 89, 0.12), transparent 24%),
    linear-gradient(180deg, #fbfbfd 0%, var(--bg) 44%, var(--bg-deep) 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.18) 0 1px, transparent 1px 72px);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.app-shell {
  width: min(1500px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 26px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 2px 4px 18px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 40px;
  line-height: 1.06;
  font-weight: 760;
}

h2 {
  font-size: 17px;
  line-height: 1.25;
  font-weight: 680;
}

.title-stack {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}

.tool-tabs {
  display: inline-flex;
  gap: 3px;
  margin-top: 15px;
  border: 1px solid rgba(60, 60, 67, 0.1);
  border-radius: 999px;
  padding: 4px;
  background: rgba(118, 118, 128, 0.12);
  box-shadow: inset 0 1px 1px rgba(31, 35, 45, 0.04);
}

.tool-tab {
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  padding: 0 16px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 680;
  transition:
    color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.tool-tab:hover {
  color: var(--ink);
}

.tool-tab.active {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.78) inset, 0 8px 20px rgba(31, 35, 45, 0.08);
}

.tool-tab:active {
  transform: scale(0.98);
}

.top-actions,
.preview-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.button,
.text-button,
.icon-button,
.preset-row button {
  -webkit-tap-highlight-color: transparent;
  transition:
    transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1),
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
}

.button {
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 999px;
  padding: 0 18px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.62)),
    rgba(255, 255, 255, 0.72);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.72) inset, 0 12px 28px rgba(31, 35, 45, 0.08);
  font-size: 14px;
  font-weight: 680;
}

.button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.92);
  transform: translateY(-1px);
}

.button:active:not(:disabled),
.text-button:active:not(:disabled),
.icon-button:active:not(:disabled),
.preset-row button:active:not(:disabled) {
  transform: scale(0.98);
}

.button.primary,
.button.solid {
  color: #f5f5f7;
  border-color: rgba(0, 122, 255, 0.72);
  background: linear-gradient(180deg, #1b8dff 0%, var(--accent) 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.28) inset, 0 16px 34px rgba(0, 122, 255, 0.28);
}

.button.primary:hover:not(:disabled),
.button.solid:hover:not(:disabled) {
  background: linear-gradient(180deg, #2f98ff 0%, var(--accent-strong) 100%);
}

.button.ghost {
  color: var(--ink);
}

.text-button {
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  padding: 0 11px;
  color: var(--accent);
  background: transparent;
  font-size: 13px;
  font-weight: 650;
}

.text-button:hover:not(:disabled) {
  background: var(--accent-soft);
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.metric {
  min-height: 82px;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 18px;
  padding: 15px 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.58)),
    var(--surface);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(26px) saturate(170%);
  -webkit-backdrop-filter: blur(26px) saturate(170%);
}

.metric.accent {
  border-color: rgba(0, 122, 255, 0.18);
  background:
    radial-gradient(circle at 85% 0%, rgba(0, 122, 255, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.58));
}

.metric-label {
  display: block;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 590;
}

.metric strong {
  font-size: 27px;
  line-height: 1;
  font-weight: 760;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(270px, 340px) minmax(430px, 1fr) minmax(286px, 340px);
  gap: 16px;
  align-items: stretch;
}

.queue-panel,
.preview-panel,
.control-panel {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.56)),
    var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(34px) saturate(180%);
  -webkit-backdrop-filter: blur(34px) saturate(180%);
}

.queue-panel,
.control-panel,
.preview-panel {
  display: flex;
  flex-direction: column;
  padding: 16px;
}

.dropzone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 178px;
  overflow: hidden;
  border: 1px solid rgba(60, 60, 67, 0.12);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 0%, rgba(0, 122, 255, 0.13), transparent 44%),
    rgba(255, 255, 255, 0.52);
  text-align: center;
  outline: none;
}

.dropzone::after {
  position: absolute;
  inset: 1px;
  border-radius: 17px;
  pointer-events: none;
  content: "";
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.dropzone.dragging,
.dropzone:focus-visible {
  border-color: rgba(0, 122, 255, 0.55);
  background:
    radial-gradient(circle at 50% 0%, rgba(0, 122, 255, 0.22), transparent 48%),
    rgba(255, 255, 255, 0.72);
  box-shadow: 0 0 0 5px rgba(0, 122, 255, 0.13);
}

.drop-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 17px;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 12px 28px rgba(31, 35, 45, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.92);
  font-size: 30px;
  line-height: 1;
  font-weight: 360;
}

.drop-title {
  display: block;
  color: var(--ink);
  font-size: 16px;
  font-weight: 680;
}

.drop-copy {
  display: block;
  max-width: 235px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.queue-head,
.preview-top,
.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.queue-head {
  padding: 18px 2px 9px;
}

.queue-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.queue-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 278px;
  overflow: auto;
  border-top: 1px solid var(--line);
}

.queue-list::-webkit-scrollbar {
  width: 10px;
}

.queue-list::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: rgba(60, 60, 67, 0.22);
  background-clip: content-box;
}

.queue-empty {
  display: grid;
  place-items: center;
  min-height: 180px;
  color: var(--quiet);
  font-size: 14px;
  text-align: center;
}

.queue-item {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  width: 100%;
  padding: 10px 8px;
  border: 0;
  border-bottom: 1px solid rgba(60, 60, 67, 0.1);
  border-radius: 13px;
  color: inherit;
  background: transparent;
  text-align: left;
}

.queue-item:hover {
  background: rgba(255, 255, 255, 0.48);
}

.queue-item.selected {
  background: rgba(0, 122, 255, 0.1);
}

.thumb {
  width: 46px;
  height: 46px;
  overflow: hidden;
  border: 1px solid rgba(60, 60, 67, 0.12);
  border-radius: 12px;
  background: #fbfbfd;
  box-shadow: 0 7px 18px rgba(31, 35, 45, 0.08);
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-main {
  min-width: 0;
}

.file-name {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-meta {
  display: flex;
  gap: 7px;
  align-items: center;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 8px;
  color: var(--muted);
  background: rgba(118, 118, 128, 0.12);
  font-size: 12px;
  font-weight: 650;
}

.status-pill.done {
  color: #176b30;
  background: rgba(52, 199, 89, 0.16);
}

.status-pill.error {
  color: #a81f17;
  background: rgba(255, 59, 48, 0.14);
}

.row-actions {
  display: flex;
  gap: 5px;
  align-items: center;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border: 1px solid rgba(60, 60, 67, 0.1);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  font-size: 15px;
  font-weight: 520;
}

.icon-button:hover:not(:disabled) {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.86);
}

.preview-top {
  align-items: center;
  padding: 2px 2px 14px;
}

.preview-top h2 {
  max-width: 430px;
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comparison {
  position: relative;
  flex: 1;
  min-height: 520px;
  overflow: hidden;
  border: 1px solid rgba(60, 60, 67, 0.12);
  border-radius: 20px;
  background:
    linear-gradient(45deg, rgba(60, 60, 67, 0.055) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(60, 60, 67, 0.055) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(60, 60, 67, 0.055) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(60, 60, 67, 0.055) 75%);
  background-color: rgba(255, 255, 255, 0.62);
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  background-size: 24px 24px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.compare-image {
  position: absolute;
  inset: 0;
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 20px;
}

.comparison.has-image .compare-image.original {
  display: block;
}

.comparison.has-output .compare-image.compressed {
  display: block;
}

.compare-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  z-index: 3;
  display: none;
  width: 2px;
  background: rgba(0, 122, 255, 0.94);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.86);
}

.comparison.has-output .compare-divider {
  display: block;
}

.compare-divider::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.16)),
    rgba(0, 122, 255, 0.72);
  box-shadow: 0 10px 26px rgba(0, 122, 255, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  content: "";
  transform: translate(-50%, -50%);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
}

.compare-divider::before {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: 13px;
  height: 13px;
  border-right: 2px solid rgba(255, 255, 255, 0.92);
  border-bottom: 2px solid rgba(255, 255, 255, 0.92);
  content: "";
  transform: translate(-50%, -50%) rotate(135deg);
}

.compare-range {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: none;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
}

.comparison.has-output .compare-range {
  display: block;
}

.preview-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
}

.preview-empty strong {
  color: var(--ink);
  font-size: 22px;
  font-weight: 720;
}

.preview-empty span {
  font-size: 14px;
}

.comparison.has-image .preview-empty {
  display: none;
}

.compare-badge {
  position: absolute;
  top: 14px;
  z-index: 5;
  display: none;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 999px;
  padding: 6px 11px;
  color: rgba(29, 29, 31, 0.88);
  background: rgba(255, 255, 255, 0.64);
  box-shadow: 0 10px 24px rgba(31, 35, 45, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 650;
  backdrop-filter: blur(18px) saturate(170%);
  -webkit-backdrop-filter: blur(18px) saturate(170%);
}

.comparison.has-image .compare-badge.before {
  left: 14px;
  display: inline-flex;
}

.comparison.has-output .compare-badge.after {
  right: 14px;
  display: inline-flex;
  color: var(--accent);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.detail-grid div {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 16px;
  padding: 12px 13px;
  background: rgba(255, 255, 255, 0.54);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.detail-grid span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 590;
}

.detail-grid strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 690;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.control-panel {
  gap: 16px;
}

.panel-heading {
  display: block;
}

.settings-group {
  padding-top: 16px;
  border-top: 1px solid rgba(60, 60, 67, 0.1);
}

.settings-group:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.settings-group[hidden] {
  display: none;
}

.field-label,
.range-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

select,
input[type="number"],
input[type="color"] {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(60, 60, 67, 0.14);
  border-radius: var(--radius-control);
  padding: 0 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: inset 0 1px 1px rgba(31, 35, 45, 0.04), 0 1px 0 rgba(255, 255, 255, 0.74);
  outline: none;
}

input[type="color"] {
  padding: 4px;
}

select:focus,
input:focus {
  border-color: rgba(0, 122, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.13);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

output {
  min-width: 48px;
  color: var(--accent);
  text-align: right;
}

.tick-row {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  color: var(--quiet);
  font-size: 12px;
}

.dimension-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.dimension-row label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 590;
}

.preset-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
}

.preset-row button {
  min-height: 34px;
  border: 1px solid rgba(60, 60, 67, 0.11);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(118, 118, 128, 0.1);
  font-size: 12px;
  font-weight: 650;
}

.preset-row button:hover,
.preset-row button.active {
  color: var(--accent);
  border-color: rgba(0, 122, 255, 0.2);
  background: rgba(0, 122, 255, 0.12);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 590;
}

.check-row input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}

.field-hint {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.status-card {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 10px;
  align-items: start;
  border: 1px solid rgba(60, 60, 67, 0.1);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.52);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.status-dot {
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(52, 199, 89, 0.13);
}

.status-dot[data-state="working"] {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.13);
}

.status-dot[data-state="error"] {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(255, 59, 48, 0.13);
}

.status-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 680;
}

.status-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .metric,
  .queue-panel,
  .preview-panel,
  .control-panel,
  .compare-badge {
    background: rgba(255, 255, 255, 0.94);
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16171a;
    --bg-deep: #0f1013;
    --surface: rgba(36, 37, 42, 0.72);
    --surface-solid: #24252a;
    --surface-soft: rgba(52, 53, 59, 0.56);
    --surface-hover: rgba(60, 61, 67, 0.72);
    --ink: #f5f5f7;
    --muted: #a1a1a6;
    --quiet: #7d7d83;
    --line: rgba(255, 255, 255, 0.13);
    --line-strong: rgba(255, 255, 255, 0.22);
    --shadow: 0 28px 74px rgba(0, 0, 0, 0.36);
    --shadow-soft: 0 12px 34px rgba(0, 0, 0, 0.24);
  }

  body {
    background:
      radial-gradient(circle at 20% 0%, rgba(0, 122, 255, 0.18), transparent 26%),
      radial-gradient(circle at 84% 4%, rgba(52, 199, 89, 0.1), transparent 22%),
      linear-gradient(180deg, #202126 0%, var(--bg) 48%, var(--bg-deep) 100%);
  }

  body::before {
    background-image:
      linear-gradient(rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0)),
      repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 72px);
  }

  .button {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(72, 73, 79, 0.64);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 12px 28px rgba(0, 0, 0, 0.22);
  }

  .button:hover:not(:disabled),
  .icon-button:hover:not(:disabled) {
    background: rgba(84, 85, 92, 0.76);
  }

  .metric,
  .queue-panel,
  .preview-panel,
  .control-panel {
    border-color: rgba(255, 255, 255, 0.12);
    background:
      linear-gradient(180deg, rgba(58, 59, 65, 0.74), rgba(34, 35, 40, 0.62)),
      var(--surface);
  }

  .metric.accent {
    background:
      radial-gradient(circle at 85% 0%, rgba(0, 122, 255, 0.26), transparent 34%),
      linear-gradient(180deg, rgba(58, 59, 65, 0.74), rgba(34, 35, 40, 0.62));
  }

  .dropzone,
  .detail-grid div,
  .status-card,
  .tool-tab.active,
  select,
  input[type="number"],
  input[type="color"],
  .icon-button {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
  }

  .drop-mark {
    color: #66b3ff;
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.1);
  }

  .comparison {
    border-color: rgba(255, 255, 255, 0.12);
    background-color: rgba(25, 26, 30, 0.62);
  }

  .compare-badge {
    color: rgba(245, 245, 247, 0.92);
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(46, 47, 52, 0.66);
  }

  .status-pill.done {
    color: #6ee68d;
  }

  .status-pill.error {
    color: #ff8a83;
  }
}

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

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: minmax(260px, 340px) minmax(420px, 1fr);
  }

  .control-panel {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: start;
  }

  .panel-heading {
    grid-column: 1 / -1;
  }

  .settings-group {
    border-top: 0;
    padding-top: 0;
  }
}

@media (max-width: 860px) {
  .app-shell {
    padding: 18px;
  }

  .topbar,
  .preview-top {
    align-items: stretch;
    flex-direction: column;
  }

  h1 {
    font-size: 34px;
  }

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

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

  .queue-list {
    min-height: 160px;
    max-height: 320px;
  }

  .comparison {
    min-height: 430px;
  }

  .control-panel {
    display: flex;
  }

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

@media (max-width: 560px) {
  .app-shell {
    padding: 14px;
  }

  h1 {
    font-size: 30px;
  }

  .metric-strip,
  .dimension-row,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .top-actions,
  .preview-actions {
    width: 100%;
  }

  .top-actions .button,
  .preview-actions .button {
    flex: 1;
  }

  .comparison {
    min-height: 340px;
  }

  .queue-item {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .row-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}
