/* CSS Reset and Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #3b82f6;
  --secondary: #64748b;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --danger-muted: #f87171;
  --background: #f8fafc;
  --surface: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--background);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Skip to Content */
.skip-to-content {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 10000;
  padding: 0.75rem 1.5rem;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-sm);
}

.skip-to-content:focus {
  position: fixed;
  top: 10px;
  left: 10px;
  width: auto;
  height: auto;
  overflow: visible;
}

/* App Container */
.app-container {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--surface);
}

/* Header */
.header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 24px 20px;
  text-align: center;
}

.header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.header .tagline {
  font-size: 0.875rem;
  opacity: 0.9;
}

/* Main Content */
.main-content {
  padding: 20px;
}

/* Zip Code Section */
.zip-section {
  margin-bottom: 24px;
}

.zip-section label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.zip-section input {
  width: 100%;
  padding: 12px 16px;
  font-size: 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.zip-section input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.zip-section small {
  display: block;
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Zip Code Display Mode (compact) */
.zip-display-mode,
.zip-edit-mode {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
}

.zip-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.zip-value {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--primary);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: border-color 0.2s, background-color 0.2s;
}

.zip-value:hover {
  border-color: var(--primary);
  background-color: var(--border-light);
}

.zip-value:focus {
  outline: none;
  border-color: var(--primary);
  background-color: var(--border-light);
}

/* Zip Code Edit Mode (inline) */
.zip-edit-mode input {
  width: 80px;
  padding: 4px 8px;
  font-size: 0.875rem;
  font-weight: 500;
  border: 2px solid var(--primary);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: center;
}

.zip-edit-mode input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Input Tabs */
.input-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  background: var(--border-light);
  padding: 4px;
  border-radius: var(--radius);
}

.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn svg {
  width: 24px;
  height: 24px;
}

.tab-btn.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.tab-btn:not(.active):active {
  background: rgba(255, 255, 255, 0.5);
}

/* Tab Panels */
.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* Camera Section */
.camera-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.camera-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.camera-preview .placeholder {
  text-align: center;
  color: var(--text-muted);
  padding: 20px;
}

.camera-preview .placeholder svg {
  width: 64px;
  height: 64px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.camera-preview .placeholder p {
  font-size: 0.875rem;
}

/* Drag and Drop Overlay */
.camera-preview .drag-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(34, 197, 94, 0.9);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  border: 3px dashed #166534;
  z-index: 10;
}

.camera-preview .drag-overlay svg {
  width: 96px;
  height: 96px;
  color: white;
  margin-bottom: 16px;
}

.camera-preview .drag-overlay p {
  font-size: 1.25rem;
  font-weight: 600;
  color: white;
}

.camera-preview.drag-over .drag-overlay {
  display: flex;
}

.camera-preview.drag-over .placeholder {
  opacity: 0;
}

.camera-buttons {
  display: flex;
  gap: 12px;
}

.camera-buttons .btn {
  flex: 1;
}

/* Text Section */
.text-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.text-section label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.text-section textarea {
  width: 100%;
  min-height: 280px;
  padding: 16px;
  font-size: 0.9375rem;
  font-family: inherit;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.text-section textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.text-section textarea::placeholder {
  color: var(--text-muted);
}

/* URL Section */
.url-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.url-section label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.url-section input {
  width: 100%;
  padding: 14px 16px;
  font-size: 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.url-section input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.url-section small {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}

.btn svg {
  width: 20px;
  height: 20px;
}

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

.btn-primary:active {
  background: var(--primary-dark);
  transform: scale(0.98);
}

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

.btn-secondary:hover {
  background: var(--border);
}

.btn-secondary:active {
  background: #cbd5e1;
  transform: scale(0.98);
}

.btn-action {
  width: 100%;
  background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
  color: white;
  font-size: 1rem;
  padding: 16px;
  margin-top: 8px;
}

.btn-action:active {
  transform: scale(0.98);
  opacity: 0.9;
}

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

.btn-full {
  width: 100%;
}

/* Loading Overlay */
.loading-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  z-index: 1000;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.loading-overlay.active {
  display: flex;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-overlay p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  text-align: center;
  padding: 0 20px;
}

/* Results Section */
.results-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 2px solid var(--border-light);
}

.results-header {
  text-align: center;
  margin-bottom: 24px;
}

.results-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  cursor: text;
  padding: 4px 8px;
  margin: -4px -8px 4px -8px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: border-color 0.2s ease, background-color 0.2s ease;
  outline: none;
}

.results-header h2:hover {
  border-color: var(--border);
  background-color: var(--border-light);
}

.results-header h2:focus {
  border-color: var(--primary);
  background-color: var(--surface);
}

/* Servings Control */
.servings-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}

.servings-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.servings-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 1.25rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, border-color 0.2s;
}

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

.servings-btn:active {
  background-color: var(--primary);
  color: white;
}

.servings-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.servings-control input {
  width: 48px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
  padding: 0;
}

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

/* Cost Sections */
.cost-section {
  background: var(--border-light);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}

.section-header {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
}

.section-header h3 {
  flex: 1;
  font-size: 0.9375rem;
  font-weight: 600;
}

.section-header .subtotal {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--primary);
  margin-right: 8px;
}

.section-header .chevron {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  transition: transform 0.2s;
}

.section-header.expanded .chevron {
  transform: rotate(180deg);
}

.section-content {
  display: none;
  padding: 0 16px 16px;
}

