:root {
  --bg: #f2f7fc;
  --bg-soft: #fbfdff;
  --panel: rgba(252, 254, 255, 0.992);
  --panel-strong: rgba(255, 255, 255, 1);
  --panel-inset: rgba(247, 251, 255, 0.995);
  --text: #071428;
  --muted: #465f7c;
  --gold: #1392ff;
  --gold-soft: rgba(19, 146, 255, 0.1);
  --emerald: #0b71ff;
  --emerald-soft: rgba(11, 113, 255, 0.1);
  --blue: #004fe4;
  --blue-soft: rgba(0, 79, 228, 0.14);
  --danger: #e45f5f;
  --line: rgba(72, 116, 176, 0.34);
  --line-strong: rgba(37, 82, 162, 0.48);
  --shadow: 0 18px 36px rgba(9, 36, 78, 0.09);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html, body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Comfortaa", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(36, 130, 255, 0.08), transparent 17%),
    radial-gradient(circle at 85% 8%, rgba(0, 63, 177, 0.08), transparent 18%),
    linear-gradient(180deg, #ffffff 0%, #f4f8fc 50%, #e7eef7 100%);
  overflow-x: hidden;
}

.page-glow {
  position: fixed;
  width: 24rem;
  height: 24rem;
  filter: blur(90px);
  opacity: 0.24;
  pointer-events: none;
  z-index: 0;
}

.glow-left {
  top: -8rem;
  left: -6rem;
  background: rgba(36, 132, 255, 0.12);
}

.glow-right {
  top: 10rem;
  right: -8rem;
  background: rgba(0, 60, 184, 0.1);
}

.grid-noise {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(60, 101, 160, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(60, 101, 160, 0.05) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.35), transparent);
  pointer-events: none;
  z-index: 0;
}

.matrix-overlay {
  position: fixed;
  inset: 0;
  z-index: 32;
  overflow: hidden;
  pointer-events: none;
}

.matrix-overlay.hidden {
  display: none;
}

.matrix-line {
  position: absolute;
  left: -8%;
  right: -8%;
  color: rgba(12, 93, 202, 0.24);
  font-family: "Comfortaa", sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  white-space: nowrap;
  text-transform: uppercase;
  filter: blur(0.25px);
  opacity: 0;
  will-change: transform, opacity, letter-spacing;
}

.matrix-line.left {
  text-align: left;
  transform: translateX(-18vw) scaleX(1.08);
}

.matrix-line.right {
  text-align: right;
  transform: translateX(18vw) scaleX(1.08);
}

body.app-ready .matrix-overlay {
  opacity: 0;
  transition: opacity 1080ms ease 1180ms;
}

body.app-ready .matrix-line {
  animation: matrixSweep 1180ms cubic-bezier(.2,.9,.22,1) forwards;
}

body.app-ready .matrix-line.right {
  animation-name: matrixSweepRight;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(920px, calc(100% - 24px));
  margin: 0 auto;
  padding: 12px 0 32px;
}

.mini-topbar,
.top-tabs,
.upload-card,
.status-card,
.stats-grid,
.jobs-panel {
  opacity: 0;
  will-change: transform, opacity;
}

.mini-topbar {
  transform: translateY(-24px) scale(0.98);
}

.top-tabs {
  transform: translateX(-24px);
}

.upload-card {
  transform: translateX(-34px);
}

.status-card {
  transform: translateX(34px);
}

.stats-grid,
.jobs-panel {
  transform: translateY(28px);
}

body.app-ready .mini-topbar,
body.app-ready .top-tabs,
body.app-ready .upload-card,
body.app-ready .status-card,
body.app-ready .stats-grid,
body.app-ready .jobs-panel {
  opacity: 1;
  transform: translate(0, 0) scale(1);
}

body.app-ready .mini-topbar {
  transition: transform 760ms cubic-bezier(.2,.9,.22,1), opacity 620ms ease;
}

body.app-ready .top-tabs {
  transition: transform 760ms cubic-bezier(.2,.9,.22,1) 120ms, opacity 620ms ease 120ms;
}

body.app-ready .upload-card {
  transition: transform 880ms cubic-bezier(.2,.9,.22,1) 220ms, opacity 720ms ease 220ms;
}

