.header a, nav a, .logo-link, a[href*="index.html"], .header a { text-decoration: none !important; }
header a:hover, header a:active, header a:visited, header a:focus { text-decoration: none !important; }
h1 { text-decoration: none !important; }
h1 a { text-decoration: none !important; }

.pantry-photo,
.thumb img,
.message-media img,
.donor-note-media img,
img[data-role="content-photo"] {
  object-fit: cover !important;
  object-position: center !important;
  display: block;
}
.content-photo,
:root {
  --bg: #f5f5f5;
  --panel: #ffffff;
  --text: #2c3e50;
  --muted: #6b7280;
  --accent: #52b788;
  --primary: #2d6a4f;
  --danger: #ef4444;
  --warn: #f59e0b;
  --border: #e5e7eb;
  --shadow: rgba(0, 0, 0, 0.1);
  --app-bg: #f1f5f9;
}

* { box-sizing: border-box; }
html, body, #app { height: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}
body.modal-open {
  overflow: hidden;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  box-shadow: none;
  outline: 1pt solid rgba(148, 163, 184, 0.35);
  position: relative;
  z-index: 1001;
}
.brand { display: flex; gap: 12px; align-items: center; text-decoration: none; color: inherit; }
.brand .logo { font-size: 32px; }
.brand .title { 
  font-weight: 600; 
  font-size: 20px;
  color: var(--text);
}
.top-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: auto;
  margin-right: 32px;
}
/* Ensure nav links have no underline across the site */
nav a { text-decoration: none; }
.nav-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  padding: 8px 16px;
  border-radius: 16px;
  transition: color 0.2s ease, background 0.2s ease;
}
.nav-link:hover {
  color: var(--primary);
  background: rgba(82, 183, 136, 0.1);
}
.nav-link.active {
  color: var(--primary);
  font-weight: 600;
  background: rgba(82, 183, 136, 0.18);
}
.controls {
  display: flex;
  gap: 12px;
  align-items: center;
}
.header-cta {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  padding: 8px 18px;
  border-radius: 16px;
  border: 1px solid var(--border);
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.header-cta:hover {
  color: var(--primary);
  border-color: rgba(82, 183, 136, 0.4);
  background: rgba(82, 183, 136, 0.12);
}
.controls select {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}
.controls select:hover {
  border-color: var(--accent);
}

.layout { 
  position: relative; 
  height: calc(100% - 65px); 
  display: flex;
  overflow: hidden;
}
.layout-no-inner-header {
  height: 100%;
}
#map { 
  height: 100%; 
  flex: 1;
  order: 2;
  z-index: 1;
  position: relative;
}

.details {
  height: 100%;
  width: min(570px, 40vw);
  max-width: 90vw;
  background: var(--panel);
  border-right: 1px solid var(--border);
  box-shadow: none;
  outline: 1pt solid rgba(148, 163, 184, 0.35);
  padding: 24px;
  z-index: 1000;
  order: 1;
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
  transition: width 240ms ease;
}
.details.expanded {
  width: min(900px, 70vw);
}
.details.collapsed {
  width: 64px;
  padding: 12px 10px;
}
.details.collapsed #detailsContent { display: none; }
.details.hidden { 
  display: none;
}

#closeDetails {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--primary);
  border: none;
  font-size: 20px;
  cursor: pointer;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: none;
  outline: 1pt solid rgba(148, 163, 184, 0.45);
}
#closeDetails:hover {
  transform: translateY(-1px);
  box-shadow: none;
}
.details.collapsed #closeDetails { left: 6px; }
.details.collapsed #closeDetails { left: 11px; }

