/* ===== Reset & Variables ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --color-bg: #f5f5f7;
  --color-surface: rgba(255, 255, 255, 0.82);
  --color-surface-solid: #ffffff;
  --color-surface-border: rgba(255, 255, 255, 0.5);
  --color-text: #1d1d1f;
  --color-text-secondary: #86868b;
  --color-accent: #0071e3;
  --color-accent-hover: #0077ed;
  --color-accent-light: rgba(0, 113, 227, 0.08);
  --color-success: #34c759;
  --color-success-light: rgba(52, 199, 89, 0.1);
  --color-danger: #ff3b30;
  --color-danger-light: rgba(255, 59, 48, 0.08);
  --color-warning: #ff9500;
  --color-separator: rgba(60, 60, 67, 0.06);
  --radius-xl: 22px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-pill: 980px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.08);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition: 0.25s var(--ease);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* ===== Animated Background ===== */
.bg-gradient {
  position: fixed;
  inset: 0;
  background: linear-gradient(160deg, #f5f5f7 0%, #e8ecf1 50%, #f0f0f5 100%);
  z-index: -2;
}

.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  animation: orbFloat 20s ease-in-out infinite;
}

.orb-1 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #a2d2ff, #bde0fe);
  top: -100px; right: -100px;
}

.orb-2 {
  width: 350px; height: 350px;
  background: radial-gradient(circle, #cdb4db, #ffc8dd);
  bottom: -80px; left: -80px;
  animation-delay: -7s;
}

.orb-3 {
  width: 250px; height: 250px;
  background: radial-gradient(circle, #caffbf, #9bf6ff);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -14s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(40px, -30px) scale(1.05); }
  50% { transform: translate(-20px, 40px) scale(0.95); }
  75% { transform: translate(30px, 20px) scale(1.02); }
}

/* ===== Screens ===== */
#app { min-height: 100vh; min-height: 100dvh; }
.screen { display: none; }
.screen.active { display: flex; }

#screen-gate,
#screen-loading,
#screen-invalid {
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px;
}

/* ===== Glass Card ===== */
.card.glass {
  width: 100%;
  max-width: 440px;
  background: var(--color-surface);
  backdrop-filter: blur(40px) saturate(1.6);
  -webkit-backdrop-filter: blur(40px) saturate(1.6);
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 48px 36px;
  text-align: center;
}

/* ===== Fade-in ===== */
.fade-in {
  animation: fadeInUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  opacity: 0;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== Icons ===== */
.icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  margin-bottom: 20px;
  background: rgba(60, 60, 67, 0.06);
}

.icon-wrap svg { width: 28px; height: 28px; color: var(--color-text-secondary); }

.icon-error { background: var(--color-danger-light); }
.icon-error svg { color: var(--color-danger); }

/* ===== Typography ===== */
h1 { font-size: 1.65rem; font-weight: 700; letter-spacing: -0.025em; line-height: 1.2; margin-bottom: 8px; }
h2 { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 6px; }
h3 { font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; }

.subtitle { font-size: 0.9rem; color: var(--color-text-secondary); line-height: 1.5; margin-bottom: 12px; }
.body-text { font-size: 0.88rem; color: var(--color-text-secondary); line-height: 1.6; margin-bottom: 16px; }
strong { font-weight: 600; color: var(--color-text); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.btn-primary { background: var(--color-accent); color: #fff; }
.btn-primary:hover { background: var(--color-accent-hover); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0) scale(0.97); }

.btn-secondary { background: rgba(0, 0, 0, 0.05); color: var(--color-text); }
.btn-secondary:hover { background: rgba(0, 0, 0, 0.08); }
.btn-sm { padding: 8px 16px; font-size: 0.82rem; }

.btn-add {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  flex-shrink: 0;
}

.btn-add svg { width: 20px; height: 20px; }

/* ===== Code Form ===== */
.divider-text {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 16px;
  color: var(--color-text-secondary);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.divider-text::before,
.divider-text::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-separator);
}

.code-form { display: flex; gap: 8px; margin-bottom: 8px; }

.code-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-pill);
  font-family: var(--font);
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.6);
  color: var(--color-text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.code-input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

.code-form .btn { padding: 12px 24px; min-width: auto; }
.code-error { font-size: 0.82rem; color: var(--color-danger); margin-bottom: 8px; }

.shimmer-line {
  width: 60%;
  height: 3px;
  margin: 24px auto 0;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(0, 113, 227, 0.2), transparent);
  background-size: 200% 100%;
  animation: shimmer 2.5s ease-in-out infinite;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ===== Spinner ===== */
.spinner-wrap { display: flex; justify-content: center; margin-bottom: 20px; }

.spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(0, 0, 0, 0.06);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Main App Layout ===== */
#screen-app {
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: rgba(245, 245, 247, 0.88);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
}

