:root {
  --bg: #040915;
  --panel: rgba(8, 14, 31, 0.82);
  --border: rgba(34, 211, 238, 0.18);
  --text: #f3f7ff;
  --muted: rgba(221, 233, 255, 0.66);
  --cyan: #22d3ee;
  --blue: #60a5fa;
  --pink: #ec4899;
  --cyan-soft: rgba(34, 211, 238, 0.12);
  --pink-soft: rgba(236, 72, 153, 0.12);
  --shadow: 0 30px 80px rgba(1, 6, 18, 0.56);
  --mono: "Orbitron", sans-serif;
  --body: "Manrope", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  background:
    radial-gradient(circle at top left, rgba(34, 211, 238, 0.12), transparent 32%),
    radial-gradient(circle at 82% 18%, rgba(236, 72, 153, 0.1), transparent 28%),
    linear-gradient(180deg, #040915 0%, #02050d 100%);
  color: var(--text);
  font-family: var(--body);
  overflow-x: hidden;
}

.page-noise,
.page-grid,
.page-orb {
  pointer-events: none;
  position: fixed;
  inset: 0;
}

.page-noise {
  opacity: 0.16;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.3) 0 0.7px, transparent 0.9px),
    radial-gradient(circle at 80% 40%, rgba(255, 255, 255, 0.18) 0 0.8px, transparent 1px);
  background-size: 16px 16px, 24px 24px;
  mix-blend-mode: soft-light;
}

.page-grid {
  background-image:
    linear-gradient(rgba(34, 211, 238, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.82), transparent 85%);
}

.page-orb {
  filter: blur(96px);
  opacity: 0.5;
}

.page-orb--cyan {
  inset: auto auto 10% -6%;
  width: 34rem;
  height: 34rem;
  background: rgba(34, 211, 238, 0.22);
}

.page-orb--pink {
  inset: 4% -6% auto auto;
  width: 24rem;
  height: 24rem;
  background: rgba(236, 72, 153, 0.18);
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 1260px;
  margin: 0 auto;
  padding: 28px 24px 72px;
}

.app-header,
.hero-panel,
.panel,
.footer-panel {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(12, 19, 40, 0.88) 0%, rgba(7, 12, 28, 0.8) 100%);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 22px;
  border-radius: 24px;
  margin-bottom: 22px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(34, 211, 238, 0.18), rgba(236, 72, 153, 0.12)),
    rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(34, 211, 238, 0.24);
  color: var(--cyan);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 18px 40px rgba(34, 211, 238, 0.1);
}

.brand-icon svg {
  width: 28px;
  height: 28px;
}

.brand-kicker,
.panel-eyebrow,
.hero-eyebrow {
  margin: 0 0 6px;
  font-family: var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.74rem;
  color: var(--cyan);
}

.brand-name {
  margin: 0;
  font-family: var(--mono);
  font-size: 1.15rem;
  letter-spacing: 0.08em;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.03);
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.back-link:hover {
  transform: translateY(-1px);
  border-color: rgba(34, 211, 238, 0.28);
  background: rgba(34, 211, 238, 0.08);
}

.back-link svg {
  width: 16px;
  height: 16px;
}

.hero-panel {
  border-radius: 32px;
  padding: 36px;
  margin-bottom: 22px;
  overflow: hidden;
  position: relative;
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.6), transparent);
}

.hero-copy {
  max-width: 760px;
}

.hero-title {
  margin: 0;
  font-family: var(--mono);
  font-size: clamp(2.3rem, 5vw, 4.8rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.hero-title span {
  display: block;
}

.accent-word {
  color: var(--pink);
  text-shadow: 0 0 28px rgba(236, 72, 153, 0.24);
}

.hero-description {
  margin: 18px 0 0;
  max-width: 760px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.75;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.hero-badge {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #d8fff7;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.03fr) minmax(360px, 0.97fr);
  gap: 22px;
}

.panel {
  border-radius: 28px;
  padding: 28px;
}

.panel-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 24px;
}

.panel-header h2,
.footer-panel h2 {
  margin: 0;
  font-size: 1.5rem;
}

.upload-zone {
  position: relative;
  min-height: 240px;
  border-radius: 24px;
  border: 1.5px dashed rgba(34, 211, 238, 0.22);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
    rgba(5, 9, 19, 0.55);
  overflow: hidden;
  transition: border-color 0.25s ease, transform 0.25s ease, background 0.25s ease;
}

.upload-zone.is-dragging {
  border-color: rgba(34, 211, 238, 0.5);
  transform: translateY(-2px);
  background:
    linear-gradient(180deg, rgba(34, 211, 238, 0.08), rgba(236, 72, 153, 0.06)),
    rgba(5, 9, 19, 0.7);
}

.upload-zone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-content {
  min-height: 240px;
  display: grid;
  place-items: center;
  padding: 28px;
  text-align: center;
}

.upload-inner {
  max-width: 420px;
}

.upload-icon {
  width: 82px;
  height: 82px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(34, 211, 238, 0.14), rgba(236, 72, 153, 0.16)),
    rgba(255, 255, 255, 0.02);
  color: var(--cyan);
  border: 1px solid rgba(34, 211, 238, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 18px 50px rgba(34, 211, 238, 0.08);
}

.upload-icon svg {
  width: 42px;
  height: 42px;
}

.upload-title {
  margin: 0;
  font-size: 1.4rem;
}

.upload-description {
  margin: 12px 0 16px;
  color: var(--muted);
  line-height: 1.75;
}

.upload-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.upload-badge strong {
  color: var(--cyan);
}

.queue-card,
.stats-grid,
.setting-block,
.queue-list,
.action-row,
.preview-stage,
.preview-meta,
.notes-list {
  margin-top: 20px;
}

.queue-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.queue-card__icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.16), rgba(236, 72, 153, 0.16));
  color: var(--cyan);
}

