
body{margin:0;font-family:sans-serif;background:#fff;color:#111}
header{max-width:900px;margin:40px auto 5px;padding:0 16px}
.smallback{max-width:900px;margin:0 auto 20px;padding:0 16px;font-size:0.9rem}
main{max-width:85%;margin:0 auto;padding:0 16px 40px}
.card{border:1px solid #e5e7eb;border-radius:14px;padding:16px;margin:16px auto;background:#fff;text-align:left}
.card.home{max-width:400px;text-align:center}
footer{border-top:1px solid #e5e7eb;margin-top:40px}
footer .inner{max-width:900px;margin:0 auto;padding:16px;color:#666;font-size:.9rem}
select{padding:8px;width:100%;max-width:100%}

/* Table + floating scrollbar */
.table-scroll-area{
  position:relative;
  width:100%;
  margin:0 auto;
  padding-bottom:24px;
}
.table-wrap{
  overflow-x:auto;
  overflow-y:visible;
  border:1px solid #e5e7eb;
  border-radius:14px;
  scrollbar-width:none; /* Firefox hide */
}
.table-wrap::-webkit-scrollbar{display:none;} /* Chrome hide */

table{border-collapse:collapse;width:100%;min-width:1400px}
th{background:#f9fafb;position:sticky;top:0;border-bottom:1px solid #e5e7eb;padding:6px 8px;white-space:nowrap;font-size:0.9rem}
td{border-top:1px solid #e5e7eb;padding:6px 8px;vertical-align:top;font-size:0.9rem}

.scrollbar-bottom{
  height:12px;
  background:#f1f5f9;
  border-radius:6px;
  overflow-x:auto;
  overflow-y:hidden;
  position:sticky;
  bottom:10px;
  width:100%;
  z-index:50;
  cursor:pointer;
  scrollbar-width:thin;
}
.scrollbar-bottom::-webkit-scrollbar{height:12px;}
.scrollbar-bottom::-webkit-scrollbar-thumb{
  background:#cbd5e1;
  border-radius:6px;
}
.scrollbar-bottom::-webkit-scrollbar-track{
  background:#e2e8f0;
}

/* Thumbnails and clickable cells */
.thumb{
  width:56px;
  height:79px;
  object-fit:cover;
  border-radius:8px;
  border:1px solid #e5e7eb;
}
td.clickable{cursor:pointer;color:#0369a1;text-decoration:underline}
td.clickable:hover{color:#0284c7}

/* Detail modal */
#cardDetail{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,0.55);
  display:none;
  align-items:center;
  justify-content:center;
  z-index:70;
}
#cardDetail.open{display:flex;}
.detail-inner{
  background:#ffffff;
  border-radius:16px;
  max-width:900px;
  width:95%;
  max-height:90vh;
  overflow-y:auto;
  padding:20px;
  box-shadow:0 20px 45px rgba(15,23,42,0.35);
}
.detail-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:12px;
}
.detail-title{font-size:1.1rem;font-weight:600}
.detail-close{background:none;border:none;font-size:1.4rem;cursor:pointer}
.detail-grid{
  display:grid;
  grid-template-columns:260px 1fr;
  gap:16px;
}
.detail-image-wrap{
  display:flex;
  justify-content:center;
}
.detail-image-wrap img{
  max-width:240px;
  border-radius:12px;
  border:1px solid #e5e7eb;
}
.detail-meta section{margin-bottom:10px;}
.detail-meta h4{
  margin:0 0 4px;
  font-size:0.95rem;
  font-weight:600;
}
.detail-meta p{
  margin:0 0 4px;
  font-size:0.9rem;
}
.detail-meta .grid-2{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px 16px;
}
.meta-row{font-size:0.9rem;margin-bottom:2px;}
.meta-row .label{font-weight:600;}

@media(max-width:800px){
  .detail-grid{grid-template-columns:1fr;}
}