.section-content.expanded {
  display: block;
}

/* Ingredient Item */
.ingredient-item,
.packaging-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.ingredient-item:last-child,
.packaging-item:last-child {
  border-bottom: none;
}

.item-details {
  flex: 1;
}

.item-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
}

.item-info {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.item-cost {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  margin-left: 12px;
}

/* Swipe Actions */
.swipe-container {
  position: relative;
  overflow: hidden;
}

.swipe-actions {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  pointer-events: none;
}

.swipe-action-left,
.swipe-action-right {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0;
  transition: opacity 0.1s ease;
}

.swipe-action-left {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, var(--danger));
  color: white;
}

.swipe-action-right {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: linear-gradient(270deg, transparent, var(--primary));
  color: white;
}

.swipeable-item {
  position: relative;
  background: var(--surface);
  z-index: 1;
  touch-action: pan-y;
  will-change: transform;
}

.swipeable-item.swipe-active {
  cursor: grabbing;
}

/* Labor Details */
.labor-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 0.875rem;
}

.labor-item .label {
  color: var(--text-secondary);
}

.labor-item .value {
  font-weight: 500;
}

.labor-item.total {
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding-top: 12px;
  font-weight: 600;
}

/* Major Sections (Kitchen/Business) */
.major-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  overflow: hidden;
}

.major-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  cursor: pointer;
  user-select: none;
  background: linear-gradient(to right, var(--border-light), transparent);
  transition: background 0.2s;
}

.major-section-header:hover {
  background: var(--border-light);
}

.major-section-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: var(--radius);
  flex-shrink: 0;
}

.major-section-icon svg {
  width: 20px;
  height: 20px;
  stroke: white;
}

.major-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.major-section-subtotal {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--primary);
}

.major-chevron {
  width: 20px;
  height: 20px;
  stroke: var(--text-muted);
  transition: transform 0.3s;
  flex-shrink: 0;
}

.major-section.expanded .major-chevron {
  transform: rotate(180deg);
}

.major-section-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.major-section.expanded .major-section-content {
  max-height: 2000px;
  transition: max-height 0.5s ease-in;
}

/* Nested cost sections within major sections */
.major-section .cost-section {
  border: none;
  border-radius: 0;
  border-top: 1px solid var(--border-light);
}

.major-section .cost-section:first-child {
  border-top: none;
}

/* Business section icon color */
#businessSection .major-section-icon {
  background: var(--success);
}

/* Totals Section */
.totals-section {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.total-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 0.9375rem;
}

.total-row span:first-child {
  color: var(--text-secondary);
}

.total-row span:last-child {
  font-weight: 600;
}

.total-row.highlight {
  background: var(--border-light);
  margin: 8px -16px -8px;
  padding: 12px 16px;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.total-row.highlight span:last-child {
  color: var(--success);
}

/* Pricing Section */
.pricing-section {
  margin-bottom: 20px;
}

.pricing-section h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.price-cards {
  display: flex;
  gap: 12px;
}

.price-card {
  flex: 1;
  background: var(--border-light);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}

.price-card.featured {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
}

.price-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  opacity: 0.8;
}

.price-value {
  font-size: 1.5rem;
  font-weight: 700;
}

.price-card.featured .price-label {
  color: rgba(255, 255, 255, 0.85);
}

/* Notes Section */
.notes-section {
  background: #fef3c7;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
}

.notes-section h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: #92400e;
  margin-bottom: 8px;
}

.notes-section p {
  font-size: 0.8125rem;
  color: #78350f;
  line-height: 1.5;
}

/* Results Action Buttons */
.results-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
}

.results-actions .btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn.saved {
  background: var(--success);
  cursor: default;
}

.btn.saved:active {
  transform: none;
}

/* Error Message */
.error-message {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  color: #dc2626;
  font-size: 0.875rem;
  text-align: center;
}

/* Auth UI Styles */
.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.header-top h1 {
  margin-bottom: 0;
}

.auth-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-btn {
  display: inline-block;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: background 0.2s, transform 0.1s;
}

.auth-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.auth-btn:active {
  transform: scale(0.95);
}

.auth-dev-mode {
  padding: 4px 10px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--warning);
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-full);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 6px;
}

.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.user-name {
  font-size: 0.75rem;
  font-weight: 500;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Header Actions Container */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Hamburger Menu Button */
.hamburger-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 36px;
  height: 36px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

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

.hamburger-btn:active {
  transform: scale(0.95);
}

.hamburger-line {
  width: 18px;
  height: 2px;
  background: white;
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}

/* Menu Overlay */
.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  z-index: 998;
}

.menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Slide-out Menu */
.slide-menu {
  position: fixed;
  top: 0;
  right: -280px;
  width: 280px;
  height: 100%;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  transition: right 0.3s ease-out;
  z-index: 999;
  display: flex;
  flex-direction: column;
}

.slide-menu.active {
  right: 0;
}

.menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
}

.menu-title {
  font-size: 1.125rem;
  font-weight: 600;
}

.menu-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s;
}

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

.menu-close-btn svg {
  width: 18px;
  height: 18px;
  stroke: white;
}

.menu-items {
  list-style: none;
  padding: 12px 0;
  margin: 0;
  flex: 1;
  overflow-y: auto;
}

.menu-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}

.menu-item a:hover {
  background: var(--border-light);
  color: var(--primary);
}