.header-title { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.02em; }

.guest-badge {
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  background: rgba(0, 0, 0, 0.04);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-weight: 500;
}

.app-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px calc(76px + var(--safe-bottom));
  -webkit-overflow-scrolling: touch;
}

/* ===== Views ===== */
.view { display: none; }
.view.active { display: block; animation: viewFadeIn 0.3s var(--ease) forwards; }

@keyframes viewFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.view-header { margin-bottom: 20px; }
.view-header h2 { margin-bottom: 4px; }

/* ===== Tab Bar ===== */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  border-top: 0.5px solid rgba(0, 0, 0, 0.08);
  padding: 6px 0 calc(6px + var(--safe-bottom));
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 0;
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: color var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.tab svg { width: 22px; height: 22px; transition: color var(--transition); }
.tab.active { color: var(--color-accent); }
.tab.active svg { stroke: var(--color-accent); }

/* ===== Section Card ===== */
.section-card {
  background: var(--color-surface-solid);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  border: 0.5px solid rgba(0, 0, 0, 0.04);
}

.section-title { margin-bottom: 12px; color: var(--color-text); }

.section-text {
  font-size: 0.88rem;
  color: var(--color-text-secondary);
  line-height: 1.65;
}

/* ===== Info View ===== */
.hero-banner {
  height: 190px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.12);
  color: #fff;
  text-align: center;
  padding: 20px;
}

.hero-title {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  margin-bottom: 4px;
}

.hero-subtitle { font-size: 0.95rem; opacity: 0.85; color: #fff; }

.detail-row { display: flex; align-items: center; gap: 14px; }

.detail-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--color-accent-light);
  flex-shrink: 0;
}

.detail-icon svg { width: 20px; height: 20px; color: var(--color-accent); }

.detail-label { font-size: 0.78rem; color: var(--color-text-secondary); margin-bottom: 2px; }
.detail-value { font-size: 0.92rem; font-weight: 500; }

.map-container {
  margin-top: 14px;
  border-radius: var(--radius-md);
  overflow: hidden;
  height: 180px;
  background: rgba(0, 0, 0, 0.03);
}

.map-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--color-text-secondary);
  font-size: 0.85rem;
}

.map-placeholder svg { width: 32px; height: 32px; margin-bottom: 8px; opacity: 0.4; }
.map-container iframe { width: 100%; height: 100%; border: 0; }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.photo-thumb {
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  position: relative;
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s var(--ease);
}

.photo-thumb:hover img { transform: scale(1.06); }

.photo-placeholder {
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-placeholder svg { width: 28px; height: 28px; color: var(--color-text-secondary); opacity: 0.3; }

/* ===== Amenity List ===== */
.amenity-list { display: flex; flex-direction: column; gap: 14px; }

.amenity-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.amenity-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--color-accent-light);
  flex-shrink: 0;
}

.amenity-icon svg { width: 20px; height: 20px; color: var(--color-accent); }

.amenity-title { font-size: 0.92rem; font-weight: 600; margin-bottom: 2px; }
.amenity-desc { font-size: 0.82rem; color: var(--color-text-secondary); line-height: 1.5; }

/* ===== Lightbox ===== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s cubic-bezier(0.32, 0.72, 0, 1), visibility 0.4s;
}

.lightbox.lb-open {
  opacity: 1;
  visibility: visible;
}

.lb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(40px) saturate(1.5);
  -webkit-backdrop-filter: blur(40px) saturate(1.5);
}

.lb-chrome {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 0;
}

.lb-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 16px 20px;
  flex-shrink: 0;
}

.lb-counter {
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.lb-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
  position: relative;
  padding: 0 72px;
}

.lb-content {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
}

.lb-img {
  max-width: min(92vw, 1200px);
  max-height: calc(100vh - 160px);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.06);
  object-fit: contain;
  opacity: 0;
  transform: scale(0.92) translateY(12px);
  transition: opacity 0.5s cubic-bezier(0.32, 0.72, 0, 1),
              transform 0.5s cubic-bezier(0.32, 0.72, 0, 1);
  will-change: transform, opacity;
}

.lb-img.lb-img-visible {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* Slide direction hints */
.lb-img.lb-slide-left {
  opacity: 0;
  transform: scale(0.96) translateX(-40px);
}

