/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Primary: Warm teal → emerald gradient feel */
  --primary: #10b981;
  --primary-dark: #059669;
  --primary-deeper: #047857;
  --primary-light: #a7f3d0;
  --primary-glow: rgba(16, 185, 129, 0.3);

  /* Accent: Amber/warm */
  --accent: #f59e0b;
  --accent-dark: #d97706;
  --accent-light: #fef3c7;

  /* Semantic */
  --green: #22c55e;
  --green-bg: #f0fdf4;
  --red: #ef4444;
  --red-bg: #fef2f2;
  --yellow: #eab308;

  /* Neutrals */
  --bg: #f0fdf4;
  --bg-card: #ffffff;
  --text: #1a1a2e;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --border: #e5e7eb;
  --border-light: #f3f4f6;

  /* Grays for dark elements */
  --dark: #064e3b;
  --dark-surface: #065f46;

  /* Spacing & shape */
  --radius: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --shadow-glow: 0 4px 24px var(--primary-glow);
  --transition: 0.2s ease;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  padding-bottom: calc(90px + var(--safe-bottom));
}

button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select { font-family: inherit; }
ul { list-style: none; }

/* ===== HEADER ===== */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--primary-deeper), var(--dark-surface));
  color: white;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 4px 20px rgba(5, 150, 105, 0.25);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-logo {
  font-size: 30px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3));
  animation: cartBounce 3s ease-in-out infinite;
}

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

.app-title {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #fff 60%, var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.app-subtitle {
  font-size: 11px;
  opacity: 0.75;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.btn-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  color: white;
  transition: background var(--transition);
}

.btn-icon:hover { background: rgba(255,255,255,0.15); }
.btn-icon:active { background: rgba(255,255,255,0.25); }

/* ===== BUDGET BAR ===== */
.budget-bar {
  background: var(--bg-card);
  margin: 12px;
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  border: 1px solid var(--border-light);
}

.budget-bar.status-safe {
  border-left: 4px solid var(--green);
  background: linear-gradient(135deg, var(--green-bg), var(--bg-card));
}
.budget-bar.status-warning {
  border-left: 4px solid var(--yellow);
  background: linear-gradient(135deg, #fefce8, var(--bg-card));
}
.budget-bar.status-danger {
  border-left: 4px solid var(--red);
  background: linear-gradient(135deg, var(--red-bg), var(--bg-card));
}

.budget-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.budget-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.budget-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 1px;
}

.budget-value {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  margin-top: 2px;
  letter-spacing: -0.3px;
}

.budget-budget {
  cursor: pointer;
  color: var(--primary);
}

.budget-budget:hover { text-decoration: underline; }

.budget-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
}

.budget-progress-wrap {
  height: 8px;
  background: var(--border-light);
  border-radius: var(--radius-full);
  margin-top: 14px;
  overflow: hidden;
}

.budget-progress {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--primary), var(--green));
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s ease;
  width: 0%;
}

.budget-progress.warning { background: linear-gradient(90deg, var(--yellow), var(--accent)); }
.budget-progress.danger { background: linear-gradient(90deg, var(--red), #dc2626); }

.budget-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  box-shadow: 0 0 0 3px transparent;
  transition: all 0.3s ease;
}

.status-dot.safe { background: var(--green); box-shadow: 0 0 0 3px rgba(34,197,94,0.15); }
.status-dot.warning { background: var(--yellow); box-shadow: 0 0 0 3px rgba(234,179,8,0.15); }
.status-dot.danger { background: var(--red); box-shadow: 0 0 0 3px rgba(239,68,68,0.15); animation: pulse-dot 1.5s ease-in-out infinite; }

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 3px rgba(239,68,68,0.15); }
  50% { box-shadow: 0 0 0 6px rgba(239,68,68,0.08); }
}

/* ===== VOICE SECTION ===== */
.voice-section {
  text-align: center;
  padding: 8px 20px 20px;
}

.mic-btn {
  position: relative;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-deeper));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  box-shadow: var(--shadow-glow);
  transition: transform 0.15s ease, box-shadow 0.3s ease;
  z-index: 2;
}

.mic-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 30px var(--primary-glow);
}
.mic-btn:active { transform: scale(0.94); }

.mic-btn.listening {
  background: linear-gradient(135deg, var(--red), #dc2626);
  box-shadow: 0 4px 30px rgba(239, 68, 68, 0.45);
  animation: mic-glow 1.5s ease-in-out infinite;
}

@keyframes mic-glow {
  0%, 100% { box-shadow: 0 4px 30px rgba(239, 68, 68, 0.45); }
  50% { box-shadow: 0 4px 50px rgba(239, 68, 68, 0.6); }
}

.mic-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 3px solid var(--primary);
  opacity: 0;
  pointer-events: none;
}