.menu-item a:active {
  background: var(--border);
}

.menu-item svg {
  width: 20px;
  height: 20px;
  stroke: var(--text-secondary);
  flex-shrink: 0;
}

.menu-item a:hover svg {
  stroke: var(--primary);
}

/* Coming Soon Notification */
.coming-soon-notification {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 12px 24px;
  background: var(--text-primary);
  color: white;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: transform 0.3s ease-out, opacity 0.3s;
  z-index: 1000;
}

.coming-soon-notification.active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Responsive adjustments for larger screens */
@media (min-width: 481px) {
  .app-container {
    margin: 20px auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-height: calc(100vh - 40px);
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --background: #0f172a;
    --surface: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: #334155;
    --border-light: #1e293b;
  }

  .header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #1e3a8a 100%);
  }

  .loading-overlay {
    background: rgba(15, 23, 42, 0.95);
  }

  .notes-section {
    background: #422006;
  }

  .notes-section h4,
  .notes-section p {
    color: #fcd34d;
  }
}

/* Touch feedback */
@media (hover: none) {
  .btn:active {
    opacity: 0.8;
  }

  .section-header:active {
    background: rgba(0, 0, 0, 0.05);
  }
}

/* Safe area insets for notched phones */
@supports (padding-top: env(safe-area-inset-top)) {
  .header {
    padding-top: calc(24px + env(safe-area-inset-top));
  }

  .main-content {
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
  }

  .my-recipes-screen {
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
  }
}

/* ============================================
   My Recipes Screen
   ============================================ */

.my-recipes-screen {
  padding: 0 16px 20px;
}

.my-recipes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  margin-bottom: 8px;
}

.my-recipes-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.back-btn,
.add-recipe-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: var(--border-light);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s;
}

.back-btn:hover,
.add-recipe-btn:hover {
  background: var(--border);
}

.back-btn svg,
.add-recipe-btn svg {
  width: 20px;
  height: 20px;
  stroke: var(--text-primary);
}

/* Recipes Toolbar */
.recipes-toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.search-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.search-box svg {
  width: 18px;
  height: 18px;
  stroke: var(--text-muted);
  flex-shrink: 0;
}

.search-box input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.9375rem;
  color: var(--text-primary);
  outline: none;
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.group-select {
  display: flex;
  align-items: center;
  gap: 6px;
}

.group-select label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.group-select select {
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--text-primary);
  cursor: pointer;
}

/* Recipe List */
.recipes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.recipe-group {
  margin-bottom: 8px;
}

.recipe-group-header {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 8px;
}

/* Recipe Card */
.recipe-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 16px;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.recipe-card:hover {
  border-color: var(--border);
  box-shadow: var(--shadow);
}

.recipe-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.recipe-card-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  flex: 1;
  margin-right: 12px;
}

.recipe-card-cost {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

.recipe-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.recipe-card-category {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
}

.recipe-card-tag {
  display: inline-flex;
  padding: 4px 8px;
  background: var(--border-light);
  color: var(--text-secondary);
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
}

.recipe-card-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.recipe-card-actions {
  display: flex;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.recipe-card-actions button {
  flex: 1;
  padding: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s;
}

.recipe-action-view {
  background: var(--primary);
  color: white;
}

.recipe-action-view:hover {
  background: var(--primary-dark);
}

.recipe-action-clone {
  background: var(--border-light);
  color: var(--text-primary);
}

.recipe-action-clone:hover {
  background: var(--border);
}

.recipe-action-delete {
  background: transparent;
  color: var(--danger);
  flex: 0 0 auto;
  padding: 8px 12px;
}

.recipe-action-delete:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* Empty State */
.recipes-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.recipes-empty svg {
  width: 64px;
  height: 64px;
  stroke: var(--text-muted);
  margin-bottom: 16px;
}

.recipes-empty h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px;
}

.recipes-empty p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0 0 24px;
}

/* Recipes Loading */
.recipes-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
}

.recipes-loading p {
  margin-top: 16px;
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

/* Delete Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
  padding: 20px;
}

.modal-content {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 360px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}

.modal-content h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 12px;
}

.modal-content p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin: 0 0 24px;
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  gap: 12px;
}

.modal-actions .btn {
  flex: 1;
}

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

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

.btn-danger:active {
  background: #dc2626;
  transform: scale(0.98);
}

/* Vertical modal actions */
.modal-actions-vertical {
  flex-direction: column;
  gap: 8px;
}

.modal-actions-vertical .btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 16px;
}

.modal-actions-vertical .btn svg {
  flex-shrink: 0;
}

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

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

.ingredient-modal-name {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 16px;
  text-align: center;
}

/* Substitution Modal */
.modal-content-lg {
  max-width: 420px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.modal-header h3 {
  margin: 0;
}

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: var(--border-light);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s;
}

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

.modal-close svg {
  stroke: var(--text-secondary);
}

.substitution-original {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.substitution-original strong {
  color: var(--text-primary);
}

/* Substitution loading state */
.substitution-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 0;
  gap: 12px;
}

.substitution-loading .loading-spinner {
  width: 32px;
  height: 32px;
}

.substitution-loading p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0;
}

