:root {
  --primary: #0b3d63;
  --accent: #e8590c;
  --bg: #f4f7f9;
  --card-bg: #ffffff;
  --border: #d9e2e8;
  --text: #1c2b33;
  --text-muted: #6b7c85;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.app-header {
  background: var(--primary);
  color: white;
  padding: 12px 16px;
  /* iPhoneのノッチ・ステータスバーにボタンが隠れて押せなくなるのを防ぐ */
  padding-top: calc(12px + env(safe-area-inset-top));
  position: sticky;
  top: 0;
  z-index: 10;
}

.tab-btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(255, 255, 255, 0.3);
}

.app-header h1 {
  margin: 0 0 8px 0;
  font-size: 1.2rem;
}

.tabs {
  display: flex;
  gap: 8px;
}

.tab-btn {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: 8px;
  background: rgba(255,255,255,0.15);
  color: white;
  font-size: 0.95rem;
}

.tab-btn.active {
  background: white;
  color: var(--primary);
  font-weight: bold;
}

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

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

.card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.card h2 {
  margin-top: 0;
  font-size: 1.05rem;
}

.row {
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
  align-items: center;
}

label {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  color: var(--text-muted);
  flex: 1;
  min-width: 140px;
}

input, textarea {
  margin-top: 4px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
}

button {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  font-size: 0.95rem;
  cursor: pointer;
}

button.primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.file-btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-size: 0.95rem;
}

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

.photo-preview {
  max-width: 120px;
  max-height: 120px;
  border-radius: 8px;
  object-fit: cover;
}

.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.backup-actions {
  display: flex;
  gap: 8px;
}

.filters { margin-bottom: 10px; }

.catch-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.catch-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.catch-item img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  background: var(--bg);
}

.catch-item .info { flex: 1; min-width: 0; }
.catch-item .info .title { font-weight: bold; }
.catch-item .info .meta { color: var(--text-muted); font-size: 0.85rem; }
.catch-item .actions { display: flex; flex-direction: column; gap: 4px; }
.catch-item .actions button { font-size: 0.8rem; padding: 4px 8px; }

.map-container {
  width: 100%;
  height: 60vh;
  border-radius: 8px;
  overflow: hidden;
}

.catch-pin {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid white;
  box-shadow: 0 0 2px rgba(0,0,0,0.4);
}

#weather-result .wx-block {
  margin-top: 10px;
}

#weather-result .wx-now {
  font-size: 1.4rem;
  font-weight: bold;
}

#weather-result table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 0.85rem;
}

#weather-result th, #weather-result td {
  border-bottom: 1px solid var(--border);
  padding: 6px 4px;
  text-align: center;
}
