/* ===== Fanzinarium – shared styles ===== */

/* ---------- base ---------- */
*,*::before,*::after{box-sizing:border-box;}
body{background:#fff;font-family:serif;font-size:0.8em;color:#777;margin:0;line-height:1.45;min-height:100vh;display:flex;flex-direction:column;}
#results-area{flex:1 0 auto;}
img{max-width:100%;height:auto;}
a{color:#777;text-decoration:none;background:#fff;}
a:visited{color:#aaa;background:#fff;}
a:hover{background:#fffd71;}

/* ---------- search main title ---------- */
.search-main-title{
  font-family:serif;
  font-size:1.1rem;
  font-weight:normal;
  color:#555;
  margin:0 0 2px;
  line-height:1.4;
  letter-spacing:.02em;
}
.search-subtitle{
  font-size:.85rem;
  color:#777;
  margin:0 0 8px;
}

/* ---------- layout ---------- */
.site-wrap{max-width:1280px;margin:0 auto;padding:0 14px;text-align:center;}

/* ---------- nav ---------- */
#men1{background:#fff;font-family:Helvetica,Arial,sans-serif;font-size:1.2em;color:#fffd71;margin:0;}
#men2{background:#fff;font-family:Helvetica,Arial,sans-serif;font-size:1em;color:#fffd71;margin:0;}
#men3{background:#fff;font-family:Helvetica,Arial,sans-serif;font-size:0.9em;color:#fffd71;margin:0;}
#men1 a,#men1 span,#men2 a,#men2 span,#men3 a,#men3 span{display:inline-block;padding:4px 8px;border-radius:4px;margin:2px 3px;}

/* ---------- form ---------- */
input[type="text"]{padding:6px 8px;border:1px solid #bdbdbd;border-radius:4px;min-width:220px;font-size:1em;}
input[type="submit"]{padding:6px 10px;border:1px solid #847aff;border-radius:4px;background:#f7f5ff;color:#4f43aa;font-weight:bold;cursor:pointer;}
input[type="submit"]:hover{background:#ece7ff;}
@media (max-width:600px){
  #search-form p{display:flex;flex-wrap:nowrap;gap:4px;margin:0;align-items:stretch;}
  #search-form input[type="text"]{flex:1;min-width:0;}
  #search-form input[type="submit"]{flex:0 0 auto;white-space:nowrap;margin-top:0;align-self:stretch;}
}

/* ---------- cover grid ---------- */
.covers-zone{display:flex;flex-wrap:wrap;justify-content:center;gap:6px;padding:8px 6px 14px;}
.covers-zone img.search-result-cover{max-width:200px;max-height:200px;height:auto;border-radius:4px;box-shadow:none;filter:drop-shadow(0 1px 2px rgba(0,0,0,.22));transition:transform .15s ease,filter .15s ease;cursor:pointer;vertical-align:top;object-fit:contain;}
.covers-zone img.search-result-cover:hover{transform:translateY(-2px);filter:drop-shadow(0 2px 4px rgba(0,0,0,.3));}
.cover-item{display:flex;flex-direction:column;align-items:center;max-width:200px;}
.cover-label{font-size:.82rem;font-weight:600;color:#2d2640;text-align:center;line-height:1.4;width:100%;max-width:200px;overflow:visible;white-space:normal;word-break:break-word;padding:3px 6px 3px;margin:3px 2px 6px 2px;background:rgba(253,250,240,0.7);border-radius:0 0 5px 5px;border:1px solid #e8e4d0;border-top:none;}

/* ---------- pmb no-cover placeholder ---------- */
.pmb-no-cover-card{display:inline-flex!important;flex-direction:column;align-items:center;cursor:pointer;max-width:200px;padding:0!important;background:transparent!important;border:none!important;transition:transform .15s ease;}
.pmb-no-cover-card:hover{transform:translateY(-2px);}
.pmb-no-cover-card:hover svg{filter:drop-shadow(0 2px 4px rgba(0,0,0,.2));}
.pmb-no-cover-card svg{max-width:200px;max-height:200px;display:block;width:100%;height:auto;}
.cover-item:has(.pmb-no-cover-card){border:1px solid #d5d0ef;border-radius:5px;overflow:hidden;background:#f0eefc;}
.cover-item:has(.pmb-no-cover-card) .pmb-no-cover-card{width:100%;}
.cover-item:has(.pmb-no-cover-card) .cover-label{margin:0;border:none;border-radius:0;background:rgba(253,250,240,0.85);}

/* ---------- example links ---------- */
.search-examples{font-size:.78em;color:#6f7482;line-height:1.55;max-width:980px;margin:4px auto 8px;}
.search-examples-title{font-weight:600;color:#5f6472;}
.search-examples-cat{font-weight:600;color:#747f99;}
.example-link{display:inline-block;margin:1px 4px 1px 0;padding:1px 5px;border:1px solid #e1e1e1;border-radius:4px;background:#fffdf8;font-size:.95em;}

/* ---------- no result ---------- */
.no-result-box{max-width:1000px;margin:20px auto;padding:14px;border:1px solid #e5e8f2;background:#fff;border-radius:8px;color:#334155;text-align:left;}
.no-result-title{font-size:1.05em;font-weight:bold;margin-bottom:8px;}
.suggestions-title{font-weight:bold;margin:8px 0 6px 0;}
.suggestions-list{line-height:1.8;}
.suggestion-link{display:inline-block;margin:2px 6px 2px 0;padding:2px 6px;border:1px solid #cfcfcf;background:#fff9d6;}

/* ---------- lookup progress bar ---------- */
.lookup-progress{position:fixed;left:0;top:0;width:100%;height:4px;background:rgba(132,122,255,.18);z-index:9999;display:none;}
.lookup-progress-bar{height:100%;width:0%;background:linear-gradient(90deg,#7fb8ff,#cfe6ff,#7fb8ff);background-size:200% 100%;animation:lookupMove .9s linear infinite;transition:width .18s ease;}
@keyframes lookupMove{0%{background-position:200% 0}100%{background-position:-200% 0}}

/* ---------- model cache mini popup ---------- */
.model-cache-popup{position:fixed;right:14px;bottom:14px;z-index:2300;min-width:168px;max-width:220px;padding:8px 10px;background:rgba(27,37,63,.94);color:#f4f7ff;border:1px solid rgba(170,188,230,.45);border-radius:10px;box-shadow:0 8px 22px rgba(0,0,0,.25);display:none;backdrop-filter:blur(3px);}
.model-cache-popup.visible{display:block;}
.model-cache-topline{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px;}
.model-cache-title{font-size:.74rem;font-weight:700;letter-spacing:.02em;text-transform:uppercase;color:#d8e3ff;}
.model-cache-percent{font-size:.82rem;font-weight:700;color:#fff;}
.model-cache-bar{position:relative;height:6px;background:rgba(150,166,204,.35);border-radius:8px;overflow:hidden;}
.model-cache-bar-fill{display:block;height:100%;width:0%;background:linear-gradient(90deg,#66a6ff,#8bc7ff,#66a6ff);transition:width .18s ease;}

/* ---------- debug cache button ---------- */
.model-cache-debug-btn{position:fixed;left:8px;top:8px;z-index:2301;padding:2px 7px;border:1px solid rgba(120,138,180,.65);border-radius:9px;background:rgba(245,249,255,.75);color:#3b4f7b;font:600 11px/1.2 Helvetica,Arial,sans-serif;cursor:pointer;opacity:.72;backdrop-filter:blur(2px);}
.model-cache-debug-btn:hover{opacity:.95;background:rgba(238,245,255,.9);}
.model-cache-debug-btn:disabled{opacity:.55;cursor:default;}

/* ---------- loading glow on covers ---------- */
.search-result-cover.pmb-loading{animation:pmbLoadingGlow 1.2s ease-in-out infinite;}
@keyframes pmbLoadingGlow{0%{filter:saturate(1) brightness(1)}50%{filter:saturate(1.2) brightness(1.16)}100%{filter:saturate(1) brightness(1)}}

/* ---------- image loading shimmer ---------- */
.covers-zone .search-result-cover:not(.img-loaded){background:linear-gradient(90deg,#e2e6f0 25%,#d0d5e6 50%,#e2e6f0 75%);background-size:200% 100%;animation:imgShimmer 1.2s ease-in-out infinite;width:150px;aspect-ratio:150/224;}
@keyframes imgShimmer{0%{background-position:200% 0}100%{background-position:-200% 0}}
/* Spinner for fixed-size thumb-wrap (PMB search cards) */
.thumb-wrap.cover-loading{position:relative;}
.thumb-wrap.cover-loading::after{content:'';position:absolute;top:50%;left:50%;width:28px;height:28px;margin:-14px 0 0 -14px;border:3px solid #c5cfe8;border-top-color:#38496f;border-radius:50%;animation:spinCover .75s linear infinite;pointer-events:none;}
@keyframes spinCover{to{transform:rotate(360deg)}}

/* ---------- PMB result card grid (recherche pmb) ---------- */
.result-toolbar{max-width:1100px;margin:0 auto 10px;padding:0 8px;color:#38496f;font-size:.95rem;text-align:left;}
.result-grid{max-width:1240px;margin:0 auto;display:flex;flex-wrap:wrap;justify-content:center;gap:16px;padding:8px 6px 14px;}
.pmb-card{width:260px;background:#fff;border:1px solid #dfe5f3;border-radius:8px;padding:8px;box-shadow:0 1px 2px rgba(0,0,0,.05);}
.pmb-card .thumb-wrap{width:100%;height:280px;background:#f3f6fc;border:1px solid #e1e7f6;border-radius:6px;display:flex;align-items:center;justify-content:center;overflow:hidden;}
.pmb-card img{max-width:100%;max-height:100%;object-fit:contain;display:block;cursor:pointer;}
.pmb-ph{font-size:.9rem;color:#5f6d8d;padding:10px;text-align:center;line-height:1.35;}
.pmb-title{margin:8px 2px 6px;font-weight:700;color:#26385f;line-height:1.35;min-height:32px;cursor:pointer;}
.pmb-title:hover{text-decoration:underline;}
.pmb-actions{display:flex;justify-content:flex-end;align-items:center;gap:8px;}
.pmb-detail-btn{font-size:.82rem;padding:5px 8px;border:1px solid #cad4ed;background:#f7f9ff;border-radius:4px;color:#2b4278;cursor:pointer;}
.pmb-detail-btn:hover{background:#eef3ff;}
.status-box{max-width:1100px;margin:0 auto 8px;padding:0 8px;text-align:left;color:#3c4763;}
.search-loading{display:inline-block;padding:7px 11px;border:1px dashed #ccd5ea;border-radius:8px;background:#fbfcff;color:#4d5d82;}

/* ---------- maintenance ---------- */
.maintenance-box{max-width:760px;margin:14px auto;padding:14px;border:1px solid #eadf9a;border-radius:8px;background:#fffdf1;color:#5f5a42;}

/* ---------- retour au site ---------- */
.retour-site-btn{display:inline-block;padding:6px 14px;border:1px solid #847aff;border-radius:6px;background:#f7f5ff;color:#4f43aa;font-family:Helvetica,Arial,sans-serif;font-size:.9em;font-weight:600;text-decoration:none;transition:background .12s;}
.retour-site-btn:hover{background:#ece7ff;}
.retour-site-btn:visited{color:#4f43aa;background:#f7f5ff;}

/* ---------- theme labels ---------- */
.theme-label{display:inline-block;padding:4px 8px;border-radius:4px;margin:2px 3px;font-family:Helvetica,Arial,sans-serif;color:#4f43aa;font-weight:600;}

/* ---------- footer ---------- */
.site-footer{padding:8px 0 10px 0;font-size:0.92em;color:#5e5e5e;line-height:1.6;}
footer.site-wrap{margin-top:auto;flex-shrink:0;}

/* ---------- back to top ---------- */
.back-to-top{position:fixed;bottom:50px;right:42px;transform:translateY(10px);z-index:1500;width:44px;height:44px;border-radius:50%;border:1px solid #c5bff5;background:#ede9ff;color:#4f43aa;font-size:1.3rem;font-weight:700;cursor:pointer;box-shadow:0 2px 8px rgba(0,0,0,.12);opacity:0;pointer-events:none;transition:opacity .25s,transform .25s;}
.back-to-top.visible{opacity:1;pointer-events:auto;transform:translateY(0);}
.back-to-top:hover{background:#ddd7ff;border-color:#a99fdf;}

/* ---------- close all panels button ---------- */
.close-all-panels-btn{position:fixed;bottom:14px;left:50%;transform:translateX(-50%);z-index:2100;padding:7px 20px;border:1px solid #d94040;border-radius:20px;background:#c0392b;color:#fff;font-size:.85rem;font-weight:600;font-family:Helvetica,Arial,sans-serif;cursor:pointer;box-shadow:0 2px 10px rgba(0,0,0,.25);transition:opacity .2s;opacity:0;pointer-events:none;}
.close-all-panels-btn.visible{opacity:1;pointer-events:auto;}
.close-all-panels-btn:hover{background:#e74c3c;border-color:#c0392b;}

/* ===== INLINE DETAIL PANEL (replaces modal) ===== */
.detail-panel{
  max-width:100%;
  width:100%;
  box-sizing:border-box;
  margin:2px auto 4px;
  background:#fff;
  border:1px solid #d5daea;
  border-radius:8px;
  box-shadow:0 2px 8px rgba(0,0,0,.08);
  overflow:hidden;
  animation:detailSlide .2s ease-out;
}
@keyframes detailSlide{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:translateY(0)}}
.detail-panel-inner{
  display:flex;
  gap:4px;
  padding:3px;
  align-items:flex-start;
}
.detail-panel-thumb{
  flex:0 0 auto;
  max-width:90px;
}
.detail-panel-thumb img{
  max-width:90px;
  height:auto;
  border-radius:3px;
  border:1px solid #e0e0e0;
  object-fit:contain;
}
.detail-panel-thumb img.search-result-cover{
  max-width:90px;
  box-shadow:0 1px 4px rgba(0,0,0,.10);
  transform:none;
}
.detail-panel-content{
  flex:1 1 0%;
  min-width:0;
  overflow-x:hidden;
}
.detail-panel-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:3px;
  margin-bottom:1px;
  position:sticky;
  top:0;
  z-index:2;
  background:#fff;
  padding:0 0 1px;
}
.detail-panel-title{
  font-family:Helvetica,Arial,sans-serif;
  font-size:.82rem;
  font-weight:700;
  color:#26385f;
  margin:0;
  min-width:0;
  overflow:hidden;
  display:-webkit-box;
  -webkit-line-clamp:1;
  -webkit-box-orient:vertical;
  white-space:normal;
  word-break:break-word;
  overflow-wrap:anywhere;
}
.detail-panel-close{
  padding:1px 6px;
  border:1px solid #c5bff5;
  border-radius:3px;
  background:#ede9ff;
  color:#4f43aa;
  cursor:pointer;
  font-size:.7rem;
  font-weight:600;
  font-family:Helvetica,Arial,sans-serif;
  flex-shrink:0;
  transition:all .12s ease;
}
.detail-panel-close:hover{background:#ddd7ff;border-color:#a99fdf;}
.detail-panel-link{
  display:inline-block;
  font-size:.72rem;
  color:#2f4c9a;
  margin-bottom:1px;
}
.detail-panel-link:hover{text-decoration:underline;background:transparent;}
.detail-panel-body{font-family:Arial,sans-serif;font-size:.72rem;line-height:1.2;}
.detail-panel-body table{width:100%!important;border-collapse:collapse!important;table-layout:fixed;word-break:break-word;border:0!important;}
.detail-panel-body td,.detail-panel-body th{border:0!important;border-bottom:1px solid #f1f3f8!important;padding:1px 3px!important;vertical-align:top;}
.detail-panel-body tr:last-child td,.detail-panel-body tr:last-child th{border-bottom:0!important;}
.detail-panel-body tbody tr:nth-child(odd){background:#fff;}
.detail-panel-body tbody tr:nth-child(even){background:#f8faff;}
/* Detail table: label column (th) narrower and styled */
.detail-panel-body table.pmb-detail-table th{width:32%;font-weight:700;color:#2f4c9a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:.70rem;}
.detail-panel-body table.pmb-detail-table td{color:#1a2b4a;}
/* Exemplaires table: header row */
.detail-panel-body table.pmb-exemplaires-table thead th{background:#fff!important;color:#2f4c9a;font-weight:700;}
/* No-exemplaires placeholder row */
.detail-panel-body .pmb-no-exemplaires{font-style:italic;color:#8898b8;text-align:center!important;}
.detail-panel-body{max-width:100%;overflow-y:auto;overflow-x:hidden;}
@media (max-width:600px){
  .detail-panel-body table{min-width:0!important;width:100%!important;table-layout:auto!important;}
  .detail-panel-body table.pmb-exemplaires-table,
  .detail-panel-body table.pmb-detail-table{display:block!important;width:100%!important;border-collapse:separate!important;border-spacing:0!important;}
  .detail-panel-body table.pmb-exemplaires-table thead,
  .detail-panel-body table.pmb-detail-table thead{display:none!important;}
  .detail-panel-body table.pmb-exemplaires-table tbody,
  .detail-panel-body table.pmb-detail-table tbody{display:block!important;width:100%!important;}
  .detail-panel-body table.pmb-exemplaires-table tr,
  .detail-panel-body table.pmb-detail-table tr{display:block!important;width:100%!important;margin:0 0 5px!important;padding:4px 6px!important;border:1px solid #e6ebf7!important;border-radius:5px!important;background:#fff!important;}
  .detail-panel-body table.pmb-exemplaires-table th,
  .detail-panel-body table.pmb-exemplaires-table td,
  .detail-panel-body table.pmb-detail-table th,
  .detail-panel-body table.pmb-detail-table td{display:block!important;width:100%!important;padding:1px 0!important;text-align:left!important;border:none!important;white-space:normal!important;overflow-wrap:anywhere!important;word-break:break-word!important;}
  /* Detail table mobile: label (th) is a small coloured header above the value (td) */
  .detail-panel-body table.pmb-detail-table th{font-size:.67rem!important;color:#7080a8!important;font-weight:600!important;text-transform:uppercase!important;letter-spacing:.03em!important;padding-bottom:0!important;white-space:normal!important;overflow:visible!important;text-overflow:clip!important;}
  .detail-panel-body table.pmb-detail-table td{font-size:.76rem!important;color:#1a2b4a!important;font-weight:400!important;padding-top:1px!important;}
  /* Exemplaires table mobile: hide thead, use data-label pseudo-content per cell */
  .detail-panel-body table.pmb-exemplaires-table tr[data-row-title]::before{content:attr(data-row-title);display:block;margin:0 0 4px;font-weight:700;color:#2f4c9a;font-size:.76rem;border-bottom:1px dashed #d8e1f3;padding-bottom:2px;}
  .detail-panel-body table.pmb-exemplaires-table td[data-label]::before{content:attr(data-label) "\00a0: ";font-weight:700;color:#3b4f7b;}
}
.detail-panel-body ul,.detail-panel-body ol{list-style:none!important;margin:0!important;padding-left:0!important;}
.detail-panel-body li{margin:0!important;padding:0!important;}
.detail-panel-body img{display:none;}
.detail-panel-body a{color:#1f4bb3!important;text-decoration:none;}
.detail-panel-body a:hover{text-decoration:underline;}
.detail-panel-body h1,.detail-panel-body h2,.detail-panel-body h3{margin:2px 0 1px;font-size:.76rem;}
.detail-panel-body hr{border:none;border-top:1px solid #e3e6ef;margin:2px 0;}
.detail-panel-error{padding:3px 5px;border:1px solid #f0d0d0;background:#fff7f7;border-radius:3px;color:#8a2d2d;font-size:.72rem;}
.detail-panel-loading{display:flex;align-items:center;gap:4px;padding:4px;border:1px dashed #cfd6ea;border-radius:4px;background:#fbfcff;}
.detail-panel-loading .zine-stack{position:relative;width:34px;height:32px;flex:0 0 34px;}
.detail-panel-loading .zine-page{position:absolute;left:0;top:0;width:22px;height:30px;background:#fff;border:1px solid #b9c5e6;border-radius:2px;box-shadow:0 1px 2px rgba(0,0,0,.08);transform-origin:left center;}
.detail-panel-loading .zine-page:before{content:"";display:block;height:1px;margin:6px 4px;background:#8fa2d6;box-shadow:0 5px 0 #8fa2d6,0 10px 0 #8fa2d6;opacity:.75;}
.detail-panel-loading .zine-page.p1{animation:pmbZineFlip 1.05s ease-in-out infinite;}
.detail-panel-loading .zine-page.p2{left:6px;top:1px;animation:pmbZineFlip 1.05s ease-in-out infinite .16s;}
.detail-panel-loading .zine-page.p3{left:12px;top:2px;animation:pmbZineFlip 1.05s ease-in-out infinite .32s;}
.detail-panel-loading .loading-text{font-weight:600;color:#38496f;line-height:1.2;font-size:.76rem;animation:pmbZinePulse 1.1s ease-in-out infinite;}
@keyframes pmbZineFlip{0%{transform:rotate(0) translateX(0)}40%{transform:rotate(-7deg) translateX(-1px)}70%{transform:rotate(6deg) translateX(1px)}100%{transform:rotate(0) translateX(0)}}
@keyframes pmbZinePulse{0%,100%{opacity:.55}50%{opacity:1}}
.search-status-pending{animation:pmbZinePulse 1.1s ease-in-out infinite;font-size:.82rem;color:#6b83b8;margin-left:5px;}

.pmb-table-block+.pmb-table-block{margin-top:4px;padding-top:4px;border-top:1px solid #eef1f7;}
.pmb-exemplaires-title{margin:0 0 2px;padding:0;font-size:.72rem;font-weight:700;color:#38496f;}
.pmb-location-alert{margin:0 0 6px;padding:6px 8px;border:1px solid #d3c47a;border-radius:6px;background:#fff8d8;color:#5f4f08;font-size:.78rem;font-weight:700;line-height:1.35;}


/* ===== FLOATING DETAIL PANEL ===== */
.detail-panel-floating{
  position:fixed;
  z-index:2000;
  max-width:580px;
  width:580px;
  max-height:70vh;
  overflow-y:auto;
  overflow-x:hidden;
  box-shadow:0 8px 32px rgba(0,0,0,.18), 0 2px 8px rgba(0,0,0,.1);
  border-radius:10px;
  animation:detailFloat .22s ease-out;
  scrollbar-width:thin;
  scrollbar-color:#9aa9c9 #eef2fb;
  scrollbar-gutter:stable both-edges;
}
.detail-panel-floating::-webkit-scrollbar{width:10px;height:10px;}
.detail-panel-floating::-webkit-scrollbar-track{background:#eef2fb;border-radius:8px;}
.detail-panel-floating::-webkit-scrollbar-thumb{background:#9aa9c9;border-radius:8px;}
.detail-panel-floating::-webkit-scrollbar-thumb:hover{background:#7f90b6;}
@keyframes detailFloat{from{opacity:0;transform:scale(.96) translateY(8px)}to{opacity:1;transform:scale(1) translateY(0)}}
.detail-panel-floating{
  cursor:grab;
  user-select:none;
}
.detail-panel-floating.dragging{cursor:grabbing;}
.detail-panel-floating .detail-panel-thumb{display:none;}
.detail-panel-floating .detail-panel-content{overflow:visible;}
.detail-panel-floating .detail-panel-head{position:sticky;top:0;z-index:5;}
.detail-panel-floating .detail-panel-body{
  cursor:auto;
  user-select:text;
}
.detail-panel-floating .detail-panel-head{
  border-bottom:1px solid #eef1f7;
  padding:2px 5px 1px;
  background:#f9f8ff;
  border-radius:10px 10px 0 0;
}
.detail-panel-floating .detail-panel-head::before{
  content:'\2261';
  font-size:1rem;
  color:#b0a8e8;
  margin-right:3px;
  line-height:1;
}

/* Active cover highlight */
.cover-item-active img,.cover-item-active.search-result-cover,img.cover-item-active{
  outline:3px solid var(--arrow-color, #847aff);
  outline-offset:2px;
  border-radius:4px;
  filter:drop-shadow(0 0 6px rgba(132,122,255,.4))!important;
}

/* ===== SHARE POPUP ===== */
.share-popup{display:flex;gap:6px;padding:6px 8px;background:#f0f4ff;border:1px solid #cad4ed;border-radius:0 0 8px 8px;align-items:center;}
.share-popup-input{flex:1;padding:5px 8px;border:1px solid #bdc8e0;border-radius:4px;font-size:.82rem;color:#2b4278;background:#fff;min-width:0;}

/* ===== COVER DETAIL OVERLAY (URL deep-link) ===== */
.detail-overlay-bg{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.45);z-index:2500;display:flex;align-items:center;justify-content:center;padding:20px;overflow-y:auto;}
.detail-overlay-bg .detail-panel{max-width:900px;width:100%;max-height:88vh;overflow-y:auto;margin:auto;box-shadow:0 8px 32px rgba(0,0,0,.25);border-radius:10px;animation:overlaySlide .25s ease-out;}
.detail-overlay-bg .detail-panel-thumb{max-width:200px;}
.detail-overlay-bg .detail-panel-thumb img{max-width:200px;}
@keyframes overlaySlide{from{opacity:0;transform:translateY(30px)}to{opacity:1;transform:translateY(0)}}
@media(max-width:600px){
  .detail-overlay-bg{padding:8px;}
  .detail-overlay-bg .detail-panel{max-height:92vh;}
  .detail-panel-floating{max-width:calc(100vw - 16px);width:calc(100vw - 16px);}
}

/* ===== ALPHA BROWSER ===== */
.alpha-bar-wrap{position:sticky;top:0;z-index:100;background:#fff;border-bottom:1px solid #e3e6ef;padding:6px 0 4px;box-shadow:0 1px 4px rgba(0,0,0,.06);}
.alpha-bar{display:flex;justify-content:center;flex-wrap:wrap;gap:2px;max-width:1280px;margin:0 auto;padding:0 10px;}
.alpha-letter{display:inline-flex;align-items:center;justify-content:center;width:32px;height:30px;font-family:Helvetica,Arial,sans-serif;font-size:.95rem;font-weight:700;color:#4f43aa;border-radius:5px;cursor:pointer;transition:background .12s,color .12s;text-decoration:none;background:transparent;border:none;}
.alpha-letter:hover{background:#ece7ff;color:#3b2f8a;}
.alpha-letter-active{background:#847aff!important;color:#fff!important;}
.alpha-letter-empty{color:#ccc;cursor:default;}
.alpha-letter-empty:hover{background:transparent;color:#ccc;}
.alpha-filter-wrap{display:flex;align-items:center;justify-content:center;gap:8px;margin-top:4px;padding:0 10px;}
.alpha-filter-wrap input[type="text"]{min-width:180px;max-width:280px;padding:5px 10px;border:1px solid #c8cfe0;border-radius:6px;font-size:.9rem;}
#alpha-filter-count{font-size:.85rem;color:#666;min-width:60px;}
.alpha-browser{text-align:left;max-width:1280px;margin:0 auto;padding:10px 14px 20px;}
.alpha-section{margin-bottom:16px;scroll-margin-top:90px;}
.alpha-section-title{display:flex;align-items:baseline;gap:10px;margin:0 0 8px;padding:6px 0 4px;border-bottom:2px solid #847aff;font-family:Helvetica,Arial,sans-serif;}
.alpha-section-letter{font-size:1.6rem;font-weight:800;color:#4f43aa;}
.alpha-section-count{font-size:.85rem;font-weight:400;color:#888;}
.alpha-codes{display:flex;flex-wrap:wrap;gap:5px;margin-bottom:4px;}
.alpha-code-btn{display:inline-flex;align-items:center;gap:4px;padding:5px 10px;border:1px solid #c5bff5;border-radius:6px;background:#f3f1ff;font-family:Helvetica,Arial,sans-serif;font-size:.88rem;font-weight:600;color:#4f43aa;cursor:pointer;transition:all .12s ease;line-height:1;}
.alpha-code-btn:hover{background:#ece7ff;border-color:#b0a8e8;}
.alpha-code-btn-active{background:#847aff!important;color:#fff!important;border-color:#6b5fcf!important;}
.alpha-code-count{font-size:.75rem;font-weight:400;color:#9088cc;margin-left:1px;}
.alpha-code-btn-active .alpha-code-count{color:rgba(255,255,255,.75);}
.alpha-expanded{margin:8px 0;animation:detailSlide .2s ease-out;width:100%;}
.alpha-expanded-header{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:6px 8px;background:#f0edff;border-radius:6px 6px 0 0;border:1px solid #d5d0ef;border-bottom:none;flex-basis:100%;width:100%;}
.alpha-expanded-title{font-family:Helvetica,Arial,sans-serif;font-size:.92rem;font-weight:700;color:#38496f;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.alpha-expanded-close{padding:4px 12px;border:1px solid #c5bff5;border-radius:6px;background:#ede9ff;color:#4f43aa;cursor:pointer;font-size:.82rem;font-weight:600;font-family:Helvetica,Arial,sans-serif;flex-shrink:0;transition:all .12s ease;}
.alpha-expanded-close:hover{background:#ddd7ff;border-color:#a99fdf;}
.alpha-expanded-grid{border:1px solid #d5d0ef;border-top:none;border-radius:0 0 6px 6px;padding:8px 6px;background:rgba(255,255,255,.6);flex-basis:100%;width:100%;}

/* ===== SEARCH SECTIONS ===== */
.search-section{margin:10px auto;max-width:1280px;border-radius:8px;overflow:hidden;border:1px solid #d5daea;background:#fff;}
.search-section-header{display:flex;align-items:center;gap:8px;padding:10px 14px;cursor:pointer;user-select:none;transition:background .12s;border-left:4px solid #847aff;}
.search-section-header:hover{background:#f8f9ff;}
.search-section[data-type="titre"] .search-section-header{border-left-color:#4a90d9;}
.search-section[data-type="pmb"] .search-section-header{border-left-color:#48b079;}
.search-section[data-type="wise"] .search-section-header{border-left-color:#9b6ed8;}
.search-section-title{font-family:Helvetica,Arial,sans-serif;font-weight:700;font-size:.95rem;color:#26385f;}
.search-section-subtitle{font-size:.82rem;color:#888;font-style:italic;}
.search-section-count{font-size:.85rem;color:#555;margin-left:auto;}
.search-section-toggle{font-size:1.1rem;color:#847aff;transition:transform .2s;flex-shrink:0;}
.search-section.collapsed .search-section-toggle{transform:rotate(-90deg);}
.search-section-body{border-top:1px solid #e8ecf5;}
.search-section.collapsed .search-section-body{display:none;}
.search-section-status{padding:14px;text-align:center;color:#5f6d8d;font-size:.92rem;}
.search-section-error{color:#8a2d2d;background:#fff7f7;}

/* ===== RESPONSIVE ===== */
html{overflow-x:hidden;}
@media(max-width:768px){
  body{font-size:.85em;}
  .site-wrap{padding:0 8px;}
  #men1{font-size:1.15em;}
  #men1 a,#men1 span{padding:5px 7px;margin:2px 3px;font-size:1em;white-space:normal;word-break:break-word;}
  #men2 a,#men2 span,#men3 a,#men3 span{padding:4px 6px;margin:2px 2px;font-size:.92em;white-space:normal;word-break:break-word;}
  input[type="text"]{min-width:160px;font-size:.95em;}
  input[type="submit"]{display:block;margin-top:8px;}
  #wise-form p{display:flex;flex-wrap:nowrap;gap:4px;align-items:center;margin:0;}
  #wise-form input[type="text"]{flex:1;min-width:0;}
  #wise-form input[type="submit"]{display:inline-block;flex:0 0 auto;white-space:nowrap;margin-top:0;}
  .covers-zone img.search-result-cover{max-width:190px;max-height:190px;}
  .cover-item{max-width:190px;}
  .cover-label{max-width:190px;font-size:.82rem;}
  .detail-panel-inner{flex-direction:column;gap:8px;padding:8px;}
  .detail-panel-floating{max-width:calc(100vw - 16px);width:calc(100vw - 16px);}
  .detail-panel-thumb{max-width:80px;align-self:center;}
  .detail-panel-thumb img{max-width:80px;}
  .detail-panel-content{max-height:300px;overflow-y:auto;overflow-x:hidden;}
  .pmb-card{width:calc(50% - 12px);min-width:140px;}
  .pmb-card .thumb-wrap{height:220px;}
  .result-grid{gap:10px;padding:6px 4px 10px;}
  .example-link{font-size:.9em;padding:2px 4px;margin:1px 3px;}
  img[alt='logo']{max-width:80%;height:auto;}
  .search-section-header{padding:8px 10px;}
  .search-section-subtitle{display:none;}
  .alpha-letter{width:26px;height:26px;font-size:.82rem;}
  .alpha-section-letter{font-size:1.3rem;}
  .alpha-bar{gap:1px;padding:0 4px;}
  .alpha-filter-wrap input[type="text"]{min-width:140px;}
  .model-cache-popup{right:8px;bottom:8px;min-width:150px;padding:7px 8px;}
  .model-cache-debug-btn{left:6px;top:6px;padding:2px 6px;font-size:10px;}
}
@media(max-width:480px){
  #men1{font-size:1.05em;}
  #men1 a,#men1 span{padding:5px 6px;margin:2px 2px;font-size:1em;}
  #men2 a,#men2 span,#men3 a,#men3 span{padding:3px 5px;font-size:.88em;}
  input[type="text"]{min-width:120px;width:calc(100% - 90px);}
  .covers-zone img.search-result-cover{max-width:165px;max-height:165px;}
  .cover-item{max-width:165px;}
  .cover-label{max-width:165px;font-size:.78rem;}
  .detail-panel-thumb{max-width:70px;}
  .detail-panel-thumb img{max-width:70px;}
  .pmb-card{width:100%;max-width:300px;}
  .search-section-title{font-size:.88rem;}
  .alpha-letter{width:22px;height:24px;font-size:.75rem;}
  .alpha-code-btn{padding:4px 7px;font-size:.8rem;}
}