.mic-btn.listening .mic-ring {
  animation: mic-pulse 1.2s ease-out infinite;
  border-color: var(--red);
}

@keyframes mic-pulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.5); opacity: 0; }
}

.voice-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 12px;
  font-weight: 500;
}

.voice-hint.error { color: var(--red); font-weight: 600; }

/* ===== TEXT INPUT FALLBACK ===== */
.text-input-fallback {
  margin-top: 18px;
  text-align: left;
}

.text-fallback-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 10px;
  letter-spacing: 0.3px;
}

.text-input-row {
  display: flex;
  gap: 10px;
}

.text-input-main {
  flex: 1;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 16px;
  font-size: 15px;
  font-weight: 500;
  transition: border-color var(--transition), box-shadow var(--transition);
}

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

.text-input-btn {
  padding: 13px 22px;
  white-space: nowrap;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 15px;
  box-shadow: var(--shadow-glow);
  transition: all var(--transition);
}

.text-input-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px var(--primary-glow);
}
.text-input-btn:active { transform: scale(0.97); }

/* ===== TRANSCRIPT ===== */
.transcript-box {
  background: var(--bg-card);
  border: 2px dashed var(--primary-light);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-top: 14px;
  text-align: left;
}

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

.transcript-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.transcript-status {
  font-size: 11px;
  color: var(--primary);
  font-weight: 600;
  background: var(--primary-glow);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.transcript-text {
  font-size: 16px;
  color: var(--text);
  font-weight: 600;
  font-style: italic;
  min-height: 24px;
}

/* ===== PARSE PREVIEW ===== */
.parse-preview {
  background: var(--bg-card);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-top: 14px;
  text-align: left;
  box-shadow: var(--shadow-glow);
  animation: slideInUp 0.3s ease;
}

.parse-preview.pending-pulse {
  border-color: #f59e0b;
  animation: pendingPulse 1.5s ease-in-out infinite;
}

@keyframes pendingPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
}

.parse-result {
  font-size: 14px;
  margin-bottom: 14px;
}

.parse-result .item-name {
  font-weight: 800;
  color: var(--text);
  font-size: 17px;
}

.parse-result .item-detail {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 3px;
  font-weight: 500;
}

.parse-result .item-price {
  color: var(--primary-dark);
  font-weight: 800;
  font-size: 20px;
  margin-top: 6px;
  letter-spacing: -0.3px;
}

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

/* ===== QUICK ADD ===== */
.quick-add {
  padding: 0 12px;
  margin-bottom: 14px;
}

.section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
  padding-left: 6px;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.quick-btn {
  padding: 14px 8px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  transition: all var(--transition);
}

.quick-btn:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.quick-btn:active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: scale(0.96);
}

/* ===== CART SECTION ===== */
.cart-section {
  padding: 0 12px;
  margin-bottom: 18px;
}

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 6px 14px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.3px;
}

.cart-count {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  min-width: 24px;
  text-align: center;
  box-shadow: var(--shadow-glow);
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 48px 20px;
}

.empty-icon {
  font-size: 56px;
  margin-bottom: 12px;
  opacity: 0.5;
  animation: empty-bounce 3s ease-in-out infinite;
}

@keyframes empty-bounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-8px) rotate(-3deg); }
  75% { transform: translateY(-4px) rotate(3deg); }
}

.empty-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-secondary);
}

.empty-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
  font-weight: 500;
}

/* ===== CART ITEMS ===== */
.cart-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cart-item {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-light);
  animation: slideInUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cart-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--primary), var(--green));
  border-radius: 0 3px 3px 0;
}

.cart-item.swiping {
  transform: translateX(-80px);
  opacity: 0.7;
}

.cart-item .item-info {
  flex: 1;
  min-width: 0;
}

.cart-item .item-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item .item-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
  font-weight: 500;
}

.cart-item .item-total {
  font-weight: 800;
  font-size: 16px;
  color: var(--primary-dark);
  white-space: nowrap;
  letter-spacing: -0.3px;
}

.cart-item .item-actions {
  display: flex;
  gap: 4px;
}

.cart-item .btn-sm-icon {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  transition: all var(--transition);
}

.cart-item .btn-sm-icon:hover { background: var(--border-light); color: var(--text-secondary); }
.cart-item .btn-sm-icon.delete:hover { background: var(--red-bg); color: var(--red); }

/* ===== RECENT ITEMS ===== */
.recent-section {
  padding: 0 12px;
  margin-bottom: 16px;
}

.recent-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.recent-scroll::-webkit-scrollbar { display: none; }

.recent-chip {
  flex-shrink: 0;
  padding: 9px 16px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition);
  white-space: nowrap;
}

