:root {
  --bg: #faf9f7;
  --card: #ffffff;
  --ink: #1f1d1a;
  --muted: #6b6660;
  --accent: #b8763e;
  --accent-dark: #96602f;
  --border: #e7e2da;
  --error: #b3261e;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px 80px;
}

h1 {
  font-size: 1.4rem;
  margin: 8px 0 4px;
}

.muted { color: var(--muted); font-size: 0.95rem; }
.error { color: var(--error); font-size: 0.9rem; }

.screen[hidden] { display: none; }

#pin-form {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

input[type="password"] {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
}

button, .file-btn, .sheet-btn {
  padding: 12px 18px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: white;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

button:hover, .file-btn:hover, .sheet-btn:hover { background: var(--accent-dark); }

.dropzone {
  margin-top: 20px;
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 32px 16px;
  text-align: center;
  background: var(--card);
}

.dropzone.drag-over { border-color: var(--accent); background: #fdf3ea; }

.file-btn { margin-top: 8px; }

.gallery {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}

.photo-tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
}

.photo-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-tile .delete-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.sheet-btn {
  margin-top: 28px;
  width: 100%;
  text-align: center;
}