/* Substitution options */
.substitution-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.substitution-option {
  display: flex;
  align-items: flex-start;
  padding: 12px;
  background: var(--border-light);
  border: 2px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.substitution-option:hover {
  border-color: var(--primary);
  background: var(--surface);
}

.substitution-option-details {
  flex: 1;
}

.substitution-option-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.substitution-option-info {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.substitution-option-reason {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-style: italic;
}

.substitution-option-cost {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  margin-left: 12px;
}

.substitution-cost-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.substitution-cost-diff {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 0.75rem;
  font-weight: 500;
}

.substitution-cost-diff.cheaper {
  color: var(--success);
}

.substitution-cost-diff.expensive {
  color: var(--danger);
}

.substitution-cost-diff.same {
  color: var(--text-muted);
}

.substitution-cost-diff svg {
  width: 12px;
  height: 12px;
}

/* Custom substitution input */
.custom-substitution {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.custom-substitution label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.custom-substitution-row {
  display: flex;
  gap: 8px;
}

.custom-substitution-row input {
  flex: 1;
  padding: 10px 12px;
  font-size: 0.875rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.2s;
}

.custom-substitution-row input:focus {
  outline: none;
  border-color: var(--primary);
}

.btn-sm {
  padding: 10px 16px;
  font-size: 0.8125rem;
}

/* Substitution error state */
.substitution-error {
  text-align: center;
  padding: 16px 0;
}

.substitution-error p {
  font-size: 0.875rem;
  color: var(--danger);
  margin-bottom: 12px;
}

/* Add Item Button */
.add-item-btn-container {
  padding: 12px 16px;
  border-top: 1px solid var(--border-light);
}

.add-item-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--primary);
  background: transparent;
  border: 1px dashed var(--primary);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.add-item-btn:hover {
  background: rgba(37, 99, 235, 0.05);
  border-style: solid;
}

.add-item-btn:active {
  transform: scale(0.98);
}

.add-item-btn svg {
  stroke: var(--primary);
}

/* Add Ingredient Modal */
.add-ingredient-input {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.add-ingredient-input label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.add-ingredient-input input {
  padding: 14px 16px;
  font-size: 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.add-ingredient-input input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.add-ingredient-input small {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.add-ingredient-input .btn {
  margin-top: 8px;
}

.add-ingredient-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 0;
  gap: 12px;
}

.add-ingredient-loading .loading-spinner {
  width: 32px;
  height: 32px;
}

.add-ingredient-loading p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0;
}

.add-ingredient-error {
  text-align: center;
  padding: 16px 0;
}

.add-ingredient-error p {
  font-size: 0.875rem;
  color: var(--danger);
  margin-bottom: 12px;
}

/* Price Override Modal */
.price-override-current {
  background: var(--border-light);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 16px;
}

.price-override-ingredient {
  font-size: 0.9375rem;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.price-override-detail {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin: 2px 0;
}

.price-override-input {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.price-override-input label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.price-override-input input {
  padding: 14px 16px;
  font-size: 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.price-override-input input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.price-override-input small {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.price-override-input .btn {
  margin-top: 8px;
}

.price-override-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 0;
  gap: 12px;
}

.price-override-loading .loading-spinner {
  width: 32px;
  height: 32px;
}

.price-override-loading p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0;
}

.price-override-error {
  text-align: center;
  padding: 16px 0;
}

.price-override-error p {
  font-size: 0.875rem;
  color: var(--danger);
  margin-bottom: 12px;
}

/* Price Override Indicator */
.item-info.has-override {
  color: var(--warning);
}

.item-info .override-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 4px;
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-radius: 3px;
  margin-left: 4px;
}

/* Labor Edit Modal */
.labor-edit-modal {
  max-width: 320px;
}

.labor-edit-content {
  padding: 16px;
}

.labor-edit-field {
  margin-bottom: 16px;
}

.labor-edit-field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.labor-edit-input-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.labor-edit-input-group input {
  flex: 1;
  padding: 12px;
  font-size: 1.25rem;
  font-weight: 600;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-primary);
}

.labor-edit-input-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.labor-edit-unit {
  font-size: 0.875rem;
  color: var(--text-secondary);
  min-width: 40px;
}

/* Add Labor Modal */
.add-labor-modal {
  max-width: 360px;
}

.add-labor-content {
  padding: 16px;
}

.add-labor-field {
  margin-bottom: 16px;
}

.add-labor-field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.add-labor-field input {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-primary);
}

.add-labor-field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.add-labor-field input::placeholder {
  color: var(--text-secondary);
}

/* Editable Labor Items */
.labor-item.editable {
  cursor: pointer;
  transition: background 0.2s;
}

.labor-item.editable:hover {
  background: rgba(37, 99, 235, 0.05);
}

.labor-item.editable:active {
  background: rgba(37, 99, 235, 0.1);
}

.labor-item .edit-indicator {
  font-size: 0.75rem;
  color: var(--primary);
  margin-left: 4px;
}

/* Custom Labor Items */
.custom-labor-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.custom-labor-item:last-child {
  border-bottom: none;
}

.custom-labor-details {
  flex: 1;
}

.custom-labor-name {
  font-size: 0.875rem;
  color: var(--text-primary);
}

.custom-labor-time {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.custom-labor-cost {
  font-weight: 500;
  color: var(--text-primary);
}

.custom-labor-remove {
  padding: 8px;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  margin-left: 8px;
  border-radius: 4px;
  transition: all 0.2s;
}

.custom-labor-remove:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.custom-labor-remove svg {
  width: 16px;
  height: 16px;
}

/* Custom Labor Section Divider */
.custom-labor-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.custom-labor-divider::before,
.custom-labor-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Packaging Edit Modal */
.packaging-edit-modal {
  max-width: 360px;
}

.packaging-edit-content {
  padding: 16px;
}

.packaging-edit-field {
  margin-bottom: 16px;
}

.packaging-edit-field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.packaging-edit-field input {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-primary);
}

.packaging-edit-field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.packaging-edit-cost {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: var(--surface);
  border-radius: 8px;
  margin-bottom: 16px;
}

.packaging-edit-cost .label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.packaging-edit-cost .value {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Add Packaging Modal */
.add-packaging-modal {
  max-width: 360px;
}

.add-packaging-content {
  padding: 16px;
}

.add-packaging-field {
  margin-bottom: 16px;
}

.add-packaging-field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.add-packaging-field input {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-primary);
}

.add-packaging-field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.add-packaging-field input::placeholder {
  color: var(--text-secondary);
}

/* Editable Packaging Items */
.packaging-item.editable {
  cursor: pointer;
  transition: background 0.2s;
  padding: 12px;
  margin: -12px;
  border-radius: 8px;
}

.packaging-item.editable:hover {
  background: rgba(37, 99, 235, 0.05);
}

.packaging-item.editable:active {
  background: rgba(37, 99, 235, 0.1);
}

/* Dark mode for My Recipes */
@media (prefers-color-scheme: dark) {
  .recipe-card-category {
    background: rgba(37, 99, 235, 0.2);
    color: #93c5fd;
  }

  .recipe-action-delete:hover {
    background: rgba(239, 68, 68, 0.2);
  }
}

/* ============================================
   Plan & Usage Styles
   ============================================ */

/* Usage Counter in Header */
.usage-counter {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  padding: 4px 8px;
  background: var(--border-light);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.usage-plan-badge {
  font-weight: 600;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--secondary);
  color: white;
}

.usage-plan-badge.plan-free { background: var(--secondary); }
.usage-plan-badge.plan-starter { background: var(--primary); }
.usage-plan-badge.plan-pro { background: #7c3aed; }
.usage-plan-badge.plan-payg { background: var(--success); }

.usage-text {
  color: var(--text-secondary);
  white-space: nowrap;
}

.usage-counter.usage-warning .usage-text {
  color: var(--warning);
  font-weight: 500;
}

.usage-counter.usage-depleted .usage-text {
  color: var(--danger);
  font-weight: 600;
}

/* Feature Gated Elements */
.feature-gated {
  opacity: 0.5;
  position: relative;
}

.feature-gated::after {
  content: '';
  position: absolute;
  inset: 0;
  cursor: not-allowed;
}

/* Upgrade Prompt */
.upgrade-prompt {
  margin: 16px;
  padding: 20px;
  background: var(--surface);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.upgrade-prompt h3 {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.upgrade-detail {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.upgrade-message {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.upgrade-actions {
  display: flex;
  gap: 8px;
}

/* Branding Footer */
.branding-footer {
  text-align: center;
  padding: 12px 16px;
  margin-top: 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

.branding-footer strong {
  color: var(--text-secondary);
}

.upgrade-link {
  color: var(--primary);
  text-decoration: underline;
  margin-left: 4px;
}

/* Success Message */
.success-message {
  padding: 12px 16px;
  margin: 16px;
  background: #d1fae5;
  color: #065f46;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
}

/* Pricing Modal */
.pricing-modal {
  max-width: 720px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
}

.pricing-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.pricing-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  position: relative;
}

.pricing-card.featured {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.pricing-card.current {
  background: var(--border-light);
}

.pricing-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: white;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.pricing-card h4 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.pricing-price {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.pricing-price span {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text-secondary);
}

.pricing-features {
  list-style: none;
  text-align: left;
  font-size: 0.8rem;
  margin-bottom: 16px;
}

.pricing-features li {
  padding: 4px 0;
  color: var(--text-primary);
}

.pricing-features li::before {
  content: '✓ ';
  color: var(--success);
  font-weight: 700;
}

.pricing-features li.disabled {
  color: var(--text-muted);
  text-decoration: line-through;
}

.pricing-features li.disabled::before {
  content: '— ';
  color: var(--text-muted);
}

.current-plan-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--success);
  padding: 4px 8px;
  background: #d1fae5;
  border-radius: var(--radius-sm);
}

.pricing-payg {
  text-align: center;
  padding: 16px;
  border-top: 1px solid var(--border);
}

.pricing-payg h4 {
  font-size: 1rem;
  margin-bottom: 4px;
}

.pricing-payg p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

/* Mobile: stack pricing cards vertically */
@media (max-width: 600px) {
  .pricing-cards {
    grid-template-columns: 1fr;
  }

  .pricing-modal {
    max-width: 100%;
  }
}

/* Dark mode for plan UI */
@media (prefers-color-scheme: dark) {
  .usage-counter {
    background: rgba(255, 255, 255, 0.1);
  }

  .upgrade-prompt {
    background: var(--surface);
    border-color: var(--primary-light);
  }

  .success-message {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
  }

  .branding-footer {
    border-top-color: rgba(255, 255, 255, 0.1);
  }

  .pricing-card {
    border-color: rgba(255, 255, 255, 0.1);
    background: var(--surface);
  }

  .pricing-card.current {
    background: rgba(255, 255, 255, 0.05);
  }

  .current-plan-badge {
    background: rgba(16, 185, 129, 0.15);
  }
}

/* ============================================
   Landing Page Styles
   ============================================ */

.landing-page {
  --landing-max: 1120px;
  --warm-bg: #fdf8f4;
  --warm-accent: #e8735a;
  --warm-accent-dark: #d4563d;
  --warm-accent-light: #fef0ec;
  --warm-brown: #5c3d2e;
  --warm-cream: #FFF8F0;
  background: var(--warm-cream);
}

/* Navigation */
.landing-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
}

.landing-nav-inner {
  max-width: var(--landing-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.landing-logo {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
}

.landing-nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.landing-nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: color 0.2s;
}

.landing-nav-link:hover {
  color: var(--text-primary);
}

.landing-nav-cta {
  font-size: 0.875rem;
  font-weight: 600;
  color: white;
  background: var(--warm-accent);
  text-decoration: none;
  padding: 8px 20px;
  border-radius: var(--radius-full);
  transition: background 0.2s, transform 0.1s;
}

.landing-nav-cta:hover {
  background: var(--warm-accent-dark);
}

.landing-nav-cta:active {
  transform: scale(0.97);
}

/* Hero Section */
.landing-hero {
  max-width: var(--landing-max);
  margin: 0 auto;
  padding: 60px 20px 40px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: center;
}

.landing-hero-content h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--warm-brown);
  margin-bottom: 20px;
}

.hero-accent {
  color: var(--warm-accent);
}

.hero-subtitle {
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 32px;
  max-width: 520px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.btn-landing-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 32px;
  font-size: 1rem;
  font-weight: 600;
  color: white;
  background: var(--warm-accent);
  border: none;
  border-radius: var(--radius-full);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(232, 115, 90, 0.3);
}

.btn-landing-primary:hover {
  background: var(--warm-accent-dark);
  box-shadow: 0 4px 16px rgba(232, 115, 90, 0.4);
}

.btn-landing-primary:active {
  transform: scale(0.97);
}

.btn-landing-lg {
  padding: 18px 40px;
  font-size: 1.125rem;
}

.btn-landing-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  background: transparent;
  border: 2px solid var(--border);
  border-radius: var(--radius-full);
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

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

.hero-note {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.landing-hero-image {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.landing-hero-image img {
  width: 100%;
  height: auto;
  display: block;
}

.hero-frosted-overlay {
  position: absolute;
  bottom: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  max-width: 260px;
  box-shadow: 0 4px 24px rgba(92, 61, 46, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.hero-overlay-title {
  font-family: 'Playfair Display', serif;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--warm-brown);
  margin-bottom: 6px;
}

.hero-overlay-cost {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.hero-overlay-cost strong {
  color: var(--warm-accent);
  font-size: 1rem;
}

.hero-overlay-items {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.hero-overlay-time {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.hero-overlay-time strong {
  color: var(--warm-accent);
}

/* Section shared styles */
.landing-section-inner {
  max-width: var(--landing-max);
  margin: 0 auto;
  padding: 0 20px;
}

.landing-section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.75rem;
  font-weight: 700;
  text-align: center;
  color: var(--warm-brown);
  margin-bottom: 12px;
}

.landing-section-subtitle {
  font-size: 1.0625rem;
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 48px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

/* Features */
.landing-features {
  padding: 80px 0;
  background: var(--warm-bg);
}

.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.feature-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}

.feature-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--warm-accent-light);
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.feature-icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--warm-accent);
}

.feature-card h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* How It Works */
.landing-how-it-works {
  padding: 80px 0;
  background: var(--warm-bg);
}

.steps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  max-width: 960px;
  margin: 40px auto 0;
  align-items: center;
}

.step-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: left;
  box-shadow: 0 2px 12px rgba(92, 61, 46, 0.08);
  position: relative;
}

.step-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--warm-accent);
  margin-bottom: 20px;
}

.step-icon-group {
  width: 80px;
  height: 80px;
  margin-bottom: 20px;
  color: var(--warm-accent);
}

.step-icon-group svg {
  width: 100%;
  height: 100%;
}

.step-connector {
  display: none;
  color: var(--warm-accent);
  justify-content: center;
  align-items: center;
}

.step-connector svg {
  width: 48px;
  height: 24px;
}

.step-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--warm-brown);
  margin-bottom: 8px;
}

