/* ═══════════════════════════════════════════
   Mom's Witchy Book — Dark Gothic Theme
   ═══════════════════════════════════════════ */

:root {
  --bg-deep: #0d0b14;
  --bg-card: #16132a;
  --bg-card-hover: #1e1a35;
  --bg-surface: #221e38;
  --purple-dark: #2d1b69;
  --purple: #7C3AED;
  --purple-light: #A78BFA;
  --purple-glow: rgba(124, 58, 237, 0.3);
  --gold: #CA8A04;
  --gold-light: #EAB308;
  --gold-glow: rgba(202, 138, 4, 0.25);
  --text-primary: #f0e6ff;
  --text-secondary: #9b8ab8;
  --text-muted: #6b5b7b;
  --border: rgba(124, 58, 237, 0.15);
  --border-active: rgba(124, 58, 237, 0.4);
  --radius: 16px;
  --radius-sm: 10px;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --safe-top: var(--tg-safe-top, env(safe-area-inset-top, 0px));
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --navbar-h: 48px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(124, 58, 237, 0.08), transparent 60%),
    radial-gradient(ellipse at 50% 100%, rgba(202, 138, 4, 0.05), transparent 50%);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
}

/* ── Pull-to-refresh ─────────────────── */
.ptr {
  position: fixed;
  top: calc(var(--navbar-h) + var(--safe-top));
  left: 50%;
  transform: translateX(-50%) translateY(-50px);
  z-index: 60;
  transition: transform 200ms;
  pointer-events: none;
}
.ptr.visible { transform: translateX(-50%) translateY(8px); }
.ptr-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2.5px solid rgba(167, 139, 250, 0.2);
  border-top-color: var(--purple-light);
  animation: submitSpin 0.7s linear infinite;
}

/* ── Particles ─────────────────────────── */
.particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: var(--purple-light);
  border-radius: 50%;
  opacity: 0;
  animation: particleFloat 8s infinite ease-in-out;
}
@keyframes particleFloat {
  0% { opacity: 0; transform: translateY(100vh) scale(0); }
  20% { opacity: 0.6; }
  80% { opacity: 0.3; }
  100% { opacity: 0; transform: translateY(-10vh) scale(1); }
}

/* ── App container ─────────────────────── */
#app {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* ── Navbar ─────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: calc(var(--navbar-h) + var(--safe-top));
  padding: 0 16px;
  padding-top: var(--safe-top);
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(13, 11, 20, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-title {
  flex: 1;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-back, .nav-search {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--purple-light);
  cursor: pointer;
  border-radius: 50%;
  transition: background 200ms;
}
.nav-back:active, .nav-search:active {
  background: rgba(124, 58, 237, 0.15);
}
.hidden { display: none !important; }

/* ── Screens ───────────────────────────── */
.screen {
  display: none;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-top: calc(var(--navbar-h) + var(--safe-top));
  padding-bottom: calc(80px + var(--safe-bottom));
  animation: fadeIn 300ms ease-out;
}
.screen.active { display: block; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Home Hero ─────────────────────────── */
.home-hero {
  position: relative;
  padding: 32px 24px 24px;
  text-align: center;
}
.hero-glow {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, var(--purple-glow) 0%, transparent 70%);
  pointer-events: none;
  animation: heroGlow 6s ease-in-out infinite alternate;
}
@keyframes heroGlow {
  0% { opacity: 0.5; transform: translateX(-50%) scale(0.9); }
  100% { opacity: 0.8; transform: translateX(-50%) scale(1.1); }
}
.hero-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  position: relative;
  filter: drop-shadow(0 0 20px rgba(124, 58, 237, 0.3));
}
.shimmer-text {
  background: linear-gradient(
    105deg,
    var(--purple-light) 0%,
    var(--gold-light) 25%,
    #fff 50%,
    var(--gold-light) 75%,
    var(--purple-light) 100%
  );
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmerText 4s ease-in-out infinite;
}
@keyframes shimmerText {
  0%, 100% { background-position: 100% 50%; }
  50% { background-position: 0% 50%; }
}
.hero-sub {
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

/* ── Section cards ─────────────────────── */
.home-sections {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  padding: 0 16px;
  margin-top: 8px;
}
.section-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 8px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 200ms, border-color 200ms, box-shadow 200ms;
  overflow: hidden;
}
.section-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 300ms;
  pointer-events: none;
  border-radius: var(--radius);
}
.section-recipes::before {
  background: radial-gradient(circle at 50% 0%, rgba(202, 138, 4, 0.12), transparent 70%);
}
.section-notes::before {
  background: radial-gradient(circle at 50% 0%, rgba(124, 58, 237, 0.15), transparent 70%);
}
.section-favs::before {
  background: radial-gradient(circle at 50% 0%, rgba(234, 179, 8, 0.15), transparent 70%);
}
.section-favs .section-icon { color: var(--gold-light); }
.section-card:active {
  transform: scale(0.97);
}
.section-card:hover::before { opacity: 1; }
.section-card:hover {
  border-color: var(--border-active);
  box-shadow: 0 4px 24px var(--purple-glow);
}
.section-icon {
  color: var(--purple-light);
  transition: color 200ms;
}
.section-recipes .section-icon { color: var(--gold); }
.section-label {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
  text-align: center;
}
.section-count {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Favorites tabs ───────────────────── */
.fav-tabs {
  display: flex;
  gap: 0;
  padding: 8px 20px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(13, 11, 20, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.fav-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 200ms;
}
.fav-tab.active {
  color: var(--gold-light);
  border-bottom-color: var(--gold);
}

/* ── Item cards ────────────────────────── */
.item-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: transform 200ms, border-color 200ms, box-shadow 200ms;
  overflow: hidden;
}
.item-card:active { transform: scale(0.98); }
.item-card:hover {
  border-color: var(--border-active);
  box-shadow: 0 4px 20px var(--purple-glow);
}
.item-card-photo {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}
.item-card-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 4px;
  color: var(--text-primary);
}
.item-card-category {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}
.item-card-fav {
  position: absolute;
  top: 12px;
  right: 12px;
  color: var(--gold);
  font-size: 16px;
}