#detailsContent { 
  margin-top: 48px; 
  overflow-y: auto; 
  height: calc(100% - 48px); 
  padding-left: 46px;
  padding-right: 8px; 
  width: 100%;
  overflow-x: hidden;
}
.detail-hero {
  background: var(--panel);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: none;
  outline: 1pt solid rgba(148, 163, 184, 0.35);
  margin-bottom: 32px;
  border: none;
}
.detail-hero-cover {
  position: relative;
}
.detail-hero-cover img.detail-hero-img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
}
.detail-hero-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--primary);
  font-weight: 600;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 999px;
  box-shadow: none;
  outline: 1pt solid rgba(148, 163, 184, 0.35);
}
.detail-floating-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.94);
  color: var(--primary);
  font-size: 18px;
  cursor: pointer;
  box-shadow: none;
  outline: 1pt solid rgba(148, 163, 184, 0.45);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.detail-floating-btn:hover {
  transform: translateY(-1px);
}
.detail-hero-body {
  padding: 28px 30px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.detail-title {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
}
.detail-subline {
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
}
.detail-description {
  margin: 0;
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
}
.detail-contact {
  display: flex;
  align-items: center;
  gap: 12px;
}
.detail-contact-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(82, 183, 136, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--primary);
}
.detail-contact-info {
  font-size: 14px;
  color: var(--text);
}
.detail-contact-info span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.detail-contact-info a {
  color: var(--accent);
  text-decoration: none;
}
.detail-contact-info a:hover {
  text-decoration: underline;
}
.detail-section {
  margin-bottom: 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.detail-section h2 {
  margin: 0;
  font-size: 20px;
  color: var(--text);
  font-weight: 600;
}
.stock-section {
  display: block;
}
.stock-card {
  background: var(--panel);
  border-radius: 16px;
  padding: 24px;
  border: none;
  box-shadow: none;
  outline: 1pt solid rgba(148, 163, 184, 0.35);
}
.stock-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}
.stock-card-head-text {
  min-width: 0;
}
.stock-card-head h2 {
  margin: 0;
}
.stock-card-desc {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}
.stock-info-wrap {
  position: relative;
  flex-shrink: 0;
  display: inline-flex;
}
.stock-info-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 2px solid rgba(44, 62, 80, 0.6);
  background: transparent;
  color: rgba(44, 62, 80, 0.85);
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.stock-info-btn:hover {
  background: rgba(148, 163, 184, 0.12);
}
.stock-info-img {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 6px;
  max-width: min(67.5vw, 315px);
  width: auto;
  height: auto;
  max-height: 52.5vh;
  object-fit: contain;
  z-index: 1000;
  pointer-events: none;
}
.stock-info-wrap:hover .stock-info-img {
  display: block;
}
/* Extend hover zone so image stays visible when moving mouse onto it */
.stock-info-wrap:hover::after {
  content: '';
  position: absolute;
  left: -60px;
  right: -60px;
  top: 0;
  bottom: -320px;
  z-index: 999;
}
.stock-meta {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}
.stock-meta-line {
  margin: 0;
}

/* Shared card style for detail sections (wishlist) */
.detail-card-section {
  background: var(--panel);
  border-radius: 16px;
  padding: 24px;
  border: none;
  box-shadow: none;
  outline: 1pt solid rgba(148, 163, 184, 0.35);
}
.detail-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.detail-card-head h2 {
  margin: 0;
}