body.app-ready .status-card {
  transition: transform 880ms cubic-bezier(.2,.9,.22,1) 320ms, opacity 720ms ease 320ms;
}

body.app-ready .stats-grid,
body.app-ready .jobs-panel {
  transition: transform 820ms cubic-bezier(.2,.9,.22,1) 420ms, opacity 680ms ease 420ms;
}

@keyframes matrixSweep {
  0% {
    opacity: 0;
    letter-spacing: 0.42em;
    filter: blur(6px);
    transform: translateX(-18vw) scaleX(1.12);
  }
  28% {
    opacity: 0.46;
  }
  100% {
    opacity: 0;
    letter-spacing: 0.18em;
    filter: blur(10px);
    transform: translateX(1vw) scaleX(1);
  }
}

@keyframes matrixSweepRight {
  0% {
    opacity: 0;
    letter-spacing: 0.42em;
    filter: blur(6px);
    transform: translateX(18vw) scaleX(1.12);
  }
  28% {
    opacity: 0.46;
  }
  100% {
    opacity: 0;
    letter-spacing: 0.18em;
    filter: blur(10px);
    transform: translateX(-1vw) scaleX(1);
  }
}

.panel {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.995), rgba(246, 250, 255, 0.99)),
    linear-gradient(135deg, rgba(223, 236, 250, 0.22), transparent 52%);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), transparent 18%),
    linear-gradient(90deg, rgba(19, 115, 255, 0.04), transparent 28%, transparent 72%, rgba(19, 115, 255, 0.03));
  pointer-events: none;
}

.panel-inset {
  background: linear-gradient(180deg, rgba(252, 254, 255, 1), rgba(240, 246, 253, 0.99));
  border-radius: var(--radius-lg);
}

.mini-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 22px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-logo-shell {
  width: 48px;
  height: 48px;
  padding: 4px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(216, 231, 246, 0.72));
  border: 1px solid rgba(96, 140, 203, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 11px;
  object-fit: cover;
}

.topbar-title {
  margin-top: 2px;
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--text);
}

.topbar-greeting {
  margin-top: 2px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

.topbar-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0.56rem 0.82rem;
  border-radius: 999px;
  background: rgba(242, 252, 245, 0.98);
  border: 1px solid rgba(91, 190, 107, 0.24);
  color: #216235;
  flex-shrink: 0;
  font-size: 0.92rem;
  font-weight: 700;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "Ethnocentric", "Comfortaa", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blue);
}

.section-heading h2 {
  margin: 8px 0 0;
  font-family: "Comfortaa", sans-serif;
  font-size: clamp(1.6rem, 3vw, 2.35rem);
  line-height: 0.98;
}

.section-copy {
  max-width: 28rem;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.dropzone-actions,
.search-wrap,
.chip-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}

button:hover {
  transform: translateY(-1px);
}

.primary-btn,
.ghost-btn,
.chip,
.tab-btn {
  border-radius: 999px;
  padding: 0.82rem 1.08rem;
  font-weight: 700;
}

