:root {
  --bg: #f4f1eb;
  --bg-card: #ffffff;
  --bg-dark: #1a2f23;
  --primary: #2d4a35;
  --primary-light: #4a7c59;
  --accent: #c8d8a0;
  --accent-warm: #e8c97a;
  --text: #1a2f23;
  --text-light: #5a6b5e;
  --text-muted: #8a9b8e;
  --border: #d8d3c8;
  --danger: #c44;
  --danger-bg: #fde8e8;
  --success: #2d6a3e;
  --shadow-sm: 0 1px 3px rgba(26,47,35,0.08);
  --shadow-md: 0 4px 16px rgba(26,47,35,0.1);
  --shadow-lg: 0 8px 32px rgba(26,47,35,0.15);
  --radius: 14px;
  --radius-sm: 10px;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, system-ui, sans-serif;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { height: 100%; -webkit-tap-highlight-color: transparent; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
  min-height: 100dvh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle at 20% 50%, rgba(200,216,160,0.12) 0%, transparent 50%),
                    radial-gradient(circle at 80% 20%, rgba(232,201,122,0.08) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

#app { position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh; }

/* ========== VIEWS ========== */
.view { display: none; }
.view.active { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }

/* ========== AUTH / LOGIN ========== */
.auth-container {
  max-width: 400px;
  width: 100%;
  margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.logo-section { text-align: center; margin-bottom: 2.5rem; }

.logo {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: center;
}

.logo-icon svg { width: 64px; height: 64px; filter: drop-shadow(0 2px 8px rgba(26,47,35,0.2)); }

.logo-text h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.15;
  text-align: left;
}
.logo-text h1 span {
  font-weight: 400;
  font-style: italic;
  color: var(--primary-light);
  font-size: 0.95em;
}

.tagline {
  margin-top: 0.75rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

/* ========== FORMS ========== */
.auth-form {
  width: 100%;
  background: var(--bg-card);
  padding: 1.75rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}

.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 0.4rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.form-group .required { color: var(--danger); }

.form-group input, .search-container input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--bg);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-group input:focus, .search-container input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(74,124,89,0.12);
}
.form-group input::placeholder, .search-container input::placeholder {
  color: var(--text-muted);
}

.form-group select {
  width: 100%;
  padding: 0.65rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  background: var(--bg);
  color: var(--text);
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a9b8e' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
}
.form-group select:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(74,124,89,0.12);
}