.step-card p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Pricing */
.landing-pricing {
  padding: 80px 0;
  background: var(--warm-bg);
}

.landing-pricing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  max-width: 900px;
  margin: 0 auto 32px;
}

.landing-pricing-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  position: relative;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.landing-pricing-card.featured {
  border-color: var(--warm-accent);
  box-shadow: 0 0 0 1px var(--warm-accent), var(--shadow-md);
}

.landing-pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--warm-accent);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 16px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.landing-pricing-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--warm-brown);
  margin-bottom: 8px;
}

.landing-pricing-price {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--warm-brown);
  margin-bottom: 8px;
}

.landing-pricing-price span {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-secondary);
}

.landing-pricing-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.landing-pricing-features {
  list-style: none;
  text-align: left;
  margin-bottom: 28px;
}

.landing-pricing-features li {
  padding: 6px 0;
  font-size: 0.9375rem;
  color: var(--text-primary);
}

.landing-pricing-features li::before {
  content: '\2713\0020';
  color: var(--success);
  font-weight: 700;
}

.landing-pricing-features li.disabled {
  color: var(--text-muted);
  text-decoration: line-through;
}

.landing-pricing-features li.disabled::before {
  content: '\2014\0020';
  color: var(--text-muted);
}

.btn-landing-plan {
  display: block;
  width: 100%;
  padding: 12px 24px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--warm-accent);
  background: transparent;
  border: 2px solid var(--warm-accent);
  border-radius: var(--radius-full);
  text-decoration: none;
  text-align: center;
  transition: background 0.2s, color 0.2s;
}