.lb-img.lb-slide-right {
  opacity: 0;
  transform: scale(0.96) translateX(40px);
}

.lb-caption {
  padding: 14px 20px 24px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.88rem;
  font-weight: 500;
  text-align: center;
  letter-spacing: 0.01em;
  min-height: 52px;
  flex-shrink: 0;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.4s 0.15s cubic-bezier(0.32, 0.72, 0, 1),
              transform 0.4s 0.15s cubic-bezier(0.32, 0.72, 0, 1);
}

.lb-caption.lb-caption-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Navigation buttons */
.lb-close,
.lb-prev,
.lb-next {
  z-index: 2;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.32, 0.72, 0, 1);
  -webkit-tap-highlight-color: transparent;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.lb-close svg,
.lb-prev svg,
.lb-next svg {
  width: 20px;
  height: 20px;
  color: rgba(255, 255, 255, 0.85);
  transition: color 0.2s ease;
}

.lb-close:hover,
.lb-prev:hover,
.lb-next:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.15);
  transform: scale(1.08);
}

.lb-close:hover svg,
.lb-prev:hover svg,
.lb-next:hover svg {
  color: #fff;
}

.lb-close:active,
.lb-prev:active,
.lb-next:active {
  transform: scale(0.94);
  background: rgba(255, 255, 255, 0.25);
}

.lb-close { /* inside top bar, no absolute positioning */ }

.lb-prev,
.lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.lb-prev { left: 16px; }
.lb-next { right: 16px; }

.lb-prev:hover { transform: translateY(-50%) scale(1.08); }
.lb-next:hover { transform: translateY(-50%) scale(1.08); }
.lb-prev:active { transform: translateY(-50%) scale(0.94); }
.lb-next:active { transform: translateY(-50%) scale(0.94); }

@media (max-width: 640px) {
  .lb-stage { padding: 0 12px; }
  .lb-img {
    max-width: 100vw;
    max-height: calc(100vh - 140px);
    border-radius: 10px;
  }
  .lb-prev, .lb-next { width: 36px; height: 36px; }
  .lb-prev svg, .lb-next svg { width: 16px; height: 16px; }
  .lb-prev { left: 6px; }
  .lb-next { right: 6px; }
  .lb-close { width: 36px; height: 36px; }
  .lb-close svg { width: 16px; height: 16px; }
  .lb-top-bar { padding: 12px 14px; }
}

/* ===== Status View ===== */
.toggle-group { display: flex; flex-direction: column; gap: 8px; }

.toggle-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 18px;
  background: rgba(0, 0, 0, 0.02);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.toggle-btn:hover { background: rgba(0, 0, 0, 0.04); }

.toggle-btn.active[data-status="attending"] {
  border-color: var(--color-success);
  background: var(--color-success-light);
}

.toggle-btn.active[data-status="not-attending"] {
  border-color: var(--color-danger);
  background: var(--color-danger-light);
}

.toggle-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toggle-icon svg { width: 18px; height: 18px; }

.toggle-btn.active[data-status="attending"] .toggle-icon svg { color: var(--color-success); }
.toggle-btn.active[data-status="not-attending"] .toggle-icon svg { color: var(--color-danger); }

/* Counter */
.counter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.counter-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.counter-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.04);
}

.counter-icon svg { width: 18px; height: 18px; color: var(--color-text-secondary); }

.counter-controls { display: flex; align-items: center; gap: 14px; }

