:root {
  --green: #2d7a4f;
  --green-light: #e8f5ee;
  --pink: #e8748a;
  --pink-light: #fdf0f3;
  --text: #2c2c2c;
  --muted: #888;
  --border: #e4e4e4;
  --white: #fff;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f7f9f8;
  color: var(--text);
  min-height: 100vh;
}

/* ── Header ── */
header {
  background: var(--green);
  color: #fff;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
header h1 { font-size: 1.2rem; font-weight: 700; letter-spacing: 0.5px; }
header .subtitle { font-size: 0.8rem; opacity: 0.8; }
.flower-icon { font-size: 1.6rem; }
.header-logo { height: 28px; width: auto; object-fit: contain; border-radius: 4px; }

/* ── Nav tabs ── */
nav {
  background: var(--white);
  border-bottom: 2px solid var(--border);
  overflow-x: auto;
  display: flex;
  gap: 0;
  padding: 0 12px;
  scrollbar-width: none;
}
nav::-webkit-scrollbar { display: none; }
nav button {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 14px 18px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
nav button:hover { color: var(--green); }
nav button.active {
  color: var(--green);
  border-bottom-color: var(--green);
  font-weight: 700;
}

/* ── Main content ── */
main { max-width: 1200px; margin: 0 auto; padding: 24px 16px; }

.section { display: none; }
.section.active { display: block; }

.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Loading / error ── */
.loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.loading::before { content: "🌸"; display: block; font-size: 2rem; margin-bottom: 12px; }
.error { text-align: center; padding: 40px; color: #c0392b; }

/* ── Card grid ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 6px 24px rgba(0,0,0,0.12); }

.card-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: var(--green-light);
}
.card-img-placeholder {
  width: 100%;
  height: 160px;
  background: linear-gradient(135deg, var(--green-light), var(--pink-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

.card-body { padding: 14px 16px 16px; }
.card-title { font-size: 0.95rem; font-weight: 600; line-height: 1.4; margin-bottom: 6px; }
.card-meta { font-size: 0.78rem; color: var(--muted); margin-bottom: 4px; }
.card-desc { font-size: 0.82rem; color: #555; line-height: 1.5; margin-top: 8px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ── Tags / badges ── */
.badge {
  display: inline-block;
  background: var(--green-light);
  color: var(--green);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  margin-right: 4px;
}
.badge.pink { background: var(--pink-light); color: var(--pink); }

/* ── Locations map section ── */
.region-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.region-btn {
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}
.region-btn:hover, .region-btn.active {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

/* ── Species bloom calendar ── */
.bloom-bar {
  display: flex;
  gap: 2px;
  margin: 6px 0;
}
.bloom-month {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: var(--border);
}
.bloom-month.active { background: var(--pink); }

/* ── Current report ── */
.report-list { display: flex; flex-direction: column; gap: 12px; }
.report-item {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.report-scale {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--pink);
  min-width: 40px;
  text-align: center;
}
.report-info { flex: 1; }
.report-name { font-weight: 600; font-size: 0.9rem; margin-bottom: 2px; }
.report-sub { font-size: 0.78rem; color: var(--muted); }

/* ── Shop ── */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.shop-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.shop-name { font-weight: 700; font-size: 0.95rem; margin-bottom: 4px; }
.shop-meta { font-size: 0.78rem; color: var(--muted); margin-bottom: 8px; }
.shop-tags { display: flex; flex-wrap: wrap; gap: 4px; }

/* ── Fans / Community ── */
.fans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.fans-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  gap: 14px;
  padding: 14px;
  align-items: center;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s;
}
.fans-card:hover { transform: translateY(-2px); }
.fans-thumb {
  width: 60px; height: 60px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--green-light);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1.6rem;
}
.fans-info .fans-title { font-weight: 600; font-size: 0.88rem; }
.fans-info .fans-src { font-size: 0.75rem; color: var(--muted); margin-top: 4px; }

/* ── Messages ── */
.msg-list { display: flex; flex-direction: column; gap: 10px; }
.msg-item {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text);
}
.msg-date { font-size: 0.72rem; color: var(--muted); margin-top: 8px; }

/* ── Scale row ── */
.scale-row {
  display: flex; align-items: center; gap: 8px; margin: 8px 0;
}
.scale-num { font-size: 1.6rem; font-weight: 800; min-width: 36px; }
.scale-bar-wrap {
  flex: 1; height: 7px; background: #e4e4e4; border-radius: 4px; overflow: hidden;
}
.scale-bar-fill { height: 100%; border-radius: 4px; }
.scale-unit { font-size: 0.72rem; color: #aaa; }

/* ── Modal ── */
#modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
#modal {
  background: var(--white);
  border-radius: var(--radius);
  max-width: 700px; width: 100%;
  max-height: 85vh; overflow-y: auto;
  position: relative;
  padding: 24px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.2);
}
#modal-close {
  position: sticky; top: 0; float: right;
  background: var(--border); border: none;
  border-radius: 50%; width: 32px; height: 32px;
  cursor: pointer; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
}
.modal-section { margin-top: 20px; }
.modal-section-title {
  font-size: 1rem; font-weight: 700;
  color: var(--green); margin-bottom: 12px;
  border-bottom: 2px solid var(--green-light);
  padding-bottom: 6px;
}
.modal-location-name { font-size: 1.3rem; font-weight: 800; margin-bottom: 4px; }
.modal-meta { font-size: 0.82rem; color: var(--muted); margin-bottom: 6px; }
.modal-desc { font-size: 0.88rem; line-height: 1.6; color: #444; }
.modal-img { width: 100%; height: 200px; object-fit: cover; border-radius: 8px; margin-bottom: 16px; }
.linked-item {
  background: var(--green-light); border-radius: 8px;
  padding: 12px 14px; margin-bottom: 8px;
}
.linked-item.pink { background: var(--pink-light); }
.linked-item-title { font-weight: 600; font-size: 0.9rem; }
.linked-item-meta { font-size: 0.78rem; color: var(--muted); margin-top: 3px; }
.linked-item a { color: var(--green); font-size: 0.78rem; }
.linked-item.pink a { color: var(--pink); }
.no-linked { font-size: 0.82rem; color: var(--muted); }

/* ── Privacy ── */
.privacy-content {
  max-width: 720px;
  margin: 0 auto;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  line-height: 1.9;
  font-size: 0.95rem;
  color: var(--text);
}

.privacy-content p {
  margin-bottom: 16px;
}

.privacy-content p:first-child {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--green);
  margin-bottom: 20px;
}

/* ── QR Codes ── */
.qr-codes {
  display: flex;
  gap: 32px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.qr-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.qr-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green);
}

.qr-item img {
  width: 140px;
  height: 140px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  background: #fff;
}

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

/* ── Responsive ── */
@media (max-width: 600px) {
  .card-grid { grid-template-columns: 1fr; }
  nav button { padding: 12px 14px; font-size: 0.82rem; }
}