.detail-gauge {
  position: relative;
  width: 200px;
  max-width: 100%;
  margin: 0 auto;
}
.detail-gauge-svg {
  width: 100%;
  height: auto;
}
.detail-gauge-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  padding-bottom: 8px;
}
.detail-gauge-status {
  font-weight: 700;
  color: var(--primary);
  font-size: 16px;
}
.detail-gauge-count {
  font-size: 13px;
  color: var(--muted);
}
/* Donor Notes section (same style as Leave a message) */
.donor-notes-section {
  background: rgba(82, 183, 136, 0.08);
  border: 1px solid rgba(82, 183, 136, 0.2);
  border-radius: 12px;
  padding: 16px;
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.donor-notes-section h2 {
  margin: 0;
}
.donor-notes-cta {
  width: 100%;
  border: none;
  border-radius: 16px;
  padding: 14px 18px;
  background: rgba(82, 183, 136, 0.18);
  color: var(--primary);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
}
.donor-notes-cta:hover {
  background: rgba(82, 183, 136, 0.28);
}
.donor-notes-latest {
  min-height: 60px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.donor-note-empty {
  color: var(--muted);
  font-size: 14px;
  padding: 12px 0;
}
.donor-note-card {
  padding: 16px;
  border-radius: 20px;
  background: var(--panel);
  border: none;
  box-shadow: none;
  outline: 1pt solid rgba(148, 163, 184, 0.35);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.donor-note-media {
  line-height: 0;
}
.donor-note-media img {
  width: 160px;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  object-fit: cover;
}
.donor-note-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}
.donor-note-items strong {
  display: inline-block;
}
.donor-note-chips {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.donor-note-chip {
  display: inline-block;
  align-self: flex-start;
  max-width: 100%;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(82, 183, 136, 0.14);
  color: var(--text);
  font-size: 13px;
  line-height: 1.2;
  word-break: break-word;
}
.donor-note-time {
  font-size: 12px;
  color: var(--muted);
}
.donor-note-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.donor-note-modal {
  position: relative;
  background: var(--panel);
  border-radius: 16px;
  padding: 24px;
  max-width: 420px;
  width: 100%;
  border: none;
  box-shadow: none;
  outline: 1pt solid rgba(148, 163, 184, 0.45);
}
.donor-note-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
}
.donor-note-modal h3 {
  margin: 0 0 8px;
  font-size: 18px;
  color: var(--text);
}
.donor-note-modal-hint {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--muted);
}
.donor-note-form label {
  display: block;
  margin-bottom: 12px;
  font-size: 14px;
  color: var(--text);
}
.donor-note-form label span {
  display: block;
  margin-bottom: 4px;
}
.donor-note-form input[type="file"],
.donor-note-form input[type="text"],
.donor-note-form textarea,
.donor-note-form select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  box-sizing: border-box;
}
.donor-note-form input[type="text"],
.donor-note-keywords-input {
  margin-top: 8px;
}
.donor-note-form textarea {
  resize: vertical;
  min-height: 72px;
}
.donor-note-categories-title {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--text);
}
.donor-note-categories-list {
  max-height: 220px;
  overflow-y: auto;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}
