:root {
  color-scheme: dark;
  font: 16px/1.45 system-ui, sans-serif;
  background: #111;
  color: #f5f5f5;
}

* { box-sizing: border-box; }

body {
  min-height: 100svh;
  margin: 0;
  padding: max(20px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
}

main { width: min(100%, 560px); margin: 0 auto; }
header, .sync-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 30px; }
header p { margin-bottom: 0; color: #999; }
h2 { margin: 30px 0 10px; font-size: 15px; color: #aaa; text-transform: uppercase; letter-spacing: .06em; }

button, .camera-button {
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.capture { margin-top: 36px; text-align: center; }
.camera-button {
  display: block;
  padding: 24px;
  background: #f3c43e;
  color: #111;
  font-size: 20px;
}
.camera-button input { display: none; }
#capture-status, #sync-status { margin: 12px 0 0; color: #aaa; }

.sync-card {
  margin-top: 24px;
  padding: 16px;
  border: 1px solid #333;
  border-radius: 14px;
  background: #181818;
}

progress { width: 100%; height: 9px; margin-top: 14px; accent-color: #f3c43e; }
button { padding: 11px 15px; background: #f3c43e; color: #111; }
button.quiet { padding: 7px 10px; background: #292929; color: #ddd; font-weight: 600; }

#activity { margin: 0; padding: 0; list-style: none; }
#activity li {
  padding: 9px 0;
  border-bottom: 1px solid #242424;
  color: #bbb;
  font: 13px/1.4 ui-monospace, monospace;
  overflow-wrap: anywhere;
}
#activity li.error { color: #ff8585; }
#activity li.success { color: #72dc95; }

dialog {
  width: min(calc(100% - 28px), 520px);
  max-height: calc(100svh - 28px);
  padding: 20px;
  border: 1px solid #3b3b3b;
  border-radius: 16px;
  background: #171717;
  color: inherit;
}
dialog::backdrop { background: rgb(0 0 0 / .72); }
dialog header { margin-bottom: 18px; }
dialog h2 { margin: 0; color: #fff; font-size: 20px; text-transform: none; letter-spacing: 0; }
dialog label:not(.flag) { display: block; margin: 13px 0; color: #bbb; }
dialog input:not([type="checkbox"]), dialog textarea {
  width: 100%;
  margin-top: 5px;
  padding: 11px;
  border: 1px solid #3b3b3b;
  border-radius: 9px;
  background: #222;
  color: #fff;
  font: inherit;
}
dialog textarea { resize: vertical; font: 12px/1.4 ui-monospace, monospace; }
.config-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.config-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 18px; }
dialog section[hidden] { display: none; }
#fields-panel > button[type="submit"] { width: 100%; margin-top: 8px; }
.flag { display: block; margin: 12px 0; }
.flag input { margin-right: 8px; }
.hint { color: #888; font-size: 13px; }
.setup-hint {
  margin-top: 14px;
  color: #999;
  font-size: 13px;
}
.setup-hint summary { cursor: pointer; }
.setup-hint p { margin: 10px 0 6px; }
.setup-hint pre {
  overflow-x: auto;
  margin: 0;
  padding: 10px;
  border-radius: 8px;
  background: #0e0e0e;
  color: #ccc;
  font: 11px/1.45 ui-monospace, monospace;
}
.danger {
  width: 100%;
  margin-top: 18px;
  background: #3a2020;
  color: #ff9a9a;
}

.photo-review h2 { margin-bottom: 14px; }
.photo-review img {
  display: block;
  width: 100%;
  max-height: 65svh;
  border-radius: 10px;
  object-fit: contain;
  background: #0b0b0b;
}
.review-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}
.review-actions button { padding: 14px; }
