:root{
  --bg:#0b1220;
  --border:rgba(255,255,255,.08);
  --text:rgba(255,255,255,.92);
  --muted:rgba(255,255,255,.65);
  --radius:18px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background: radial-gradient(1200px 800px at 20% 10%, #142a52 0%, var(--bg) 55%), var(--bg);
  color:var(--text);
}

.app{max-width:1300px;margin:0 auto;padding:24px;display:flex;flex-direction:column;gap:18px}

.topbar{
  display:flex;gap:16px;align-items:center;justify-content:space-between;
  background:linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:18px;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
}

.title h1{margin:0;font-size:22px}
.subtitle{margin:6px 0 0;color:var(--muted);font-size:13px}

.actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.btn{
  appearance:none;border:1px solid var(--border);
  background:rgba(255,255,255,.06);
  color:var(--text);
  padding:10px 12px;border-radius:14px;
  cursor:pointer;font-weight:650;font-size:13px;
  transition: transform .08s ease, background .2s ease, opacity .2s ease;
  display:inline-flex;align-items:center;justify-content:center;
}
.btn:hover{background:rgba(255,255,255,.09)}
.btn:active{transform: translateY(1px)}
.btn:disabled{opacity:.45;cursor:not-allowed}
.btnGhost{background:transparent}
.btnGhost:hover{background:rgba(255,255,255,.06)}

.main{display:grid;grid-template-columns: 1.05fr .95fr;gap:18px}
@media (max-width: 980px){ .main{grid-template-columns:1fr} }

.gridWrap,.previewWrap{
  background:linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:16px;
  box-shadow: 0 12px 40px rgba(0,0,0,.22);
}

.sectionHeader{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;margin-bottom:12px}
.sectionHeader h2{margin:0;font-size:15px}
.status{font-size:12px;color:var(--muted)}
.hint{font-size:12px;color:var(--muted)}

.dropzone{
  border:1px dashed rgba(255,255,255,.18);
  background:rgba(0,0,0,.10);
  border-radius:16px;
  padding:14px;
  margin-bottom:12px;
  display:flex;align-items:center;justify-content:space-between;gap:12px;
}
.dropzone strong{font-size:13px}
.dropzone span{font-size:12px;color:var(--muted)}
.dropzone.dragover{
  border-color: rgba(106,166,255,.55);
  background: rgba(106,166,255,.10);
}

.bulkActions{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:12px}

.grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:12px;
}
@media (min-width: 640px){ .grid{grid-template-columns: repeat(3, minmax(0, 1fr));} }
@media (min-width: 1024px){ .grid{grid-template-columns: repeat(4, minmax(0, 1fr));} }

.card{
  border:1px solid var(--border);
  border-radius:16px;
  background:rgba(0,0,0,.12);
  padding:10px;
  cursor:pointer;
  transition: transform .12s ease, background .2s ease, opacity .2s ease;
  user-select:none;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.card:hover{transform: translateY(-2px); background:rgba(255,255,255,.05)}
.card.hidden{opacity:.45}
.cardTop{display:flex;align-items:center;justify-content:space-between;gap:10px}
.cardTitle{font-size:13px;font-weight:750}
.iconBtn{
  width:30px;height:30px;
  border-radius:999px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.05);
  display:inline-flex;align-items:center;justify-content:center;
  cursor:pointer;
}
.iconBtn:hover{background:rgba(255,255,255,.08)}
.icon{width:16px;height:16px;fill:rgba(255,255,255,.88)}

.thumb{
  width:100%;
  aspect-ratio: 3 / 4;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(0,0,0,.10);
  overflow:hidden;
  position:relative;
}
.thumb iframe{
  width:140%;
  height:140%;
  border:0;
  transform: scale(.72);
  transform-origin: top left;
  pointer-events:none;
  background:transparent;
}

.metaRow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  font-size:12px;
  color:var(--muted);
}
.metaRow span:last-child{color:rgba(255,255,255,.86)}
.metaRow strong{color:rgba(255,255,255,.92);font-weight:750}

.previewWrap{min-height: 520px}
.visibleList{
  border:1px solid var(--border);
  border-radius:16px;
  background:rgba(0,0,0,.12);
  overflow:auto;
  max-height: 100%;
  padding:12px;
  display:flex;
  flex-direction:column;
  gap:12px;
}
.pageBlock{
  border:1px solid rgba(255,255,255,.10);
  border-radius:14px;
  background:rgba(0,0,0,.10);
  overflow:hidden;
}
.pageHeader{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  border-bottom:1px solid rgba(255,255,255,.08);
  color:var(--muted);
  font-size:12px;
}
.pageHeader strong{color:rgba(255,255,255,.92)}
.pageViewer{
  height: 520px;
  background:rgba(0,0,0,.08);
}
.pageViewer iframe{
  width:100%;
  height:100%;
  border:0;
  background:transparent;
}

.fileInputVisuallyHidden{
  position:absolute;
  width:1px;height:1px;
  padding:0;margin:-1px;
  overflow:hidden;clip:rect(0,0,0,0);
  white-space:nowrap;border:0;
}


.btnIcon{
  width:16px;
  height:16px;
  fill: rgba(255,255,255,.92);
  margin-right:8px;
  flex: 0 0 auto;
}
.btn span{display:inline-block}

.instructions{
  border:1px solid rgba(255,255,255,.10);
  border-radius:16px;
  background:rgba(0,0,0,.10);
  padding:12px 12px;
  margin-bottom:12px;
}
.instructionsTitle{
  font-size:12px;
  font-weight:750;
  color:rgba(255,255,255,.88);
  margin-bottom:8px;
}
.instructionsList{
  margin:0;
  padding-left:18px;
  color: var(--muted);
  font-size:12px;
  line-height:1.45;
}
.instructionsList strong{color:rgba(255,255,255,.90)}

/* v11-5 fixes */
.visibleList{
  overflow:auto !important;
  max-height: 100%;
}
.pageBlock{
  flex: 0 0 auto;
}
.pageViewer{
  height:520px;
  flex: 0 0 auto;
}
.thumb iframe{
  pointer-events:none;
}
.thumb{
  cursor:pointer;
}

/* v11-7 thumbnail overlay click target */
.thumb{
  position:relative;
}
.thumbOverlay{
  position:absolute;
  inset:0;
  z-index:10;
}
