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

:root {
  --primary: #E07A5F;
  --secondary: #3D405B;
  --accent: #81B29A;
  --accent-soft: #F2CC8F;
  --gold: #F4F1DE;
  --gold-light: #f0d89d;
  --surface: #fefefe;
  --surface-alt: #f7f5f2;
  --surface-dark: #eee9e3;
  --text: #1a1a2e;
  --text-secondary: #6b6578;
  --text-muted: #a09aab;
  --border: #e8e2db;
  --border-light: #f0ebe5;
  --danger: #dc3545;
  --danger-soft: #fde8ea;
  --success: #28a745;
  --shadow-sm: 0 1px 3px rgba(26, 26, 46, 0.06);
  --shadow-md: 0 4px 12px rgba(26, 26, 46, 0.08);
  --shadow-lg: 0 8px 30px rgba(26, 26, 46, 0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
}

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

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--surface-alt);
  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: var(--primary);
  color: white;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(26, 26, 46, 0.2);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-icon {
  font-size: 1.6rem;
}

.logo h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.back-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}

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

.add-btn {
  background: var(--accent);
  border: none;
  color: white;
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}

.add-btn:hover {
  background: var(--accent-soft);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(233, 69, 96, 0.3);
}

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

/* ==================== RECIPE LIST ==================== */

.recipe-list-page {
  animation: fadeIn 0.3s ease;
}

.search-bar-container {
  margin-bottom: 1rem;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 1rem;
  font-size: 1rem;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 0.85rem 2.5rem 0.85rem 2.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-family: 'DM Sans', sans-serif;
  background: var(--surface);
  color: var(--text);
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.1);
}

.clear-search {
  position: absolute;
  right: 0.8rem;
  background: var(--surface-dark);
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.glass-filter-row {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
  scrollbar-width: none;
}

.glass-filter-row::-webkit-scrollbar {
  display: none;
}

.glass-chip {
  flex-shrink: 0;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--surface);
  cursor: pointer;
  font-size: 0.82rem;
  font-family: 'DM Sans', sans-serif;
  color: var(--text-secondary);
  transition: all 0.2s;
  white-space: nowrap;
}

.glass-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.glass-chip.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.2rem;
}

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

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

.card-img {
  height: 180px;
  overflow: hidden;
  position: relative;
}

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

.recipe-card:hover .card-img img {
  transform: scale(1.05);
}

.placeholder-img {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
}

.placeholder-img span {
  font-size: 3.5rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.card-body {
  padding: 1rem 1.2rem 1.2rem;
}

.card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.glass-badge {
  background: var(--surface-alt);
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  font-size: 0.78rem;
}

.ingredient-count {
  font-size: 0.78rem;
}

/* ==================== EMPTY STATE ==================== */

.empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  animation: fadeIn 0.5s ease;
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

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

.empty-state p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-size: 1rem;
}

.stats-bar {
  text-align: center;
  padding: 1.5rem 0 0.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ==================== RECIPE DETAIL ==================== */

.recipe-detail {
  animation: fadeIn 0.3s ease;
}

.detail-hero {
  position: relative;
  height: 300px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-lg);
}

.detail-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2rem 1.5rem 1.5rem;
  background: linear-gradient(transparent, rgba(26, 26, 46, 0.85));
}

.hero-overlay h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  color: white;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.detail-hero.no-photo {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 220px;
}

.hero-emoji {
  font-size: 4rem;
  margin-bottom: 0.5rem;
}

.detail-hero.no-photo h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  color: white;
}

.detail-content {
  max-width: 700px;
  margin: 0 auto;
}

.detail-meta-bar {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.meta-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.4rem 0.9rem;
  border-radius: 100px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ==================== SHAKER CALCULATOR ==================== */

.shaker-calculator {
  background: var(--surface);
  border: 2px solid var(--gold);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 20px rgba(212, 168, 83, 0.1);
}

.section-header {
  text-align: center;
  margin-bottom: 1rem;
}

.section-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  color: var(--text);
}

