:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-strong: #f3f4f6;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --text: #111827;
  --muted: #6b7280;
  --muted-2: #9ca3af;
  --accent: #111827;
  --accent-soft: #f3f4f6;
  --danger: #b91c1c;
  --success: #15803d;
  --shadow-lg: 0 18px 40px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 10px 24px rgba(15, 23, 42, 0.05);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
}

body.theme-dark {
  color-scheme: dark;
  --bg: #0f1115;
  --surface: #151821;
  --surface-soft: #1b1f28;
  --surface-strong: #222735;
  --line: #2d3443;
  --line-strong: #46506a;
  --text: #f5f7fb;
  --muted: #a4adbc;
  --muted-2: #7f8898;
  --accent: #f5f7fb;
  --accent-soft: #1f2430;
  --danger: #fda4af;
  --success: #86efac;
  --shadow-lg: 0 20px 42px rgba(0, 0, 0, .28);
  --shadow-md: 0 12px 26px rgba(0, 0, 0, .18);
}

* { box-sizing: border-box; }

[v-cloak] { display: none; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Space Grotesk', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  transition: background-color .18s ease, color .18s ease;
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .58; }

.app-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(340px, 420px) minmax(0, 1fr);
  gap: 18px;
  width: 100%;
  min-height: 100vh;
  padding: 20px;
}

.glass-panel {
  position: relative;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.control-panel {
  position: sticky;
  top: 20px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px;
  border-radius: var(--radius-xl);
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-copy {
  min-width: 0;
  flex: 1;
}

.brand-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex: 0 0 48px;
  color: var(--accent);
  font-size: 48px;
  line-height: 1;
}

.header-token-btn {
  margin-left: auto;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
}

.brand-header h1, .gallery-head h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -.03em;
  color: var(--text);
}

.brand-header p, .gallery-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  transition: .18s ease;
}

.theme-toggle:hover {
  border-color: var(--line-strong);
  color: var(--text);
  background: var(--surface-soft);
}

.form-stack, .field {
  display: flex;
  flex-direction: column;
}

.form-stack { gap: 16px; }
.field { gap: 8px; }
.field > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.glass-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  padding: 12px;
  font-size: 14px;
  line-height: 1.5;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, background .18s ease;
}

.glass-input:hover {
  border-color: var(--line-strong);
}

.glass-input:focus {
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(17, 24, 39, .08);
  background: var(--surface);
}

body.theme-dark .glass-input:focus {
  box-shadow: 0 0 0 3px rgba(245, 247, 251, .10);
}

.glass-input::placeholder { color: var(--muted-2); }
.prompt-area { min-height: 132px; resize: vertical; line-height: 1.65; }

.token-field {
  margin-bottom: 0;
}

.key-input-wrap { position: relative; }
.key-input-wrap .glass-input { padding-right: 48px; }
.ghost-icon {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--muted);
  transition: .18s ease;
}

.ghost-icon:hover {
  border-color: var(--line-strong);
  color: var(--text);
  background: var(--surface-strong);
}

.ref-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start;
  padding: 4px 0 2px;
}

.ref-square-btn {
  position: relative;
  width: 96px;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 0 0 auto;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.ref-square-btn:hover {
  border-color: #9ca3af;
  background: var(--surface-soft);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.ref-square-plus {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  color: var(--text);
  background: var(--surface-soft);
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
  border: 1px solid var(--line);
}

.ref-square-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}

.ref-strip .ref-card {
  width: 96px;
  flex: 0 0 auto;
  box-shadow: var(--shadow-md);
}

.quick-controls {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 10px;
  align-items: end;
  width: 100%;
}

.compact-field { min-width: 0; }
.compact-field .glass-input {
  min-height: 40px;
  padding-right: 34px;
}
.compact-field select.glass-input {
  appearance: none;
  font-size: 13px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.compact-field select.glass-input option {
  font-size: 13px;
}
.style-field,
.ratio-field,
.resolution-field { min-width: 0; }

.ref-actions, .modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.soft-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  transition: .18s ease;
}

.soft-btn:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: var(--surface-soft);
  transform: translateY(-1px);
}

