:root {
  --bg: #0f172a;
  --card: #1e293b;
  --line: #334155;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #22c55e;
  --danger: #ef4444;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 18px;
  line-height: 1.5;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
#app { max-width: 640px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.5rem; margin: 8px 0 16px; }
h2 { font-size: 1.25rem; margin: 20px 0 8px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  margin: 12px 0;
}
.card h3 { margin: 0 0 6px; font-size: 1.15rem; }
.card .meta { color: var(--muted); font-size: 0.9rem; }
.card.clickable { cursor: pointer; }
.hint { color: var(--muted); }
.error { color: var(--danger); font-weight: 600; }
.ok { color: var(--accent); font-weight: 600; }
.text { white-space: pre-wrap; word-wrap: break-word; }
label { display: block; margin: 14px 0 4px; font-weight: 600; }
input, select, textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
}
textarea { min-height: 140px; }
button {
  font: inherit;
  font-weight: 600;
  color: #04210f;
  background: var(--accent);
  border: 0;
  border-radius: 12px;
  padding: 14px 18px;
  min-height: 48px;
  cursor: pointer;
}
button.secondary { background: var(--line); color: var(--text); }
button.danger { background: var(--danger); color: #fff; }
button.full { width: 100%; margin-top: 16px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.row > button { flex: 1; }
.thumb { width: 100%; border-radius: 10px; margin-top: 10px; background: #fff; cursor: zoom-in; }
.caption { color: var(--muted); font-size: 0.95rem; margin: 4px 0 12px; }
.badge {
  display: inline-block;
  background: var(--line);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.8rem;
  margin-right: 6px;
}
.checks label { display: flex; gap: 10px; align-items: center; font-weight: 400; margin: 8px 0; }
.checks input { width: 24px; height: 24px; }
dialog#viewer {
  width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh;
  margin: 0; padding: 8px; border: 0;
  background: #000; color: #fff;
}
dialog#viewer::backdrop { background: #000; }
#viewer-img { display: block; width: 100%; height: calc(100% - 64px); object-fit: contain; touch-action: pinch-zoom; }
#viewer-close { width: 100%; margin-bottom: 8px; }

#logo-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  height: calc(52px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 12px 0 12px;
  background: #0f172a;
}
#logo-bar img {
  height: 40px;
  width: 40px;
}
body {
  padding-top: calc(52px + env(safe-area-inset-top));
}