.primary-btn {
  background: linear-gradient(180deg, #1f9bff 0%, #006aff 56%, #0048c2 100%);
  color: #f7fbff;
  border: 1px solid rgba(0, 75, 194, 0.58);
  box-shadow:
    0 10px 18px rgba(0, 72, 173, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.ghost-btn,
.chip,
.tab-btn {
  background: rgba(250, 252, 255, 0.98);
  color: var(--text);
  border: 1px solid rgba(96, 140, 203, 0.24);
}

.ghost-btn:hover,
.chip:hover,
.tab-btn:hover {
  border-color: rgba(15, 176, 255, 0.46);
}

.small-btn {
  padding: 0.75rem 1rem;
}

.submit-btn {
  width: 100%;
  justify-content: center;
  margin-top: 4px;
}

.top-tabs {
  display: flex;
  gap: 8px;
  padding: 8px;
  margin-top: 14px;
  border-radius: 999px;
}

.tab-btn.active,
.chip.active {
  background: linear-gradient(180deg, rgba(244, 250, 255, 1), rgba(225, 238, 254, 0.98));
  border-color: var(--line-strong);
  color: #0a2344;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 4px 12px rgba(0, 86, 188, 0.06);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.stats-strip {
  gap: 0;
  overflow: hidden;
}

.stat-card {
  padding: 14px;
  border-radius: var(--radius-lg);
  min-height: 88px;
}

.stats-strip .stat-card {
  min-height: 72px;
  padding: 12px 10px;
  display: grid;
  align-content: center;
  border-right: 1px solid rgba(129, 180, 229, 0.14);
}

.stats-strip .stat-card:last-child {
  border-right: 0;
}

.stat-label {
  color: var(--muted);
  font-size: 0.92rem;
}

.stat-value {
  display: block;
  margin-top: 14px;
  font-family: "Comfortaa", sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
}

.stats-strip .stat-value {
  margin-top: 6px;
  font-size: clamp(1.2rem, 2vw, 1.7rem);
}

.tab-content {
  display: none;
  margin-top: 16px;
}

.tab-content.active {
  display: block;
  animation: fadeSlide 260ms ease;
}

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

.upload-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.7fr);
  gap: 14px;
}

.upload-card,
.status-card,
.jobs-panel {
  padding: 20px;
}

.compact-stats .stat-value {
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.heading-copy {
  max-width: 30rem;
}

.upload-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.56rem 0.82rem;
  border-radius: 999px;
  background: rgba(248, 251, 255, 0.99);
  border: 1px solid rgba(96, 140, 203, 0.24);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #0d84ff;
  box-shadow: 0 0 14px rgba(13, 132, 255, 0.24);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2dbb4f;
  box-shadow: 0 0 18px rgba(45, 187, 79, 0.58);
}

.dropzone {
  margin-top: 16px;
  padding: 12px;
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(70, 126, 196, 0.4);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(240, 247, 255, 0.92)),
    rgba(243, 248, 255, 0.98);
  min-height: 164px;
  display: grid;
  place-items: center;
  transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.dropzone.dragover {
  border-color: rgba(0, 98, 224, 0.62);
  background:
    linear-gradient(180deg, rgba(25, 122, 255, 0.12), transparent),
    rgba(236, 244, 255, 1);
  transform: translateY(-2px);
}

.dropzone.selected {
  border-color: rgba(54, 134, 220, 0.38);
  background:
    linear-gradient(180deg, rgba(12, 111, 246, 0.06), transparent),
    rgba(240, 247, 255, 0.99);
  box-shadow: 0 16px 34px rgba(18, 82, 162, 0.08);
}

.dropzone-inner {
  text-align: center;
  max-width: 24rem;
}

.dropzone-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 8px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(222, 236, 249, 0.86)),
    rgba(255, 255, 255, 0.7);
  position: relative;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 10px 20px rgba(28, 76, 142, 0.12);
}

.dropzone-icon::before,
.dropzone-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #3db3ff, #005de5);
}

.dropzone-icon::before {
  top: 12px;
  width: 6px;
  height: 18px;
  border-radius: 999px;
}

.dropzone-icon::after {
  top: 23px;
  width: 18px;
  height: 18px;
  clip-path: polygon(50% 100%, 0 34%, 26% 34%, 26% 0, 74% 0, 74% 34%, 100% 34%);
  border-radius: 0;
}

.dropzone h3 {
  margin: 0;
  font-family: "Comfortaa", sans-serif;
  font-size: 1.08rem;
}

.dropzone p,
.summary-empty,
.current-job p,
.job-meta,
.job-subline,
.file-meta,
.field-label span {
  color: var(--muted);
}

.dropzone p {
  margin: 6px auto 0;
  max-width: 20rem;
  font-size: 0.9rem;
  line-height: 1.4;
}

.dropzone-actions {
  justify-content: center;
  margin-top: 14px;
}

.dropzone-mini-pills {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.mini-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.34rem 0.66rem;
  border-radius: 999px;
  background: rgba(251, 253, 255, 0.99);
  border: 1px solid rgba(96, 140, 203, 0.22);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.dropzone-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  padding: 0.54rem 0.9rem;
  border-radius: 999px;
  background: rgba(238, 248, 255, 0.98);
  border: 1px solid rgba(58, 130, 215, 0.24);
  color: #184d86;
  font-size: 0.84rem;
  font-weight: 800;
  text-align: center;
}