.local-choice-btn {
  width: 100%;
  margin-bottom: 12px;
}

.hidden-input { display: none; }

.ref-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.ref-card:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.ref-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.ref-card button {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, .92);
  transition: .18s ease;
}

body.theme-dark .ref-card button {
  background: rgba(21, 24, 33, .92);
}

.ref-card button:hover {
  background: #fee2e2;
  border-color: #fecaca;
  color: #991b1b;
}

body.theme-dark .ref-card button:hover {
  background: rgba(127, 29, 29, .86);
  border-color: rgba(248, 113, 113, .55);
  color: #fecaca;
}

.ref-card small {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 8px 8px 7px;
  color: var(--text);
  font-size: 10px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: rgba(255,255,255,.84);
}

body.theme-dark .ref-card small {
  color: #fff;
  background: rgba(17, 24, 39, .74);
}

body.theme-dark .image-card time {
  background: #22c55e;
  color: #052e16;
}

body.theme-dark .task-badge {
  background: #111827;
  color: #fff;
}

.prompt-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.token-mini-btn {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  transition: .18s ease;
}

.token-mini-btn:hover {
  border-color: var(--line-strong);
  color: var(--text);
  background: var(--surface-soft);
}

.token-mini-btn.header-token-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
}

.token-panel {
  display: grid;
  gap: 8px;
}

.token-panel-inline {
  margin-top: 0;
}

.ref-card.selected {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 1px rgba(17, 24, 39, .04), var(--shadow-md);
}

.generate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  border: 1px solid var(--text);
  border-radius: 14px;
  padding: 0 20px;
  color: var(--surface);
  background: var(--text);
  font-weight: 800;
  letter-spacing: .01em;
  transition: transform .18s ease, opacity .18s ease, box-shadow .18s ease;
}

.generate-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.generate-btn.small { min-height: 40px; border-radius: 12px; }

.shine-btn { position: relative; overflow: hidden; }
.shine-btn::after { content: none; }

.spinner, .large-spinner {
  border-radius: 999px;
  border-style: solid;
  animation: spin .72s linear infinite;
}

.spinner {
  width: 17px;
  height: 17px;
  border-width: 2px;
  border-color: rgba(255,255,255,.35);
  border-top-color: #fff;
}

.large-spinner {
  width: 46px;
  height: 46px;
  border-width: 3px;
  border-color: rgba(17,24,39,.12);
  border-top-color: var(--text);
}

.gallery-panel {
  position: relative;
  min-height: calc(100vh - 40px);
  border-radius: var(--radius-xl);
  padding: 24px;
}

.gallery-head > div {
  min-width: 0;
}

.gallery-clear-btn {
  flex: 0 0 32px;
}

.gallery-clear-btn:hover:not(:disabled) {
  color: var(--danger);
}

.gallery-clear-btn:disabled {
  opacity: .42;
}

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

.compact { min-height: 36px; }

.images-grid {
  display: grid;
  grid-template-columns: repeat(var(--columns, 3), minmax(0, 1fr));
  justify-items: center;
  gap: 16px;
}

.image-card {
  position: relative;
  overflow: hidden;
  width: min(100%, 240px);
  aspect-ratio: 1 / 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  animation: fade-in .28s ease both;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

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

  .image-hit-area {
    position: relative;
    inset: auto;
  }

  .image-card img {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
  }
}

.image-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.08);
}

.placeholder-card {
  display: grid;
  place-items: center;
  align-content: center;
  justify-self: center;
  width: min(100%, 220px);
  min-height: 120px;
  aspect-ratio: auto;
  gap: 10px;
  padding: 14px;
  text-align: center;
}

.error-placeholder-card {
  border-style: dashed;
  border-color: color-mix(in srgb, var(--danger) 55%, var(--line));
  background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--danger) 10%, var(--surface-soft)));
}

.error-placeholder-card .task-badge {
  background: var(--danger);
}

.error-placeholder-card .loading-progress-text {
  color: var(--danger);
}

.error-spinner {
  color: var(--danger);
}

