/* Bin ID — mobile-first, iPhone primary. px font sizes only. */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 16px; line-height: 1.45; color: #1a1a1a; background: #f4f4f2; }
h1 { font-size: 23px; margin: 0 0 8px; }
h2 { font-size: 19px; margin: 0 0 8px; }
h3 { font-size: 16px; margin: 0 0 6px; }
p { margin: 0 0 12px; }
small, .muted { font-size: 14px; color: #666; }
a { color: #0b6e4f; }
.wrap { max-width: 820px; margin: 0 auto; padding: 16px; }
header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; background: #111; color: #fff; position: sticky; top: 0; z-index: 10; }
header .brand { font-weight: 800; font-size: 19px; letter-spacing: .02em; }
header .brand span { color: #ffc800; }
header button { background: transparent; color: #fff; border: 1px solid #555; }
input[type=text], input[type=password], input[type=search], textarea { width: 100%; font-size: 16px; padding: 10px 12px; border: 1px solid #ccc; border-radius: 10px; background: #fff; }
textarea { min-height: 72px; resize: vertical; }
label { display: block; font-size: 14px; font-weight: 600; margin: 12px 0 4px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 16px; line-height: 20px; padding: 10px 16px; border-radius: 10px; border: 1px solid #111; background: #111; color: #fff; cursor: pointer; text-decoration: none; }
.btn.secondary { background: #fff; color: #111; }
.btn.danger { background: #b3261e; border-color: #b3261e; }
.btn.small { font-size: 14px; padding: 6px 10px; }
.btn:disabled { opacity: .5; cursor: default; }
.card { background: #fff; border: 1px solid #e2e2de; border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.bin-row { display: flex; gap: 12px; align-items: center; cursor: pointer; }
.bin-row img.thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; background: #eee; flex-shrink: 0; }
.bin-row .thumb-empty { width: 72px; height: 72px; border-radius: 10px; background: #eee; display: flex; align-items: center; justify-content: center; font-size: 23px; font-weight: 800; color: #999; flex-shrink: 0; }
.bin-code { font-size: 19px; font-weight: 800; letter-spacing: .08em; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; background: #eee; cursor: pointer; }
.photo-item { position: relative; }
.photo-item button { position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,.7); color: #fff; border: none; border-radius: 999px; width: 32px; height: 32px; font-size: 16px; cursor: pointer; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 12px; }
.lightbox img { max-width: 100%; max-height: 88vh; border-radius: 8px; }
.lightbox button { position: absolute; top: 14px; right: 14px; background: #fff; border: none; border-radius: 999px; width: 38px; height: 38px; font-size: 18px; cursor: pointer; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.search-row { display: flex; gap: 8px; margin: 12px 0; }
.search-row input { flex: 1; }
.qr-box { text-align: center; padding: 12px; }
.qr-box canvas, .qr-box img { max-width: 260px; width: 100%; height: auto; }
.big-code { font-size: 32px; font-weight: 800; letter-spacing: .12em; text-align: center; margin: 8px 0; }
.empty { text-align: center; color: #666; padding: 32px 12px; }
.error { background: #fdeceb; border: 1px solid #f5c6c2; color: #7a1f1a; border-radius: 10px; padding: 10px 12px; margin: 12px 0; }
.hidden { display: none !important; }
@page { size: 4in 6in; margin: 0; }
@media print {
  body { background: #fff; }
  header, .toolbar, .btn, .search-row { display: none !important; }
  .card { border: none; }
  img { max-width: 100%; }
}
@media (max-width: 640px) {
  body { font-size: 14px; }
  h1 { font-size: 18px; }
  h2 { font-size: 16px; }
  input[type=text], input[type=password], input[type=search], textarea { font-size: 16px; }
  .btn { min-height: 38px; }
  .wrap { padding: 12px; }
  .grid { grid-template-columns: repeat(2, 1fr); }
}