.upload-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.field-label {
  display: grid;
  gap: 8px;
}

.field-label input,
.search-wrap input {
  width: 100%;
  border: 1px solid rgba(94, 138, 198, 0.28);
  border-radius: var(--radius-sm);
  padding: 0.82rem 0.95rem;
  background: rgba(255, 255, 255, 1);
  color: var(--text);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  line-height: 1.2;
}

.field-label input:focus,
.search-wrap input:focus {
  border-color: rgba(0, 94, 255, 0.42);
  box-shadow: 0 0 0 3px rgba(0, 94, 255, 0.08);
}

.field-group {
  display: grid;
  gap: 10px;
}

.field-title {
  font-weight: 700;
}

.chip-row {
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(241, 247, 254, 0.94);
  border: 1px solid rgba(102, 143, 198, 0.16);
}

.chip {
  min-width: 48px;
  padding: 0.7rem 0.94rem;
  justify-content: center;
}

.chip.active {
  box-shadow: 0 12px 24px rgba(41, 148, 242, 0.14);
}

.selection-summary {
  padding: 14px;
  border: 1px solid rgba(101, 143, 198, 0.16);
}

.selection-summary.flash {
  animation: summaryFlash 560ms ease;
}

.summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.summary-title {
  font-weight: 800;
  color: var(--text);
}

.summary-total {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.72rem;
  border-radius: 999px;
  background: rgba(250, 253, 255, 0.94);
  border: 1px solid rgba(101, 143, 198, 0.18);
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 800;
}

.summary-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.summary-metric {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.72rem;
  border-radius: 999px;
  background: rgba(245, 250, 255, 0.96);
  border: 1px solid rgba(101, 143, 198, 0.16);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.summary-metric strong {
  margin-left: 6px;
  color: var(--text);
}

.summary-list,
.job-files {
  display: grid;
  gap: 8px;
}

.summary-item,
.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(244, 249, 255, 0.96);
  border: 1px solid rgba(100, 142, 197, 0.14);
}

.file-item {
  align-items: center;
}

.file-item-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}

.file-preview-link {
  flex: 0 0 auto;
  text-decoration: none;
}

.file-preview-thumb {
  display: block;
  width: 54px;
  height: 54px;
  border-radius: 14px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(99, 140, 194, 0.22);
  box-shadow: 0 10px 18px rgba(31, 81, 148, 0.08);
}

.file-preview-fallback {
  display: grid;
  place-items: center;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 800;
}

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

.file-body strong {
  display: block;
  line-height: 1.2;
  word-break: break-word;
}

.summary-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.78rem 1rem;
  border-radius: 14px;
  background: rgba(247, 251, 255, 0.98);
  border: 1px dashed rgba(99, 140, 194, 0.24);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

@keyframes summaryFlash {
  0% {
    transform: translateY(0);
    box-shadow: 0 0 0 rgba(41, 201, 254, 0);
  }
  35% {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px rgba(41, 201, 254, 0.14);
  }
  100% {
    transform: translateY(0);
    box-shadow: 0 0 0 rgba(41, 201, 254, 0);
  }
}

.summary-item strong,
.job-title {
  font-size: 1rem;
}

.summary-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.42rem 0.68rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.summary-pill.photo,
.status-pill.completed {
  background: rgba(14, 122, 255, 0.1);
  color: #0560d8;
}

.summary-pill.video,
.status-pill.processing,
.status-pill.queued {
  background: rgba(9, 80, 187, 0.12);
  color: #2d6ed3;
}

.summary-pill.archive {
  background: rgba(232, 241, 250, 0.9);
  color: var(--text);
}

.status-pill.failed {
  background: rgba(255, 127, 127, 0.12);
  color: var(--danger);
}

.current-job {
  margin-top: 18px;
  min-height: 176px;
  border-radius: var(--radius-lg);
  padding: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 247, 254, 0.97));
  border: 1px solid rgba(101, 143, 198, 0.18);
}

