.album {
  position: relative;
  z-index: 1;
  width: min(100%, 760px);
  padding: 24px 20px;
  background: var(--surface);
  border: 2px solid #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

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

.album-header h2 { margin: 0; font-size: 1.25rem; }
.album-actions { display: flex; gap: 8px; }
.album-actions[hidden], .album-locked[hidden] { display: none; }

.album-locked { margin-top: 18px; text-align: center; color: var(--text-soft); }
.album-status { margin: 18px 0 0; text-align: center; color: var(--text-soft); }
.album-status:empty { display: none; }

.btn {
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn:focus-visible { outline: 3px dashed var(--pink); outline-offset: 3px; }
.btn-primary { background: linear-gradient(135deg, var(--heart), #ffa9c6); color: #fff; }
.btn-ghost { background: #fff; color: var(--text); border: 1.5px solid var(--pink-soft); }
.btn-danger { background: #fff; color: #d9534f; border: 1.5px solid #f3b6b4; }

.grid {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.grid:empty { display: none; }

.tile {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 18px;
  overflow: hidden;
  background: var(--cream);
  cursor: zoom-in;
}
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.tile:hover img { transform: scale(1.05); }
.tile:focus-visible { outline: 3px dashed var(--heart); outline-offset: 2px; }
.tile-date {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text);
  background: rgba(255, 255, 255, 0.85);
}

dialog {
  border: 0;
  padding: 0;
  color: var(--text);
  font-family: var(--font-body);
}
dialog::backdrop { background: rgba(93, 78, 78, 0.45); backdrop-filter: blur(3px); }

.sheet { width: min(100% - 32px, 420px); border-radius: var(--radius); background: var(--bg); }
.sheet-body { display: grid; gap: 14px; padding: 24px; }
.sheet-body h3 { margin: 0; font-size: 1.2rem; }
.sheet-body .hint { margin: -8px 0 0; }
.sheet-body label { display: grid; gap: 6px; font-weight: 600; font-size: 0.9rem; }
.sheet-body input, .sheet-body textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--pink-soft);
  border-radius: 14px;
  font: inherit;
  font-weight: 500;
  color: var(--text);
  background: #fff;
}
.sheet-body input:focus, .sheet-body textarea:focus { outline: none; border-color: var(--heart); }
.sheet-actions { display: flex; justify-content: flex-end; gap: 8px; }
.form-error { margin: 0; color: #d9534f; font-size: 0.9rem; }
.form-error[hidden] { display: none; }
.counter-hint { float: right; font-weight: 500; color: var(--text-soft); }
progress { width: 100%; accent-color: var(--heart); }
progress[hidden] { display: none; }

.picker {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 160px;
  border: 2px dashed var(--pink);
  border-radius: 18px;
  background: #fff;
  overflow: hidden;
  cursor: pointer;
}
.picker input[type='file'] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.picker-preview { width: 100%; max-height: 260px; object-fit: contain; }
.picker-preview[hidden], .picker-hint[hidden] { display: none; }
.picker-hint { color: var(--text-soft); }

.lightbox {
  width: min(100% - 24px, 900px);
  max-height: calc(100dvh - 24px);
  padding: 14px;
  border-radius: var(--radius);
  background: var(--bg);
}
.lightbox figure { margin: 0; }
.lightbox img {
  display: block;
  width: 100%;
  max-height: calc(100dvh - 190px);
  object-fit: contain;
  border-radius: 18px;
  background: #fff;
}
.lightbox figcaption { display: grid; gap: 4px; padding: 12px 4px; }
.lightbox .sheet-actions { justify-content: space-between; }