.queue-card__icon svg {
  width: 28px;
  height: 28px;
}

.queue-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.queue-card__label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.84rem;
}

.queue-card__name {
  margin: 0;
  font-size: 1rem;
  line-height: 1.45;
}

.queue-card__placeholder {
  color: rgba(216, 229, 255, 0.5);
}

.queue-card__chip {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.18);
  color: var(--cyan);
  font-size: 0.75rem;
  white-space: nowrap;
}

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

.stat-card {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.76rem;
}

.stat-card strong {
  display: block;
  font-size: 0.98rem;
  line-height: 1.45;
}

.setting-label {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.toggle-grid,
.chip-grid {
  display: grid;
  gap: 12px;
}

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

.toggle-chip,
.chip-option,
.format-chip,
.color-option {
  position: relative;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.toggle-chip:hover,
.chip-option:hover,
.format-chip:hover,
.color-option:hover {
  transform: translateY(-1px);
  border-color: rgba(34, 211, 238, 0.22);
}

.toggle-chip.is-active,
.chip-option.is-active,
.format-chip.is-active,
.color-option.is-active {
  border-color: rgba(34, 211, 238, 0.32);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.1), rgba(236, 72, 153, 0.06));
}

.toggle-chip strong,
.format-chip strong {
  display: block;
  font-size: 1rem;
}

.toggle-chip span,
.format-chip span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.6;
}

.chip-grid--compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.chip-option {
  padding: 10px 12px;
  text-align: center;
  font-weight: 700;
}

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

.color-option {
  padding: 12px;
}

.color-swatch {
  width: 100%;
  height: 42px;
  border-radius: 12px;
  margin-bottom: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.color-swatch--white {
  background: #ffffff;
}

.color-swatch--black {
  background: #050505;
}

.color-swatch--transparent {
  background: repeating-conic-gradient(#3d4559 0% 25%, #1f2635 0% 50%) 0 0 / 14px 14px;
}

.color-option strong,
.color-option span {
  display: block;
}

.color-option span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.field-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.field-row strong {
  white-space: nowrap;
  color: var(--muted);
}

.field-input {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color 0.22s ease, background 0.22s ease;
}

.field-input:focus {
  border-color: rgba(34, 211, 238, 0.35);
  background: rgba(34, 211, 238, 0.06);
}

.field-hint {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 0.85rem;
}

.queue-list {
  display: grid;
  gap: 12px;
}

.queue-item {
  display: grid;
  grid-template-columns: auto auto 72px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.queue-item.is-dragging {
  opacity: 0.45;
}

.queue-item.is-over {
  border-color: rgba(34, 211, 238, 0.28);
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.08);
}

.queue-handle {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  cursor: grab;
}

.queue-index {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: #ffffff;
  font-weight: 800;
  font-size: 0.82rem;
}

.queue-thumb {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
}

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

.queue-meta {
  min-width: 0;
}

.queue-meta strong,
.queue-meta span {
  display: block;
}

.queue-meta strong {
  font-size: 0.95rem;
  line-height: 1.45;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-meta span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.queue-delete {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  cursor: pointer;
}

.queue-delete:hover {
  color: var(--pink);
  border-color: rgba(236, 72, 153, 0.24);
}

.queue-empty {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  line-height: 1.7;
}

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

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

.action-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(34, 211, 238, 0.24);
  background: rgba(34, 211, 238, 0.08);
}

.action-btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.action-btn--primary {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.18), rgba(236, 72, 153, 0.22));
  border-color: rgba(34, 211, 238, 0.26);
  box-shadow: 0 20px 50px rgba(34, 211, 238, 0.08);
}

.preview-stage {
  border-radius: 24px;
  overflow: hidden;
  background: repeating-conic-gradient(#1a2132 0% 25%, #131927 0% 50%) 0 0 / 18px 18px;
  min-height: 360px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.preview-stage img {
  max-width: 100%;
  max-height: 720px;
  display: block;
  object-fit: contain;
}

.preview-placeholder {
  text-align: center;
  padding: 40px 24px;
}

.preview-placeholder__icon {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--cyan);
}

.preview-placeholder__icon svg {
  width: 36px;
  height: 36px;
}

.preview-placeholder h3 {
  margin: 0 0 10px;
}

.preview-placeholder p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.preview-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.meta-card {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.meta-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.78rem;
}

.meta-card strong {
  display: block;
  font-size: 0.98rem;
  line-height: 1.55;
}

.notes-list {
  padding: 18px;
  border-radius: 22px;
  background: rgba(236, 72, 153, 0.06);
  border: 1px solid rgba(236, 72, 153, 0.14);
}

.notes-list h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.notes-list ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.8;
}

.footer-panel {
  margin-top: 22px;
  border-radius: 28px;
  padding: 28px;
}

.footer-panel p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.8;
  max-width: 760px;
}

.image-concat-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(12px);
  z-index: 9999;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid rgba(34, 211, 238, 0.22);
  background: rgba(8, 12, 26, 0.95);
  color: var(--text);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.35);
  font: 700 14px var(--body);
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.image-concat-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.image-concat-toast.is-error {
  border-color: rgba(236, 72, 153, 0.26);
}

@media (max-width: 1120px) {
  .workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 20px 16px 60px;
  }

  .app-header {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-panel,
  .panel,
  .footer-panel {
    padding: 22px;
    border-radius: 24px;
  }

  .stats-grid,
  .preview-meta,
  .action-row,
  .toggle-grid,
  .chip-grid--compact,
  .color-grid {
    grid-template-columns: 1fr;
  }

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

  .queue-thumb {
    display: none;
  }

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