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

:root {
  --forest-deep: #F57F17;
  --forest-mid: #F9A825;
  --forest-light: #FBC02D;
  --forest-bright: #FDD835;
  --forest-bg: #FFFDE7;
  --forest-card: #FFFFFF;
  --forest-text: #1B4332;
  --forest-text-secondary: #4A6B5A;
  --forest-text-muted: #7A9B8A;
  --forest-border: #D4E5DB;
  --forest-shadow: rgba(27, 67, 50, 0.08);
  --forest-shadow-hover: rgba(27, 67, 50, 0.15);
  --forest-overlay: rgba(27, 67, 50, 0.6);
  --font-display: 'Fraunces', serif;
  --font-body: 'DM Sans', sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

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

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--forest-bg);
  color: var(--forest-text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* === APP SHELL === */
.app-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding-bottom: 2rem;
}

.app-header {
  background: linear-gradient(135deg, var(--forest-deep) 0%, var(--forest-mid) 60%, var(--forest-light) 100%);
  padding: 2rem 1.5rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  position: relative;
  overflow: hidden;
}

.app-header::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -10%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(82, 183, 136, 0.2) 0%, transparent 70%);
  border-radius: 50%;
}

.app-header::after {
  content: '';
  position: absolute;
  bottom: -40%;
  left: 10%;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(64, 145, 108, 0.15) 0%, transparent 70%);
  border-radius: 50%;
}

.header-content {
  position: relative;
  z-index: 1;
}

.app-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: white;
  letter-spacing: -0.02em;
}

.app-subtitle {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.75);
  margin-top: 0.25rem;
  font-weight: 300;
}

.add-btn {
  position: relative;
  z-index: 1;
  background: var(--forest-bright);
  color: var(--forest-deep);
  border: none;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(82, 183, 136, 0.3);
}

.add-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(82, 183, 136, 0.4);
}

.add-btn:active {
  transform: translateY(0);
}

/* === TAB BAR === */
.tab-bar {
  display: flex;
  background: var(--forest-card);
  border-bottom: 1px solid var(--forest-border);
  padding: 0 1rem;
  position: sticky;
  top: 0;
  z-index: 50;
}

.tab-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border: none;
  background: none;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--forest-text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
}

.tab-item.active {
  color: var(--forest-mid);
  border-bottom-color: var(--forest-bright);
}

.tab-item:hover:not(.active) {
  color: var(--forest-text-secondary);
}

.tab-icon {
  font-size: 1.1rem;
}

/* === MAIN CONTENT === */
.main-content {
  padding: 1rem 1rem 2rem;
}

/* === STATS ROW === */
.stats-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.stat-chip {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  background: var(--forest-card);
  border: 1px solid var(--forest-border);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.5rem;
  box-shadow: 0 1px 3px var(--forest-shadow);
}

.stat-icon {
  font-size: 1.25rem;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--forest-mid);
}

.stat-label {
  font-size: 0.7rem;
  color: var(--forest-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}

/* === GALLERY CONTROLS === */
.gallery-controls {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  align-items: stretch;
}

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

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

.search-input {
  width: 100%;
  padding: 0.65rem 2rem 0.65rem 2.5rem;
  border: 1px solid var(--forest-border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.85rem;
  background: var(--forest-card);
  color: var(--forest-text);
  transition: border-color 0.2s ease;
  min-height: 44px;
}

.search-input:focus {
  outline: none;
  border-color: var(--forest-bright);
  box-shadow: 0 0 0 3px rgba(82, 183, 136, 0.15);
}

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

.search-clear {
  position: absolute;
  right: 0.65rem;
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--forest-text-muted);
  cursor: pointer;
  padding: 0.25rem;
}

.sort-select {
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--forest-border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.85rem;
  background: var(--forest-card);
  color: var(--forest-text);
  cursor: pointer;
  min-height: 44px;
}

.sort-select:focus {
  outline: none;
  border-color: var(--forest-bright);
}

/* === GALLERY GRID === */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

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

.sighting-card {
  background: var(--forest-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--forest-border);
  box-shadow: 0 1px 4px var(--forest-shadow);
  cursor: pointer;
  transition: all 0.25s ease;
  animation: cardFadeIn 0.4s ease both;
}

.sighting-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px var(--forest-shadow-hover);
  border-color: var(--forest-bright);
}