/* Category-specific glow */
.item-card[data-category="Молитвы"] { border-color: rgba(124, 58, 237, 0.25); }
.item-card[data-category="Медитации"] { border-color: rgba(59, 130, 246, 0.25); }
.item-card[data-category="Практики"] { border-color: rgba(168, 85, 247, 0.25); }
.item-card[data-category="Энергии и чакры"] { border-color: rgba(236, 72, 153, 0.25); }
.item-card[data-category="Аффирмации"] { border-color: rgba(234, 179, 8, 0.25); }
.item-card[data-category="Мудрость / цитаты"] { border-color: rgba(16, 185, 129, 0.25); }

/* Favorite mini card */
.fav-card {
  min-width: 140px;
  max-width: 160px;
  flex-shrink: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  cursor: pointer;
  transition: transform 200ms, box-shadow 200ms;
}
.fav-card:active { transform: scale(0.97); }
.fav-card:hover { box-shadow: 0 4px 16px var(--purple-glow); }
.fav-card-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.fav-card-cat {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Categories bar ────────────────────── */
.categories-bar {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  overflow-x: auto;
  scrollbar-width: none;
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(13, 11, 20, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.categories-bar::-webkit-scrollbar { display: none; }
.cat-chip {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 200ms;
}
.cat-chip:active { transform: scale(0.95); }
.cat-chip.active {
  background: var(--purple);
  border-color: var(--purple);
  color: #fff;
  box-shadow: 0 2px 12px var(--purple-glow);
}

/* ── Items grid ────────────────────────── */
.items-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 8px 20px;
}
@media (max-width: 360px) {
  .items-grid { grid-template-columns: 1fr; }
}

/* ── FAB ───────────────────────────────── */
.fab {
  position: fixed;
  bottom: calc(24px + var(--safe-bottom));
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--purple-dark));
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px var(--purple-glow);
  transition: transform 200ms, box-shadow 200ms;
  z-index: 30;
}
.fab:active { transform: scale(0.92); }
.fab:hover { box-shadow: 0 6px 28px rgba(124, 58, 237, 0.5); }