.loading-progress-text {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.task-badge, .image-card time {
  position: absolute;
  z-index: 2;
  right: 10px;
  top: 10px;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 800;
  background: var(--text);
  color: #fff;
}

.image-card time {
  background: #16a34a;
  color: #fff;
}

.image-hit-area {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  cursor: zoom-in;
  background: var(--surface-soft);
}

.image-hit-area:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -4px;
}

.image-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  transition: transform .24s ease;
}

.image-card:hover img {
  transform: scale(1.02);
}

.card-prompt-marquee {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  overflow: hidden;
  padding: 8px 10px;
  color: #fff;
  background: rgba(15, 23, 42, .52);
  backdrop-filter: blur(8px);
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
  text-overflow: ellipsis;
  pointer-events: none;
}

.card-prompt-marquee span {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.image-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  padding: 10px;
  background: rgba(17, 24, 39, .34);
  transition: opacity .18s ease;
}

.image-card:hover .image-overlay,
.image-card:focus-within .image-overlay {
  opacity: 1;
  pointer-events: auto;
}

.image-actions,
.image-prompt-panel {
  pointer-events: auto;
}

.image-card:hover .image-overlay { opacity: 1; }

.image-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(17, 24, 39, .38);
  backdrop-filter: blur(10px);
}

.image-prompt-panel {
  display: grid;
  gap: 6px;
  padding: 10px;
  border-radius: 14px;
  color: #fff;
  background: rgba(17, 24, 39, .72);
  backdrop-filter: blur(10px);
}

.prompt-text {
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.45;
}

.image-meta-lines {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: hidden;
  overflow-y: hidden;
  white-space: nowrap;
  font-size: 11px;
  line-height: 1.45;
  color: rgba(255, 255, 255, .84);
  scrollbar-width: none;
}

.image-meta-lines::-webkit-scrollbar {
  display: none;
}

.image-meta-lines span {
  flex: 0 0 auto;
  white-space: nowrap;
  animation: meta-scroll 7s linear infinite alternate;
}

.image-meta-lines:hover span {
  animation-play-state: paused;
}

.reference-badge {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.image-overlay button, .lightbox-actions button, .lightbox-close {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow-md);
  transition: .18s ease;
}

body.theme-dark .image-overlay button,
body.theme-dark .lightbox-actions button,
body.theme-dark .lightbox-close {
  color: var(--text);
  background: rgba(21, 24, 33, .92);
  border-color: var(--line-strong);
}

.image-overlay button:hover, .lightbox-actions button:hover, .lightbox-close:hover {
  transform: translateY(-1px);
  background: #fff;
}

body.theme-dark .image-overlay button:hover,
body.theme-dark .lightbox-actions button:hover,
body.theme-dark .lightbox-close:hover {
  background: var(--surface-strong);
}

.image-overlay .image-delete-btn:hover, .lightbox-actions .image-delete-btn:hover {
  border-color: #fecaca;
  color: #991b1b;
  background: #fee2e2;
}

body.theme-dark .image-overlay .image-delete-btn:hover,
body.theme-dark .lightbox-actions .image-delete-btn:hover {
  border-color: rgba(248, 113, 113, .55);
  color: #fecaca;
  background: rgba(127, 29, 29, .86);
}

.empty-state {
  min-height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  grid-column: 1 / -1;
  padding: 42px 18px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 22px;
  background: linear-gradient(180deg, var(--surface), var(--surface-soft));
}

.empty-state i { color: var(--text); font-size: 48px; }
.empty-state h3 { margin: 0; color: var(--text); }
.empty-state p { margin: 0; max-width: 360px; line-height: 1.6; color: var(--muted); }
.empty-state.error-state {
  border-color: color-mix(in srgb, var(--danger) 45%, var(--line));
  background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--danger) 8%, var(--surface-soft)));
}
.empty-state.error-state i,
.empty-state.error-state h3,
.empty-state.error-state p {
  color: var(--danger);
}

.recommendation-section {
  grid-column: 1 / -1;
  margin-top: 14px;
}

.recommendation-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
}

.recommendation-head h3 {
  margin: 0;
  font-size: 18px;
}

.recommendation-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

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

