* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  background: #f4f6f2;
  color: #1b2a1c;
  padding-bottom: env(safe-area-inset-bottom);
}

.topbar {
  background: #2e7d32;
  color: white;
  padding: 14px 16px calc(14px + env(safe-area-inset-top));
  position: sticky; top: 0; z-index: 10;
}
.topbar h1 { margin: 0; font-size: 18px; }

.tabs {
  display: flex;
  background: white;
  border-bottom: 1px solid #ddd;
  position: sticky;
  top: 48px;
  z-index: 9;
}
.tab-btn {
  flex: 1;
  padding: 10px 4px;
  border: none;
  background: none;
  font-size: 13px;
  color: #666;
  cursor: pointer;
}
.tab-btn.active {
  color: #2e7d32;
  font-weight: bold;
  border-bottom: 3px solid #2e7d32;
}

main { padding: 12px; max-width: 640px; margin: 0 auto; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

form label {
  display: block;
  margin-bottom: 14px;
  font-size: 14px;
  font-weight: 600;
  color: #33452f;
}
form input[type=text],
form input[type=datetime-local],
form input[type=search],
form textarea,
form select {
  width: 100%;
  margin-top: 6px;
  padding: 10px;
  font-size: 15px;
  border: 1px solid #cfd8cc;
  border-radius: 8px;
  background: white;
  font-weight: normal;
}
form textarea { resize: vertical; }

.photo-label { display: block; }
.photo-preview {
  width: 100%;
  min-height: 180px;
  border: 2px dashed #8fae86;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #5b7a54;
  background: #eef4ea;
  overflow: hidden;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
}
.photo-preview img {
  height: 110px; width: auto;
  border-radius: 8px;
  object-fit: cover;
}

.loc-row { display: flex; gap: 8px; }
.loc-row input { flex: 1; }
.loc-row button {
  padding: 10px 12px;
  border: none;
  background: #55803f;
  color: white;
  border-radius: 8px;
  font-size: 13px;
  white-space: nowrap;
}

.hint { font-weight: normal; color: #78876f; font-size: 12px; display: block; margin-top: 4px; }

.btn-primary {
  width: 100%;
  padding: 14px;
  background: #2e7d32;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: bold;
  margin-top: 6px;
}
.btn-secondary {
  width: 100%;
  padding: 12px;
  background: #e8f0e4;
  color: #2e7d32;
  border: 1px solid #b8d1ae;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 10px;
  font-weight: bold;
}
.btn-danger {
  width: 100%;
  padding: 12px;
  background: #fdecea;
  color: #b3261e;
  border: 1px solid #f2b8b5;
  border-radius: 10px;
  font-weight: bold;
}

.list-toolbar { display: flex; gap: 8px; margin-bottom: 6px; }
.list-toolbar select, .list-toolbar input { padding: 8px; border-radius: 8px; border: 1px solid #cfd8cc; }
.list-toolbar input { flex: 1; }
.list-toolbar #btn-sync { padding: 8px 12px; border: none; background: #e8f0e4; border-radius: 8px; font-size: 16px; }
#sync-status { margin-bottom: 8px; min-height: 14px; }
.badge.pending, .entry-card .badge.pending { background: #fff8e1; color: #a17400; }

.entry-list { display: flex; flex-direction: column; gap: 10px; }
.entry-card {
  display: flex;
  gap: 10px;
  background: white;
  border: 1px solid #e2e8de;
  border-radius: 12px;
  padding: 10px;
  cursor: pointer;
}
.entry-card img {
  width: 72px; height: 72px; object-fit: cover; border-radius: 8px; flex-shrink: 0;
  background: #eee;
}
.entry-card .no-photo {
  width: 72px; height: 72px; border-radius: 8px; flex-shrink: 0;
  background: #eee; display: flex; align-items: center; justify-content: center; font-size: 24px;
}
.entry-card .meta { flex: 1; min-width: 0; }
.entry-card .meta .date { font-size: 12px; color: #888; }
.entry-card .meta .place { font-size: 14px; font-weight: 600; margin: 2px 0; }
.entry-card .meta .note { font-size: 13px; color: #555; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  background: #eef4ea;
  color: #2e7d32;
  margin-top: 4px;
}
.badge.신고완료, .badge.완료 { background: #e3f2fd; color: #1565c0; }
.badge.확인중 { background: #fff3e0; color: #e65100; }

.map-box { width: 100%; height: 70vh; border-radius: 12px; overflow: hidden; }

.settings-card {
  background: white; border: 1px solid #e2e8de; border-radius: 12px;
  padding: 14px; margin-bottom: 12px;
}
.settings-card h2 { font-size: 15px; margin: 0 0 8px; }
.version { text-align: center; }

.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: flex-end; justify-content: center; z-index: 100;
}
.modal.hidden { display: none; }
.modal-content {
  background: white; width: 100%; max-width: 640px;
  max-height: 88vh; overflow-y: auto;
  border-radius: 16px 16px 0 0;
  padding: 18px;
  position: relative;
}
.modal-close {
  position: absolute; top: 10px; right: 14px;
  border: none; background: none; font-size: 20px; color: #666;
}
.modal-content img { width: 100%; border-radius: 10px; margin-bottom: 10px; }
.modal-content .field { margin-bottom: 10px; }
.modal-content .field label { font-size: 12px; color: #888; display: block; }
.modal-content .field .value { font-size: 15px; }
.modal-actions { display: flex; gap: 8px; margin-top: 14px; }
.modal-actions button { flex: 1; padding: 10px; border-radius: 8px; border: none; font-weight: bold; }
.modal-actions .save { background: #2e7d32; color: white; }
.modal-actions .delete { background: #fdecea; color: #b3261e; }