.card-image-wrapper {
  position: relative;
  width: 100%;
  height: 180px;
  overflow: hidden;
  background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
}

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

.sighting-card:hover .card-image {
  transform: scale(1.05);
}

.card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(45, 106, 79, 0.08), rgba(82, 183, 136, 0.12));
}

.placeholder-emoji {
  font-size: 3rem;
  opacity: 0.5;
}

.card-badge {
  position: absolute;
  bottom: 0.5rem;
  left: 0.5rem;
  background: rgba(27, 67, 50, 0.85);
  color: white;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-style: italic;
  backdrop-filter: blur(4px);
}

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

.card-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--forest-deep);
  margin-bottom: 0.35rem;
}

.card-meta {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.75rem;
  color: var(--forest-text-muted);
  margin-bottom: 0.35rem;
}

.card-notes {
  font-size: 0.8rem;
  color: var(--forest-text-secondary);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* === EMPTY STATE === */
.empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: gentleBounce 3s ease-in-out infinite;
}

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

.empty-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--forest-mid);
  margin-bottom: 0.5rem;
}

.empty-text {
  font-size: 0.9rem;
  color: var(--forest-text-muted);
  max-width: 300px;
  margin: 0 auto;
  line-height: 1.5;
}

/* === SKELETON LOADING === */
.gallery-loading {
  padding: 1rem;
}

.skeleton-stats {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.skeleton-stat {
  flex: 1;
  height: 80px;
  background: linear-gradient(90deg, var(--forest-border) 25%, #e8ede9 50%, var(--forest-border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

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

.skeleton-card {
  height: 260px;
  background: linear-gradient(90deg, var(--forest-border) 25%, #e8ede9 50%, var(--forest-border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-lg);
}

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

/* === MAP VIEW === */
.map-view {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.map-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.map-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--forest-deep);
}

.map-count {
  font-size: 0.8rem;
  color: var(--forest-text-muted);
  background: var(--forest-card);
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  border: 1px solid var(--forest-border);
}

.map-container {
  width: 100%;
  height: 500px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--forest-border);
  box-shadow: 0 2px 8px var(--forest-shadow);
}

.map-empty {
  text-align: center;
  padding: 2rem;
  color: var(--forest-text-muted);
  font-size: 0.9rem;
}

/* === MODAL === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--forest-overlay);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

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

.modal-content {
  background: var(--forest-card);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0.8; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem 0.75rem;
  border-bottom: 1px solid var(--forest-border);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--forest-deep);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--forest-text-muted);
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}

.modal-body {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-footer {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.5rem 1.5rem;
  border-top: 1px solid var(--forest-border);
  justify-content: flex-end;
}

/* === PHOTO UPLOAD === */
.photo-upload-section {
  margin-bottom: 0.25rem;
}

.photo-upload-label {
  display: block;
  cursor: pointer;
}

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

.photo-placeholder-upload {
  width: 100%;
  height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 2px dashed var(--forest-border);
  border-radius: var(--radius-md);
  background: rgba(82, 183, 136, 0.04);
  transition: all 0.2s ease;
}

.photo-placeholder-upload:hover {
  border-color: var(--forest-bright);
  background: rgba(82, 183, 136, 0.08);
}

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

.upload-text {
  font-size: 0.85rem;
  color: var(--forest-text-muted);
}

.file-input-hidden {
  display: none;
}

/* === FORM === */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--forest-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.form-input {
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--forest-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--forest-text);
  transition: border-color 0.2s ease;
  min-height: 44px;
  background: var(--forest-card);
}

.form-input:focus {
  outline: none;
  border-color: var(--forest-bright);
  box-shadow: 0 0 0 3px rgba(82, 183, 136, 0.12);
}

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

.form-textarea {
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--forest-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--forest-text);
  resize: vertical;
  transition: border-color 0.2s ease;
  background: var(--forest-card);
}

.form-textarea:focus {
  outline: none;
  border-color: var(--forest-bright);
  box-shadow: 0 0 0 3px rgba(82, 183, 136, 0.12);
}

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

.form-row {
  display: flex;
  gap: 0.75rem;
}