.servings-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.serving-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  background: var(--surface);
  color: var(--primary);
  font-size: 1.4rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.serving-btn:hover:not(:disabled) {
  background: var(--primary);
  color: white;
}

.serving-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.serving-display {
  text-align: center;
}

.serving-number {
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.serving-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.quick-servings {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.quick-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.quick-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.quick-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* ==================== INGREDIENTS ==================== */

.ingredients-section,
.instructions-section,
.notes-section {
  margin-bottom: 2rem;
}

.ingredients-section h2,
.instructions-section h2,
.notes-section h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-light);
  color: var(--text);
}

.ingredients-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ingredient-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-light);
  animation: rowSlideIn 0.3s ease both;
  transition: background 0.15s;
}

.ingredient-row:hover {
  background: var(--surface-alt);
}

.ingredient-row:last-child {
  border-bottom: none;
}

.ingredient-amount {
  min-width: 80px;
  text-align: right;
  flex-shrink: 0;
}

.ingredient-amount .amount {
  font-weight: 600;
  color: var(--accent);
  font-size: 1.05rem;
  margin-right: 0.3rem;
}

.ingredient-amount .unit {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.ingredient-name {
  font-weight: 500;
  color: var(--text);
  flex: 1;
}

.original-amount {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ==================== INSTRUCTIONS ==================== */

.instructions-text {
  background: var(--surface);
  padding: 1.2rem 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  line-height: 1.8;
  color: var(--text);
}

.instructions-text p {
  margin-bottom: 0.6rem;
}

.instructions-text p:last-child {
  margin-bottom: 0;
}

.notes-text {
  background: var(--surface);
  padding: 1rem 1.2rem;
  border-radius: var(--radius-md);
  border-left: 3px solid var(--gold);
  color: var(--text-secondary);
  font-style: italic;
}

/* ==================== DETAIL ACTIONS ==================== */

.detail-actions {
  display: flex;
  gap: 0.8rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light);
}

/* ==================== FORM ==================== */

.recipe-form-page {
  max-width: 700px;
  margin: 0 auto;
  animation: fadeIn 0.3s ease;
}

.form-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.recipe-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-section {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

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

.flex-1 {
  flex: 1;
}

.form-label {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.error-text {
  color: var(--danger);
  font-weight: 400;
  font-size: 0.8rem;
}

.form-input,
.form-select,
.form-textarea {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-family: 'DM Sans', sans-serif;
  background: var(--surface);
  color: var(--text);
  transition: all 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.1);
}

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

.form-textarea {
  resize: vertical;
  line-height: 1.7;
}

.servings-input {
  width: 80px;
  text-align: center;
}

/* ==================== PHOTO UPLOAD ==================== */

.photo-upload-area {
  min-height: 120px;
}

.upload-trigger {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-muted);
  gap: 0.5rem;
}

.upload-trigger:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(233, 69, 96, 0.03);
}

.upload-icon {
  font-size: 1.8rem;
}

.photo-preview {
  position: relative;
  display: inline-block;
}

.photo-preview img {
  max-width: 100%;
  max-height: 200px;
  border-radius: var(--radius-md);
  object-fit: cover;
}

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

/* ==================== INGREDIENTS EDITOR ==================== */

.ingredients-editor {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.ingredient-edit-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.ing-drag-controls {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ing-move-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  font-size: 0.7rem;
  line-height: 1;
  transition: color 0.15s;
}

.ing-move-btn:hover:not(:disabled) {
  color: var(--accent);
}

.ing-move-btn:disabled {
  opacity: 0.2;
}

.ing-amount-input {
  width: 60px;
  text-align: center;
  flex-shrink: 0;
}

.ing-unit-select {
  width: 80px;
  flex-shrink: 0;
}

.ing-name-input {
  flex: 1;
  min-width: 100px;
}

.remove-ing-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  flex-shrink: 0;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.remove-ing-btn:hover:not(:disabled) {
  background: var(--danger-soft);
  border-color: var(--danger);
  color: var(--danger);
}

.remove-ing-btn:disabled {
  opacity: 0.2;
  cursor: not-allowed;
}

.add-ing-btn {
  background: var(--surface-alt);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 1rem;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.add-ing-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(233, 69, 96, 0.03);
}

/* ==================== FORM ACTIONS ==================== */

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

/* ==================== BUTTONS ==================== */

.primary-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.2s;
}

