* { box-sizing: border-box; }
body { font: 14px system-ui, -apple-system, sans-serif; margin: 0; color: #222; background: #fafafa; }
header { padding: 12px 20px; background: #fff; border-bottom: 1px solid #e5e5e5; display: flex; align-items: center; gap: 24px; }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.btn-ghost { background: none; border: 1px solid #ccc; color: #555; padding: 5px 10px; border-radius: 6px; cursor: pointer; font: inherit; }
.btn-ghost:hover { background: #f2f2f2; }
body.centered { min-height: 100vh; display: grid; place-items: center; }
.login-card { background: #fff; padding: 32px 28px; border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,0.08); width: 320px; display: flex; flex-direction: column; gap: 12px; }
.login-card h1 { margin: 0; }
.login-card input { padding: 8px 10px; border: 1px solid #ccc; border-radius: 6px; font: inherit; }
.err { color: #a00; font-size: 13px; margin: 0; }
h1 { font-size: 18px; margin: 0; }
nav button { background: none; border: 0; padding: 6px 10px; cursor: pointer; color: #555; font: inherit; border-radius: 6px; }
nav button.active { background: #eef; color: #113; }
main { padding: 20px; }
.tab { display: none; }
.tab.active { display: block; }
.btn { display: inline-block; padding: 6px 12px; background: #113; color: #fff; border: 0; border-radius: 6px; cursor: pointer; font: inherit; }
.btn:hover { background: #225; }
.btn:disabled { opacity: 0.5; cursor: default; }
.muted { color: #888; font-size: 13px; }
.picker { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
table { width: 100%; border-collapse: collapse; margin-top: 12px; background: #fff; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid #eee; font-size: 13px; }
th { font-weight: 600; background: #f4f4f4; }
td.status { font-weight: 500; }
.st-queued  { color: #888; }
.st-hashing { color: #a70; }
.st-checking { color: #a70; }
.st-uploading { color: #06a; }
.st-done    { color: #080; }
.st-skipped { color: #08a; }
.st-failed  { color: #a00; }
progress { width: 100%; height: 8px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.grid img { width: 100%; aspect-ratio: 1/1; object-fit: cover; background: #eee; border-radius: 4px; }
.thumb { padding: 0; border: 0; background: none; cursor: zoom-in; display: block; }
.thumb:focus-visible { outline: 2px solid #113; outline-offset: 2px; border-radius: 4px; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.92); display: grid; place-items: center; z-index: 1000; cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 96vw; max-height: 96vh; object-fit: contain; box-shadow: 0 4px 40px rgba(0,0,0,0.6); }
#lightbox-close { position: fixed; top: 12px; right: 16px; background: none; border: 0; color: #fff; font-size: 32px; line-height: 1; cursor: pointer; padding: 4px 10px; }
#lightbox-close:hover { color: #ccc; }
.dup-group { border: 1px solid #ddd; background: #fff; border-radius: 8px; padding: 12px; margin-bottom: 12px; }
.dup-group h3 { margin: 0 0 8px 0; font-size: 14px; }
.dup-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.dup-photo { border: 2px solid transparent; border-radius: 4px; padding: 4px; }
.dup-photo.keeper { border-color: #080; }
.dup-photo img { width: 100%; aspect-ratio: 1/1; object-fit: cover; background: #eee; border-radius: 3px; display: block; }
.dup-photo label { display: block; font-size: 12px; margin-top: 4px; word-break: break-all; }
.dup-actions { margin-top: 8px; display: flex; gap: 8px; }
