/* photo gallery — pilot styling */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f6f7f9; color: #1c2733;
}
a { color: #2563eb; }
.hidden { display: none !important; }
.muted { color: #6b7684; }
.center { text-align: center; }
.warn { color: #b45309; }
.ok { color: #15803d; }

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 20px; background: #fff; border-bottom: 1px solid #e5e8ec;
  position: sticky; top: 0; z-index: 5;
}
.brand { font-weight: 700; font-size: 18px; }
.brand small { color: #6b7684; font-weight: 400; }

.wrap { max-width: 1080px; margin: 20px auto; padding: 0 16px; display: flex; flex-direction: column; gap: 14px; }

.card {
  background: #fff; border: 1px solid #e5e8ec; border-radius: 10px;
  padding: 16px 18px;
}
.card h2 { margin: 0 0 10px; font-size: 16px; }
.card.error { background: #fef2f2; color: #991b1b; border-color: #fecaca; }

.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.btns { display: flex; gap: 8px; }

.btn {
  display: inline-block; padding: 8px 16px; border-radius: 8px;
  border: 1px solid #d4d9df; background: #fff; color: #1c2733;
  font-size: 14px; cursor: pointer; text-decoration: none;
}
.btn:hover { background: #f1f4f7; }
.btn.primary { background: #2563eb; border-color: #2563eb; color: #fff; }
.btn.primary:hover { background: #1d4fd8; }
.btn.primary:disabled { opacity: .5; cursor: wait; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: #eef1f4; }
.hint { display: block; margin-top: 8px; font-size: 12.5px; color: #6b7684; }

.crumbs { margin-bottom: 8px; font-size: 14px; }
.folder-list {
  list-style: none; margin: 0 0 10px; padding: 0; max-height: 260px; overflow-y: auto;
}
.folder-list li { padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.folder-list li:hover { background: #f1f4f7; }

.photo-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.tile {
  position: relative; border-radius: 8px; overflow: hidden;
  background: #eef1f4; aspect-ratio: 1 / 1;
}
.tile img {
  width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in;
}
.tile .check {
  position: absolute; left: 6px; bottom: 6px;
  background: rgba(255,255,255,.92); border-radius: 6px;
  padding: 2px 8px; font-size: 12.5px; display: flex; gap: 5px; align-items: center;
}
.tile.pending { outline: 2px dashed #f59e0b; outline-offset: -3px; }

.group-head {
  grid-column: 1 / -1;
  font-size: 13px; font-weight: 600; color: #4b5563;
  margin-top: 10px; padding: 4px 2px;
  border-bottom: 1px solid #e5e8ec;
}

.syncbar { display: flex; justify-content: space-between; align-items: center; }
#sync-status { font-size: 13.5px; }

.viewer-grid { min-height: 200px; }

.lightbox {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(10, 14, 18, .94);
  display: flex; align-items: center; justify-content: center;
}
.lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 4px; }
.lb-close {
  position: absolute; top: 12px; right: 18px; font-size: 34px;
  background: none; border: none; color: #fff; cursor: pointer;
}
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  font-size: 46px; background: none; border: none; color: #fff; cursor: pointer;
  padding: 20px; user-select: none;
}
.lb-prev { left: 8px; } .lb-next { right: 8px; }
.lb-caption {
  position: absolute; bottom: 14px; left: 0; right: 0;
  text-align: center; color: #cbd3da; font-size: 13.5px;
}

.footer { padding: 24px 0 40px; font-size: 13px; }

.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: #1c2733; color: #fff; padding: 10px 18px; border-radius: 8px;
  font-size: 14px; z-index: 60; max-width: 90vw;
}

@media (max-width: 640px) {
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}