.current-job.completed {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top center, rgba(72, 194, 255, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(240, 247, 255, 0.97));
  border-color: rgba(77, 133, 208, 0.24);
  box-shadow:
    0 24px 56px rgba(18, 76, 146, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.46);
}

.current-job.completed::before {
  content: "";
  position: absolute;
  inset: -24% -18% auto;
  height: 180px;
  background: radial-gradient(circle, rgba(55, 164, 255, 0.14), transparent 62%);
  pointer-events: none;
  animation: readyGlow 2.8s ease-in-out infinite;
}

.current-job.empty {
  display: grid;
  place-items: center;
  text-align: center;
}

.status-card .section-heading h2 {
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
}

.current-job.empty p {
  max-width: 18rem;
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.45;
}

.empty-orbit {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  margin-bottom: 12px;
  border: 1px solid rgba(134, 176, 226, 0.18);
  box-shadow: inset 0 0 14px rgba(223, 240, 255, 0.12), 0 0 24px rgba(22, 127, 255, 0.06);
  position: relative;
}

.empty-orbit::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  border: 1px solid rgba(22, 127, 255, 0.22);
}

.job-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(241, 247, 254, 0.98));
  border: 1px solid rgba(101, 143, 198, 0.18);
  box-shadow:
    0 10px 22px rgba(8, 44, 97, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.jobs-grid {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.seo-panel {
  padding: 20px;
}

.seo-heading {
  align-items: flex-start;
}

.seo-lockup {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.seo-lock-chip,
.seo-meta-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.46rem 0.76rem;
  border-radius: 999px;
  background: rgba(246, 250, 255, 0.98);
  border: 1px solid rgba(102, 143, 198, 0.18);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.seo-meta-pill strong {
  margin-left: 6px;
  color: var(--text);
}

.seo-stats-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-top: 16px;
  overflow: hidden;
}

.seo-stat-card {
  min-height: 78px;
  padding: 14px 12px;
  display: grid;
  align-content: center;
  border-right: 1px solid rgba(129, 180, 229, 0.14);
}

.seo-stat-value {
  display: block;
  margin-top: 6px;
  font-family: "Comfortaa", sans-serif;
  font-size: clamp(1.3rem, 2.2vw, 1.8rem);
}

.seo-stat-card:last-child {
  border-right: 0;
}

.seo-filter-panel {
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(88, 131, 188, 0.26);
  background: linear-gradient(180deg, rgba(252, 254, 255, 0.995), rgba(244, 249, 255, 0.99));
}

.seo-search-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 6px;
}

.seo-search-wrap input {
  flex: 1 1 auto;
  min-height: 36px;
  height: 36px;
  padding: 0.45rem 0.74rem;
  font-size: 0.9rem;
}

.seo-filter-groups {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.seo-select-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.seo-select-label {
  display: grid;
  gap: 4px;
  min-width: min(320px, 100%);
}

.seo-select-label span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.seo-select-label select {
  width: 100%;
  border: 1px solid rgba(94, 138, 198, 0.28);
  border-radius: var(--radius-sm);
  height: 36px;
  padding: 0.34rem 0.74rem;
  background: rgba(255, 255, 255, 1);
  color: var(--text);
  outline: none;
  font: inherit;
}

.seo-select-label select:focus {
  border-color: rgba(0, 94, 255, 0.42);
  box-shadow: 0 0 0 3px rgba(0, 94, 255, 0.08);
}

.seo-filter-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.seo-filter-panel .chip,
.seo-filter-panel .small-btn,
.seo-filter-panel .ghost-btn {
  padding: 0.46rem 0.74rem;
  font-size: 0.8rem;
}

.seo-jobs-grid {
  grid-template-columns: 1fr;
}

.seo-job-card {
  gap: 16px;
  padding: 18px;
}

.seo-job-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.seo-identity {
  min-width: 0;
}

.seo-buyer-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.seo-buyer {
  font-size: 1rem;
  color: var(--text);
}

.seo-secondary {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
}

.seo-job-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
}

.seo-job-copy {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.seo-quick-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.seo-preview-row {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  max-width: 228px;
}

.seo-preview-thumb {
  width: 64px;
  height: 64px;
  border-radius: 14px;
}

.seo-progress-box {
  gap: 8px;
}

.seo-delivery-row,
.seo-drawer-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.seo-delivery-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.42rem 0.72rem;
  border-radius: 999px;
  background: rgba(246, 250, 255, 0.98);
  border: 1px solid rgba(102, 143, 198, 0.18);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.seo-delivery-chip.ready {
  background: rgba(237, 246, 255, 0.98);
  border-color: rgba(79, 133, 208, 0.24);
  color: #0f5fca;
}

.seo-delivery-chip.idle {
  background: rgba(238, 244, 252, 0.98);
  color: #47647f;
}

.seo-job-actions {
  justify-content: flex-start;
}

.seo-empty-card {
  min-height: 132px;
  place-items: center;
  text-align: center;
}

.seo-error-line {
  color: #cf5d5d;
  font-size: 0.9rem;
  line-height: 1.4;
}

.job-top,
.job-actions,
.drawer-top,
.drawer-metrics {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.job-title {
  margin: 0;
  font-family: "Comfortaa", sans-serif;
}

.job-actions .ghost-btn,
.job-actions .primary-btn {
  padding: 0.72rem 1rem;
}

.completion-banner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(244, 249, 255, 0.99), rgba(236, 245, 255, 0.97));
  border: 1px solid rgba(86, 137, 205, 0.22);
  box-shadow: 0 18px 34px rgba(15, 74, 145, 0.12);
}

.completion-core {
  position: relative;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.99), rgba(224, 239, 255, 0.94));
  flex: 0 0 auto;
}