.recent-chip:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
  transform: translateY(-1px);
}
.recent-chip:active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ===== FAB ===== */
.fab {
  position: fixed;
  bottom: calc(28px + var(--safe-bottom));
  right: max(24px, calc((100vw - 480px) / 2 + 24px));
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-deeper));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 24px var(--primary-glow);
  z-index: 40;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fab:hover {
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 8px 32px var(--primary-glow);
}
.fab:active { transform: scale(0.9); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 700;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 24px var(--primary-glow); }
.btn-primary:active { transform: scale(0.97); }

.btn-success {
  background: linear-gradient(135deg, var(--green), #16a34a);
  color: white;
}
.btn-success:hover { transform: translateY(-1px); }

.btn-outline {
  background: var(--bg-card);
  border: 2px solid var(--border);
  color: var(--text);
  font-weight: 600;
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary-dark); }

.btn-ghost { color: var(--text-secondary); padding: 11px 14px; font-weight: 600; }
.btn-ghost:hover { background: var(--border-light); color: var(--text); }

.btn-full { width: 100%; }

.btn-text { font-size: 13px; font-weight: 700; padding: 6px 10px; border-radius: 8px; }
.btn-danger-text { color: var(--red); }
.btn-danger-text:hover { background: var(--red-bg); }

.btn-sm { padding: 7px 14px; font-size: 13px; }

.btn-stepper {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: var(--border-light);
  font-size: 20px;
  font-weight: 800;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.btn-stepper:hover { background: var(--border); }
.btn-stepper:active { background: var(--primary); color: white; }

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal-sheet {
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 22px 0;
}

.modal-header h3 {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.modal-close {
  color: var(--text-muted) !important;
}

.modal-body {
  padding: 22px;
}

/* ===== INPUTS ===== */
.input-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
  margin-top: 16px;
}

.input-label:first-child { margin-top: 0; }

.input-group {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.input-group:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.input-prefix {
  padding: 13px 16px;
  font-weight: 700;
  color: var(--text-muted);
  font-size: 15px;
  background: var(--border-light);
  border-right: 1px solid var(--border);
}

.input-field {
  flex: 1;
  padding: 13px 16px;
  border: none;
  background: transparent;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  outline: none;
  min-width: 0;
}

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

.input-field.input-center { text-align: center; }

.input-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.input-row {
  display: flex;
  gap: 14px;
}

.input-col { flex: 1; }

.budget-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.chip {
  padding: 9px 18px;
  border-radius: var(--radius-full);
  background: var(--border-light);
  border: 1.5px solid var(--border);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition);
}

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

/* ===== MENU ===== */
.menu-item {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 18px 4px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border-light);
  transition: all var(--transition);
}

.menu-item:last-child { border-bottom: none; }
.menu-item:hover { color: var(--primary-dark); }
.menu-item.menu-danger { color: var(--red); }
.menu-item.menu-danger:hover { color: #dc2626; }
.menu-icon { font-size: 22px; }

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: calc(100px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--dark);
  color: white;
  padding: 13px 22px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-icon {
  font-size: 17px;
}

/* ===== INSTALL BANNER ===== */
.install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  padding: 18px 22px calc(18px + var(--safe-bottom));
  box-shadow: 0 -4px 24px rgba(0,0,0,0.08);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid var(--border-light);
}

.install-content {
  display: flex;
  align-items: center;
  gap: 14px;
}

.install-icon { font-size: 30px; }
.install-title { font-size: 15px; font-weight: 700; color: var(--text); }
.install-desc { font-size: 12px; color: var(--text-muted); font-weight: 500; }

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

/* ===== ANIMATIONS ===== */
@keyframes slideInUp {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.shake { animation: shake 0.3s ease; }

/* ===== RESPONSIVE ===== */
@media (min-width: 481px) {
  #app { padding: 0; }

  .budget-bar,
  .cart-section,
  .quick-add,
  .recent-section {
    padding-left: 20px;
    padding-right: 20px;
  }
}

/* ===== DARK MODE (prefers) ===== */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0f1a;
    --bg-card: #111827;
    --text: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: #1e293b;
    --border-light: #1a2332;
    --primary-glow: rgba(16, 185, 129, 0.2);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
    --shadow: 0 4px 16px rgba(0,0,0,0.25);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.35);
    --green-bg: rgba(34,197,94,0.08);
    --red-bg: rgba(239,68,68,0.08);
  }

  .app-header {
    background: linear-gradient(135deg, #022c22, #064e3b);
  }

  .modal { background: var(--bg-card); }
  .modal-overlay { background: rgba(0,0,0,0.7); }

  .input-group {
    background: var(--bg);
    border-color: var(--border);
  }

  .input-prefix {
    background: var(--border-light);
    border-color: var(--border);
  }

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

  .btn-outline {
    background: var(--bg-card);
    border-color: var(--border);
  }

  .text-input-main {
    background: var(--bg-card);
    border-color: var(--border);
  }
}