/* ── Detail screen — shared ────────────── */
.detail-content { padding: 20px; }
.detail-photo {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 20px;
}
.detail-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 8px;
}
.detail-category {
  margin-bottom: 20px;
}
.cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid rgba(124, 58, 237, 0.2);
  color: var(--purple-light);
}
.detail-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
}
.detail-btn {
  flex: 1;
  padding: 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(19, 17, 26, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 200ms;
}
.detail-btn:active { transform: scale(0.97); }
.detail-btn.fav-active { border-color: var(--gold); color: var(--gold); }
.detail-btn.delete:hover { border-color: #ef4444; color: #ef4444; }

/* ── Detail — Recipe mode ─────────────── */
.detail-recipe-mode {
  position: relative;
  margin: 10px 10px 0;
  padding: 0 0 20px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 20% 0%, rgba(202, 138, 4, 0.1), transparent 50%),
    radial-gradient(circle at 80% 100%, rgba(124, 58, 237, 0.08), transparent 50%),
    linear-gradient(170deg, #15121f, #0e0c16);
  border: 1px solid rgba(202, 138, 4, 0.15);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}
.detail-recipe-mode .detail-photo {
  border-radius: 18px 18px 0 0;
  margin-bottom: 0;
  max-height: 240px;
}
.detail-recipe-mode .detail-title {
  padding: 20px 20px 0;
  background: linear-gradient(135deg, #fff5e6, var(--gold-light) 60%, var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.detail-recipe-mode .detail-category {
  padding: 8px 20px 0;
}
.detail-recipe-mode .cat-badge {
  background: rgba(202, 138, 4, 0.1);
  border-color: rgba(202, 138, 4, 0.2);
  color: var(--gold-light);
}
.recipe-desc {
  padding: 0 20px;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  font-style: italic;
}
.recipe-section {
  margin: 0 14px 16px;
  border-radius: 14px;
  background: rgba(20, 17, 30, 0.6);
  border: 1px solid rgba(202, 138, 4, 0.1);
  overflow: hidden;
}
.recipe-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--gold);
  border-bottom: 1px solid rgba(202, 138, 4, 0.08);
  background: rgba(202, 138, 4, 0.04);
}
.recipe-section-icon { font-size: 16px; }
.recipe-section-body { padding: 14px 16px; }

/* Ingredients */
.ingredient-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 5px 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.ingredient-row:last-child { border-bottom: none; }
.ingredient-dot {
  flex-shrink: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  margin-top: 6px;
}

/* Steps */
.step-row {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.step-row:last-child { border-bottom: none; }
.step-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #b8860b);
  color: #0e0c16;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.step-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.detail-recipe-mode .detail-actions {
  padding: 0 14px;
}
.detail-recipe-mode .detail-btn {
  border-color: rgba(202, 138, 4, 0.15);
}

/* ── Detail — Note mode ───────────────── */
.detail-note-mode {
  position: relative;
  margin: 10px 10px 0;
  padding: 28px 22px 24px;
  border-radius: 22px;
  background:
    radial-gradient(ellipse at 10% 10%, rgba(124, 58, 237, 0.18), transparent 50%),
    radial-gradient(ellipse at 90% 90%, rgba(202, 138, 4, 0.12), transparent 50%),
    linear-gradient(155deg, #18132a, #0f0d17);
  border: 1px solid rgba(167, 139, 250, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(167, 139, 250, 0.1),
    inset 0 -1px 0 rgba(202, 138, 4, 0.08),
    0 16px 48px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
.detail-note-mode::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    175deg,
    rgba(255, 255, 255, 0.015) 0px,
    rgba(255, 255, 255, 0.015) 1px,
    transparent 1px,
    transparent 7px
  );
  pointer-events: none;
}
.detail-note-mode::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 19px;
  border: 1px solid rgba(202, 138, 4, 0.08);
  pointer-events: none;
}
.detail-note-mode .detail-title {
  position: relative;
  background: linear-gradient(135deg, #f4ecff, #a78bfa 55%, #eab308);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 12px rgba(124, 58, 237, 0.25));
}
.detail-note-mode .cat-badge {
  background: rgba(124, 58, 237, 0.12);
  border-color: rgba(167, 139, 250, 0.25);
  color: var(--purple-light);
}
.note-divider {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 6px;
  margin-bottom: 20px;
  opacity: 0.6;
  position: relative;
}
.note-body {
  position: relative;
  font-size: 15px;
  line-height: 1.85;
  color: #e6ddf6;
  white-space: pre-wrap;
  z-index: 1;
}
.detail-note-mode .detail-actions {
  position: relative;
  z-index: 1;
}
.detail-note-mode .detail-btn {
  background: rgba(20, 17, 31, 0.7);
  border-color: rgba(167, 139, 250, 0.18);
}

/* ── Search ────────────────────────────── */
.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 20px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 200ms;
}
.search-box:focus-within {
  border-color: var(--purple);
  box-shadow: 0 0 16px var(--purple-glow);
}
.search-box svg { color: var(--text-muted); flex-shrink: 0; }
.search-box input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 15px;
  font-family: var(--font-body);
}
.search-box input::placeholder { color: var(--text-muted); }
.search-results { padding: 0 20px; }
.search-results .item-card { margin-bottom: 12px; }