.completion-core::before,
.completion-core::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(56, 131, 218, 0.24);
  animation: readyPulse 1.9s ease-out infinite;
}

.completion-core::after {
  animation-delay: 0.6s;
}

.completion-mark {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(180deg, #2aa0ff, #005fe8);
  box-shadow: 0 10px 24px rgba(0, 95, 232, 0.24);
}

.completion-mark::before,
.completion-mark::after {
  content: "";
  position: absolute;
  background: #ffffff;
  border-radius: 999px;
}

.completion-mark::before {
  width: 4px;
  height: 11px;
  left: 8px;
  top: 12px;
  transform: rotate(-42deg);
}

.completion-mark::after {
  width: 4px;
  height: 17px;
  left: 15px;
  top: 7px;
  transform: rotate(42deg);
}

.completion-copy {
  min-width: 0;
}

.completion-title {
  font-family: "Comfortaa", sans-serif;
  font-size: 1.12rem;
  font-weight: 800;
  color: #103c78;
}

.completion-text {
  margin-top: 4px;
  color: #5a708b;
  font-size: 0.92rem;
  line-height: 1.35;
}

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

.progress-percent {
  color: var(--blue);
  font-size: 0.86rem;
  font-weight: 800;
}

.current-job.completed .progress-percent {
  color: #0f64d3;
}

.preview-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.preview-thumb {
  width: 78px;
  height: 78px;
  border-radius: 16px;
  object-fit: cover;
  border: 1px solid rgba(101, 143, 198, 0.2);
  background: rgba(255, 255, 255, 0.7);
}

.preview-fallback {
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  color: var(--muted);
}

.progress-box {
  display: grid;
  gap: 10px;
}

.progress-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(218, 230, 245, 0.96);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8fd5ff, #2f99ff, #0058dd);
  transition: width 320ms ease;
}

.current-job.completed .progress-fill {
  background: linear-gradient(90deg, #8fd5ff, #2f99ff, #0058dd);
}

.job-drawer {
  position: fixed;
  inset: 0;
  z-index: 10;
}

.job-drawer.hidden {
  display: none;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.56);
  backdrop-filter: blur(8px);
}

.drawer-panel {
  position: absolute;
  top: 16px;
  right: 16px;
  bottom: 16px;
  width: min(540px, calc(100% - 24px));
  padding: 24px;
  overflow-y: auto;
}

.drawer-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(241, 247, 255, 0.94);
}

.drawer-close::before,
.drawer-close::after {
  content: "";
  position: absolute;
  top: 20px;
  left: 11px;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
}

.drawer-close::before {
  transform: rotate(45deg);
}