.btn-landing-plan:hover {
  background: var(--warm-accent-light);
}

.btn-landing-plan-featured {
  background: var(--warm-accent);
  color: white;
}

.btn-landing-plan-featured:hover {
  background: var(--warm-accent-dark);
}

.landing-payg {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
  padding: 24px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.landing-payg p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.landing-payg strong {
  color: var(--text-primary);
}

/* Testimonials */
.landing-testimonials {
  padding: 80px 0;
}

.testimonials-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.testimonial-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
}

.testimonial-text {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-primary);
  font-style: italic;
  margin-bottom: 20px;
}

.testimonial-text::before {
  content: '\201C';
  display: none;
}

.testimonial-author {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.testimonial-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
}

.testimonial-role {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* Final CTA */
.landing-cta {
  padding: 80px 0;
  background: linear-gradient(135deg, var(--warm-accent) 0%, var(--warm-accent-dark) 100%);
  text-align: center;
}

.landing-cta h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  color: white;
  margin-bottom: 12px;
}

.landing-cta p {
  font-size: 1.0625rem;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 32px;
}

.landing-cta .btn-landing-primary {
  background: white;
  color: var(--warm-accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.landing-cta .btn-landing-primary:hover {
  background: #f8f8f8;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.landing-cta .hero-note {
  color: rgba(255, 255, 255, 0.7);
  margin-top: 16px;
}

/* Landing Footer */
.landing-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 40px 20px;
}

.landing-footer-inner {
  max-width: var(--landing-max);
  margin: 0 auto;
  text-align: center;
}

.landing-footer-brand {
  margin-bottom: 20px;
}

.landing-footer-brand .landing-logo {
  display: block;
  margin-bottom: 8px;
}

.landing-footer-brand p {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.landing-footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 20px;
}

.landing-footer-links a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.landing-footer-links a:hover {
  color: var(--text-primary);
}

.landing-footer-copy {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* App Footer (in-app legal links) */
.app-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.app-footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.app-footer-links a {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.app-footer-links a:hover {
  color: var(--text-secondary);
}

/* Responsive: Tablet+ */
@media (min-width: 640px) {
  .landing-hero {
    padding: 80px 20px 60px;
  }

  .landing-hero-content h1 {
    font-size: 2.75rem;
  }

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

  .steps-grid {
    grid-template-columns: 1fr auto 1fr auto 1fr;
  }

  .step-connector {
    display: flex;
  }

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

  .landing-pricing-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Responsive: Desktop */
@media (min-width: 960px) {
  .landing-hero {
    grid-template-columns: 1fr 1fr;
    padding: 100px 20px 80px;
  }

  .landing-hero-content h1 {
    font-size: 3rem;
  }

  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .testimonials-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Landing Page: full-width app-container override */
.landing-page ~ .app-container {
  /* When landing page exists, app-container uses normal behavior */
}

/* Dark mode for landing page */
@media (prefers-color-scheme: dark) {
  .landing-page {
    --warm-bg: #172033;
    --warm-accent-light: rgba(232, 115, 90, 0.15);
  }

  .landing-nav {
    background: rgba(30, 41, 59, 0.95);
    border-bottom-color: var(--border);
  }

  .landing-cta {
    background: linear-gradient(135deg, #c9513a 0%, #a83d2a 100%);
  }

  .landing-footer {
    background: var(--surface);
    border-top-color: var(--border);
  }

  .feature-card {
    background: var(--surface);
    box-shadow: none;
    border: 1px solid var(--border);
  }

  .testimonial-card {
    border-color: var(--border);
  }

  .landing-pricing-card {
    background: var(--surface);
    border-color: var(--border);
  }

  .landing-pricing-card.featured {
    border-color: var(--warm-accent);
  }

  .landing-payg {
    background: var(--surface);
    border-color: var(--border);
  }

  /* Warm brown -> text-primary in dark mode */
  .landing-page .landing-section-title,
  .landing-page .landing-pricing-card h3,
  .landing-page .landing-pricing-price {
    color: var(--text-primary);
  }

  .landing-page .landing-hero-content h1 {
    color: var(--text-primary);
  }

  /* Step cards dark mode */
  .landing-page .step-card {
    background: var(--surface);
    box-shadow: none;
    border: 1px solid var(--border);
  }

  .landing-page .step-card h3 {
    color: var(--text-primary);
  }

  .landing-page .step-label {
    color: var(--warm-accent);
  }

  .landing-page .step-connector {
    color: var(--warm-accent);
  }

  /* Hero overlay dark mode */
  .hero-frosted-overlay {
    background: rgba(30, 41, 59, 0.85);
    border-color: rgba(255, 255, 255, 0.1);
  }

  .hero-overlay-title {
    color: var(--text-primary);
  }

  .hero-overlay-items {
    border-bottom-color: rgba(255, 255, 255, 0.1);
  }

  /* Auth pages dark mode */
  .auth-page {
    --warm-bg: #172033;
    --warm-cream: #0f172a;
    --warm-accent-light: rgba(232, 115, 90, 0.15);
  }

  .auth-card {
    background: var(--surface);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  }

  .auth-field input {
    background: var(--background);
    border-color: var(--border);
    color: var(--text-primary);
  }

  .auth-title,
  .auth-logo {
    color: var(--text-primary);
  }

  /* Pricing page dark mode */
  .pricing-page {
    --warm-bg: #172033;
    --warm-cream: #0f172a;
    --warm-accent-light: rgba(232, 115, 90, 0.15);
  }

  .comparison-table thead th {
    color: var(--text-primary);
  }

  .comparison-table .featured-col {
    background: rgba(232, 115, 90, 0.1);
  }

  .faq-item {
    background: var(--surface);
    box-shadow: none;
    border: 1px solid var(--border);
  }

  .faq-item h3 {
    color: var(--text-primary);
  }
}

/* ============================================
   Share Modal
   ============================================ */

.share-modal {
  max-width: 500px;
}

.share-recipe-name {
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 1rem;
}

.share-url-container {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.share-url-input {
  flex: 1;
  padding: 0.75rem;
  background: var(--surface-darker);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: monospace;
}

.share-url-input:focus {
  outline: none;
  border-color: var(--warm-accent);
}

.share-copy-btn {
  padding: 0.75rem 1.25rem;
  background: var(--warm-accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.share-copy-btn:hover:not(:disabled) {
  background: var(--warm-accent-hover);
}

.share-copy-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.share-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.share-unshare-btn {
  padding: 0.75rem 1.25rem;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.share-unshare-btn:hover {
  background: var(--surface-darker);
  color: var(--text-primary);
}

.share-close-btn {
  padding: 0.75rem 1.25rem;
  background: var(--warm-accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.share-close-btn:hover {
  background: var(--warm-accent-hover);
}

.recipe-action-share {
  background: transparent;
  color: var(--warm-accent);
  border: 1px solid var(--warm-accent);
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.recipe-action-share:hover {
  background: var(--warm-accent);
  color: white;
}

@media (max-width: 480px) {
  .share-url-container {
    flex-direction: column;
  }

  .share-copy-btn {
    width: 100%;
  }

  .share-actions {
    flex-direction: column-reverse;
  }

  .share-unshare-btn,
  .share-close-btn {
    width: 100%;
  }
}

/* ============================================
   Auth Pages (Login / Sign Up)
   ============================================ */

.auth-page {
  --warm-bg: #fdf8f4;
  --warm-accent: #e8735a;
  --warm-accent-dark: #d4563d;
  --warm-accent-light: #fef0ec;
  --warm-brown: #5c3d2e;
  --warm-cream: #FFF8F0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--warm-cream);
}

.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  box-shadow: 0 4px 24px rgba(92, 61, 46, 0.1);
  text-align: center;
}

.auth-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
  color: var(--warm-brown);
}

.auth-logo svg {
  width: 56px;
  height: 56px;
}

.auth-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--warm-brown);
  margin-bottom: 8px;
}

.auth-subtitle {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

.auth-field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.auth-field input {
  width: 100%;
  padding: 12px 16px;
  font-size: 0.9375rem;
  font-family: 'Inter', sans-serif;
  color: var(--text-primary);
  background: var(--background);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-field input::placeholder {
  color: var(--text-muted);
}

.auth-field input:focus {
  border-color: var(--warm-accent);
  box-shadow: 0 0 0 3px rgba(232, 115, 90, 0.12);
}

.auth-button {
  width: 100%;
  padding: 14px 24px;
  margin-top: 8px;
  font-size: 1rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  color: white;
  background: var(--warm-accent);
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(232, 115, 90, 0.3);
}

.auth-button:hover {
  background: var(--warm-accent-dark);
  box-shadow: 0 4px 16px rgba(232, 115, 90, 0.4);
}

.auth-button:active {
  transform: scale(0.97);
}

.auth-link {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 20px;
}

.auth-link a {
  color: var(--warm-accent);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s;
}

.auth-link a:hover {
  color: var(--warm-accent-dark);
}

.auth-forgot {
  margin-top: 12px;
}

/* ============================================
   Standalone Pricing Page
   ============================================ */

.pricing-hero {
  padding: 60px 0 40px;
  text-align: center;
}

.pricing-comparison {
  padding: 60px 0;
}

.comparison-table-wrapper {
  overflow-x: auto;
  margin-top: 40px;
}

.comparison-table {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.comparison-table th,
.comparison-table td {
  padding: 14px 20px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.comparison-table th:first-child,
.comparison-table td:first-child {
  text-align: left;
  font-weight: 500;
}

.comparison-table thead th {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--warm-brown);
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border);
}

.comparison-table .featured-col {
  background: var(--warm-accent-light);
}

.comparison-table thead .featured-col {
  color: var(--warm-accent);
}

.comparison-table .check {
  color: var(--success);
  font-weight: 700;
}

.comparison-table td {
  color: var(--text-secondary);
}

/* FAQ */
.pricing-faq {
  padding: 80px 0;
  background: var(--warm-bg);
}

.faq-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: 40px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.faq-item {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  box-shadow: 0 2px 8px rgba(92, 61, 46, 0.06);
}

.faq-item h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--warm-brown);
  margin-bottom: 8px;
}

.faq-item p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

@media (min-width: 640px) {
  .faq-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