/* ── Voice button ──────────────────────── */
.voice-btn {
  position: fixed;
  bottom: calc(24px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), #4c1d95);
  border: 2px solid var(--purple-light);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 30;
  transition: transform 200ms;
}
.voice-btn:active { transform: translateX(-50%) scale(0.92); }
.voice-btn-search {
  bottom: calc(24px + var(--safe-bottom));
}
.voice-pulse {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid var(--purple-light);
  opacity: 0;
  animation: voicePulse 2s ease-out infinite;
}
.voice-pulse-2 {
  animation-delay: 1s;
}
@keyframes voicePulse {
  0% { transform: scale(0.8); opacity: 0.6; }
  100% { transform: scale(1.6); opacity: 0; }
}
.voice-btn.recording {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border-color: #fca5a5;
  animation: voiceRecording 0.8s ease-in-out infinite alternate;
}
.voice-btn.recording .voice-pulse {
  border-color: #fca5a5;
}
@keyframes voiceRecording {
  0% { box-shadow: 0 0 20px rgba(239, 68, 68, 0.4); }
  100% { box-shadow: 0 0 40px rgba(239, 68, 68, 0.7); }
}

/* ── Add screen ────────────────────────── */
.add-form { padding: 20px; }
.add-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-primary);
}
.add-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 4px;
  margin-bottom: 12px;
  background: rgba(20, 17, 31, 0.78);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.add-mode-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 200ms;
}
.add-mode-btn:active {
  transform: scale(0.98);
}
.add-mode-btn.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.88), rgba(45, 27, 105, 0.94));
  border-color: rgba(167, 139, 250, 0.42);
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.28);
}
.add-mode-hint {
  margin-bottom: 14px;
  min-height: 36px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-secondary);
}
.add-mode-pane {
  animation: fadeIn 220ms ease-out;
}
.add-mode-pane.hidden {
  display: none !important;
}
.add-textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color 200ms;
}
.add-textarea:focus {
  border-color: var(--purple);
  box-shadow: 0 0 16px var(--purple-glow);
}
.add-textarea::placeholder { color: var(--text-muted); }
.add-photos {
  margin-top: 16px;
}
.add-mode-pane .add-photos {
  margin-top: 2px;
}
.add-photo-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: border-color 200ms;
}
.add-photo-btn:hover { border-color: var(--purple); }
.photo-previews {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.photo-preview {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border);
}
.add-submit {
  margin-top: 20px;
  width: 100%;
  padding: 14px;
  border-radius: var(--radius);
  border: none;
  background: linear-gradient(135deg, var(--purple), var(--purple-dark));
  color: #fff;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 200ms, box-shadow 200ms;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.add-submit::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -120%;
  width: 45%;
  background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.35) 50%, transparent 100%);
  opacity: 0;
  pointer-events: none;
}
.add-submit:active { transform: scale(0.98); }
.add-submit:hover { box-shadow: 0 4px 20px var(--purple-glow); }
.add-submit:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}
.add-submit.is-loading {
  cursor: progress;
  opacity: 1;
  animation: submitPulse 1.9s ease-in-out infinite;
  box-shadow: 0 0 0 1px rgba(234, 179, 8, 0.35), 0 8px 26px rgba(124, 58, 237, 0.45);
}
.add-submit.is-loading::before {
  opacity: 1;
  animation: submitShimmer 1.3s linear infinite;
}
.add-submit.is-loading:active {
  transform: none;
}
.add-submit.is-loading:disabled {
  opacity: 1;
}
.btn-loader {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: var(--gold-light);
  border-right-color: var(--purple-light);
  animation: submitSpin 0.9s linear infinite;
  filter: drop-shadow(0 0 6px rgba(234, 179, 8, 0.55));
}
.btn-label {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
}
.btn-dots {
  display: inline-block;
  min-width: 14px;
  text-align: left;
}
@keyframes submitShimmer {
  0% { transform: translateX(0); }
  100% { transform: translateX(420%); }
}
@keyframes submitSpin {
  100% { transform: rotate(360deg); }
}
@keyframes submitPulse {
  0%, 100% {
    transform: translateY(0);
    box-shadow: 0 0 0 1px rgba(234, 179, 8, 0.35), 0 8px 24px rgba(124, 58, 237, 0.35);
  }
  50% {
    transform: translateY(-1px);
    box-shadow: 0 0 0 1px rgba(234, 179, 8, 0.45), 0 12px 28px rgba(124, 58, 237, 0.5);
  }
}

/* ── Loading skeleton ──────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-surface) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Reduced motion ────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