.drawer-close::after {
  transform: rotate(-45deg);
}

.drawer-metrics {
  margin-top: 18px;
}

.drawer-metrics-secondary {
  margin-top: 12px;
}

.seo-drawer-previews {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.metric-pill {
  min-width: 140px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(245, 250, 255, 0.98);
  border: 1px solid rgba(101, 143, 198, 0.16);
}

.metric-pill strong {
  display: block;
  margin-top: 8px;
  font-family: "Comfortaa", sans-serif;
  font-size: 1.25rem;
}

.hidden {
  display: none !important;
}

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 12px;
  z-index: 20;
}

.toast {
  min-width: 240px;
  max-width: 360px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(252, 254, 255, 0.98);
  border: 1px solid rgba(101, 143, 198, 0.18);
  box-shadow: var(--shadow);
  animation: toastIn 220ms ease;
}

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

@keyframes readyPulse {
  0% {
    transform: scale(0.92);
    opacity: 0.72;
  }
  70% {
    transform: scale(1.42);
    opacity: 0;
  }
  100% {
    transform: scale(1.42);
    opacity: 0;
  }
}

@keyframes readyGlow {
  0%, 100% {
    opacity: 0.72;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-4px);
  }
}

@media (max-width: 980px) {
  .upload-layout {
    grid-template-columns: 1fr;
  }

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

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

  .seo-job-main {
    grid-template-columns: 1fr;
  }

  .seo-preview-row {
    justify-content: flex-start;
    max-width: none;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 16px, 1200px);
    padding-top: 10px;
  }

  .mini-topbar,
  .upload-card,
  .status-card,
  .jobs-panel {
    padding: 16px;
  }

  .seo-panel {
    padding: 14px;
  }

  .seo-heading .section-copy {
    margin-top: 8px;
    font-size: 0.88rem;
    line-height: 1.35;
  }

  .seo-lock-chip {
    padding: 0.36rem 0.62rem;
    font-size: 0.74rem;
  }

  .mini-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-heading {
    flex-direction: column;
  }

  .upload-badge {
    align-self: flex-start;
  }

  .summary-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .file-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .file-item-main,
  .file-item .job-actions {
    width: 100%;
  }

  .completion-banner {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .stats-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 12px;
  }

  .stats-strip .stat-card {
    min-height: 58px;
    padding: 10px 8px;
  }

  .stats-strip .stat-value {
    margin-top: 4px;
    font-size: 1.18rem;
  }

  .stats-strip .stat-label {
    font-size: 0.76rem;
  }

  .status-card .section-heading h2 {
    font-size: 1.18rem;
  }

  .current-job {
    margin-top: 12px;
    min-height: 138px;
    padding: 12px;
  }

  .current-job.empty p {
    max-width: 15rem;
    font-size: 0.88rem;
    line-height: 1.38;
  }

  .empty-orbit {
    width: 42px;
    height: 42px;
    margin-bottom: 10px;
  }

  .empty-orbit::before {
    inset: 7px;
  }

  .seo-stats-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 12px;
    border-radius: 20px;
  }

  .seo-stat-card {
    min-height: 58px;
    padding: 8px 7px;
  }

  .seo-stat-value {
    margin-top: 4px;
    font-size: 1.35rem;
  }

  .seo-stat-card .stat-label {
    font-size: 0.8rem;
  }

  .seo-filter-panel {
    margin-top: 8px;
    padding: 8px;
  }

  .seo-filter-groups {
    gap: 5px;
    margin-top: 6px;
  }

  .seo-select-label {
    min-width: 100%;
  }

  .seo-filter-panel .chip,
  .seo-filter-panel .small-btn,
  .seo-filter-panel .ghost-btn {
    padding: 0.42rem 0.68rem;
    font-size: 0.76rem;
  }

  .top-tabs {
    border-radius: 24px;
    flex-direction: column;
  }

  .seo-search-wrap {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .seo-search-wrap input {
    flex: none;
    width: 100%;
    min-height: 34px;
    height: 34px;
    padding: 0.4rem 0.68rem;
  }

  .drawer-panel {
    top: 8px;
    right: 8px;
    left: 8px;
    width: auto;
  }
}