.primary-btn:hover:not(:disabled) {
  background: var(--accent-soft);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(233, 69, 96, 0.3);
}

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

.secondary-btn {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.2s;
}

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

.danger-btn {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid var(--danger);
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.2s;
}

.danger-btn:hover {
  background: var(--danger);
  color: white;
}

/* ==================== MODAL ==================== */

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

.modal-content {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: modalSlide 0.3s ease;
}

.modal-content h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.modal-content p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.modal-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
}

/* ==================== SKELETONS ==================== */

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.2rem;
  padding-top: 3rem;
}

.skeleton-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.skeleton-img {
  height: 180px;
  background: linear-gradient(90deg, var(--surface-dark) 25%, var(--surface-alt) 50%, var(--surface-dark) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-text {
  height: 14px;
  margin: 1rem;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--surface-dark) 25%, var(--surface-alt) 50%, var(--surface-dark) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-text.short {
  width: 60%;
}

.skeleton-text.wide {
  width: 80%;
}

.detail-skeleton {
  padding: 2rem 0;
}

.skeleton-hero {
  height: 250px;
  border-radius: var(--radius-lg);
  background: linear-gradient(90deg, var(--surface-dark) 25%, var(--surface-alt) 50%, var(--surface-dark) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  margin-bottom: 1.5rem;
}

.form-skeleton {
  padding: 2rem;
}

/* ==================== ANIMATIONS ==================== */

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

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

@keyframes rowSlideIn {
  from {
    opacity: 0;
    transform: translateX(-12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

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

/* ==================== RESPONSIVE ==================== */

@media (max-width: 640px) {
  .app-main {
    padding: 1rem;
  }

  .header-content {
    height: 56px;
  }

  .logo h1 {
    font-size: 1.25rem;
  }

  .add-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.82rem;
  }

  .recipe-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .card-img {
    height: 160px;
  }

  .detail-hero {
    height: 220px;
    border-radius: var(--radius-md);
  }

  .hero-overlay h1,
  .detail-hero.no-photo h1 {
    font-size: 1.5rem;
  }

  .servings-control {
    gap: 1rem;
  }

  .serving-number {
    font-size: 2.2rem;
  }

  .ingredient-edit-row {
    flex-wrap: wrap;
  }

  .ing-drag-controls {
    display: none;
  }

  .ing-amount-input {
    width: 50px;
  }

  .ing-unit-select {
    width: 70px;
  }

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

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

  .form-actions .primary-btn,
  .form-actions .secondary-btn {
    width: 100%;
    text-align: center;
  }

  .detail-actions {
    flex-direction: column;
  }

  .detail-actions .primary-btn,
  .detail-actions .danger-btn {
    width: 100%;
    text-align: center;
  }

  .ingredient-row {
    flex-wrap: wrap;
    gap: 0.3rem;
  }

  .ingredient-amount {
    min-width: 70px;
  }

  .original-amount {
    width: 100%;
    padding-left: 70px;
  }
}

@media (min-width: 641px) and (max-width: 900px) {
  .recipe-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
```

<!-- WALKTHROUGH_SCRIPT:
[
  {"step": 1, "narration": "Welcome to Mixology, your personal cocktail recipe book. Let's add your first recipe!", "view": "user", "highlight_selector": ".add-btn", "wait_for": "tap_to_continue"},
  {"step": 2, "narration": "Tap '+ New Recipe' to create a cocktail. Fill in the name, glass type, and upload a photo.", "view": "user", "highlight_selector": ".add-btn", "wait_for": "user_interaction"},
  {"step": 3, "narration": "Add each ingredient with its amount and unit. You can reorder them with the arrow buttons.", "view": "user", "highlight_selector": ".ingredients-editor", "wait_for": "tap_to_continue"},
  {"step": 4, "narration": "Set the base servings — this is how many drinks the recipe makes by default.", "view": "user", "highlight_selector": ".servings-input", "wait_for": "tap_to_continue"},
  {"step": 5, "narration": "Write mixing instructions and any tasting notes, then save your recipe.", "view": "user", "highlight_selector": ".primary-btn", "wait_for": "user_interaction"},
  {"step": 6, "narration": "Tap any recipe card to view the full details and use the Shaker Calculator.", "view": "user", "highlight_selector": ".recipe-card", "wait_for": "user_interaction"},
  {"step": 7, "narration": "Use the Shaker Calculator to scale ingredients up or down. Making drinks for 6? Just tap the number and all proportions adjust automatically.", "view": "user", "highlight_selector": ".shaker-calculator", "wait_for": "tap_to_continue"},
  {"step": 8, "narration": "Search by cocktail name or ingredient, and filter by glass type to find exactly what you're looking for. Cheers! 🍸", "view": "user", "highlight_selector": ".search-input", "wait_for": "tap_to_continue"}
]
-->

/* ==================== CONTRIBUTOR IDENTITY ==================== */

.contributor-panel {
  max-width: 1200px;
  margin: 0 auto 1rem;
}

.contributor-identity {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow-sm);
}

.contributor-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.contributor-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  flex: 1;
}

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

.contributor-name-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.contributor-name-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.1);
}

/* ==================== REACTIONS ==================== */

.reaction-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.reaction-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 0.5rem 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.reaction-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.reaction-btn.active {
  border-color: var(--accent);
  background: rgba(233, 69, 96, 0.08);
  color: var(--accent);
}

.reaction-emoji {
  font-size: 1rem;
}

.reaction-count {
  font-size: 0.82rem;
  font-weight: 600;
}

.reaction-byline {
  font-size: 0.72rem;
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .contributor-identity {
    padding: 0.75rem 0.85rem;
  }

  .contributor-avatar {
    width: 40px;
    height: 40px;
    font-size: 1.15rem;
  }

  .reaction-btn {
    padding: 0.45rem 0.7rem;
  }
}

.recipe-reaction-panel {
  margin-top: 0.9rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-light);
}

.recipe-reaction-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.reaction-panel-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
}

.reaction-panel-user {
  font-size: 0.72rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reaction-summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}

.reaction-summary-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--surface-alt);
  border: 1px solid transparent;
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  font-size: 0.78rem;
  line-height: 1;
}

.reaction-summary-pill.active {
  border-color: var(--accent);
  background: rgba(233, 69, 96, 0.08);
  color: var(--accent);
}

.reaction-empty-text {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.reaction-action-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
}

.reaction-compact-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.55rem;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.78rem;
}

.reaction-compact-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.reaction-compact-btn.active {
  border-color: var(--accent);
  background: rgba(233, 69, 96, 0.08);
  color: var(--accent);
}

.reaction-compact-btn .reaction-emoji {
  font-size: 0.9rem;
}

.reaction-compact-btn .reaction-label {
  flex: 1;
  text-align: left;
}

.reaction-compact-btn .reaction-count {
  font-weight: 600;
  min-width: 1ch;
}

.filter-section {
  margin-bottom: 1rem;
}

.filter-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.filter-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.filter-select-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.filter-select {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  box-shadow: var(--shadow-sm);
}

.filter-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.1);
}

.active-filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin-bottom: 1rem;
}

.active-filter-pill {
  display: inline-flex;
  align-items: center;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.78rem;
}

.clear-filters-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  font-size: 0.78rem;
}

.clear-filters-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.recipe-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.7rem;
}

.recipe-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--surface-alt);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
  font-size: 0.74rem;
}

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

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

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

.bartender-panel-header p {
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.bartender-input-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.9rem;
  align-items: flex-start;
}

.bartender-mood-input {
  flex: 1;
  min-height: 88px;
  resize: vertical;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font: inherit;
  background: var(--surface);
  color: var(--text);
}

.bartender-mood-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.1);
}

.bartender-go-btn {
  min-width: 150px;
  align-self: stretch;
}

.bartender-error {
  margin-top: 0.7rem;
  color: var(--danger);
  font-size: 0.9rem;
}

.bartender-results-panel {
  background: linear-gradient(180deg, rgba(233, 69, 96, 0.04), rgba(255,255,255,0));
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1rem;
  margin-bottom: 1rem;
}

.bartender-results-header {
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.9rem;
}

.bartender-results-header h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
}

.bartender-query-pill {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.bartender-suggestions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}

.bartender-suggestion-card {
  text-align: left;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.bartender-suggestion-image {
  height: 140px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}

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

.bartender-suggestion-image.placeholder-img {
  display: flex;
  align-items: center;
  justify-content: center;
}

.bartender-suggestion-image.placeholder-img span {
  font-size: 2.5rem;
}

.bartender-suggestion-body {
  padding: 0.85rem;
}

.bartender-suggestion-topline {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: flex-start;
  margin-bottom: 0.35rem;
}

.bartender-suggestion-topline h4 {
  font-size: 1rem;
  font-weight: 600;
}

.bartender-score {
  font-size: 0.72rem;
  color: var(--accent);
  white-space: nowrap;
}

.bartender-suggestion-body p {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.bartender-open-link {
  display: inline-block;
  margin-top: 0.5rem;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 500;
}

.bartender-invented-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.bartender-invented-top {
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.8rem;
}

.bartender-invented-top h4 {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
}

.bartender-invented-top p,
.bartender-notes {
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.bartender-recipe-block {
  margin-top: 0.9rem;
}

.bartender-recipe-block h5 {
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

.bartender-recipe-block ul,
.bartender-recipe-block ol {
  padding-left: 1.2rem;
  color: var(--text);
}

.bartender-recipe-block li {
  margin-bottom: 0.3rem;
}

@media (max-width: 640px) {
  .bartender-input-row,
  .bartender-invented-top,
  .bartender-results-header {
    flex-direction: column;
    align-items: stretch;
  }

  .bartender-go-btn {
    min-width: 0;
  }
}

.card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.favorite-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
}

.favorite-btn:hover,
.favorite-btn.active {
  border-color: var(--gold);
  background: rgba(212, 168, 83, 0.12);
  color: var(--gold);
}

.favorite-tag {
  border-color: rgba(212, 168, 83, 0.3);
  background: rgba(212, 168, 83, 0.1);
  color: #9a6f1f;
}

.recipe-share-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.65rem;
}

.share-mini-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 0.38rem 0.7rem;
  cursor: pointer;
  font-size: 0.78rem;
  transition: all 0.2s;
}

.share-mini-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.share-toast {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  background: var(--primary);
  color: white;
  padding: 0.65rem 0.9rem;
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
  z-index: 300;
  font-size: 0.88rem;
}

.shared-recipe-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(212, 168, 83, 0.35);
  border-radius: var(--radius-md);
  background: rgba(212, 168, 83, 0.08);
  color: var(--text);
}

.bartender-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

@media (max-width: 640px) {
  .shared-recipe-banner,
  .bartender-card-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

.collection-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.65rem;
}

.collection-chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 0.32rem 0.65rem;
  cursor: pointer;
  font-size: 0.76rem;
  transition: all 0.2s;
}

.collection-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.collection-chip.active {
  border-color: var(--accent);
  background: rgba(233, 69, 96, 0.08);
  color: var(--accent);
}

.collection-empty-text {
  font-size: 0.76rem;
  color: var(--text-muted);
}