.recommendation-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  height: 60px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background-color: var(--surface);
  box-shadow: var(--shadow-md);
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.recommendation-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  background: var(--surface);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.10);
}

.recommendation-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.recommendation-icon {
  flex: 0 0 auto;
  font-size: 18px;
  color: var(--accent);
}

.recommendation-card h4 {
  margin: 0;
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recommendation-card p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.theme-dark .recommendation-card {
  background-color: var(--surface);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(15, 23, 42, .56);
}

.modal.active, .lightbox.active { display: flex; }

.modal-card {
  width: min(440px, 100%);
  border-radius: 20px;
  padding: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.modal-card h3 { margin: 0 0 8px; }
.modal-card p { margin: 0 0 16px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.modal-actions { margin-top: 16px; }

.lightbox {
  z-index: 70;
  flex-direction: column;
  gap: 16px;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.08), transparent 28%),
    radial-gradient(circle at 80% 0%, rgba(56, 189, 248, .12), transparent 24%),
    rgba(8, 15, 28, .86);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
}

.lightbox-media {
  position: relative;
  width: min(92vw, 1180px);
  max-height: 78vh;
  display: grid;
  place-items: center;
}

.lightbox-placeholder,
.lightbox-full-image {
  grid-area: 1 / 1;
  max-width: 100%;
  max-height: 78vh;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.22);
  box-shadow: 0 24px 80px rgba(15, 23, 42, .40);
  object-fit: contain;
}

.lightbox-placeholder {
  filter: blur(18px) saturate(115%);
  transform: scale(1.03);
  opacity: .84;
}

.lightbox-full-image {
  position: relative;
  z-index: 1;
  opacity: 1;
}

.lightbox-full-image.loading {
  opacity: 1;
}

.lightbox-progress-layer {
  position: absolute;
  inset: auto 20px 18px;
  z-index: 2;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.lightbox-progress-track {
  width: min(56vw, 420px);
  height: 8px;
  padding: 2px;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(10px);
  overflow: hidden;
}

.lightbox-progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(96,165,250,.92), rgba(168,85,247,.92), rgba(34,197,94,.92));
  box-shadow: 0 0 18px rgba(96,165,250,.45);
  transition: width .18s ease;
}

.lightbox-close { position: fixed; top: 18px; right: 18px; }

.lightbox-bottom-panel {
  display: grid;
  gap: 12px;
  width: min(92vw, 1180px);
  margin-top: 4px;
}

.lightbox-actions {
  justify-self: center;
}

.lightbox-prompt-panel {
  background: rgba(8, 15, 28, .74);
  backdrop-filter: blur(16px) saturate(150%);
}

.lightbox-prompt-panel .image-meta-lines span {
  animation: none;
}

.download-float {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 18px;
  color: var(--text);
  background: var(--surface);
  font-weight: 800;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes meta-scroll { from { transform: translateX(0); } to { transform: translateX(-42%); } }
@keyframes prompt-marquee { from { transform: translateX(0); } to { transform: translateX(-42%); } }

@media (max-width: 1080px) {
  .app-shell { grid-template-columns: 1fr; }
  .control-panel { position: static; }
  .gallery-panel { min-height: auto; }
  .recommendation-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .app-shell { padding: 12px; gap: 12px; }
  .control-panel, .gallery-panel { border-radius: 18px; padding: 16px; }
  .brand-header { align-items: flex-start; }
  .theme-toggle { min-height: 32px; padding: 0 10px; }
  .brand-header h1, .gallery-head h2 { font-size: 20px; }
  .ref-strip { gap: 8px; }
  .ref-actions { justify-content: stretch; }
  .soft-btn { flex: 1; }
  .gallery-head { align-items: center; }
  .images-grid { grid-template-columns: 1fr; gap: 12px; }
  .empty-state { min-height: 360px; }
  .recommendation-grid { grid-template-columns: 1fr; }
  .recommendation-card { min-height: 60px; }
  .image-overlay { opacity: 1; align-items: stretch; justify-content: flex-end; background: rgba(17, 24, 39, .18); }
    .lightbox img { max-width: 94vw; max-height: 72vh; border-radius: 16px; }
  }
  