/* Modal overlay and dialog styles */
.modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0);
  z-index: 1000; /* above everything */
  transition: background-color 0.2s ease;
}

/* Photos modal styles removed */


.modal-overlay:not([hidden]) {
  display: flex;
  background: rgba(0,0,0,0.5);
}


.modal-overlay.modal-opening {
  animation: fadeInOverlay 0.2s ease forwards;
}

.modal-overlay.modal-closing {
  animation: fadeOutOverlay 0.2s ease forwards;
}

@keyframes fadeInOverlay {
  from {
    background: rgba(0,0,0,0);
  }
  to {
    background: rgba(0,0,0,0.5);
  }
}

@keyframes fadeOutOverlay {
  from {
    background: rgba(0,0,0,0.5);
  }
  to {
    background: rgba(0,0,0,0);
  }
}

.modal {
  background: #fff;
  color: #111;
  width: min(92vw, 720px);
  max-width: 720px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  overflow: hidden;
  transform: scale(0.98);
  opacity: 0;
  font-family: Arial, sans-serif; /* Force Arial on all modals */
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Animation states for modal content */
.modal-overlay:not([hidden]) .modal {
  transform: scale(1);
  opacity: 1;
}

.modal-overlay.modal-opening .modal {
  animation: modalSlideIn 0.3s ease forwards;
}

.modal-overlay.modal-closing .modal {
  animation: modalSlideOut 0.3s ease forwards;
}

@keyframes modalSlideIn {
  from {
    transform: scale(0.96) translateY(-8px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

@keyframes modalSlideOut {
  from {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
  to {
    transform: scale(0.98) translateY(-5px);
    opacity: 0;
  }
}

/* Simplified animations for all modal types */
.modal-overlay.modal-opening .modal {
  animation: modalSimpleIn 0.2s ease-out forwards;
}

.modal-overlay.modal-closing .modal {
  animation: modalSimpleOut 0.2s ease-in forwards;
}

@keyframes modalSimpleIn {
  from {
    transform: scale(0.95) translateY(-10px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

@keyframes modalSimpleOut {
  from {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
  to {
    transform: scale(0.98) translateY(-5px);
    opacity: 0;
  }
}

/* Smooth transitions for modal states */
.modal {
  will-change: transform, opacity;
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  .modal-overlay,
  .modal {
    transition: opacity 0.2s ease !important;
  }
  
  .modal-overlay.modal-opening .modal,
  .modal-overlay.modal-closing .modal {
    animation: none !important;
  }
  
  @keyframes fadeInOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  
  @keyframes fadeOutOverlay {
    from { opacity: 1; }
    to { opacity: 0; }
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(90deg,#f7f7f7,#fff);
  border-bottom: 1px solid #eee;
}

.modal-header h2 { font-size: 18px; margin: 0; }
.modal-close {
  background: transparent;
  border: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.modal-body { padding: 16px; }

/* Photos gallery layout */
.modal.msn-window .photos-root { display:flex; flex-direction:column; gap:12px; }
.modal.msn-window .photos-status { font-size:13px; color:#333; }
/* ===== Responsive Photos Grid (modal) ===== */
.modal.msn-window .photos-grid {
  display: grid;
  --photo-min: 150px; /* base minimum */
  grid-template-columns: repeat(auto-fill, minmax(var(--photo-min), 1fr));
  gap: clamp(8px, 1.2vw, 14px);
  align-items: stretch;
}
.modal.msn-window .photo-item {
  display: block;
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #eee;
  /* ratio visuel cohérent ; fallback min-height pour anciens navigateurs */
  aspect-ratio: 4 / 5;
  min-height: 160px; /* fallback */
  transition: transform .18s ease, box-shadow .18s ease, background-color .3s ease;
  will-change: transform;
}
.modal.msn-window .photo-item:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0,0,0,.18); }
.modal.msn-window .photo-item:active { transform: translateY(0); box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.modal.msn-window .photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
}
.modal.msn-window .photo-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.55), rgba(0,0,0,0.0));
  color: #fff;
  padding: 8px 10px 10px;
  font-size: 12px;
  line-height: 1.3;
  max-height: 48%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.modal.msn-window .photo-skel {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,#eee,#f5f5f5,#eee);
  background-size: 200% 100%;
  animation: skel 1.2s linear infinite;
  border-radius: 10px;
  pointer-events: none;
}
/* Très petits écrans : on réduit la largeur mini pour garder plus de colonnes */
@media (max-width: 520px) {
  .modal.msn-window .photos-grid { --photo-min: 120px; }
}
@media (max-width: 380px) {
  .modal.msn-window .photos-grid { --photo-min: 110px; }
}
/* Haute densité horizontale (paysage) : ratio plus horizontal si la hauteur est réduite */
@media (max-height: 520px) and (min-aspect-ratio: 4/3) {
  .modal.msn-window .photo-item { aspect-ratio: 5 / 4; }
}
/* Réduction d’animation pour accessibilité */
@media (prefers-reduced-motion: reduce) {
  .modal.msn-window .photo-skel { animation: none; background: #eee; }
  .modal.msn-window .photo-item { transition: none; }
  .modal.msn-window .photo-item:hover { transform: none; box-shadow: none; }
}

@keyframes skel {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* auto-fill grid adapts responsively; no explicit breakpoints needed */

/* Fullscreen gallery styles used by tpl-menu */
.menu-gallery { position: relative; width: 100%; height: 100%; display:flex; align-items:center; justify-content:flex-start; overflow: hidden; }
.menu-gallery .gallery-track { display:flex; flex-wrap: nowrap; height:100%; overflow:visible; align-items:center; justify-content:flex-start; gap:0; transition: transform 300ms ease; will-change: transform; }
/* Each slide is a container, image sits inside without forced upscaling */
.gallery-slide { flex: 0 0 100%; /* width overridden dynamically for percent-based slider */ width:100%; height:100%; display:flex; align-items:center; justify-content:center; min-width: 0; }
.gallery-slide img { max-width:100%; max-height:100%; width:auto; height:auto; object-fit: contain; display:block; }
.menu-gallery button.gallery-prev, .menu-gallery button.gallery-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,0.5); color: #fff; border:none; padding:12px; border-radius:6px; cursor:pointer; font-size:18px;
  z-index: 2;
}
.menu-gallery button.gallery-prev { left: 12px; }
.menu-gallery button.gallery-next { right: 12px; }

/* Headerless embedded gallery (not a modal) */
.menu-gallery-embed {
  position: fixed; /* lightweight overlay without modal system */
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(92vw, 820px);
  max-width: 92vw;
  max-height: 88vh;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.25);
  z-index: 1200;
  overflow: hidden;
}
.menu-gallery-embed .menu-gallery { width: 100%; height: 100%; }
.menu-gallery-embed .gallery-slide { height: 100%; }
@media (max-width: 520px){
  .menu-gallery-embed { width: 94vw; max-width: 94vw; border-radius: 10px; }
}

/* When used in a modal we want the modal to be wider/taller for images */
.modal.menu-fullscreen { max-width: 100vw; width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; margin: 0; display:flex; flex-direction:column; }
.modal.menu-fullscreen .modal-body { padding: 0; height: auto; flex: 1 1 auto; overflow: auto; }

/* Vertical stacked menu (scroll down to see next pages) */
.menu-vertical { width: 100%; /* let height grow for scrolling */ display: flex; flex-direction: column; gap: 16px; align-items: center; justify-content: flex-start; box-sizing: border-box; padding: 16px; }
.menu-vertical .menu-figure { margin: 0; width: 100%; display: flex; align-items: center; justify-content: center; }
.menu-vertical .menu-figure img { max-width: 100%; height: auto; object-fit: contain; display: block; }

/* Compact menu modal (small, swipeable) */
.modal.menu-compact { width: min(92vw, 860px); max-width: 860px; max-height: 86vh; }
.modal.menu-compact .modal-body { padding: 0; }
.modal.menu-compact .menu-gallery { height: min(76vh, 80vw); }

/* Apropos: inline PDF viewer */
.apropos-docs { margin-top: 8px; }
.apropos-pdf-actions { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:10px; }
.pdf-viewer-slot { width: 100%; height: min(70vh, 80vw); border: 1px solid #e5e5e5; border-radius: 6px; overflow: hidden; background: #fafafa; display:flex; align-items:center; justify-content:center; }
.pdf-viewer-slot[hidden] { display: none !important; }
.pdf-viewer-slot iframe { width:100%; height:100%; border:0; display:block; background:#fff; }
.pdf-placeholder { padding: 12px; text-align:center; }

/* Inline loader for menu modal */
.inline-loader { width: 100%; height: 100%; display:flex; flex-direction:column; gap:10px; align-items:center; justify-content:center; }
.inline-loader .spinner { width: 36px; height: 36px; border: 3px solid #eee; border-top-color: #f17978; border-radius: 50%; animation: spin 0.9s linear infinite; }
.inline-loader .text { font-size: 14px; color: #666; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 520px){
  .modal.menu-compact { width: 92vw; max-width: 92vw; }
  .modal.menu-compact .menu-gallery { height: min(70vh, 92vw); }
}

/* PDF fullscreen viewer */
.modal.pdf-fullscreen { max-width: 100vw; width:100vw; height:100vh; max-height:100vh; border-radius:0; }
.modal.pdf-fullscreen .modal-body { padding:0; height:100%; display:flex; flex-direction:column; }
.pdf-viewer.fullscreen { position:relative; display:flex; flex-direction:column; width:100%; height:100%; background:#fff; }
.pdf-viewer-controls, .pdf-viewer-title, .pdf-viewer-indicator, .pv-btn.pv-download { display:none !important; }
/* Legacy dual layout removed; single PDF mode */
.pdf-single { flex:1; position:relative; background:#fafafa; display:flex; }
.pdf-frame.single { flex:1; width:100%; height:100%; border:none; background:#fff; }
.pv-close-floating { position:fixed; top:14px; right:18px; z-index:1500; background:rgba(0,0,0,0.55); color:#fff; border:none; width:46px; height:46px; border-radius:50%; cursor:pointer; font-size:30px; line-height:1; display:flex; align-items:center; justify-content:center; backdrop-filter: blur(4px); box-shadow:0 4px 18px rgba(0,0,0,0.35); transition:background .25s ease, transform .25s ease; }
.pv-close-floating:hover { background:rgba(0,0,0,0.7); }
.pv-close-floating:active { transform:scale(.95); }
.pdf-fallback { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; font-size:14px; color:#333; }
.pdf-fallback a { color:#111; text-decoration:underline; }

/* Responsive remains trivial for single PDF */
@media (max-width: 820px){
  .pdf-viewer-indicator { margin-left:auto; }
}

@media (max-width: 520px){
  .pdf-frame { height:50%; }
  .pdf-viewer-controls { flex-wrap:wrap; }
  .pdf-viewer-title { flex:1 1 100%; }
  .pdf-viewer-indicator { flex:1 1 100%; }
}

/* allow modal to grow taller for fullscreen content */
.modal { max-height: 96vh; overflow: hidden; }

/* Removed contact-specific styles (form, embedded, inline contact, toasts) */

/* Keep a generic mobile-friendly modal width (avoid full-width on phones) */
@media (max-width: 520px) {
  .modal:not(.pdf-fullscreen):not(.menu-fullscreen) { width: 88vw; max-width: 88vw; border-radius: 8px; }
  .modal.msn-window { width: min(420px, 88vw); max-width: 88vw; }
  .modal.msn-window.msn-wide { width: min(720px, 92vw); max-width: 92vw; }
}

/* ================= MSN Retro Window (A Propos) ================= */
.modal.msn-window { 
  width: 420px;
  max-width: 90vw;
  background: #ece9d8; /* vieux beige Windows */
  border: 2px solid #0153b4;
  padding: 0;
  box-shadow: 0 0 0 1px #fff inset, 0 0 0 2px #0153b4 inset, 0 12px 28px rgba(0,0,0,.45);
  font-family: Arial, sans-serif; /* Force Arial strictly for MSN-style modals */
  position: fixed;
}

/* Wider layout for archives */
.modal.msn-window.msn-wide {
  width: 720px;
  max-width: 96vw;
}
/* Make MSN modal body scrollable within viewport */
.modal.msn-window .modal-body { max-height: calc(96vh - 52px); overflow: auto; }
.modal.msn-window .modal-header { 
  background: linear-gradient(90deg,#0a65d4,#1a82ff); 
  border: none; 
  padding: 6px 8px; 
  color: #fff; 
  font-size: 13px; 
  font-weight: 600; 
  cursor: default; /* dragging disabled */
  user-select: none;
}
.modal.msn-window .modal-header h2 { font-size: 13px; font-weight: 600; }
.modal.msn-window .modal-close { 
  background: #c9302c; 
  border: 1px solid #7d0f0f; 
  color: #fff; 
  width: 22px; height:22px; 
  font-size: 16px; line-height:1; padding:0; border-radius:2px;
}
.modal.msn-window .modal-close:hover { background:#e54842; }
.modal.msn-window .modal-body { 
  background: #f4f2ea; 
  padding: 14px 16px; 
  color:#222; 
  font-size: 13px; 
  line-height:1.4;
}
.msn-about-block { 
  background:#fff; 
  border:1px solid #b5b2a8; 
  padding:12px 14px; 
  border-radius:4px; 
  box-shadow: 0 1px 0 #fff inset, 0 0 0 1px #d8d6cf inset;
}
.msn-about-block p { margin:0 0 10px; }
.msn-about-block ul.about-list { margin:0 0 12px 18px; padding:0; font-size:12px; }
.msn-about-block ul.about-list li { margin-bottom:4px; }
.msn-about-block .mini-note { font-size:11px; opacity:.7; font-style:italic; }

/* Login specific minor tweaks (inherits msn-form) */
.modal.msn-window .login-root { 
  display:flex; 
  flex-direction:column; 
  gap:14px; 
  background:#fff; 
  padding:14px 16px 18px; 
  border:1px solid #b5b2a8; 
  border-radius:6px; 
  box-shadow:0 1px 0 #fff inset, 0 0 0 1px #d8d6cf inset;
}
.modal.msn-window .login-form { display:flex; flex-direction:column; gap:12px; }
.modal.msn-window .login-form .field { display:flex; flex-direction:column; gap:4px; }
.modal.msn-window .login-form label { font-size:12px; font-weight:600; color:#1c1c1c; letter-spacing:.2px; }
.modal.msn-window .login-form input[type="email"],
.modal.msn-window .login-form input[type="password"] { 
  font-size:14px; 
  padding:8px 10px; 
  border:1px solid #b5b2a8; 
  border-radius:6px; 
  background:#fdfdfc; 
  transition: border-color .18s ease, box-shadow .18s ease, background .25s ease; 
}
.modal.msn-window .login-form input[type="email"]:focus,
.modal.msn-window .login-form input[type="password"]:focus { 
  outline:none; border-color:#0a65d4; box-shadow:0 0 0 2px rgba(10,101,212,.25); background:#fff; 
}
.modal.msn-window .login-form input[type="email"]:invalid,
.modal.msn-window .login-form input[type="password"]:invalid { box-shadow:none; }
.modal.msn-window .login-form .form-actions { margin-top:4px; display:flex; justify-content:flex-end; }
.modal.msn-window .login-form .msn-btn.login-submit { 
  min-width:140px; 
  display:inline-flex; 
  align-items:center; 
  justify-content:center; 
  gap:6px; 
  font-weight:600; 
  letter-spacing:.3px; 
  background:linear-gradient(180deg,#0d73f2,#0a65d4 60%,#095dc2); 
  border:1px solid #0a5ec8; 
  color:#fff; 
  text-shadow:0 1px 0 rgba(0,0,0,.25); 
  transition: transform .18s ease, box-shadow .25s ease, background .25s ease; 
}
.modal.msn-window .login-form .msn-btn.login-submit:hover { background:linear-gradient(180deg,#1280ff,#0d6ede 60%,#0a5ec2); }
.modal.msn-window .login-form .msn-btn.login-submit:active { transform:translateY(1px); }
.modal.msn-window .login-form .msn-btn.login-submit:disabled { opacity:.6; cursor:progress; transform:none; }
.modal.msn-window .login-form .login-status { font-size:12px; min-height:16px; }
.modal.msn-window .login-form .login-status:empty { display:none; }
.modal.msn-window .login-form .alt-actions { display:flex; justify-content:space-between; align-items:center; margin-top:2px; }
.modal.msn-window .login-form .link-inline { background:none; border:none; color:#0a65d4; font-size:12px; cursor:pointer; padding:0; text-decoration:underline; }
.modal.msn-window .login-form .link-inline:hover { color:#0c74f0; }
.modal.msn-window .login-form .pw-box { position:relative; display:flex; align-items:center; }
.modal.msn-window .login-form .pw-box input { flex:1; padding-right:70px; }
.modal.msn-window .login-form .pw-box .pw-toggle { 
  position:absolute; top:0; right:0; bottom:0; 
  background:linear-gradient(180deg,#f2f7fc,#e3eef9); 
  border:1px solid #b5c6d8; 
  cursor:pointer; 
  font-size:11px; 
  padding:0 10px; 
  line-height:1; 
  color:#0a65d4; 
  border-radius:0 6px 6px 0; 
  display:inline-flex; align-items:center; justify-content:center; 
  gap:4px; 
  transition: background .2s ease, color .2s ease, border-color .2s ease; 
}
.modal.msn-window .login-form .pw-box .pw-toggle:hover { background:linear-gradient(180deg,#ffffff,#eef5fb); color:#084b94; }
.modal.msn-window .login-form .pw-box .pw-toggle:active { background:#d9e8f5; }
.modal.msn-window .login-form .pw-box .pw-toggle:focus-visible { outline:2px solid #0a65d4; outline-offset:2px; }
@media (max-width:520px){
  .modal.msn-window .login-root { padding:12px 12px 16px; }
  .modal.msn-window .login-form .msn-btn.login-submit { min-width:120px; }
}

/* ================= Responsive Enhancements (all modals) ================= */
/* Generic: allow body to scroll inside if content taller than viewport */
.modal { max-height: 96vh; display:flex; flex-direction:column; }
.modal .modal-body { overflow:auto; }

/* Extremely narrow screens: stretch edge-to-edge for usability */
@media (max-width: 360px) {
  .modal:not(.pdf-fullscreen):not(.menu-fullscreen) { width:100vw; max-width:100vw; border-radius:0; }
  .modal.msn-window { width:100vw; max-width:100vw; border-radius:0; }
  .modal.msn-window .modal-body { max-height: calc(100vh - 46px); }
}

/* Very small height (landscape phones): compress vertical chrome */
@media (max-height: 520px) {
  .modal.msn-window { font-size:12px; }
  .modal.msn-window .modal-header { padding:4px 6px; }
  .modal.msn-window .modal-body { padding:10px 12px; }
  .modal.msn-window .login-root { padding:10px 12px 14px; }
  .modal.msn-window .msn-form input, 
  .modal.msn-window .msn-form textarea { padding:6px 8px; font-size:13px; }
  .modal.msn-window .msn-form .msn-btn { padding:6px 10px; font-size:13px; }
}

/* Ultra small height: go full height minus safe areas */
@media (max-height: 440px) {
  .modal.msn-window { height:100vh; max-height:100vh; top:0 !important; left:0 !important; }
  .modal.msn-window .modal-body { max-height: calc(100vh - 42px); }
}

/* Respect safe-area on notched devices */
@supports(padding:max(env(safe-area-inset-bottom),0px)) {
  .modal.msn-window .modal-body { padding-bottom: calc( max(env(safe-area-inset-bottom), 16px) ); }
  .modal.pdf-fullscreen .modal-body { padding-bottom: env(safe-area-inset-bottom); }
}

/* Reduce motion users: avoid subtle scale jumps on focus outlines etc. */
@media (prefers-reduced-motion: reduce) {
  .modal .modal-body, .modal { scroll-behavior: auto; }
}

/* Improve scroll aesthetics (WebKit) */
.modal .modal-body::-webkit-scrollbar { width:10px; }
.modal .modal-body::-webkit-scrollbar-track { background:transparent; }
.modal .modal-body::-webkit-scrollbar-thumb { background: #c9c9c9; border-radius:6px; border:2px solid #f4f2ea; }
.modal .modal-body::-webkit-scrollbar-thumb:hover { background:#b2b2b2; }

/* Drag ghost feedback (optional subtle) */
.msn-dragging { opacity: .92; cursor: grabbing !important; }

/* MSN style form (used by contact) */
.modal.msn-window .msn-form { display: grid; gap: 10px; }
.modal.msn-window .msn-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal.msn-window .msn-form .field label { display:block; font-size:12px; color:#222; margin: 4px 0; }
.modal.msn-window .msn-form input[type="text"],
.modal.msn-window .msn-form input[type="email"],
.modal.msn-window .msn-form input[type="tel"],
.modal.msn-window .msn-form textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #cfcfcf;
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
  background: #fff;
}
/* Force Arial on all modal form controls (covers Contact textarea specifically) */
.modal .msn-form input,
.modal .msn-form textarea,
.modal.msn-window .msn-form input,
.modal.msn-window .msn-form textarea { font-family: Arial, sans-serif; }
.modal.msn-window .msn-form textarea { min-height: 110px; }
.modal.msn-window .msn-form .form-actions { display:flex; justify-content: flex-end; }
.modal.msn-window .msn-btn { padding: 8px 14px; border-radius: 6px; border: 1px solid #b5b2a8; cursor: pointer; font-size: 14px; }
.modal.msn-window .msn-btn--primary { background: #0a65d4; color: #fff; border-color:#0a65d4; }
@media (max-width: 520px){
  .modal.msn-window .msn-form .row { grid-template-columns: 1fr; }
}

/* MSN Archives list */
.modal.msn-window .archives-root { display:flex; flex-direction:column; gap:10px; }
.modal.msn-window .archives-status { font-size: 12px; color:#333; }
.modal.msn-window .archives-list { display:grid; grid-template-columns: 1fr; gap:10px; }
.modal.msn-window .archive-item { display:flex; gap:12px; align-items:center; padding:8px; background:#fff; border:1px solid #b5b2a8; border-radius:6px; cursor: pointer; transition: background .2s ease, border-color .2s ease; }
.modal.msn-window .archive-item:hover { background:#f7f7f7; border-color:#9aa7b6; }
.modal.msn-window .archive-thumb { width:68px; height:68px; border-radius:6px; overflow:hidden; background:#eee; display:flex; align-items:center; justify-content:center; flex:0 0 auto; }
.modal.msn-window .archive-thumb img { width:100%; height:100%; object-fit:cover; object-position:center; display:block; }
.modal.msn-window .archive-meta { display:flex; flex-direction:column; gap:6px; min-width:0; }
.modal.msn-window .archive-title { font-weight:600; color:#222; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size: 16px; }
.modal.msn-window .archive-date { font-size:13px; color:#666; }
.modal.msn-window .archives-status { font-size: 13px; }

@media (max-width: 820px){
  .modal.msn-window.msn-wide { width: 92vw; }
}

/* Staggered appearance for Archives list items (Archives only) */
.modal.msn-window .archives-list.play-stagger .archive-item.appear {
  opacity: 0;
  transform: translateY(8px);
  animation: archItemIn 250ms ease-out forwards;
}
@keyframes archItemIn {
  to { opacity: 1; transform: translateY(0); }
}

/* Mobile responsiveness for archives modal */
@media (max-width: 520px){
  .modal.msn-window.msn-wide { width: 92vw; max-width: 92vw; border-radius: 8px; }
  .modal.msn-window .archive-thumb { width: 56px; height: 56px; }
  .modal.msn-window .archive-item { padding: 8px; }
  .modal.msn-window .archive-title {
    font-size: 15px;
    white-space: normal;
    line-clamp: 2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}