.form-group-half {
  flex: 1;
}

.input-with-action {
  display: flex;
  gap: 0.5rem;
}

.input-with-action .form-input {
  flex: 1;
}

.identify-btn {
  width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--forest-border);
  border-radius: var(--radius-sm);
  background: rgba(82, 183, 136, 0.08);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.identify-btn:hover:not(:disabled) {
  background: rgba(82, 183, 136, 0.2);
  border-color: var(--forest-bright);
}

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

.location-btn {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--forest-border);
  border-radius: var(--radius-sm);
  background: var(--forest-card);
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--forest-text-secondary);
  cursor: pointer;
  text-align: left;
  min-height: 44px;
  transition: all 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.location-btn:hover:not(:disabled) {
  border-color: var(--forest-bright);
}

.location-btn.located {
  color: var(--forest-mid);
  background: rgba(82, 183, 136, 0.06);
  border-color: var(--forest-bright);
}

.location-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

/* === BUTTONS === */
.btn-primary {
  padding: 0.7rem 1.5rem;
  background: var(--forest-mid);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 44px;
}

.btn-primary:hover:not(:disabled) {
  background: var(--forest-deep);
  transform: translateY(-1px);
}

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

.btn-secondary {
  padding: 0.7rem 1.5rem;
  background: none;
  color: var(--forest-text-secondary);
  border: 1px solid var(--forest-border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 44px;
}

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

/* === DETAIL MODAL === */
.detail-modal {
  background: var(--forest-card);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  overflow-y: auto;
  position: relative;
  animation: slideUp 0.3s ease;
}

.detail-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 10;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(27, 67, 50, 0.7);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1.25rem;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background 0.2s ease;
}

.detail-close:hover {
  background: rgba(27, 67, 50, 0.9);
}

.detail-hero {
  width: 100%;
  height: 280px;
  overflow: hidden;
}

.detail-hero-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(45, 106, 79, 0.1), rgba(82, 183, 136, 0.15));
}

.detail-hero-emoji {
  font-size: 5rem;
  opacity: 0.4;
}

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

.detail-body {
  padding: 1.5rem;
}

.detail-name {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--forest-deep);
  margin-bottom: 0.15rem;
}

.detail-species {
  font-size: 0.95rem;
  color: var(--forest-light);
  font-style: italic;
  margin-bottom: 1rem;
}

.detail-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.detail-meta-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--forest-text-secondary);
}

.detail-meta-icon {
  font-size: 0.9rem;
}

.detail-section {
  margin-bottom: 1.25rem;
}

.detail-section-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--forest-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.detail-notes {
  font-size: 0.9rem;
  color: var(--forest-text-secondary);
  line-height: 1.6;
  white-space: pre-wrap;
}

.learn-more-btn {
  width: 100%;
  padding: 0.85rem;
  background: rgba(82, 183, 136, 0.08);
  border: 1px dashed var(--forest-bright);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--forest-mid);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 1rem;
}

.learn-more-btn:hover:not(:disabled) {
  background: rgba(82, 183, 136, 0.15);
}

.learn-more-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* === PLANT INFO CARD === */
.plant-info-card {
  background: rgba(82, 183, 136, 0.06);
  border: 1px solid var(--forest-border);
  border-left: 4px solid var(--forest-bright);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  animation: cardFadeIn 0.35s ease both;
}

