@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,400&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --primary: #F72585;
  --secondary: #7209B7;
  --accent: #3A0CA3;
  --accent-light: #4361EE;
  --accent-dark: #4CC9F0;
  --bg: #F5F2ED;
  --bg-warm: #EDE8E0;
  --surface: #FFFFFF;
  --surface-alt: #FAF8F5;
  --text: #1A1A1A;
  --text-secondary: #6B6B6B;
  --text-muted: #999999;
  --border: #E5E0D8;
  --border-light: #F0ECE5;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.15);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --font-display: 'Cormorant Garamond', serif;
  --font-body: 'DM Sans', sans-serif;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

::selection {
  background: var(--accent);
  color: var(--surface);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ============ LOADING ============ */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 1rem;
}

.loading-icon {
  font-size: 3rem;
  animation: pulse 1.5s ease-in-out infinite;
}

.loading-text {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--text-secondary);
  font-weight: 300;
  letter-spacing: 0.03em;
}

.loading-bar {
  width: 120px;
  height: 2px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.loading-bar-fill {
  height: 100%;
  width: 40%;
  background: var(--accent);
  border-radius: 2px;
  animation: loadSlide 1.2s ease-in-out infinite;
}

@keyframes loadSlide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.1); opacity: 1; }
}

/* ============ APP ============ */
.app {
  min-height: 100vh;
}

/* ============ HEADER ============ */
.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(255,255,255,0.92);
}

.header-left {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.gallery-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--text);
}

.artwork-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  gap: 0.6rem;
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.btn-icon {
  font-size: 1em;
}

.btn-primary {
  background: var(--primary);
  color: var(--surface);
}

.btn-primary:hover {
  background: var(--secondary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-warm);
  border-color: var(--accent-light);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--surface-alt);
  color: var(--text);
}

.btn-danger {
  background: transparent;
  color: #C0392B;
  border: 1px solid #E8C4C0;
}

.btn-danger:hover {
  background: #FDF2F0;
  border-color: #C0392B;
}

.btn-lg {
  padding: 0.75rem 1.6rem;
  font-size: 0.95rem;
}

/* ============ GRID ============ */
.artwork-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  padding: 1.5rem 2rem 3rem;
  max-width: 1400px;
  margin: 0 auto;
}

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

.artwork-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all var(--transition);
  animation: cardFadeIn 0.5s ease both;
}

.artwork-card:nth-child(1) { animation-delay: 0s; }
.artwork-card:nth-child(2) { animation-delay: 0.06s; }
.artwork-card:nth-child(3) { animation-delay: 0.12s; }
.artwork-card:nth-child(4) { animation-delay: 0.18s; }
.artwork-card:nth-child(5) { animation-delay: 0.24s; }
.artwork-card:nth-child(6) { animation-delay: 0.30s; }
.artwork-card:nth-child(7) { animation-delay: 0.36s; }
.artwork-card:nth-child(8) { animation-delay: 0.42s; }
.artwork-card:nth-child(n+9) { animation-delay: 0.48s; }

.artwork-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-light);
}

.card-image-wrapper {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--bg-warm);
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.artwork-card:hover .card-image {
  transform: scale(1.05);
}

.card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
}

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

.overlay-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  backdrop-filter: blur(4px);
}

.overlay-btn:hover {
  background: var(--surface);
  transform: scale(1.1);
}

.card-info {
  padding: 0.85rem 1rem;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.15rem;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-artist {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.card-year {
  display: inline-block;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  letter-spacing: 0.05em;
}

/* ============ DETAIL OVERLAY ============ */
.detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.detail-panel {
  background: var(--surface);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  position: relative;
  animation: slideUp 0.3s ease;
}

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

.detail-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  backdrop-filter: blur(4px);
}

.detail-close:hover {
  background: var(--surface);
  transform: scale(1.1);
}

.detail-image-wrapper {
  width: 100%;
  max-height: 400px;
  overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--bg-warm);
}

.detail-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  max-height: 400px;
}

.detail-info {
  padding: 1.5rem;
}

.detail-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 0.3rem;
}

