:root {
  color-scheme: light dark;
  --bg: #f7f4ee;
  --card: #ffffff;
  --text: #262019;
  --muted: #7a7267;
  --accent: #8a5a2b;
  --danger: #b3402f;
  --border: #e7e0d3;
}

* { box-sizing: border-box; }

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

header {
  padding: 20px 16px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

header h1 {
  font-size: 19px;
  margin: 0;
}

header a.back {
  text-decoration: none;
  color: var(--accent);
  font-size: 16px;
}

main {
  padding: 0 16px;
  max-width: 520px;
  margin: 0 auto;
}

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

.section-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 10px;
}

label.field-label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin: 12px 0 4px;
}
label.field-label:first-child { margin-top: 0; }

input[type="text"], input[type="date"], textarea, select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 16px;
  background: var(--card);
  color: var(--text);
  font-family: inherit;
}

textarea { resize: vertical; min-height: 60px; }

button {
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: white;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

button:active { opacity: 0.8; }
button.secondary { background: var(--border); color: var(--text); }
button.danger { background: var(--danger); }
button.full { width: 100%; margin-top: 12px; }

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

.batch-card {
  display: flex;
  gap: 12px;
  background: var(--card);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 12px;
  text-decoration: none;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.batch-card .thumb {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--border);
  flex-shrink: 0;
}

.batch-card .thumb.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}

.batch-card .info { flex: 1; min-width: 0; }
.batch-card .name { font-size: 16px; font-weight: 700; margin: 0 0 4px; }
.batch-card .category { font-size: 12px; color: var(--muted); margin: 0 0 6px; }
.batch-card .days { font-size: 13px; margin: 0; }
.batch-card .ready { font-size: 13px; color: var(--accent); margin: 2px 0 0; }

.fab-link {
  display: block;
  text-align: center;
  text-decoration: none;
  background: var(--accent);
  color: white;
  border-radius: 12px;
  padding: 14px;
  font-weight: 700;
  font-size: 16px;
  margin: 8px 0 20px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.photo-item { position: relative; }
.photo-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}
.photo-item .label {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.photo-item button.danger {
  position: absolute;
  top: 4px;
  right: 4px;
  padding: 2px 7px;
  font-size: 11px;
  border-radius: 8px;
}

.muted { color: var(--muted); font-size: 14px; }

.status-msg { margin-top: 10px; font-size: 14px; }
.status-msg.ok { color: #2f7a4f; }
.status-msg.error { color: var(--danger); }

.install-guide {
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1712;
    --card: #262019;
    --text: #f2ede4;
    --muted: #a89e8f;
    --border: #3a332a;
  }
}