.info-description {
  font-size: 0.9rem;
  color: var(--forest-text-secondary);
  line-height: 1.55;
  margin-bottom: 1rem;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.info-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--forest-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.info-value {
  font-size: 0.88rem;
  color: var(--forest-text);
}

.fun-facts {
  margin-top: 0.5rem;
}

.facts-list {
  list-style: none;
  padding: 0;
  margin-top: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.facts-list li {
  font-size: 0.85rem;
  color: var(--forest-text-secondary);
  padding-left: 1.2rem;
  position: relative;
  line-height: 1.45;
}

.facts-list li::before {
  content: '🌿';
  position: absolute;
  left: 0;
  font-size: 0.7rem;
}

/* === DELETE BTN === */
.detail-actions {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--forest-border);
}

.delete-btn {
  width: 100%;
  padding: 0.7rem;
  background: none;
  border: 1px solid var(--forest-border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--forest-text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 44px;
}

.delete-btn:hover {
  border-color: #e53e3e;
  color: #e53e3e;
}

.delete-btn.confirm {
  background: #e53e3e;
  color: white;
  border-color: #e53e3e;
}

/* === RESPONSIVE === */
@media (max-width: 640px) {
  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem 1rem 1.25rem;
  }

  .add-btn {
    width: 100%;
    text-align: center;
  }

  .app-title {
    font-size: 1.4rem;
  }

  .gallery-controls {
    flex-direction: column;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

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

  .map-container {
    height: 380px;
  }

  .detail-hero {
    height: 220px;
  }

  .stats-row {
    gap: 0.5rem;
  }

  .stat-chip {
    padding: 0.5rem 0.35rem;
  }

  .stat-value {
    font-size: 1.25rem;
  }

  .modal-content,
  .detail-modal {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
}

@media (min-width: 641px) {
  .modal-overlay {
    align-items: center;
  }

  .modal-content,
  .detail-modal {
    border-radius: var(--radius-xl);
    max-height: 85vh;
  }

  .main-content {
    padding: 1.5rem;
  }
}

@media (min-width: 900px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
```

<!-- WALKTHROUGH_SCRIPT:
[
  {"step": 1, "narration": "Welcome to your Nature Journal! This is where all your plant sightings will appear as beautiful photo cards.", "view": "user", "highlight_selector": ".gallery", "wait_for": "tap_to_continue"},
  {"step": 2, "narration": "Tap '+ Log Sighting' to record a new plant discovery. You can add a photo, name, species, date, location, and notes.", "view": "user", "highlight_selector": ".add-btn", "wait_for": "tap_to_continue"},
  {"step": 3, "narration": "Use the camera button to photograph plants directly, or choose a photo from your gallery.", "view": "user", "highlight_selector": ".photo-upload-section", "wait_for": "tap_to_continue"},
  {"step": 4, "narration": "Press the DNA icon next to the species field to let AI help identify the plant and share a fun fact.", "view": "user", "highlight_selector": ".identify-btn", "wait_for": "tap_to_continue"},
  {"step": 5, "narration": "Tap 'Get Location' to pin your sighting on the map with GPS coordinates.", "view": "user", "highlight_selector": ".location-btn", "wait_for": "tap_to_continue"},
  {"step": 6, "narration": "Switch to the Map tab to see all your sightings plotted on an interactive map.", "view": "user", "highlight_selector": ".tab-bar", "wait_for": "tap_to_continue"},
  {"step": 7, "narration": "Tap any sighting card to see full details and use 'Learn More' for AI-powered plant information.", "view": "user", "highlight_selector": ".sighting-card", "wait_for": "tap_to_continue"}
]
-->

/* === AUTH / JOURNAL GATING === */
.detail-auth-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--forest-border);
  background: rgba(82, 183, 136, 0.05);
}

.detail-auth-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.detail-auth-avatar {
  font-size: 1rem;
}

.detail-auth-name,
.detail-auth-status {
  font-size: 0.9rem;
  color: var(--forest-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.auth-btn {
  border: 1px solid var(--forest-border);
  border-radius: var(--radius-md);
  padding: 0.55rem 0.9rem;
  min-height: 40px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.auth-login-btn {
  background: #fff;
  color: var(--forest-mid);
}

.auth-login-btn:hover {
  border-color: var(--forest-bright);
  background: rgba(82, 183, 136, 0.08);
}

.auth-logout-btn {
  background: none;
  color: var(--forest-text-secondary);
}

.auth-logout-btn:hover {
  border-color: #e53e3e;
  color: #e53e3e;
}

.detail-access-note {
  margin-top: 0.25rem;
}

@media (max-width: 640px) {
  .detail-auth-bar {
    padding: 0.8rem 0.9rem;
    flex-direction: column;
    align-items: stretch;
  }

  .auth-btn {
    width: 100%;
  }
}

.photo-capture-actions {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.photo-capture-btn,
.photo-upload-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 44px;
  text-align: center;
}

.photo-upload-btn {
  padding: 0.7rem 1.5rem;
  background: var(--forest-mid);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.photo-upload-btn:hover {
  background: var(--forest-deep);
  transform: translateY(-1px);
}

.photo-upload-btn:active {
  transform: translateY(0);
}

.photo-capture-btn:disabled,
.photo-upload-btn:has(input:disabled) {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (max-width: 640px) {
  .photo-capture-actions {
    flex-direction: column;
  }
}

.location-auto-tagger {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.location-manual-grid {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.location-manual-note {
  font-size: 0.8rem;
  color: var(--forest-text-muted);
}

.location-error {
  font-size: 0.8rem;
  color: #e53e3e;
}

.map-location-help {
  font-size: 0.82rem;
  color: var(--forest-text-muted);
  background: rgba(82, 183, 136, 0.05);
  border: 1px solid var(--forest-border);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.9rem;
  line-height: 1.45;
}

.map-search-row {
  margin-top: 0.25rem;
}

.map-search-input {
  width: 100%;
}

.map-empty {
  border: 1px dashed var(--forest-border);
  border-radius: var(--radius-md);
  background: rgba(82, 183, 136, 0.04);
}

.ai-identify-section {
  padding-top: 0.25rem;
}

.ai-url-group {
  margin-top: 0.75rem;
}

.ai-upload-btn {
  width: 100%;
}

.ai-result-card {
  margin-top: 1rem;
}

.route-share-panel {
  padding: 0.9rem;
  border: 1px solid var(--forest-border);
  border-radius: var(--radius-lg);
  background: var(--forest-card);
  box-shadow: 0 1px 4px var(--forest-shadow);
}

.route-name-input {
  width: 100%;
}

.route-share-actions {
  display: flex;
  gap: 0.75rem;
}

.route-share-btn {
  flex: 1;
}

.route-share-link-box {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.route-share-link-label,
.route-share-message,
.route-share-summary-title {
  font-size: 0.8rem;
  color: var(--forest-text-muted);
}

.route-share-link {
  font-size: 0.82rem;
}

.route-share-summary {
  padding-top: 0.25rem;
}

.route-share-summary ol {
  margin-left: 1.1rem;
  color: var(--forest-text-secondary);
  font-size: 0.85rem;
  line-height: 1.45;
}

.route-share-summary li + li {
  margin-top: 0.3rem;
}

@media (max-width: 640px) {
  .route-share-actions {
    flex-direction: column;
  }
}

.journal-pdf-export {
  margin: 0 1.5rem 1rem;
}

.journal-pdf-actions {
  margin-bottom: 0.85rem;
}

.journal-pdf-btn {
  width: 100%;
}

.journal-pdf-report {
  background: #fff;
  color: #1b4332;
  border: 1px solid var(--forest-border);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.journal-pdf-header {
  margin-bottom: 1rem;
}

.journal-pdf-header h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.journal-pdf-header p {
  font-size: 0.9rem;
  color: var(--forest-text-secondary);
}

.journal-pdf-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.journal-pdf-entry {
  display: flex;
  gap: 0.85rem;
  border: 1px solid var(--forest-border);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  break-inside: avoid;
  page-break-inside: avoid;
}

.journal-pdf-entry-media {
  width: 92px;
  flex: 0 0 92px;
  height: 92px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(82, 183, 136, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}

.journal-pdf-entry-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.journal-pdf-placeholder {
  font-size: 2rem;
  opacity: 0.7;
}

.journal-pdf-entry-body h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin-bottom: 0.2rem;
}

.journal-pdf-subtitle {
  font-size: 0.82rem;
  color: var(--forest-text-muted);
  margin-bottom: 0.45rem;
}

.journal-pdf-notes,
.journal-pdf-meta {
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--forest-text-secondary);
  margin-top: 0.25rem;
}

.journal-pdf-empty {
  padding: 1rem;
  border: 1px dashed var(--forest-border);
  border-radius: var(--radius-md);
  color: var(--forest-text-muted);
  text-align: center;
}

@media (max-width: 640px) {
  .journal-pdf-export {
    margin: 0 0.9rem 0.9rem;
  }

  .journal-pdf-entry {
    flex-direction: column;
  }

  .journal-pdf-entry-media {
    width: 100%;
    flex-basis: auto;
    height: 180px;
  }
}
