@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=Playfair+Display:wght@600;700&display=swap');

:root {
  --primary: #FF6F00;
  --primary-dark: #FFB300;
  --primary-light: #FDD835;
  --primary-glow: rgba(108, 92, 231, 0.15);
  --secondary: #C0CA33;
  --secondary-dark: #FFFFFF;
  --accent: #FD79A8;
  --accent-light: #FDCFE2;
  --danger: #E17055;
  --danger-light: #FAD2C7;
  --warning: #FDCB6E;
  --surface: #FFFFFF;
  --surface-raised: #FAFBFF;
  --bg: #F0F0F8;
  --bg-deep: #E8E8F4;
  --text: #2D3436;
  --text-secondary: #636E72;
  --text-light: #B2BEC3;
  --border: #E2E6F0;
  --border-light: #F0F2F8;
  --shadow-sm: 0 1px 3px rgba(45, 52, 54, 0.04);
  --shadow-md: 0 4px 12px rgba(45, 52, 54, 0.06);
  --shadow-lg: 0 8px 30px rgba(45, 52, 54, 0.08);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

::selection {
  background: var(--primary-light);
  color: white;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ===== APP SHELL ===== */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 50%, #4834d4 100%);
  padding: 2rem 1.5rem 1.5rem;
  position: relative;
  overflow: hidden;
}

.app-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
  border-radius: 50%;
}

.app-header::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(253,121,168,0.15) 0%, transparent 70%);
  border-radius: 50%;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.back-btn {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  font-family: inherit;
  margin-bottom: 0.75rem;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}

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

.app-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: white;
  margin-bottom: 0.2rem;
}

.app-subtitle {
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  font-weight: 300;
}

.app-main {
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem;
}

/* ===== SKELETON LOADING ===== */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.skeleton-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  height: 180px;
}

.skeleton-line {
  background: linear-gradient(90deg, var(--border-light) 25%, var(--bg) 50%, var(--border-light) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
  margin-bottom: 0.75rem;
}

.skeleton-line.wide { width: 80%; height: 20px; }
.skeleton-line.medium { width: 60%; height: 14px; }
.skeleton-line.narrow { width: 40%; height: 14px; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-state.small {
  padding: 2.5rem 1.5rem;
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: float 3s ease-in-out infinite;
}

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

.empty-state h2, .empty-state h3 {
  font-family: 'Playfair Display', serif;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--text-secondary);
  max-width: 400px;
  margin: 0 auto 1.5rem;
}

/* ===== BUTTONS ===== */
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--primary-glow);
}

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

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.btn-danger {
  background: var(--danger);
  color: white;
  border: none;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.8rem; }

.btn-icon {
  background: none;
  border: 1px solid var(--border-light);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background: var(--bg);
  border-color: var(--primary-light);
}

.btn-danger-icon:hover {
  background: var(--danger-light);
  border-color: var(--danger);
}

.btn-icon-sm {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.3rem;
  border-radius: 4px;
  transition: background 0.15s;
}

.btn-icon-sm:hover {
  background: var(--bg);
}

/* ===== REGISTRY LIST ===== */
.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.list-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
}

.registry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

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

.registry-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  overflow: hidden;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-sm);
  animation: cardIn 0.4s ease both;
  position: relative;
}

.registry-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: var(--primary-light);
}

.card-top {
  background: linear-gradient(135deg, var(--surface-raised), var(--bg));
  padding: 1.25rem 1.25rem 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  cursor: pointer;
}

.card-emoji {
  font-size: 2.2rem;
}

.card-type-badge {
  background: var(--primary-glow);
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
}

.card-body {
  padding: 0.75rem 1.25rem 1rem;
  cursor: pointer;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text);
}

.card-date {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.card-count {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.progress-section {
  margin-top: 0.5rem;
}

.progress-bar {
  height: 6px;
  background: var(--bg-deep);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.3rem;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--secondary), var(--secondary-dark));
  border-radius: 3px;
  transition: width 0.4s ease;
  min-width: 0;
}

.progress-text {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.card-actions {
  display: flex;
  gap: 0.5rem;
  padding: 0 1.25rem 1rem;
  border-top: 1px solid var(--border-light);
  padding-top: 0.75rem;
}

.confirm-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  z-index: 5;
  border-radius: var(--radius-lg);
  padding: 1rem;
}

.confirm-overlay p {
  font-weight: 500;
  text-align: center;
}