.password-field { position: relative; }
.password-field input { padding-right: 3rem; }
.toggle-pw {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
}

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  width: 100%;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-light); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--accent);
  color: var(--primary);
}
.btn-secondary:hover { background: #b8ca8e; }

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
}
.btn-danger:hover { background: #f5cece; }

.link-btn {
  background: none;
  border: none;
  color: var(--primary-light);
  font-family: var(--font-body);
  font-size: 0.9rem;
  cursor: pointer;
  margin-top: 1rem;
  padding: 0.5rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link-btn:hover { color: var(--primary); }

.icon-btn {
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 8px;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-btn:hover { background: rgba(26,47,35,0.06); color: var(--text); }
.icon-btn.active { color: var(--primary); background: rgba(74,124,89,0.12); }

.error-msg {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: var(--danger-bg);
  color: var(--danger);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  text-align: center;
}
.success-msg {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: #e4f5e8;
  color: var(--success);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  text-align: center;
}

.forgot-section { width: 100%; margin-top: 1.5rem; }
.forgot-text { font-size: 0.9rem; color: var(--text-light); margin-bottom: 1rem; text-align: center; }

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.25rem 0;
}

/* ========== APP HEADER ========== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  padding: 0.75rem 1rem 0;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(216,211,200,0.5);
}

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

.logo-small {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
}
.logo-small span {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
}

.header-actions { display: flex; gap: 0.25rem; }

/* ========== SEARCH ========== */
.search-container {
  position: relative;
  margin-bottom: 0.75rem;
}
.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.search-container input {
  padding-left: 2.75rem;
  padding-right: 2.75rem;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
}
.search-clear-btn {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color 0.15s, background 0.15s;
}
.search-clear-btn:hover { color: var(--text); background: var(--border); }

/* ========== LIST SWITCHER ========== */
.list-switcher {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding-bottom: 0.75rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.list-switcher::-webkit-scrollbar { display: none; }

.list-tabs { display: flex; gap: 0.4rem; flex: 1; overflow-x: auto; scrollbar-width: none; }
.list-tabs::-webkit-scrollbar { display: none; }

.list-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.9rem;
  border-radius: 99px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-light);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
  flex-shrink: 0;
}
.list-tab:hover { border-color: var(--primary-light); }
.list-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.list-tab .tab-count {
  font-size: 0.75rem;
  opacity: 0.7;
}
.list-tab .tab-edit {
  display: none;
  margin-left: 0.2rem;
  opacity: 0.6;
}
.list-tab.active .tab-edit { display: inline-flex; }
.list-tab .tab-edit:hover { opacity: 1; }

.category-filter-btn {
  flex-shrink: 0;
  color: var(--text-muted);
  padding: 0.4rem;
}
.category-filter-btn.active {
  color: var(--primary);
  background: rgba(74,124,89,0.12);
}

.add-list-btn {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 99px;
  border: 1.5px dashed var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.add-list-btn:hover { border-color: var(--primary-light); color: var(--primary-light); background: rgba(74,124,89,0.05); }

/* ========== CATEGORY FILTER PANEL ========== */
.category-filter-panel {
  padding: 0.6rem 0 0.75rem;
  border-top: 1px solid var(--border);
  margin-top: -1px;
}
.category-filter-panel[hidden] { display: none !important; }
.category-filter-options {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.category-chip {
  padding: 0.28rem 0.75rem;
  border-radius: 99px;
  border: 1.5px solid var(--border);
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-light);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.category-chip:hover { border-color: var(--primary-light); color: var(--primary); }
.category-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.category-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ========== ACTIVE FILTER BANNER ========== */
.filter-active-banner {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  background: rgba(232,201,122,0.25);
  color: var(--primary);
  font-size: 0.82rem;
  border-top: 1px solid rgba(232,201,122,0.5);
  margin-top: -1px;
}
.filter-active-banner[hidden] { display: none !important; }
.filter-active-banner strong { font-weight: 600; }
.filter-active-banner button {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-light);
  display: flex;
  align-items: center;
  padding: 0.2rem;
  border-radius: 50%;
  transition: color var(--transition);
}
.filter-active-banner button:hover { color: var(--danger); }

/* ========== ITEMS ========== */
.items-section {
  flex: 1;
  padding: 0.75rem 1rem;
  padding-bottom: 6.5rem;
}

#items-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.item-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: all var(--transition);
  animation: fadeSlideIn 0.25s ease;
}
.item-card:hover { box-shadow: var(--shadow-sm); }

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

.item-card.checked {
  opacity: 0.55;
  background: rgba(255,255,255,0.5);
}
.item-card.checked .item-text { text-decoration: line-through; color: var(--text-muted); }

.item-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border: 2px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  position: relative;
  background: var(--bg);
}
.item-checkbox:checked {
  background: var(--primary-light);
  border-color: var(--primary-light);
}
.item-checkbox:checked::after {
  content: '';
  width: 6px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}

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

.item-text {
  font-size: 0.95rem;
  color: var(--text);
  word-break: break-word;
}

/* Item tags row (category + list) */
.item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.3rem;
}
.item-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.12rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.4;
}
/* Category tag: rectangular corners + square dot */
.item-tag-category {
  border-radius: 4px;
}
.item-tag-category .item-tag-shape {
  width: 6px;
  height: 6px;
  border-radius: 1px;
  flex-shrink: 0;
}
/* List tag: pill corners + circle dot */
.item-tag-list {
  border-radius: 99px;
}
.item-tag-list .item-tag-shape {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.item-photo-thumb {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  cursor: pointer;
  border: 1px solid var(--border);
  flex-shrink: 0;
  transition: transform var(--transition);
}
.item-photo-thumb:hover { transform: scale(1.1); }

.item-actions {
  display: flex;
  gap: 0.225rem;
  flex-shrink: 0;
}
.item-actions .icon-btn { color: var(--text-muted); padding: 0.3rem; }
.item-actions .icon-btn:hover { color: var(--primary-light); }
.item-actions .icon-btn.danger:hover { color: var(--danger); }

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}
.empty-state svg { margin-bottom: 1rem; opacity: 0.3; }
.empty-state p { font-size: 0.95rem; }

/* ========== ADD ITEM BAR ========== */
.add-item-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px rgba(26,47,35,0.08);
  z-index: 40;
}

.add-item-fields { display: flex; flex-direction: column; gap: 0.4rem; }

.add-item-main {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.add-item-bar input[type="text"] {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color var(--transition);
}
.add-item-bar input[type="text"]:focus { border-color: var(--primary-light); }
.add-item-bar input[type="text"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.add-item-category-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.25rem;
  color: var(--text-muted);
}
.add-item-category-row select {
  flex: 1;
  padding: 0.35rem 2rem 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.82rem;
  background: var(--bg);
  color: var(--text-light);
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%238a9b8e' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  transition: border-color var(--transition);
}
.add-item-category-row select:focus { border-color: var(--primary-light); }

.category-inline-create {
  margin-top: 0.5rem;
}
.category-inline-create input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1.5px solid var(--primary-light);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: var(--font-body);
  background: var(--bg);
  outline: none;
}