.counter-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--color-accent-light);
  color: var(--color-accent);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.counter-btn:hover { background: var(--color-accent); color: #fff; }
.counter-btn:active { transform: scale(0.9); }

.counter-value {
  font-size: 1.4rem;
  font-weight: 700;
  min-width: 28px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.btn-save { width: 100%; margin-top: 8px; padding: 14px; }

.feedback {
  margin-top: 12px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 500;
  text-align: center;
  animation: feedbackIn 0.35s var(--ease-bounce);
}

.feedback.success { background: var(--color-success-light); color: #248a3d; }
.feedback.error { background: var(--color-danger-light); color: #d70015; }

@keyframes feedbackIn {
  from { opacity: 0; transform: translateY(6px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== Bring View ===== */
.add-item-form { display: flex; gap: 8px; }

.item-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-pill);
  font-family: var(--font);
  font-size: 0.9rem;
  background: rgba(0, 0, 0, 0.02);
  color: var(--color-text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.item-input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

/* Autocomplete */
.ac-list {
  position: absolute;
  left: 0;
  right: 56px;
  top: 100%;
  margin: 4px 0 0;
  padding: 4px 0;
  list-style: none;
  background: var(--color-surface-solid);
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 50;
  max-height: 240px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.ac-list:empty { display: none; }

.ac-item {
  padding: 10px 16px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.12s ease;
}

.ac-item:hover,
.ac-item.ac-active {
  background: var(--color-accent-light);
  color: var(--color-accent);
}

/* Similarity Warning — Spotlight Overlay */
.similar-warning {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.similar-warning.visible {
  opacity: 1;
  visibility: visible;
}

.similar-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.similar-content {
  position: relative;
  background: #fff;
  border-radius: var(--radius-lg, 16px);
  padding: 24px;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  transform: scale(0.88) translateY(20px);
  transition: transform 0.45s cubic-bezier(0.32, 0.72, 0, 1),
              opacity 0.35s ease;
  opacity: 0;
}

.similar-warning.visible .similar-content {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* Animated gradient border */
.similar-content::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 2px;
  background: conic-gradient(
    from var(--gradient-angle, 0deg),
    rgba(255, 149, 0, 0.5),
    rgba(255, 55, 95, 0.35),
    rgba(175, 82, 222, 0.3),
    rgba(255, 204, 0, 0.4),
    rgba(255, 149, 0, 0.5)
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  animation: gradientSpin 3s linear infinite;
  pointer-events: none;
}

@keyframes gradientSpin {
  to { --gradient-angle: 360deg; }
}

@property --gradient-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

.similar-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 149, 0, 0.12);
  color: #e67e00;
  animation: spotlightPulse 2s ease-in-out infinite;
}

.similar-icon svg {
  width: 22px;
  height: 22px;
}

@keyframes spotlightPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 149, 0, 0.25); }
  50% { box-shadow: 0 0 0 10px rgba(255, 149, 0, 0); }
}

.similar-content p {
  font-size: 0.9rem;
  margin-bottom: 10px;
  color: #6b5300;
  text-align: center;
  line-height: 1.45;
}

.similar-content p strong {
  color: #c47800;
  font-weight: 600;
}

#similar-text {
  background: rgba(255, 149, 0, 0.06);
  border-radius: var(--radius-md, 10px);
  padding: 8px 12px;
  font-style: italic;
  color: #7a5e00;
}

.similar-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 6px;
}

/* Items List */
.items-list { min-height: 32px; }

.item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 0.5px solid var(--color-separator);
  animation: itemSlideIn 0.25s var(--ease);
}

.item-row:last-child { border-bottom: none; }

.item-info { flex: 1; }
.item-name { font-weight: 500; font-size: 0.92rem; }
.item-meta { font-size: 0.78rem; color: var(--color-text-secondary); margin-top: 1px; }

.item-delete {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: var(--color-danger-light);
  color: var(--color-danger);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
  margin-left: 10px;
}

.item-delete:hover { background: var(--color-danger); color: #fff; }

.empty-text {
  color: var(--color-text-secondary);
  font-size: 0.88rem;
  text-align: center;
  padding: 16px 0;
}

@keyframes itemSlideIn {
  from { opacity: 0; transform: translateX(-6px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ===== Utility ===== */
.hidden { display: none !important; }

/* Category Badges */
.cat-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 980px;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  vertical-align: middle;
  margin-left: 5px;
  white-space: nowrap;
}
.cat-salate     { background: rgba(52, 199, 89, 0.12); color: #248a3d; }
.cat-grillgut   { background: rgba(255, 69, 58, 0.10); color: #c62828; }
.cat-beilagen   { background: rgba(175, 130, 60, 0.12); color: #8b6914; }
.cat-dips       { background: rgba(255, 159, 10, 0.12); color: #a85d00; }
.cat-desserts   { background: rgba(255, 105, 180, 0.10); color: #c2185b; }
.cat-getraenke  { background: rgba(10, 132, 255, 0.10); color: #1565c0; }
.cat-snacks     { background: rgba(142, 68, 173, 0.10); color: #7b1fa2; }
.cat-sonstiges  { background: rgba(142, 142, 147, 0.12); color: #636366; }

/* ===== Responsive ===== */
@media (max-width: 480px) {
  .card.glass { padding: 36px 24px; }
  h1 { font-size: 1.4rem; }
  .hero-banner { height: 150px; }
  .hero-title { font-size: 1.5rem; }
}

@media (min-width: 768px) {
  .app-content { max-width: 640px; margin: 0 auto; }
  .photo-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ===== Prefers reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  .orb { animation: none; }
  .shimmer-line { animation: none; }
  .spinner { animation-duration: 1.5s; }
  .fade-in { animation: none; opacity: 1; }
}