.confirm-actions {
  display: flex;
  gap: 0.5rem;
}

/* ===== REGISTRY DETAIL ===== */
.detail-header {
  margin-bottom: 1.25rem;
}

.detail-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  margin-bottom: 0.3rem;
}

.detail-date {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.detail-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.stat-number {
  display: block;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}

.detail-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.toolbar-left, .toolbar-right {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.select-input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font-family: inherit;
  font-size: 0.82rem;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s;
}

.select-input:focus {
  outline: none;
  border-color: var(--primary-light);
}

/* ===== ITEM CARDS ===== */
.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.item-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  animation: cardIn 0.35s ease both;
}

.item-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

.item-card.item-fulfilled {
  opacity: 0.7;
  border-left: 3px solid var(--secondary);
}

.item-image {
  width: 100%;
  height: 160px;
  overflow: hidden;
  background: var(--bg);
}

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

.item-content {
  padding: 1rem;
}

.item-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.item-name {
  font-size: 1rem;
  font-weight: 600;
}

.priority-badge {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  flex-shrink: 0;
}

.priority-high { background: var(--danger-light); color: var(--danger); }
.priority-medium { background: #FFF3CD; color: #856404; }
.priority-low { background: #D4EDDA; color: #155724; }

.item-notes {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.item-meta {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.item-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
}

.item-qty {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.mini-progress {
  height: 4px;
  background: var(--bg-deep);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.mini-progress-fill {
  height: 100%;
  background: var(--secondary);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.item-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-light);
}

.btn-mark {
  background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
  color: white;
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-mark:hover {
  transform: translateY(-1px);
}

.btn-mark.btn-fulfilled {
  background: var(--bg);
  color: var(--secondary);
  border: 1px solid var(--secondary);
}

.btn-link {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.btn-link:hover {
  background: var(--primary-glow);
}

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

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

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

.modal-wide {
  max-width: 560px;
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

.modal-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-light);
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.15s;
}

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

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

.form-label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text);
  transition: all 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-textarea {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text);
  resize: vertical;
  transition: all 0.2s;
}

.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

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

.form-flex { flex: 1; }
.form-price { width: 120px; }

.form-side {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 140px;
}

.type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.type-option {
  background: var(--surface-raised);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.4rem;
  font-family: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.type-option:hover {
  border-color: var(--primary-light);
}

.type-active {
  border-color: var(--primary);
  background: var(--primary-glow);
  color: var(--primary-dark);
  font-weight: 600;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-light);
  margin-top: 0.5rem;
  padding-top: 1rem;
}

/* ===== QUANTITY & PRIORITY CONTROLS ===== */
.quantity-control {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-top: 0.25rem;
}

.qty-btn {
  background: var(--surface-raised);
  border: none;
  width: 36px;
  height: 36px;
  font-size: 1.1rem;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  transition: background 0.15s;
}

.qty-btn:hover {
  background: var(--bg);
}

.qty-value {
  width: 40px;
  text-align: center;
  font-weight: 600;
  font-size: 0.95rem;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  line-height: 36px;
}

.priority-options {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.25rem;
}

.priority-opt {
  flex: 1;
  background: var(--surface-raised);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.3rem;
  font-family: inherit;
  font-size: 0.72rem;
  text-transform: capitalize;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.priority-opt:hover {
  border-color: var(--text-light);
}

.priority-opt-active { font-weight: 600; }
.priority-opt-high { background: var(--danger-light); border-color: var(--danger); color: var(--danger); }
.priority-opt-medium { background: #FFF3CD; border-color: #FFC107; color: #856404; }
.priority-opt-low { background: #D4EDDA; border-color: #28A745; color: #155724; }

/* ===== PHOTO UPLOAD ===== */
.photo-upload-area {
  margin-top: 0.25rem;
}

.photo-preview {
  position: relative;
  width: 100%;
  height: 120px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

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

.photo-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-upload-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 80px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.85rem;
  transition: all 0.2s;
}

.photo-upload-btn:hover {
  border-color: var(--primary-light);
  color: var(--primary);
  background: var(--primary-glow);
}

/* ===== GUEST VIEW ===== */
.guest-view {
  max-width: 720px;
  margin: 0 auto;
}

.guest-header {
  text-align: center;
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.guest-emoji {
  font-size: 3rem;
  display: block;
  margin-bottom: 0.5rem;
}

.guest-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.guest-date {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.guest-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.guest-stats {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.dot { color: var(--text-light); }

.guest-info-banner {
  background: linear-gradient(135deg, var(--primary-glow), rgba(253,121,168,0.08));
  border: 1px solid var(--primary-light);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  font-size: 0.85rem;
  color: var(--primary-dark);
  margin-bottom: 1.5rem;
  text-align: center;
}

.guest-section {
  margin-bottom: 2rem;
}

.section-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-light);
  display: inline-block;
}

.fulfilled-title {
  border-color: var(--secondary);
}

.guest-items-grid {
  display: grid;
  gap: 1rem;
}

.guest-item-card {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
  animation: cardIn 0.35s ease both;
}

.guest-item-card:hover {
  box-shadow: var(--shadow-md);
}

.guest-item-done {
  opacity: 0.6;
  border-left: 3px solid var(--secondary);
}

.guest-item-image {
  width: 130px;
  min-height: 120px;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--bg);
}

.guest-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.guest-item-body {
  padding: 1rem;
  flex: 1;
}

.guest-item-body h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.guest-item-notes {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.guest-item-meta {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.6rem;
}

.guest-price {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
}

.guest-remaining {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.guest-item-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.btn-guest-purchase {
  background: linear-gradient(135deg, var(--accent), #e84393);
  color: white;
  border: none;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-guest-purchase:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(253, 121, 168, 0.3);
}

.btn-guest-link {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: all 0.15s;
}

.btn-guest-link:hover {
  background: var(--primary-glow);
  border-color: var(--primary-light);
}

.btn-guest-undo {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 0.78rem;
  cursor: pointer;
  text-decoration: underline;
  font-family: inherit;
  padding: 0;
  margin-top: 0.3rem;
}

.btn-guest-undo:hover {
  color: var(--text-secondary);
}

.confirm-purchase {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
}

.confirm-purchase span {
  color: var(--text-secondary);
}

.btn-confirm-yes {
  background: var(--secondary);
  color: white;
  border: none;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-confirm-no {
  background: none;
  border: 1px solid var(--border);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  color: var(--text-secondary);
}

.fulfilled-badge {
  background: var(--secondary);
  color: white;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .app-header {
    padding: 1.5rem 1rem 1.25rem;
  }

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

  .app-main {
    padding: 1rem;
  }

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

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

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

  .detail-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-left, .toolbar-right {
    flex-wrap: wrap;
  }

  .toolbar-right {
    justify-content: flex-end;
  }

  .form-row {
    flex-direction: column;
  }

  .form-price {
    width: 100%;
  }

  .form-side {
    flex-direction: row;
    min-width: auto;
  }

  .form-side .form-label {
    flex: 1;
  }

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

  .modal-content, .modal-wide {
    max-width: 100%;
    max-height: 95vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    margin-top: auto;
  }

  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .guest-item-card {
    flex-direction: column;
  }

  .guest-item-image {
    width: 100%;
    height: 160px;
  }

  .list-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .list-header .btn-primary {
    text-align: center;
  }
}

@media (max-width: 380px) {
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .stat-number {
    font-size: 1.1rem;
  }

  .guest-stats {
    flex-direction: column;
    gap: 0.2rem;
  }

  .dot { display: none; }
}
```

<!-- WALKTHROUGH_SCRIPT:
[
  {"step": 1, "narration": "Welcome to Gift Registry! This is your hub for creating and managing gift wishlists for any occasion — weddings, birthdays, housewarmings, and more.", "view": "user", "highlight_selector": ".app-header", "wait_for": "tap_to_continue"},
  {"step": 2, "narration": "Start by creating your first registry. Tap the 'Create Registry' button to get started.", "view": "user", "highlight_selector": ".btn-primary", "wait_for": "user_interaction"},
  {"step": 3, "narration": "Give your registry a name, pick the occasion type, and optionally add an event date and description for your guests.", "view": "user", "highlight_selector": ".modal-form", "wait_for": "user_interaction"},
  {"step": 4, "narration": "Now add gift items — include the item name, price, a link to where guests can buy it, and even upload a photo. Set quantity if you need multiples.", "view": "user", "highlight_selector": ".btn-primary", "wait_for": "user_interaction"},
  {"step": 5, "narration": "Your registry shows all items with progress tracking. Sort by price, name, or priority, and filter to see what's still needed.", "view": "user", "highlight_selector": ".detail-toolbar", "wait_for": "tap_to_continue"},
  {"step": 6, "narration": "Use the Guest View to see what your guests will see. They can tap 'I'll Get This' to mark items as purchased and avoid duplicates.", "view": "user", "highlight_selector": ".btn-secondary", "wait_for": "user_interaction"},
  {"step": 7, "narration": "Share your registry with the share button on each registry card. Your data syncs across all your devices automatically!", "view": "user", "highlight_selector": ".card-actions", "wait_for": "tap_to_continue"}
]
-->

.guest-identity-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1rem;
  margin-bottom: 1rem;
}

.guest-identity-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.guest-identity-title {
  font-size: 1rem;
  font-weight: 700;
}

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

.guest-identity-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.guest-identity-saved {
  font-size: 0.82rem;
  color: var(--secondary-dark);
  font-weight: 600;
}

.guest-identity-status {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.detail-header-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.share-controls {
  position: relative;
  flex-shrink: 0;
}

.share-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  width: min(360px, 80vw);
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.85rem;
  z-index: 20;
}

.share-url-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.share-url-input {
  flex: 1;
  min-width: 0;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  font-family: inherit;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.share-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.share-status {
  margin-top: 0.65rem;
  font-size: 0.85rem;
  color: var(--secondary-dark);
}

/* ===== REGISTRY PROGRESS CHARTS ===== */
.progress-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1rem;
}

.chart-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.chart-card-header h3 {
  font-size: 1rem;
  font-weight: 700;
}

.chart-card-header p {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.chart-completion-pill {
  background: var(--primary-glow);
  color: var(--primary-dark);
  border: 1px solid var(--primary-light);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.chart-canvas-wrap {
  position: relative;
  width: 100%;
  min-height: 240px;
}

.chart-canvas-tall {
  min-height: 320px;
}

.chart-canvas-wrap canvas {
  width: 100% !important;
  height: 240px !important;
}

.chart-canvas-tall canvas {
  height: 320px !important;
}

@media (max-width: 640px) {
  .progress-chart-grid {
    grid-template-columns: 1fr;
  }

  .chart-card-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

.registry-card-complete {
  border-color: var(--secondary);
  box-shadow: 0 8px 30px rgba(0, 184, 148, 0.12);
}

.registry-card-celebrate {
  animation: cardIn 0.4s ease both, celebratePulse 0.9s ease-in-out 3;
}

.celebration-badge {
  position: absolute;
  top: 0.8rem;
  left: 0.8rem;
  z-index: 2;
  background: linear-gradient(135deg, var(--warning), #ffeaa7);
  color: #6d4c00;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.registry-complete-message {
  margin-top: 0.6rem;
  background: rgba(0, 184, 148, 0.08);
  border: 1px solid rgba(0, 184, 148, 0.2);
  color: var(--secondary-dark);
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
}

.registry-notification-status {
  margin-top: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

@keyframes celebratePulse {
  0% { transform: translateY(0); box-shadow: var(--shadow-sm); }
  50% { transform: translateY(-3px) scale(1.01); box-shadow: 0 10px 34px rgba(0, 184, 148, 0.16); }
  100% { transform: translateY(0); box-shadow: var(--shadow-sm); }
}

@media (prefers-reduced-motion: reduce) {
  .registry-card-celebrate {
    animation: none;
  }
}

.registry-print-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.75rem;
}

.registry-pdf-page {
  background: var(--surface);
}

.no-print {
  display: block;
}

@media print {
  body {
    background: #fff;
  }

  .no-print,
  .share-controls,
  .detail-toolbar,
  .item-actions,
  .progress-chart-grid,
  .registry-print-actions,
  .btn-primary,
  .btn-secondary,
  .btn-mark,
  .btn-link,
  .btn-icon-sm,
  .btn-guest-purchase,
  .btn-guest-link,
  .btn-guest-undo,
  .guest-info-banner,
  .guest-identity-card,
  .guest-item-actions,
  .modal-overlay {
    display: none !important;
  }

  .registry-detail,
  .registry-pdf-page,
  .guest-view {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .registry-pdf-page {
    padding: 0.5in;
  }

  .stats-row {
    grid-template-columns: repeat(4, 1fr);
    page-break-inside: avoid;
  }

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

  .item-card {
    break-inside: avoid;
    page-break-inside: avoid;
    box-shadow: none;
  }

  .chart-card,
  .stat-card,
  .detail-header {
    box-shadow: none;
  }

  .registry-complete-banner {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .share-status {
    display: none !important;
  }

  .guest-view {
    max-width: 100%;
  }
}