.detail-artist {
  font-size: 0.95rem;
  color: var(--accent-dark);
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.detail-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.meta-tag {
  padding: 0.25rem 0.65rem;
  background: var(--bg-warm);
  border-radius: 20px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.detail-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1.25rem;
}

.detail-actions {
  display: flex;
  gap: 0.6rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
}

.detail-edit-form {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.edit-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

/* ============ MODAL ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

.modal-panel {
  background: var(--surface);
  border-radius: var(--radius-lg);
  max-width: 560px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.3s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem 0;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-alt);
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.modal-close:hover {
  background: var(--bg-warm);
}

.modal-form {
  padding: 1.25rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.upload-area {
  margin-bottom: 0.5rem;
}

.upload-dropzone {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 2rem;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--surface-alt);
}

.upload-dropzone:hover {
  border-color: var(--accent);
  background: var(--bg-warm);
}

.file-input {
  display: none;
}

.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.dropzone-icon {
  font-size: 2.2rem;
}

.dropzone-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.dropzone-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.upload-preview {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 16/9;
  background: var(--bg-warm);
}

.preview-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.upload-progress-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--surface);
  font-size: 0.9rem;
  font-weight: 500;
}

.form-row {
  display: flex;
  gap: 0.75rem;
}

.form-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.form-group-full {
  flex: 1 1 100%;
}

.form-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.form-input {
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  background: var(--surface);
  color: var(--text);
  transition: border-color var(--transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201,169,110,0.15);
}

.form-textarea {
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  background: var(--surface);
  color: var(--text);
  resize: vertical;
  min-height: 70px;
  transition: border-color var(--transition);
  outline: none;
}

.form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201,169,110,0.15);
}

.form-error {
  font-size: 0.8rem;
  color: #C0392B;
  padding: 0.4rem 0.6rem;
  background: #FDF2F0;
  border-radius: var(--radius-sm);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  padding-top: 0.5rem;
}

/* ============ EMPTY STATE ============ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  text-align: center;
  padding: 2rem;
}

.empty-frames {
  display: flex;
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.empty-frame {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.frame-1 {
  animation: floatFrame 3s ease-in-out infinite;
  transform: rotate(-6deg);
}

.frame-2 {
  animation: floatFrame 3s ease-in-out infinite 0.5s;
  transform: translateY(-8px);
}

.frame-3 {
  animation: floatFrame 3s ease-in-out infinite 1s;
  transform: rotate(6deg);
}

@keyframes floatFrame {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.empty-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.empty-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 380px;
  margin-bottom: 1.5rem;
}

/* ============ SLIDESHOW ============ */
.slideshow {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: #000;
  overflow: hidden;
}

.slideshow-backdrop {
  position: absolute;
  inset: 0;
  background: #0A0A0A;
}

.slideshow-image-container {
  position: absolute;
  inset: 0;
  animation: slideFadeIn 1s ease;
}

@keyframes slideFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.slideshow-image {
  position: absolute;
  inset: -10%;
  width: 120%;
  height: 120%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Ken Burns variants */
@keyframes kenburnsZoomIn {
  0% { transform: scale(1); }
  100% { transform: scale(1.15); }
}

@keyframes kenburnsZoomOut {
  0% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

@keyframes kenburnsPanLeft {
  0% { transform: scale(1.1) translateX(3%); }
  100% { transform: scale(1.1) translateX(-3%); }
}

@keyframes kenburnsPanRight {
  0% { transform: scale(1.1) translateX(-3%); }
  100% { transform: scale(1.1) translateX(3%); }
}

@keyframes kenburnsDiagonal {
  0% { transform: scale(1.05) translate(-2%, -1%); }
  100% { transform: scale(1.12) translate(2%, 1%); }
}

.kenburns-zoom-in { animation: kenburnsZoomIn 8s ease-in-out forwards; }
.kenburns-zoom-out { animation: kenburnsZoomOut 8s ease-in-out forwards; }
.kenburns-pan-left { animation: kenburnsPanLeft 8s ease-in-out forwards; }
.kenburns-pan-right { animation: kenburnsPanRight 8s ease-in-out forwards; }
.kenburns-diagonal { animation: kenburnsDiagonal 8s ease-in-out forwards; }

.slideshow-fade-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.75) 0%,
    rgba(0,0,0,0.1) 40%,
    rgba(0,0,0,0) 60%,
    rgba(0,0,0,0.15) 100%
  );
  pointer-events: none;
}

.slideshow-info {
  position: absolute;
  bottom: 5rem;
  left: 3rem;
  right: 3rem;
  max-width: 600px;
  z-index: 10;
  animation: infoFade 0.6s ease 0.3s both;
}

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

.slideshow-title {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 400;
  color: #fff;
  text-shadow: 0 2px 20px rgba(0,0,0,0.5);
  margin-bottom: 0.25rem;
  line-height: 1.2;
}

.slideshow-artist {
  font-size: 1rem;
  color: var(--accent-light);
  font-weight: 500;
  margin-bottom: 0.5rem;
  text-shadow: 0 1px 8px rgba(0,0,0,0.4);
}

.slideshow-meta {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.65);
  margin-bottom: 0.6rem;
}