.btn-add {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}
.btn-add:hover { background: var(--primary-light); transform: scale(1.05); }
.btn-add:active { transform: scale(0.95); }
.btn-add:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* ========== LOADING OVERLAY ========== */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,47,35,0.35);
  backdrop-filter: blur(3px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.15s ease;
}
.loading-overlay[hidden] { display: none !important; }

.loading-spinner-wrap {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}
.spinner-lg {
  width: 36px;
  height: 36px;
  border: 3.5px solid rgba(45,74,53,0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.loading-spinner-wrap span {
  font-size: 0.85rem;
  color: var(--text-light);
  font-weight: 500;
}

/* ========== MODALS ========== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.modal[hidden] { display: none !important; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26,47,35,0.4);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

.modal-content {
  position: relative;
  background: var(--bg-card);
  width: 100%;
  max-width: 440px;
  max-height: 85vh;
  overflow-y: auto;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-sm { max-width: 380px; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.modal-header h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--primary);
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
}
.modal-actions .btn { flex: 1; }

/* Photo modal */
.modal-photo {
  background: transparent;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  padding: 1rem;
  border-radius: 0;
}
.modal-photo img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: var(--radius);
  object-fit: contain;
}
.photo-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  color: #fff;
  background: rgba(0,0,0,0.5);
  border-radius: 50%;
  padding: 0.5rem;
}

/* ========== COLOR SWATCHES ========== */
.color-swatches {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.color-swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  border: 2.5px solid transparent;
  transition: transform 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.selected { border-color: var(--primary); transform: scale(1.1); box-shadow: 0 0 0 3px rgba(45,74,53,0.2); }

/* ========== INVITES MODAL ========== */
.invites-info {
  font-size: 0.87rem;
  color: var(--text-light);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.invite-send-section {
  margin-bottom: 1.5rem;
}
.invite-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 0.4rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.invite-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}
.invite-input-row input {
  flex: 1;
  padding: 0.7rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color var(--transition);
}
.invite-input-row input:focus { border-color: var(--primary-light); }
.invite-send-btn {
  width: auto;
  padding: 0.7rem 1.1rem;
  white-space: nowrap;
  font-size: 0.88rem;
}
.invite-msg {
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
}
.invite-msg.error { background: var(--danger-bg); color: var(--danger); }
.invite-msg.success { background: #e4f5e8; color: var(--success); }

.invites-section { margin-bottom: 1.25rem; }
.invites-section-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.6rem;
}

.invite-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.75rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 0.4rem;
}
.invite-row-email {
  flex: 1;
  font-size: 0.88rem;
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.invite-status {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.invite-status.pending { background: rgba(232,201,122,0.3); color: #8a6a10; }
.invite-status.accepted { background: #e4f5e8; color: var(--success); }
.invite-status.rejected { background: var(--danger-bg); color: var(--danger); }

.invite-actions { display: flex; gap: 0.3rem; flex-shrink: 0; }
.invite-btn {
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  border: none;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all var(--transition);
}
.invite-btn.accept { background: #e4f5e8; color: var(--success); }
.invite-btn.accept:hover { background: #caebd3; }
.invite-btn.reject { background: var(--danger-bg); color: var(--danger); }
.invite-btn.reject:hover { background: #f5cece; }
.invite-btn.cancel { background: var(--bg-card); color: var(--text-muted); border: 1px solid var(--border); }
.invite-btn.cancel:hover { color: var(--danger); border-color: var(--danger); }

.invites-empty {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0.5rem 0;
}

/* ========== RESPONSIVE ========== */
@media (min-width: 600px) {
  .auth-container { padding-top: 6rem; }
  .modal-content { border-radius: var(--radius); margin-bottom: 2rem; }
  .modal { align-items: center; }
  .items-section { max-width: 600px; margin: 0 auto; width: 100%; }
  .add-item-bar { max-width: 600px; left: 50%; transform: translateX(-50%); border-radius: var(--radius) var(--radius) 0 0; }
  .app-header { max-width: 600px; margin: 0 auto; }
}

/* ========== INSTALL BANNER ========== */
.install-banner {
  position: fixed;
  bottom: 5rem;
  left: 1rem;
  right: 1rem;
  max-width: 400px;
  margin: 0 auto;
  background: var(--primary);
  color: #fff;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--shadow-lg);
  z-index: 60;
  animation: slideUp 0.3s ease;
}
.install-banner p { flex: 1; font-size: 0.9rem; }
.install-banner .btn-install {
  background: var(--accent);
  color: var(--primary);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
}
.install-banner .btn-dismiss {
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  padding: 0.25rem;
}

/* Loading spinner (small) */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Toast notifications */
.toast {
  position: fixed;
  bottom: 6rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 99px;
  font-size: 0.9rem;
  box-shadow: var(--shadow-md);
  z-index: 200;
  animation: fadeSlideIn 0.25s ease;
  white-space: nowrap;
}
.toast.error { background: var(--danger); }