.donor-note-category-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}
.donor-note-category-item:last-child {
  margin-bottom: 0;
}
.donor-note-category-item input[type="checkbox"] {
  margin: 2px 0 0;
  flex-shrink: 0;
}
.donor-note-categories-label {
  margin-bottom: 12px;
}
.donor-note-form select[required] {
  border-color: var(--primary, #52b788);
}
.donor-notes-toggle {
  margin-top: 12px;
}
.donor-note-modal-error {
  color: var(--danger, #dc2626);
  font-size: 13px;
  margin-bottom: 12px;
  min-height: 1.2em;
}
.donor-note-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 16px;
}
.donor-note-modal-cancel,
.donor-note-modal-submit {
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.donor-note-modal-cancel {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
}
.donor-note-modal-submit {
  border: none;
  background: var(--primary);
  color: #ffffff;
}
.donor-note-modal-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}
.section-heading-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.wishlist-add {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(82, 183, 136, 0.18);
  color: var(--primary);
  font-size: 22px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none;
  outline: 1pt solid rgba(148, 163, 184, 0.45);
}
.wishlist-grid {
  width: 100%;
  min-height: 120px;
  position: relative;
}
/* Bubble chart (circle packing) container */
.wishlist-bubble-pack {
  position: relative;
  width: 100%;
  overflow: hidden;
}
.wishlist-bubble-pack-inner {
  position: relative;
  left: 0;
  top: 0;
}
.wishlist-bubble {
  position: absolute;
  left: 0;
  top: 0;
  box-sizing: border-box;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6px;
  cursor: pointer;
  font-weight: 600;
  color: var(--primary);
  background: rgba(82, 183, 136, 0.18);
  border: 2px solid rgba(82, 183, 136, 0.35);
  box-shadow: 0 2px 8px rgba(82, 183, 136, 0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  word-break: break-word;
  line-height: 1.15;
  overflow: hidden;
}
.wishlist-bubble:hover {
  transform: scale(1.06);
  box-shadow: 0 4px 16px rgba(82, 183, 136, 0.3);
  background: rgba(82, 183, 136, 0.25);
}
.wishlist-chip-count {
  color: rgba(45, 55, 72, 0.7);
}
.wishlist-chip-delta {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.18);
  color: #166534;
  font-size: 12px;
  font-weight: 600;
}
.wishlist-empty {
  color: var(--muted);
  font-size: 14px;
  padding: 8px 0;
}
.wishlist-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all 0.2s ease;
}
.wishlist-item-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(82, 183, 136, 0.1);
}
.wishlist-item-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.wishlist-item-name {
  font-weight: 600;
  color: var(--text);
  font-size: 15px;
  word-break: break-word;
}
.wishlist-item-meta {
  font-size: 12px;
  color: var(--muted);
}
.wishlist-item-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.wishlist-item-edit,
.wishlist-item-delete {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.wishlist-item-edit:hover {
  background: rgba(82, 183, 136, 0.1);
  color: var(--accent);
}
.wishlist-item-delete:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}
.wishlist-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4000;
}
.wishlist-modal {
  background: var(--panel);
  border-radius: 24px;
  width: min(440px, 90vw);
  box-shadow: none;
  outline: 1pt solid rgba(148, 163, 184, 0.45);
  padding: 32px;
  position: relative;
  display: grid;
  gap: 18px;
}
.wishlist-modal h3 {
  margin: 0;
  font-size: 22px;
  color: var(--text);
  font-weight: 700;
}
.wishlist-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(82, 183, 136, 0.2);
  color: var(--primary);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wishlist-modal-close:hover {
  background: rgba(82, 183, 136, 0.3);
}
.wishlist-form {
  display: grid;
  gap: 18px;
}
.wishlist-form label {
  display: grid;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
}
.wishlist-form input {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 15px;
  color: var(--text);
  background: #f7f9fb;
}
.wishlist-form input:focus {
  outline: none;
  border-color: rgba(82, 183, 136, 0.6);
  box-shadow: 0 0 0 3px rgba(82, 183, 136, 0.18);
}
.wishlist-form textarea,
.message-form textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 15px;
  color: var(--text);
  background: #f7f9fb;
  resize: vertical;
  min-height: 100px;
  font-family: inherit;
}
.wishlist-form textarea:focus,
.message-form textarea:focus {
  outline: none;
  border-color: rgba(82, 183, 136, 0.6);
  box-shadow: 0 0 0 3px rgba(82, 183, 136, 0.18);
}
.wishlist-modal-hint {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
.wishlist-modal-error {
  font-size: 13px;
  color: var(--danger);
  min-height: 18px;
}
.wishlist-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}
.wishlist-modal-actions button {
  min-width: 120px;
  border-radius: 14px;
  border: none;
  font-weight: 600;
  font-size: 15px;
  padding: 12px 20px;
  cursor: pointer;
}
.wishlist-modal-cancel {
  background: #e2e8f0;
  color: var(--text);
  transition: background 0.2s ease, transform 0.2s ease;
}
.wishlist-modal-cancel:hover {
  background: #d7deeb;
  transform: translateY(-1px);
}
.wishlist-modal-submit {
  background: var(--primary);
  color: white;
  box-shadow: none;
  outline: 1pt solid rgba(148, 163, 184, 0.45);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.wishlist-modal-submit:hover {
  transform: translateY(-1px);
  box-shadow: none;
}
.wishlist-modal-submit:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
  box-shadow: none;
}
.section-link {
  align-self: flex-start;
  border: none;
  background: none;
  color: var(--primary);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.section-link:visited {
  color: var(--primary);
}
.section-link:hover {
  text-decoration: underline;
}
.support-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.support-card {
  background: #f1f5f9;
  border-radius: 20px;
  border: 1px solid rgba(71, 85, 105, 0.18);
  padding: 18px;
  font-size: 15px;
  font-weight: 600;
  color: #1f2937;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.support-card span {
  display: block;
  margin-top: 6px;
  font-weight: 500;
  color: var(--muted);
}
.support-card:hover {
  transform: translateY(-2px);
  box-shadow: none;
}
.safety-link {
  border: none;
  background: none;
  color: var(--primary);
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.message-section {
  gap: 20px;
}
.message-cta {
  width: 100%;
  border: none;
  border-radius: 16px;
  padding: 14px 18px;
  background: rgba(82, 183, 136, 0.18);
  color: var(--primary);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
}
.message-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.message-card {
  display: flex;
  gap: 12px;
  padding: 16px;
  border-radius: 20px;
  background: var(--panel);
  border: none;
  box-shadow: none;
  outline: 1pt solid rgba(148, 163, 184, 0.35);
}
.message-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
  color: var(--text);
}
.message-body p {
  margin: 0;
  line-height: 1.6;
}
.message-media {
  display: flex;
  gap: 8px;
}
.message-body time {
  font-size: 12px;
  color: var(--muted);
}
.support-grid,
.wishlist-grid,
.message-list {
  width: 100%;
}
.details h2 { 
  margin: 0 0 8px; 
  font-size: 24px; 
  font-weight: 700;
  color: var(--text);
}
.details .sub { 
  color: var(--muted); 
  font-size: 14px; 
  margin-bottom: 16px; 
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Sidebar list */
.list { display: grid; gap: 10px; }
.list-item {
  width: 100%;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  outline: none;
}
.list-item:focus { box-shadow: none; outline: 1pt solid rgba(82, 183, 136, 0.8); }
.list-item:hover { border-color: var(--accent); }
.list-card { display: grid; grid-template-columns: 76px 1fr 20px; gap: 14px; align-items: center; box-shadow: none; outline: 1pt solid rgba(148, 163, 184, 0.35); }
.thumb img { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; display: block; }
.list-main { display: grid; gap: 6px; }
.list-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.list-title { font-weight: 700; color: var(--text); margin: 0; font-size: 20px; }
.list-distance { color: var(--muted); font-size: 12px; }
.list-address { color: var(--text); font-size: 14px; }
.list-meta { display: flex; gap: 8px; align-items: center; font-size: 12px; }
.stock.low { color: #ef4444; }
.stock.medium { color: #f59e0b; }
.stock.high { color: var(--accent); }
.stock.unknown { color: var(--muted); }
.dot { color: var(--muted); }
.restock { color: var(--muted); }
.chevron { color: var(--accent); font-size: 22px; font-weight: 700; display:flex; align-items:center; justify-content:center; }
.list-item:hover .chevron { transform: translateX(2px); }

/* List header controls - compact like design */
.list-controls {
  display: grid;
  grid-template-columns: repeat(3, max-content);
  align-items: center;
  gap: 24px;
  margin-bottom: 14px;
  position: sticky;
  top: 0;
  background: var(--panel);
  padding: 10px 4px;
  z-index: 5;
  border-bottom: 1px solid var(--border);
}
.list-controls label { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); font-weight: 600; }
.list-controls label span { white-space: nowrap; }
.list-controls select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: transparent;
  border: none;
  padding: 0 14px 0 2px;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: right 6px top 55%, right 0px top 55%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}
@media (max-width: 680px) {
  .list-controls { grid-template-columns: 1fr; gap: 8px; }
}
.empty { color: var(--muted); font-size: 14px; }

.list-controls {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.list-controls label { display: grid; gap: 6px; font-size: 12px; color: var(--muted); }
.list-controls select {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
}
@media (max-width: 680px) {
  .list-controls { grid-template-columns: 1fr; }
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  margin-right: 6px;
}
.badge.open { 
  background: rgba(82, 183, 136, 0.15); 
  color: var(--accent); 
}
.badge.closed { 
  background: rgba(239, 68, 68, 0.12); 
  color: var(--danger); 
}
.badge.low-inventory { 
  background: rgba(245, 158, 11, 0.12); 
  color: var(--warn); 
}
.badge.fridge {
  background: rgba(82, 183, 136, 0.15);
  color: var(--accent);
}

.kv { 
  display: grid; 
  grid-template-columns: 120px 1fr; 
  gap: 12px 16px; 
  font-size: 14px; 
  line-height: 1.6;
}

.kv-justify {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.kv .k { 
  color: var(--muted); 
  font-weight: 500;
}
.kv .v { 
  color: var(--text); 
  word-break: break-word;
  overflow-wrap: anywhere;
}

.nowrap {
  white-space: nowrap;
}

.section { 
  margin-top: 24px; 
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.section:first-of-type {
  border-top: none;
  padding-top: 0;
}
.section h3 { 
  margin: 0 0 16px; 
  font-size: 16px; 
  color: var(--text); 
  font-weight: 600; 
}
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.section-header h3 {
  margin: 0;
}
.inv-item { 
  display: flex; 
  justify-content: space-between; 
  padding: 12px 0; 
  border-bottom: 1px solid var(--border); 
  font-size: 14px;
}
.inv-item:last-child {
  border-bottom: none;
}

.chips { 
  display: flex; 
  flex-wrap: wrap; 
  gap: 8px; 
}
.chip { 
  padding: 6px 14px; 
  border-radius: 20px; 
  background: var(--bg); 
  border: 1px solid var(--border); 
  font-size: 13px; 
  color: var(--text); 
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.chip::before {
  content: '+';
  color: var(--accent);
  font-weight: 700;
}

.carousel { 
  position: relative; 
  width: 100%; 
  height: 200px; 
  background: var(--bg); 
  border: 1px solid var(--border); 
  border-radius: 16px; 
  overflow: hidden; 
  margin-bottom: 16px;
}
.carousel img { 
  width: 100%; 
  height: 100%; 
  object-fit: cover; 
  display: block; 
}
.carousel .slide { display: none; }
.carousel .slide.active { display: block; }
.carousel .nav { 
  position: absolute; 
  top: 50%; 
  transform: translateY(-50%); 
  background: rgba(255,255,255,0.9); 
  color: var(--text); 
  border: none; 
  padding: 8px 12px; 
  cursor: pointer; 
  border-radius: 8px;
  font-size: 18px;
  font-weight: 700;
  box-shadow: 0 2px 8px var(--shadow);
}
.carousel .nav:hover {
  background: white;
}
.carousel .prev { left: 12px; }
.carousel .next { right: 12px; }
.carousel .dots { 
  position: absolute; 
  bottom: 12px; 
  left: 0; 
  right: 0; 
  display: flex; 
  justify-content: center; 
  gap: 8px; 
}
.carousel .dot { 
  width: 8px; 
  height: 8px; 
  border-radius: 50%; 
  background: rgba(255,255,255,0.5); 
  cursor: pointer;
}
.carousel .dot.active { 
  background: #fff; 
  width: 24px;
  border-radius: 4px;
}

.kv-2col { 
  display: grid; 
  grid-template-columns: minmax(0,1fr) minmax(0,1fr); 
  gap: 16px; 
  font-size: 14px; 
}

.form { 
  display: grid; 
  gap: 16px; 
}
.form input, .form textarea { 
  width: 100%; 
  background: var(--panel); 
  color: var(--text); 
  border: 1px solid var(--border); 
  border-radius: 8px; 
  padding: 12px 16px; 
  font-size: 14px;
  transition: border-color 0.2s;
}
.form input:focus, .form textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.form button { 
  background: var(--accent); 
  color: white; 
  border: none; 
  border-radius: 8px; 
  padding: 12px 20px; 
  cursor: pointer; 
  font-weight: 600;
  font-size: 14px;
  transition: background 0.2s;
}
.form button:hover {
  background: var(--primary);
}
.form .row { 
  display: grid; 
  grid-template-columns: 1fr 1fr; 
  gap: 12px; 
}

/* Leaflet theme tweaks */
.leaflet-container {
  font-family: inherit;
}
.leaflet-control-container .leaflet-top.leaflet-right {
  margin-top: 80px;
  margin-right: 18px;
}
.leaflet-control-zoom {
  border: none;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: none;
  outline: 1pt solid rgba(148, 163, 184, 0.35);
}
.leaflet-control-zoom a { 
  background: transparent; 
  color: var(--primary); 
  border: none;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.leaflet-control-zoom-in {
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}
.leaflet-control-zoom a:hover {
  background: rgba(82, 183, 136, 0.12);
}
.leaflet-control-zoom a:focus {
  outline: none;
  box-shadow: none;
  outline: 1pt solid rgba(82, 183, 136, 0.8);
}
.leaflet-control-scale {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.3);
  padding: 4px 8px;
  border-radius: 6px;
  box-shadow: none;
}

/* Map legend (pin colors = pantry type) */
.map-legend {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.3);
  padding: 10px 14px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  font-size: 13px;
  color: var(--text, #1e293b);
}
.map-legend-title {
  font-weight: 600;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.3);
}
.map-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.map-legend-item:last-child { margin-bottom: 0; }
.map-legend-pin {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.leaflet-popup-content-wrapper, .leaflet-popup-tip {
  background: var(--panel); 
  color: var(--text); 
  border: 1px solid var(--border);
  box-shadow: none;
}
.leaflet-popup-content-wrapper {
  border-radius: 12px;
  padding: 4px;
}


/* Pantry photo header */
.pantry-photo {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 16px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}

/* Distance and location info */
.location-info {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 16px;
}

/* Support buttons */
.support-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 20px;
  align-items: stretch;
}
.support-btn {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.support-btn:hover {
  background: var(--bg);
  border-color: var(--accent);
}
.support-btn-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.support-btn-subtitle {
  font-size: 12px;
  color: var(--muted);
}

/* Message section */
.message-section {
  background: rgba(82, 183, 136, 0.08);
  border: 1px solid rgba(82, 183, 136, 0.2);
  border-radius: 12px;
  padding: 16px;
  margin-top: 20px;
}
.message-input {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  width: 100%;
  margin-top: 12px;
  font-size: 14px;
  color: var(--text);
}

/* Search bar styles */
.search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 16px;
  box-shadow: none;
  outline: 1pt solid rgba(148, 163, 184, 0.35);
}
.search-bar input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  color: var(--text);
  outline: none;
}

/* Pantry marker styles */
.pantry-marker {
  background: transparent !important;
  border: none !important;
}

/* Pin-style map marker (ring with pointy bottom) */
.pantry-pin {
  position: relative;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #ffffff;
  border: 6px solid var(--marker-color, #f97316);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  isolation: isolate;
  z-index: 2;
}

.pantry-pin::after {
  content: '';
  position: absolute;
  bottom: -11px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 16px;
  height: 16px;
  background: var(--marker-color, #f97316);
  border-radius: 0 0 6px 0;
  box-shadow: inherit;
  z-index: -1;
}

.pantry-pin-inner {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffffff;
  z-index: 3;
}

.pantry-pin-selected {
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.4);
}

@media (max-width: 680px) {
  .app-header { padding: 12px 16px; }
  .kv-2col { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 100px 1fr; }
  .details { 
    width: 100vw; 
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 2000;
    overflow-y: auto;
    overflow-x: hidden;
  }
  .details.expanded {
    width: 100vw;
  }
  .details.hidden {
    display: none;
  }
  .detail-hero-cover img.detail-hero-img {
    height: 220px;
  }
  .detail-hero-body {
    padding: 24px;
  }
  .support-grid {
    grid-template-columns: 1fr;
  }
  .support-card {
    padding: 16px;
  }
  .wishlist-grid {
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .detail-hero-body {
    padding: 20px 18px 24px;
  }
  .detail-title {
    font-size: 22px;
  }
  .detail-description {
    font-size: 14px;
  }
  .support-card {
    font-size: 14px;
  }
  .message-cta {
    font-size: 14px;
  }
}

/* Link button styles */
.btn-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.btn-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* Table styles for history view */
table {
  width: 100%;
  border-collapse: collapse;
}
table th,
table td {
  padding: 8px;
  text-align: left;
}
table thead th {
  border-bottom: 2px solid var(--border);
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
}
table tbody tr {
  border-bottom: 1px solid var(--border);
}
table tbody tr:hover {
  background: var(--bg);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* About page */
.about-page {
  background: #ffffff;
}
.about-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 32px 96px;
  display: flex;
  flex-direction: column;
  gap: 72px;
}
.about-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  gap: 48px;
  background: #64a866;
  border-radius: 32px;
  padding: 56px 60px;
  color: #ffffff;
  align-items: center;
  box-shadow: 0 18px 40px rgba(45, 106, 79, 0.28);
}
.about-hero-text h1 {
  margin: 0;
  font-size: 56px;
  line-height: 1.05;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.about-hero-desc {
  margin: 24px 0;
  font-size: 17px;
  line-height: 1.65;
  max-width: 540px;
}
.about-hero-features {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}
.hero-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.01em;
}
.feature-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.16);
  font-size: 18px;
}
.about-hero-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 32px;
  border-radius: 999px;
  background: #ffffff;
  color: #2d6a4f;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.about-hero-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}
.about-hero-image {
  display: inline-flex;
  justify-content: center;
}
.about-hero-image img {
  max-width: 100%;
  height: auto;
}
.about-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.about-section h2 {
  margin: 0;
  font-size: 32px;
  color: #2d6a4f;
}
.about-section p {
  margin: 0;
  color: #374151;
  line-height: 1.65;
  max-width: 840px;
}
.vision-quote {
  font-size: 22px;
  line-height: 1.7;
  font-weight: 600;
  color: #2d6a4f;
  background: rgba(82, 183, 136, 0.18);
  border-radius: 20px;
  padding: 28px;
  max-width: 920px;
}
.guides-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
}
.guide-card {
  position: relative;
  padding: 32px;
  border-radius: 32px;
  background: #e8f0ff;
  color: #1f2937;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 180px;
}
.guide-card h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #1f2937;
}
.guide-card p {
  margin: 0;
  color: #4b5563;
}
.guide-card .guide-arrow {
  margin-top: auto;
  align-self: flex-end;
  font-size: 24px;
  font-weight: 600;
  color: #1f2937;
}
.guide-blue {
  background: #dbeafe;
}
.guide-green {
  background: #dcfce7;
}
.guide-mint {
  background: #e0f2fe;
}
.guide-gold {
  background: #fef3c7;
}
.faq-simple {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
  max-width: 720px;
}
.faq-simple li {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 16px;
  color: #1f2937;
  padding: 10px 0;
  border-bottom: 1px solid rgba(55, 65, 81, 0.12);
}
.faq-simple .faq-symbol {
  font-size: 18px;
  font-weight: 600;
  color: #2d6a4f;
}
.host-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}
.host-card {
  background: #f8fafc;
  border-radius: 24px;
  padding: 18px 18px 24px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(99, 120, 99, 0.12);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.host-card img {
  width: 100%;
  border-radius: 18px;
  object-fit: cover;
  height: 180px;
}
.host-card h3 {
  margin: 0;
  font-size: 18px;
  color: #1f2937;
}
.host-card p {
  margin: 0;
  color: #4b5563;
  line-height: 1.55;
}
.host-card .host-arrow {
  align-self: flex-end;
  font-size: 22px;
  color: #2d6a4f;
}
.about-footer {
  margin-top: 24px;
  background: #8ab58b;
  border-radius: 36px 36px 0 0;
  color: #ffffff;
  padding: 56px 48px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px;
}
.about-footer h3 {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 600;
}
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.footer-brand .logo-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 28px;
  font-weight: 700;
}
.footer-meta {
  margin: 0;
  color: rgba(255, 255, 255, 0.85);
}
.footer-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}
.footer-list a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: 15px;
}
.footer-list a:hover {
  text-decoration: underline;
}
.social-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0;
}
.social-list li {
  background: rgba(255, 255, 255, 0.16);
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 14px;
}

@media (max-width: 1100px) {
  .about-hero {
    grid-template-columns: minmax(0, 1fr);
    text-align: center;
  }
  .about-hero-text h1 {
    font-size: 48px;
  }
  .about-hero-features {
    justify-content: center;
  }
  .about-hero-button {
    align-self: center;
  }
}

@media (max-width: 900px) {
  .guides-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .host-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .about-footer {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .about-main {
    padding: 40px 20px 72px;
    gap: 56px;
  }
  .about-hero {
    padding: 40px 28px;
  }
  .about-hero-text h1 {
    font-size: 42px;
  }
}