.meta-dot {
  font-size: 0.6rem;
}

.slideshow-description {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
  line-height: 1.6;
  max-width: 500px;
}

.slideshow-controls {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
  z-index: 20;
  background: rgba(0,0,0,0.4);
  padding: 0.4rem 0.6rem;
  border-radius: 40px;
  backdrop-filter: blur(12px);
}

.slide-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.slide-btn:hover {
  background: rgba(255,255,255,0.25);
}

.slide-btn-sm {
  width: 36px;
  height: 36px;
  font-size: 0.85rem;
  align-self: center;
}

.slideshow-exit {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  backdrop-filter: blur(8px);
}

.slideshow-exit:hover {
  background: rgba(255,255,255,0.2);
}

.slideshow-counter {
  position: absolute;
  top: 1.4rem;
  left: 1.5rem;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
  z-index: 20;
  letter-spacing: 0.1em;
  font-variant-numeric: tabular-nums;
}

.slideshow-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255,255,255,0.1);
  z-index: 20;
}

.slideshow-progress-bar {
  height: 100%;
  background: var(--accent);
  animation: progressFill 7s linear forwards;
}

.slideshow-progress-bar.paused {
  animation-play-state: paused;
}

@keyframes progressFill {
  from { width: 0%; }
  to { width: 100%; }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 640px) {
  .gallery-header {
    padding: 1rem 1.25rem;
    flex-wrap: wrap;
    gap: 0.6rem;
  }

  .gallery-title {
    font-size: 1.4rem;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .artwork-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
    padding: 1rem;
  }

  .card-title {
    font-size: 0.95rem;
  }

  .detail-panel {
    max-height: 95vh;
    border-radius: var(--radius-md);
  }

  .detail-image-wrapper {
    max-height: 260px;
  }

  .slideshow-info {
    bottom: 5.5rem;
    left: 1.25rem;
    right: 1.25rem;
  }

  .slideshow-title {
    font-size: 1.6rem;
  }

  .form-row {
    flex-direction: column;
    gap: 0.6rem;
  }

  .empty-frame {
    width: 60px;
    height: 60px;
    font-size: 1.6rem;
  }

  .empty-title {
    font-size: 1.4rem;
  }

  .modal-panel {
    max-height: 95vh;
  }
}

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


<!-- WALKTHROUGH_SCRIPT:
[
  {"step": 1, "narration": "Welcome to your personal virtual art gallery. This is where your curated art collection lives.", "view": "user", "highlight_selector": ".gallery-header", "wait_for": "tap_to_continue"},
  {"step": 2, "narration": "Your gallery is empty right now. Let's add your first artwork by clicking this button.", "view": "user", "highlight_selector": ".btn-primary.btn-lg", "wait_for": "user_interaction"},
  {"step": 3, "narration": "Upload an image of the artwork, fill in the details like title, artist, medium, and year, then click Add to Gallery.", "view": "user", "highlight_selector": ".modal-panel", "wait_for": "user_interaction"},
  {"step": 4, "narration": "Your artwork now appears as a card in the grid. Hover over it to see the slideshow button, or click the card to view full details.", "view": "user", "highlight_selector": ".artwork-card", "wait_for": "tap_to_continue"},
  {"step": 5, "narration": "In the detail view you can edit artwork information or remove it from your collection.", "view": "user", "highlight_selector": ".detail-panel", "wait_for": "tap_to_continue"},
  {"step": 6, "narration": "Click the Slideshow button to enter a full-screen presentation with a beautiful Ken Burns panning effect. Use arrow keys or the controls to navigate.", "view": "user", "highlight_selector": ".btn-secondary", "wait_for": "user_interaction"},
  {"step": 7, "narration": "During the slideshow, press P to pause, I to toggle artwork info, arrow keys to navigate, or Escape to exit. Enjoy your gallery!", "view": "user", "highlight_selector": ".slideshow-controls", "wait_for": "tap_to_continue"}
]
-->

