:root {
  --color-bg: #fafafa;
  --color-text: #222;
  --color-accent: #c2185b;
  --color-border: #ddd;
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: white;
  border-bottom: 1px solid var(--color-border);
}

.site-header .brand {
  font-weight: bold;
  color: var(--color-accent);
  text-decoration: none;
  font-size: 1.1rem;
}

.site-header nav a {
  margin-left: 1rem;
  color: var(--color-text);
  text-decoration: none;
}

.admin-status {
  margin-left: 1rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: #e6f4ea;
  color: #1a6b2f;
  font-size: 0.85rem;
  white-space: nowrap;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 1rem;
}

.hero {
  text-align: center;
  padding: 1.5rem 0;
}

.cta {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.button,
button {
  display: inline-block;
  background: var(--color-accent);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 0.6rem 1.2rem;
  text-decoration: none;
  font-size: 1rem;
  cursor: pointer;
}

.area-filter {
  margin-bottom: 1rem;
}

.area-filter select {
  font-size: 1rem;
  padding: 0.3rem;
}

.map {
  width: 100%;
  height: 60vh;
  min-height: 300px;
  border: 1px solid var(--color-border);
}

.tree-dot-marker span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.tree-dot-marker {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-accent);
  border: 2px solid white;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.6);
}

.tree-list {
  list-style: none;
  padding: 0;
}

.tree-list li {
  border-bottom: 1px solid var(--color-border);
}

.tree-list a {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0.25rem;
  color: var(--color-text);
  text-decoration: none;
  flex-wrap: wrap;
}

.tree-detail {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.3rem 1rem;
}

.tree-detail dt {
  font-weight: bold;
}

.tree-photo {
  max-width: 100%;
  border-radius: 4px;
  margin-top: 1rem;
}

.admin-qr {
  margin-top: 1.5rem;
  padding: 1rem;
  border: 1px dashed var(--color-border);
  border-radius: 4px;
}

.tree-qr {
  display: block;
  margin-top: 0.5rem;
}

.tree-qr-url {
  font-size: 0.85rem;
  color: #666;
  word-break: break-all;
}

.qr-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 480px;
}

.qr-form textarea,
.qr-form input[type="file"] {
  font-size: 1rem;
  padding: 0.5rem;
  width: 100%;
}

.hint {
  font-size: 0.85rem;
  color: #666;
  margin: -0.25rem 0 0;
}

.camera-widget {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#camera-captured-preview {
  width: 100%;
  max-width: 240px;
  border-radius: 4px;
  background: #000;
}

/* Fullscreen so the shutter/close controls are always on-screen, with no
   page scrolling needed to reach them (the inline preview used to push
   the form's buttons out of view). */
.camera-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #000;
}

.camera-overlay video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-close-btn,
.camera-shutter-btn {
  position: absolute;
  border: none;
}

.camera-close-btn {
  top: 1rem;
  left: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  font-size: 1.25rem;
  line-height: 1;
}

.camera-shutter-btn {
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  border: 4px solid white;
  background: rgba(255, 255, 255, 0.9);
}

.tree-id-caption {
  margin-top: -0.5rem;
  font-size: 0.85rem;
  color: #777;
}

.sponsors {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.sponsors h2 {
  font-size: 1rem;
  color: #666;
}

.sponsor-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.sponsor-link {
  color: var(--color-accent);
  text-decoration: underline;
}

.flashes {
  list-style: none;
  padding: 0.5rem 1rem;
  margin: 0;
}

.flash {
  padding: 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.3rem;
}

.flash-error {
  background: #fdecea;
  color: #a4262c;
}

.flash-warning {
  background: #fff4ce;
  color: #7a5b00;
}

.notice {
  background: #fff4ce;
  color: #7a5b00;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  display: inline-block;
}

.site-footer {
  text-align: center;
  font-size: 0.8rem;
  color: #777;
  padding: 1rem;
}

@media (min-width: 600px) {
  main {
    padding: 2rem 1rem;
  }
}