.visitor-identity-bar {
  max-width: 1400px;
  margin: 1rem auto 0;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.visitor-identity-copy {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.visitor-identity-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.visitor-identity-name {
  font-size: 0.92rem;
  color: var(--text);
  font-weight: 600;
}

.visitor-identity-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.visitor-name-input {
  min-width: 220px;
}

@media (max-width: 640px) {
  .visitor-identity-bar {
    padding: 0 1rem;
    flex-direction: column;
    align-items: stretch;
  }

  .visitor-identity-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .visitor-name-input {
    min-width: 0;
    width: 100%;
  }
}

.reaction-heart {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.reaction-heart:hover {
  background: rgba(255,255,255,0.22);
  transform: translateY(-1px);
}

.reaction-heart.is-favorited {
  background: rgba(201,169,110,0.22);
  border-color: rgba(201,169,110,0.5);
}

.guestbook-panel { margin: 0 0 24px; padding: 20px; border-radius: 16px; background: rgba(255, 255, 255, 0.75); backdrop-filter: blur(12px); border: 1px solid rgba(0, 0, 0, 0.08); }
.guestbook-header { display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.guestbook-title { margin: 0; font-size: 1.1rem; }
.guestbook-subtitle { margin: 4px 0 0; opacity: 0.72; }
.guestbook-form { display: grid; gap: 12px; margin-bottom: 18px; }
.guestbook-textarea, .guestbook-context-input { width: 100%; border: 1px solid rgba(0, 0, 0, 0.12); border-radius: 12px; padding: 12px 14px; font: inherit; background: #fff; color: inherit; }
.guestbook-textarea { resize: vertical; min-height: 96px; }
.guestbook-form-actions { display: flex; gap: 12px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.guestbook-attribution { font-size: 0.92rem; opacity: 0.75; }
.guestbook-list { display: grid; gap: 12px; }
.guestbook-entry { padding: 14px 16px; border-radius: 14px; background: rgba(255, 255, 255, 0.92); border: 1px solid rgba(0, 0, 0, 0.06); }
.guestbook-entry-meta { display: flex; gap: 10px; justify-content: space-between; flex-wrap: wrap; margin-bottom: 8px; font-size: 0.92rem; }
.guestbook-entry-author { font-weight: 700; }
.guestbook-entry-context, .guestbook-entry-time { opacity: 0.7; }
.guestbook-entry-message { margin: 0 0 8px; white-space: pre-wrap; }
.guestbook-empty { padding: 16px; border-radius: 14px; background: rgba(255, 255, 255, 0.7); opacity: 0.75; }

.rich-text-content { line-height: 1.7; }
.rich-text-content p { margin: 0 0 0.6rem; }
.rich-text-content p:last-child { margin-bottom: 0; }
.rich-text-content ul, .rich-text-content ol { margin: 0.2rem 0 0.8rem 1.2rem; }
.rich-text-content a { color: var(--accent-light); text-decoration: underline; }
.slideshow-statement { margin-top: 0.75rem; max-width: 520px; font-size: 0.92rem; color: rgba(255,255,255,0.78); }

.artwork-share-panel { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.75rem; padding: 0.75rem; border-radius: var(--radius-md); background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12); }
.artwork-qr { width: 110px; flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 0.35rem; }
.artwork-qr-image { width: 92px; height: 92px; display: block; background: #fff; border-radius: 8px; padding: 4px; }
.artwork-qr-text { font-size: 0.72rem; letter-spacing: 0.04em; text-transform: uppercase; color: rgba(255,255,255,0.65); text-align: center; }
.artwork-share-copy { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.artwork-share-label { font-size: 0.75rem; color: var(--accent-light); text-transform: uppercase; letter-spacing: 0.06em; }
.artwork-share-url { font-size: 0.8rem; color: rgba(255,255,255,0.72); word-break: break-all; }
.slideshow-share-panel { display: flex; align-items: center; gap: 0.85rem; margin-top: 0.85rem; padding: 0.85rem 1rem; border-radius: 14px; background: rgba(0,0,0,0.28); border: 1px solid rgba(255,255,255,0.12); backdrop-filter: blur(10px); max-width: 560px; }
.slideshow-share-panel .artwork-qr { width: 100px; }
.slideshow-share-panel .artwork-qr-image { width: 84px; height: 84px; }
.slideshow-share-copy { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.slideshow-share-label { font-size: 0.72rem; color: var(--accent-light); text-transform: uppercase; letter-spacing: 0.08em; }
.slideshow-share-url { font-size: 0.82rem; color: rgba(255,255,255,0.72); word-break: break-all; }
@media (max-width: 640px) {
  .artwork-share-panel, .slideshow-share-panel { align-items: flex-start; }
  .artwork-qr { width: 96px; }
  .artwork-qr-image { width: 84px; height: 84px; }
}

.gallery-content-shell {
  max-width: 1400px;
  margin: 0 auto;
}

.popular-pieces-panel {
  margin: 1rem 2rem 0;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.popular-pieces-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.popular-pieces-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.1rem;
}

.popular-pieces-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.popular-pieces-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: var(--bg-warm);
  color: var(--text-secondary);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.popular-pieces-list {
  display: grid;
  gap: 0.75rem;
}

.popular-piece-row {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1.2fr) minmax(0, 1.8fr) auto;
  gap: 0.75rem;
  align-items: center;
}

.popular-piece-rank {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--bg-warm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--accent-dark);
}

.popular-piece-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.popular-piece-title {
  font-size: 0.92rem;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.popular-piece-artist {
  font-size: 0.78rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.popular-piece-bar-track {
  height: 10px;
  border-radius: 999px;
  background: var(--border-light);
  overflow: hidden;
}

.popular-piece-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
}

.popular-piece-count {
  font-size: 0.82rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.popular-pieces-empty {
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding: 0.5rem 0 0.2rem;
}

@media (max-width: 640px) {
  .popular-pieces-panel {
    margin: 0.75rem 1rem 0;
  }

  .popular-piece-row {
    grid-template-columns: 2rem 1fr;
    grid-template-areas:
      'rank copy'
      'bar bar'
      'count count';
  }

  .popular-piece-rank { grid-area: rank; }
  .popular-piece-copy { grid-area: copy; }
  .popular-piece-bar-track { grid-area: bar; }
  .popular-piece-count { grid-area: count; }
}

.catalog-export-panel {
  margin: 1rem 2rem 0;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.catalog-export-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.catalog-export-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.1rem;
}

.catalog-export-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  max-width: 52rem;
}

.catalog-export-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.catalog-export-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  user-select: none;
}

.catalog-export-toggle input {
  accent-color: var(--accent);
}

.catalog-export-preview {
  position: absolute;
  inset: auto;
  width: 794px;
  opacity: 0;
  pointer-events: none;
  left: 0;
  top: 0;
  z-index: -1;
}

.catalog-export-page {
  width: 794px;
  padding: 28px;
  background: #fff;
  color: #111;
  page-break-after: always;
  break-after: page;
}

.catalog-export-document-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 8px;
}

.catalog-export-document-subtitle {
  font-size: 13px;
  color: #444;
  line-height: 1.5;
  margin-bottom: 14px;
}

.catalog-export-summary {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #555;
  padding-top: 10px;
  border-top: 1px solid #ddd;
}

.catalog-export-item-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.catalog-export-item-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.catalog-export-item-number {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #666;
  margin-bottom: 4px;
}

.catalog-export-item-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.15;
}

.catalog-export-item-artist {
  font-size: 13px;
  color: #6a4b19;
  font-weight: 600;
  margin-top: 4px;
}

.catalog-export-favorite-pill {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  background: #f4efe6;
  font-size: 12px;
  color: #6c5a3a;
  white-space: nowrap;
}

.catalog-export-item-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.6fr;
  gap: 16px;
  align-items: start;
}

.catalog-export-image-wrap {
  border: 1px solid #ddd;
  border-radius: 12px;
  overflow: hidden;
  background: #fafafa;
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.catalog-export-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  max-height: 420px;
}

.catalog-export-details {
  display: grid;
  gap: 10px;
  font-size: 12px;
  line-height: 1.6;
}

.catalog-export-meta-row strong,
.catalog-export-block strong {
  display: inline-block;
  margin-right: 6px;
}

.catalog-export-url {
  word-break: break-all;
}

.catalog-export-block {
  padding-top: 8px;
  border-top: 1px solid #e7e7e7;
}

.catalog-export-block p,
.catalog-export-richtext {
  margin-top: 4px;
}

.catalog-export-richtext p {
  margin: 0 0 0.55rem;
}

.catalog-export-richtext p:last-child {
  margin-bottom: 0;
}

.catalog-export-qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 12px;
  background: #fff;
}

.catalog-export-qr-image {
  width: 170px;
  height: 170px;
  display: block;
}

.catalog-export-qr-caption {
  font-size: 11px;
  color: #555;
  text-align: center;
}

.catalog-export-empty {
  font-size: 13px;
  color: #444;
}

@media (max-width: 640px) {
  .catalog-export-panel {
    margin: 0.75rem 1rem 0;
  }

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

  .catalog-export-actions {
    justify-content: flex-start;
  }

  .catalog-export-item-grid {
    grid-template-columns: 1fr;
  }

  .catalog-export-page {
    width: 100%;
    padding: 18px;
  }
}
