:root {
  --cv-stone: #3e4a58;
  --cv-stone-light: #4f5d6d;
  --cv-stone-dark: #2b3545;
  --cv-silver: #a0aab8;
  --cv-silver-light: #c0c8d4;
  --cv-silver-soft: rgba(160,170,184,0.3);
  --cv-accent: #8a9bb0;
  --cv-gold: #a0aab8;
  --cv-gold-soft: rgba(160,170,184,0.3);
  --cv-text: #d0d4da;
  --cv-text-muted: #7a8490;
  --cv-bg: #1c2535;
  --cv-frame-border: #5a6878;
  --cv-recess: #1a1e28;
}

/* ============ COLOMBARIUM CONTAINER — flex layout ============ */
#colombarium-app{
  position:relative;
  width:100%;
  height:calc(100vh - 80px);
  overflow:hidden;
  background:var(--cv-bg);
  font-family:'Georgia','Times New Roman',serif;
  color:var(--cv-text);
  box-sizing:border-box;
  display:flex;
  flex-direction:row;
}
#colombarium-app *, #colombarium-app *::before, #colombarium-app *::after{
  box-sizing:border-box;
}

/* Main area takes remaining space */
#cv-main{
  flex:1;
  position:relative;
  overflow:hidden;
  min-width:0;
}

/* ============ SIDEBAR PANEL ============ */
#cv-panel{
  width:320px;
  flex-shrink:0;
  background:linear-gradient(180deg, #cbd5dd 0%, #bcc8d2 50%, #cbd5dd 100%);
  border-left:1px solid rgba(60,70,80,0.15);
  color:#2b3545;
  display:flex;
  flex-direction:column;
  overflow-y:auto;
  overflow-x:hidden;
  scrollbar-width:thin;
  scrollbar-color:rgba(60,70,80,0.2) transparent;
  z-index:100;
  font-size:16px;
}
#cv-panel::-webkit-scrollbar{width:4px}
#cv-panel::-webkit-scrollbar-thumb{background:rgba(60,70,80,0.2);border-radius:4px}

/* Panel blocks — separated by subtle lines */
.cv-panel-block{
  padding:18px 20px;
  border-bottom:1px solid rgba(60,70,80,0.1);
}
.cv-panel-block:last-child{
  border-bottom:none;
  flex:1;
}

/* Block labels */
.cv-panel-label{
  font-size:13px;
  letter-spacing:2px;
  text-transform:uppercase;
  color:#1c2535;
  font-weight:600;
  margin-bottom:12px;
  display:flex;
  align-items:center;
  gap:8px;
}

/* --- Bloc 1: Header --- */
.cv-panel-header{
  display:flex;
  align-items:center;
  gap:12px;
  padding:16px 20px;
}
.cv-panel-logo{
  flex-shrink:0;
}
.cv-panel-brand{
  display:flex;
  flex-direction:column;
}
.cv-panel-brand-name{
  font-size:16px;
  letter-spacing:3px;
  color:#1c2535;
  font-weight:600;
}
.cv-panel-brand-sub{
  font-size:13px;
  color:#5a6878;
  font-style:italic;
}

/* --- Bloc 2: Breadcrumb --- */
.cv-panel-breadcrumbs{
  display:flex;
  flex-wrap:wrap;
  gap:4px;
  align-items:center;
}
.cv-panel-crumb{
  background:none;
  border:none;
  color:#5a6878;
  cursor:pointer;
  font-family:inherit;
  font-size:16px;
  padding:6px 4px;
  transition:color 0.3s;
}
.cv-panel-crumb:hover{
  color:#1c2535;
}
.cv-panel-crumb.active{
  color:#1c2535;
  font-weight:600;
}
.cv-panel-crumb + .cv-panel-crumb::before{
  content:'›';
  margin-right:6px;
  color:#8a9bb0;
  font-weight:300;
}

/* --- Bloc 3: Identity --- */
.cv-panel-user{
  display:flex;
  align-items:center;
  gap:12px;
}
.cv-panel-avatar{
  width:48px;
  height:48px;
  border-radius:50%;
  border:2px solid rgba(160,170,184,0.2);
}
.cv-panel-user-info{
  display:flex;
  flex-direction:column;
}
.cv-panel-user-name{
  font-size:17px;
  color:#1c2535;
  font-weight:500;
}
.cv-panel-user-link{
  font-size:14px;
  color:#3a6d9e;
  text-decoration:none;
}
.cv-panel-user-link:hover{
  text-decoration:underline;
}

/* Auth buttons (logged out) */
.cv-panel-auth{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.cv-panel-btn{
  display:flex;
  align-items:center;
  gap:10px;
  padding:14px 16px;
  border-radius:10px;
  font-size:16px;
  font-family:inherit;
  text-decoration:none;
  cursor:pointer;
  border:none;
  transition:all 0.3s;
  min-height:50px;
}
.cv-panel-btn-icon{
  font-size:22px;
  flex-shrink:0;
  width:28px;
  text-align:center;
}
.cv-panel-btn-primary{
  background:#1c2535;
  color:#e8ecf0;
  border:1px solid #2b3545;
}
.cv-panel-btn-primary:hover{
  background:#2b3545;
  border-color:#3e4a58;
}
.cv-panel-btn-secondary{
  background:rgba(255,255,255,0.5);
  color:#2b3545;
  border:1px solid rgba(60,70,80,0.15);
}
.cv-panel-btn-secondary:hover{
  background:rgba(255,255,255,0.8);
  color:#1c2535;
}

/* Help bubble */
.cv-panel-help-bubble{
  font-size:14px;
  color:#5a6878;
  font-style:italic;
  line-height:1.5;
  padding:10px 14px;
  background:rgba(255,255,255,0.4);
  border-radius:8px;
  border-left:3px solid #8a9bb0;
}

/* --- Bloc 4: Network buttons --- */
.cv-panel-btn-network{
  background:rgba(255,255,255,0.5);
  color:#2b3545;
  border:1px solid rgba(60,70,80,0.12);
  margin-bottom:8px;
  position:relative;
}
.cv-panel-btn-network:last-child{
  margin-bottom:0;
}
.cv-panel-btn-network:hover{
  background:rgba(255,255,255,0.8);
  border-color:rgba(60,70,80,0.25);
  color:#1c2535;
}

/* Tooltip on hover/focus */
.cv-panel-btn-network[data-tooltip]:hover::after,
.cv-panel-btn-network[data-tooltip]:focus::after{
  content:attr(data-tooltip);
  position:absolute;
  left:50%;
  transform:translateX(-50%);
  bottom:calc(100% + 8px);
  background:#1c2535;
  color:#e8ecf0;
  font-size:13px;
  padding:8px 12px;
  border-radius:8px;
  border:1px solid rgba(160,170,184,0.2);
  white-space:normal;
  width:220px;
  text-align:center;
  z-index:200;
  pointer-events:none;
  line-height:1.4;
  box-shadow:0 4px 16px rgba(0,0,0,0.3);
}

/* --- Bloc 5: Info contextuelle --- */
.cv-panel-info-text{
  font-size:15px;
  color:#4a5568;
  line-height:1.6;
  font-style:italic;
}

/* --- Bloc 6: Formulaire condoléance --- */
.cv-condoleance-form{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.cv-condoleance-textarea{
  width:100%;
  padding:12px;
  border:1px solid rgba(28,37,53,0.2);
  border-radius:8px;
  font-family:inherit;
  font-size:16px;
  color:#0d1520;
  background:rgba(255,255,255,0.6);
  resize:vertical;
  min-height:80px;
  line-height:1.5;
}
.cv-condoleance-textarea:focus{
  outline:none;
  border-color:#1c2535;
  background:rgba(255,255,255,0.9);
}
.cv-condoleance-textarea::placeholder{
  color:#7a8a9e;
  font-style:italic;
}
.cv-condoleance-row{
  display:flex;
  gap:8px;
  align-items:stretch;
}
.cv-condoleance-select{
  flex:1;
  padding:10px 12px;
  border:1px solid rgba(28,37,53,0.2);
  border-radius:8px;
  font-family:inherit;
  font-size:15px;
  color:#1c2535;
  background:rgba(255,255,255,0.6);
  cursor:pointer;
}
.cv-condoleance-select:focus{
  outline:none;
  border-color:#1c2535;
}
.cv-condoleance-submit{
  white-space:nowrap;
  min-height:44px !important;
  padding:10px 18px !important;
}
.cv-condoleance-feedback{
  font-size:15px;
  line-height:1.4;
  padding:8px 12px;
  border-radius:8px;
  display:none;
}
.cv-condoleance-feedback.success{
  display:block;
  background:rgba(46,204,113,0.15);
  color:#1a7a42;
  border:1px solid rgba(46,204,113,0.3);
}
.cv-condoleance-feedback.error{
  display:block;
  background:rgba(231,76,60,0.15);
  color:#a93226;
  border:1px solid rgba(231,76,60,0.3);
}
.cv-condoleance-login{
  margin:0;
}

/* --- Bloc 7: Live feed in panel --- */
.cv-panel-feed{
  display:flex;
  flex-direction:column;
  min-height:0;
}
.cv-panel-feed .cv-feed-messages{
  flex:1;
  overflow-y:auto;
  max-height:60vh;
  scrollbar-width:thin;
  scrollbar-color:rgba(60,70,80,0.15) transparent;
}

/* Feed pulse indicator */
.cv-feed-pulse{
  width:8px;
  height:8px;
  background:#e74c3c;
  border-radius:50%;
  animation:cvPulse 2s infinite;
  flex-shrink:0;
}
@keyframes cvPulse{
  0%,100%{opacity:1;transform:scale(1)}
  50%{opacity:0.5;transform:scale(1.3)}
}

/* Feed messages */
.cv-feed-msg{
  display:flex;
  gap:12px;
  padding:12px 0;
  border-bottom:1px solid rgba(28,37,53,0.15);
  animation:cvFeedIn 0.5s ease;
}
.cv-feed-msg:last-child{border-bottom:none}
@keyframes cvFeedIn{
  from{opacity:0;transform:translateY(10px)}
  to{opacity:1;transform:translateY(0)}
}
.cv-feed-msg-exit{
  opacity:0;
  transform:translateY(-10px);
  transition:all 0.4s;
}
.cv-feed-msg-avatar{
  width:40px;
  height:40px;
  border-radius:50%;
  background:#1c2535;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:15px;
  color:#e8ecf0;
  flex-shrink:0;
  font-weight:700;
}
.cv-feed-msg-content{
  flex:1;
  min-width:0;
}
.cv-feed-msg-top{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  align-items:baseline;
}
.cv-feed-msg-author{
  font-size:16px;
  color:#0d1520;
  font-weight:700;
}
.cv-feed-msg-for{
  font-size:15px;
  color:#1c2535;
  font-weight:500;
}
.cv-feed-msg-text{
  font-size:16px;
  color:#0d1520;
  line-height:1.5;
  margin-top:4px;
  overflow:hidden;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
}

/* Mobile toggle button — hidden on desktop */
.cv-panel-toggle{
  display:none;
}

/* ============ MOBILE — drawer from bottom ============ */
@media(max-width:768px){
  #colombarium-app{
    flex-direction:column;
  }
  #cv-main{
    flex:1;
    height:100%;
  }
  #cv-panel{
    position:fixed;
    bottom:0;
    left:0;
    right:0;
    width:100%;
    max-height:65vh;
    border-left:none;
    border-top:1px solid rgba(60,70,80,0.15);
    border-radius:20px 20px 0 0;
    transform:translateY(100%);
    transition:transform 0.4s cubic-bezier(0.22,1,0.36,1);
    z-index:500;
    box-shadow:0 -8px 40px rgba(0,0,0,0.5);
  }
  #cv-panel.open{
    transform:translateY(0);
  }
  /* Drag handle */
  #cv-panel::before{
    content:'';
    display:block;
    width:40px;
    height:4px;
    background:rgba(60,70,80,0.25);
    border-radius:4px;
    margin:10px auto 6px;
    flex-shrink:0;
  }
  /* Toggle button visible on mobile */
  .cv-panel-toggle{
    display:flex;
    align-items:center;
    gap:8px;
    position:fixed;
    bottom:20px;
    right:20px;
    z-index:400;
    background:rgba(28,37,53,0.92);
    color:var(--cv-silver-light);
    border:1px solid rgba(160,170,184,0.2);
    border-radius:50px;
    padding:14px 22px;
    font-family:inherit;
    font-size:17px;
    cursor:pointer;
    box-shadow:0 4px 20px rgba(0,0,0,0.4);
    backdrop-filter:blur(10px);
    -webkit-backdrop-filter:blur(10px);
    transition:all 0.3s;
  }
  .cv-panel-toggle:hover,
  .cv-panel-toggle:active{
    background:rgba(28,37,53,0.98);
    border-color:rgba(160,170,184,0.35);
  }
  .cv-panel-toggle.active{
    background:rgba(160,170,184,0.15);
  }
  .cv-panel-toggle-icon{
    font-size:22px;
  }
  /* Overlay when panel open */
  #cv-panel-overlay{
    display:none;
    position:fixed;
    inset:0;
    background:rgba(0,0,0,0.4);
    z-index:450;
  }
  #cv-panel-overlay.active{
    display:block;
  }
  /* Bigger touch targets on mobile */
  .cv-panel-btn{
    min-height:56px;
    font-size:17px;
    padding:16px 18px;
  }
  .cv-panel-crumb{
    font-size:17px;
    padding:8px 6px;
  }
  .cv-panel-feed .cv-feed-messages{
    max-height:200px;
  }
}

/* ============ LOADING ============ */
#cv-loading{
  position:absolute;
  inset:0;
  background:linear-gradient(160deg,#1c2535 0%,#253040 40%,#2a3648 70%,#1c2535 100%);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  z-index:3000;
  transition:opacity 1.5s;
}
#cv-loading.hide{
  opacity:0;
  pointer-events:none;
}
#cv-loading .logo-loading{
  width:120px;
  height:auto;
  margin-bottom:20px;
  opacity:0.85;
  filter:drop-shadow(0 0 20px rgba(160,170,184,0.2));
}
#cv-loading h1{
  color:var(--cv-silver-light);
  font-size:1.6em;
  letter-spacing:4px;
  font-weight:400;
}
#cv-loading p{
  color:var(--cv-text-muted);
  font-size:0.85em;
  margin-top:8px;
  font-style:italic;
}
.cv-load-bar{
  width:180px;
  height:2px;
  background:rgba(160,170,184,0.12);
  margin-top:30px;
  border-radius:2px;
  overflow:hidden;
}
.cv-load-fill{
  height:100%;
  background:linear-gradient(90deg,var(--cv-accent),var(--cv-silver-light));
  animation:cvLoadA 2s ease forwards;
}
@keyframes cvLoadA{
  from{width:0}
  to{width:100%}
}

/* ============ NAVIGATION (legacy — now in panel sidebar) ============ */
#cv-nav-bar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:10px 20px;
  background:linear-gradient(180deg,rgba(20,28,40,0.97) 0%,rgba(30,40,55,0.95) 100%);
  border-bottom:1px solid rgba(160,170,184,0.12);
  position:absolute;
  top:0;
  left:0;
  right:0;
  z-index:300;
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  min-height:48px;
}
.cv-nav-brand{
  display:flex;
  align-items:center;
  gap:10px;
  color:var(--cv-silver-light);
  font-size:1em;
  letter-spacing:2px;
  font-weight:400;
  text-decoration:none;
  transition:color 0.3s;
}
.cv-nav-brand:hover{
  color:var(--cv-gold);
  text-decoration:none;
}
.cv-nav-logo{
  height:28px;
  width:auto;
  opacity:0.85;
  filter:drop-shadow(0 0 8px rgba(160,170,184,0.15));
}
.cv-nav-crumbs{
  display:flex;
  gap:4px;
  align-items:center;
  font-size:0.85em;
  color:var(--cv-text-muted);
}
.cv-nav-crumb{
  cursor:pointer;
  transition:0.3s;
  padding:5px 12px;
  border-radius:12px;
}
.cv-nav-crumb:hover,.cv-nav-crumb.active{
  color:var(--cv-gold);
  background:rgba(160,170,184,0.1);
}
.cv-nav-sep{
  opacity:0.3;
  margin:0 2px;
}
.cv-nav-home{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 14px;
  border:1px solid rgba(160,170,184,0.2);
  border-radius:10px;
  color:var(--cv-silver-light);
  font-size:0.8em;
  text-decoration:none;
  transition:all 0.3s;
  white-space:nowrap;
}
.cv-nav-home:hover{
  color:var(--cv-gold);
  border-color:var(--cv-gold);
  background:rgba(201,168,76,0.08);
  text-decoration:none;
}

/* ============ LEVEL 1 — MUR GENERAL ============ */
#cv-level1{
  position:absolute;
  top:52px;
  left:0;
  right:0;
  bottom:0;
  overflow:hidden;
  transition:opacity 0.8s,transform 0.8s;
  display:flex;
  flex-direction:column;
}
#cv-level1.exit{
  opacity:0;
  transform:scale(1.05);
}
#cv-level1.hidden{
  display:none;
}

.cv-mur-title{
  display:flex;
  align-items:center;
  justify-content:center;
  padding:50px 30px 8px;
  z-index:10;
  flex-shrink:0;
  gap:20px;
  flex-wrap:wrap;
}
.cv-mur-title-text{
  text-align:center;
}
.cv-mur-title h2{
  color:var(--cv-gold);
  font-size:1.3em;
  font-weight:400;
  letter-spacing:4px;
}
.cv-mur-title p{
  color:var(--cv-text-muted);
  font-size:0.78em;
  margin-top:4px;
}

/* Search bar */
.cv-search-wrap{
  position:relative;
  flex-shrink:0;
}
.cv-search-input{
  width:240px;
  padding:8px 34px 8px 12px;
  background:rgba(255,255,255,0.06);
  border:1px solid rgba(160,170,184,0.25);
  border-radius:20px;
  color:var(--cv-text);
  font-family:Georgia,serif;
  font-size:0.82em;
  outline:none;
  transition:border-color 0.3s,box-shadow 0.3s;
}
.cv-search-input::placeholder{
  color:var(--cv-text-muted);
  font-style:italic;
}
.cv-search-input:focus{
  border-color:var(--cv-gold);
  box-shadow:0 0 12px rgba(160,170,184,0.15);
}
.cv-search-icon{
  position:absolute;
  right:11px;
  top:50%;
  transform:translateY(-50%);
  color:var(--cv-text-muted);
  font-size:0.85em;
  pointer-events:none;
  transition:color 0.3s;
}
.cv-search-input:focus ~ .cv-search-icon{
  color:var(--cv-gold);
}
.cv-search-clear{
  position:absolute;
  right:30px;
  top:50%;
  transform:translateY(-50%);
  background:none;
  border:none;
  color:var(--cv-text-muted);
  font-size:1em;
  cursor:pointer;
  display:none;
  padding:2px 4px;
  line-height:1;
}
.cv-search-clear.visible{
  display:block;
}
.cv-search-clear:hover{
  color:var(--cv-gold);
}

/* Search results dropdown */
.cv-search-results{
  position:absolute;
  top:calc(100% + 6px);
  left:0;
  right:0;
  background:rgba(30,35,50,0.97);
  border:1px solid rgba(160,170,184,0.2);
  border-radius:10px;
  max-height:220px;
  overflow-y:auto;
  box-shadow:0 8px 30px rgba(0,0,0,0.5);
  display:none;
  z-index:600;
  scrollbar-width:thin;
  scrollbar-color:var(--cv-gold) transparent;
}
.cv-search-results.open{
  display:block;
}
.cv-search-result-item{
  padding:8px 12px;
  cursor:pointer;
  transition:background 0.2s;
  border-bottom:1px solid rgba(255,255,255,0.04);
  display:flex;
  align-items:center;
  gap:8px;
}
.cv-search-result-item:last-child{
  border-bottom:none;
}
.cv-search-result-item:hover,.cv-search-result-item.selected{
  background:rgba(160,170,184,0.1);
}
.cv-search-result-item .sr-name{
  font-size:0.8em;
  color:var(--cv-text);
  font-weight:600;
}
.cv-search-result-item .sr-dates{
  font-size:0.68em;
  color:var(--cv-text-muted);
  margin-left:auto;
  flex-shrink:0;
}
.cv-search-result-item .sr-family{
  font-size:0.65em;
  color:var(--cv-gold);
  opacity:0.7;
}
.cv-search-no-result{
  padding:14px 12px;
  text-align:center;
  font-size:0.8em;
  color:var(--cv-text-muted);
  font-style:italic;
}
.cv-search-no-result span{
  display:block;
  font-size:1.2em;
  margin-bottom:4px;
  opacity:0.5;
}

/* Highlight effect on found frame */
.cv-frame-card.cv-search-highlight{
  animation:cvHighlightPulse 2s ease;
  z-index:20;
}
.cv-frame-card.cv-search-highlight .cv-frame-outer{
  box-shadow:
    0 0 25px rgba(160,170,184,0.5),
    0 0 50px rgba(160,170,184,0.2),
    0 8px 25px rgba(0,0,0,0.6),
    inset 0 1px 0 rgba(255,255,255,0.05);
  border-color:var(--cv-gold);
}
.cv-frame-card.cv-search-highlight .cv-frame-name{
  color:var(--cv-gold);
}
.cv-frame-card.cv-search-highlight .cv-frame-photo-placeholder{
  filter:grayscale(0) brightness(1.1);
}
@keyframes cvHighlightPulse{
  0%{transform:scale(1)}
  15%{transform:scale(1.2) translateY(-5px)}
  40%{transform:scale(1.15) translateY(-3px)}
  100%{transform:scale(1)}
}

.cv-mur-scroll{
  flex:1;
  overflow-x:auto;
  overflow-y:hidden;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  padding:0 0 0 20px;
  cursor:grab;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:none;
}
.cv-mur-scroll::-webkit-scrollbar{
  display:none;
}
.cv-mur-scroll:active{
  cursor:grabbing;
}

/* The wall — full colombarium grid */
.cv-mur-wall{
  display:grid;
  grid-template-rows:repeat(var(--rows, 5), 1fr);
  grid-auto-flow:column;
  grid-auto-columns:min-content;
  gap:var(--wall-gap, 12px);
  padding:var(--wall-pad, 15px 60px 15px 30px);
  min-width:max-content;
  min-height:100%;
  align-content:center;
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,0.04) 0px, transparent 1px, transparent 148px, rgba(0,0,0,0.04) 148px),
    repeating-linear-gradient(0deg, rgba(0,0,0,0.035) 0px, transparent 1px, transparent 122px, rgba(0,0,0,0.035) 122px),
    radial-gradient(ellipse at 15% 30%, rgba(55,75,95,0.14), transparent 40%),
    radial-gradient(ellipse at 60% 70%, rgba(50,65,85,0.1), transparent 35%),
    radial-gradient(ellipse at 85% 20%, rgba(45,60,80,0.08), transparent 30%),
    radial-gradient(circle at 10% 80%, rgba(0,0,0,0.1), transparent 18%),
    radial-gradient(circle at 50% 15%, rgba(0,0,0,0.06), transparent 14%),
    radial-gradient(circle at 90% 60%, rgba(0,0,0,0.08), transparent 12%),
    linear-gradient(180deg, var(--cv-stone-dark) 0%, var(--cv-stone) 30%, var(--cv-stone) 70%, var(--cv-stone-dark) 100%);
  box-shadow:inset 0 6px 40px rgba(0,0,0,0.4),inset 0 -6px 40px rgba(0,0,0,0.4);
  position:relative;
}

/* Granite / stone grain texture overlay — STRONG */
.cv-mur-wall::before{
  content:'';
  position:absolute;
  inset:0;
  z-index:0;
  pointer-events:none;
  filter:url(#cv-grain);
  background:
    repeating-conic-gradient(rgba(140,150,165,0.1) 0% 25%, transparent 0% 50%) 0 0 / 3px 3px,
    repeating-conic-gradient(rgba(0,0,0,0.12) 0% 25%, transparent 0% 50%) 1px 1px / 3px 3px,
    repeating-conic-gradient(rgba(100,110,130,0.07) 0% 25%, transparent 0% 50%) 0 0 / 7px 7px,
    radial-gradient(circle at 20% 50%, rgba(80,90,100,0.12), transparent 30%),
    radial-gradient(circle at 75% 25%, rgba(60,70,85,0.1), transparent 25%),
    radial-gradient(circle at 50% 80%, rgba(45,55,70,0.1), transparent 20%);
  opacity:1;
  mix-blend-mode:overlay;
}
/* Second grain layer for finer detail — visible */
.cv-mur-wall::after{
  content:'';
  position:absolute;
  inset:0;
  z-index:0;
  pointer-events:none;
  filter:url(#cv-grain-fine);
  background:
    repeating-conic-gradient(rgba(180,190,200,0.08) 0% 25%, transparent 0% 50%) 0 0 / 2px 2px,
    repeating-conic-gradient(rgba(0,0,0,0.1) 0% 25%, transparent 0% 50%) 1px 1px / 2px 2px;
  opacity:1;
  mix-blend-mode:hard-light;
}
/* Ensure frame cards sit above grain */
.cv-frame-card{
  z-index:1;
  position:relative;
}

/* Frame card — compact carte postale style */
.cv-frame-card{
  width:120px;
  position:relative;
  cursor:pointer;
  transition:transform 0.4s ease, box-shadow 0.4s ease;
}
.cv-frame-card:hover{
  transform:scale(1.12) translateY(-3px);
  z-index:10;
}
.cv-frame-card:hover .cv-frame-photo-placeholder{
  filter:grayscale(0) brightness(1.05);
}
.cv-frame-card:hover .cv-frame-glow{
  opacity:1;
}
.cv-frame-card:hover .cv-frame-name{
  color:var(--cv-gold);
}
.cv-frame-card:hover .cv-frame-outer{
  box-shadow:
    0 8px 25px rgba(0,0,0,0.6),
    0 0 15px rgba(160,170,184,0.12),
    inset 0 1px 0 rgba(255,255,255,0.05);
  border-color:rgba(160,170,184,0.35);
}

/* Outer frame — the full card with shadow for relief */
.cv-frame-outer{
  background:
    repeating-conic-gradient(rgba(160,170,185,0.12) 0% 25%, transparent 0% 50%) 0 0 / 2px 2px,
    repeating-conic-gradient(rgba(0,0,0,0.14) 0% 25%, transparent 0% 50%) 1px 1px / 2px 2px,
    repeating-conic-gradient(rgba(130,140,155,0.08) 0% 25%, transparent 0% 50%) 0 0 / 5px 5px,
    linear-gradient(145deg, #4a5565 0%, #3a4450 50%, #2e3845 100%);
  border:2px solid var(--cv-frame-border);
  border-radius:5px;
  padding:7px 7px 5px 7px;
  box-shadow:
    0 4px 12px rgba(0,0,0,0.5),
    0 1px 3px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.04),
    inset 0 -1px 0 rgba(0,0,0,0.2);
  transition:box-shadow 0.4s, border-color 0.4s;
  position:relative;
}

/* Inner recess where the photo sits */
.cv-frame-recess{
  background:var(--cv-recess);
  border:1px solid rgba(0,0,0,0.4);
  border-radius:2px;
  padding:3px;
  box-shadow:inset 0 2px 6px rgba(0,0,0,0.5),inset 0 -1px 3px rgba(0,0,0,0.2);
  overflow:hidden;
}

/* Photo — carte postale aspect ratio */
.cv-frame-photo-placeholder{
  width:100%;
  aspect-ratio:1/1;
  border-radius:1px;
  filter:grayscale(1) brightness(0.75);
  transition:filter 0.5s ease;
}

.cv-frame-glow{
  position:absolute;
  inset:-12px;
  border-radius:10px;
  background:radial-gradient(ellipse,rgba(160,170,184,0.1),transparent 70%);
  opacity:0;
  transition:opacity 0.4s;
  pointer-events:none;
  z-index:-1;
}

/* Name plate under the photo, inside the outer frame */
.cv-frame-plate{
  text-align:center;
  padding:4px 3px 2px;
}
.cv-frame-name{
  font-size:0.62em;
  color:var(--cv-text);
  transition:color 0.3s;
  font-weight:600;
  line-height:1.2;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.cv-frame-dates{
  font-size:0.5em;
  color:var(--cv-text-muted);
  margin-top:1px;
}

/* Scroll hint */
.cv-scroll-hint{
  position:absolute;
  bottom:18px;
  left:50%;
  transform:translateX(-50%);
  color:var(--cv-text-muted);
  font-size:0.78em;
  display:flex;
  align-items:center;
  gap:8px;
  opacity:0.6;
  animation:cvHintPulse 2s ease infinite;
  pointer-events:none;
}
@keyframes cvHintPulse{
  0%,100%{opacity:0.4}
  50%{opacity:0.8}
}

/* ============ LEVEL 2 — CHAMBRE FAMILIALE ============ */
#cv-level2{
  position:absolute;
  top:52px;
  left:0;
  right:0;
  bottom:0;
  display:none;
  opacity:0;
  transition:opacity 0.8s,transform 0.8s;
  transform:scale(0.95);
  overflow-y:auto;
  background:linear-gradient(180deg, #1c2535 0%, #232d3f 50%, #1c2535 100%);
}
#cv-level2.show{
  display:block;
  padding:0;
}
#cv-level2.visible{
  opacity:1;
  transform:scale(1);
}

.cv-chambre{
  flex:0 0 auto;
  max-width:1100px;
  width:95%;
  margin:0 auto 40px;
  /* Same stone background + grain as the memorial wall */
  background:
    repeating-conic-gradient(rgba(140,150,165,0.1) 0% 25%, transparent 0% 50%) 0 0 / 3px 3px,
    repeating-conic-gradient(rgba(0,0,0,0.12) 0% 25%, transparent 0% 50%) 1px 1px / 3px 3px,
    repeating-conic-gradient(rgba(100,110,130,0.07) 0% 25%, transparent 0% 50%) 0 0 / 7px 7px,
    repeating-linear-gradient(90deg, rgba(0,0,0,0.03) 0px, transparent 1px, transparent 148px, rgba(0,0,0,0.03) 148px),
    repeating-linear-gradient(0deg, rgba(0,0,0,0.025) 0px, transparent 1px, transparent 122px, rgba(0,0,0,0.025) 122px),
    radial-gradient(ellipse at 15% 30%, rgba(55,75,95,0.12), transparent 40%),
    radial-gradient(ellipse at 70% 70%, rgba(50,65,85,0.1), transparent 35%),
    radial-gradient(ellipse at 85% 20%, rgba(45,60,80,0.08), transparent 30%),
    linear-gradient(180deg, var(--cv-stone-dark) 0%, var(--cv-stone) 30%, var(--cv-stone) 70%, var(--cv-stone-dark) 100%);
  border:1px solid rgba(90,101,117,0.3);
  border-radius:16px;
  padding:16px 30px 30px;
  position:relative;
  overflow:visible;
  box-shadow:0 20px 60px rgba(0,0,0,0.5),inset 0 6px 30px rgba(0,0,0,0.3),inset 0 -6px 30px rgba(0,0,0,0.3);
}
/* Grain overlay on chambre */
.cv-chambre::before{
  content:'';
  position:absolute;
  inset:0;
  z-index:0;
  pointer-events:none;
  border-radius:16px;
  filter:url(#cv-grain);
  background:
    repeating-conic-gradient(rgba(140,150,165,0.1) 0% 25%, transparent 0% 50%) 0 0 / 3px 3px,
    repeating-conic-gradient(rgba(0,0,0,0.12) 0% 25%, transparent 0% 50%) 1px 1px / 3px 3px;
  opacity:1;
  mix-blend-mode:overlay;
}
/* Large watermark logo behind chambre */
.cv-chambre-watermark{
  position:absolute;
  top:50%;
  left:50%;
  transform:translate(-50%,-50%);
  width:320px;
  height:288px;
  opacity:0.04;
  pointer-events:none;
  z-index:0;
  filter:grayscale(1) brightness(1.8);
  overflow:hidden;
}
.cv-chambre>*{
  position:relative;
  z-index:1;
}

.cv-chambre-header{
  text-align:center;
  margin-bottom:20px;
}
.cv-chambre-header h2{
  color:var(--cv-gold);
  font-size:1.5em;
  font-weight:400;
  letter-spacing:3px;
}
.cv-chambre-header p{
  color:var(--cv-text-muted);
  font-size:0.85em;
  margin-top:6px;
}

.cv-chambre-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
  gap:25px;
  margin-bottom:30px;
}

.cv-chambre-card{
  background:rgba(0,0,0,0.25);
  border:1px solid rgba(90,101,117,0.25);
  border-radius:8px;
  padding:18px;
  text-align:center;
  cursor:pointer;
  transition:0.4s;
  position:relative;
  overflow:hidden;
}
.cv-chambre-card:hover{
  border-color:rgba(160,170,184,0.4);
  transform:translateY(-4px);
  box-shadow:0 10px 30px rgba(0,0,0,0.3);
}
.cv-chambre-card:hover .cv-ch-photo{
  filter:grayscale(0) brightness(1.05);
}
.cv-chambre-card:hover .cv-ch-name{
  color:var(--cv-gold);
}

/* Square photo frame — same style as memorial wall */
.cv-ch-photo-wrap{
  width:120px;
  height:120px;
  margin:0 auto 12px;
  overflow:hidden;
  border-radius:4px;
  position:relative;
}
.cv-ch-frame-outer{
  background:
    repeating-conic-gradient(rgba(160,170,185,0.12) 0% 25%, transparent 0% 50%) 0 0 / 2px 2px,
    repeating-conic-gradient(rgba(0,0,0,0.14) 0% 25%, transparent 0% 50%) 1px 1px / 2px 2px,
    linear-gradient(145deg, #4a5565 0%, #3a4450 50%, #2e3845 100%);
  border:2px solid var(--cv-frame-border);
  border-radius:4px;
  padding:5px;
  box-shadow:0 3px 10px rgba(0,0,0,0.5),inset 0 1px 0 rgba(255,255,255,0.04),inset 0 -1px 0 rgba(0,0,0,0.2);
  transition:box-shadow 0.4s,border-color 0.4s;
}
.cv-chambre-card:hover .cv-ch-frame-outer{
  box-shadow:0 6px 20px rgba(0,0,0,0.6),0 0 12px rgba(160,170,184,0.1),inset 0 1px 0 rgba(255,255,255,0.05);
  border-color:rgba(160,170,184,0.35);
}
.cv-ch-frame-recess{
  background:var(--cv-recess);
  border:1px solid rgba(0,0,0,0.4);
  border-radius:2px;
  padding:2px;
  box-shadow:inset 0 2px 5px rgba(0,0,0,0.5);
  overflow:hidden;
}
.cv-ch-photo{
  width:100%;
  aspect-ratio:1/1;
  display:block;
  border-radius:1px;
  filter:grayscale(0.7) brightness(0.8);
  transition:filter 0.5s;
}
.cv-ch-name{
  font-size:1.05em;
  font-weight:600;
  transition:color 0.3s;
}
.cv-ch-dates{
  font-size:0.8em;
  color:var(--cv-text-muted);
  margin-top:4px;
}
.cv-ch-epitaphe{
  font-size:0.78em;
  color:var(--cv-text-muted);
  font-style:italic;
  margin-top:8px;
  line-height:1.4;
}

/* Single family candle with total */
.cv-chambre-bougie{
  display:flex;
  flex-direction:column;
  align-items:center;
  margin-top:30px;
  gap:8px;
}
.cv-bougie-famille{
  position:relative;
  display:flex;
  flex-direction:column;
  align-items:center;
}
/* Realistic flame */
.cv-bougie-flamme{
  width:18px;
  height:42px;
  position:relative;
  margin-bottom:-6px;
  z-index:2;
  filter:drop-shadow(0 0 12px rgba(255,180,50,0.6)) drop-shadow(0 0 30px rgba(255,120,20,0.3));
}
.cv-bougie-flamme-inner,.cv-bougie-flamme-outer{
  position:absolute;
  bottom:0;
  left:50%;
  border-radius:50% 50% 50% 50% / 60% 60% 40% 40%;
}
.cv-bougie-flamme-outer{
  width:18px;
  height:42px;
  transform:translateX(-50%);
  background:radial-gradient(ellipse at 50% 80%, #ffcc33 0%, #ff9500 40%, #ff5500 70%, transparent 100%);
  animation:cvFlammeOuter 0.4s ease-in-out infinite alternate;
}
.cv-bougie-flamme-inner{
  width:8px;
  height:22px;
  transform:translateX(-50%);
  background:radial-gradient(ellipse at 50% 75%, #fff8e0 0%, #ffee88 50%, #ffcc33 100%);
  animation:cvFlammeInner 0.3s ease-in-out infinite alternate;
  z-index:1;
}
@keyframes cvFlammeOuter{
  0%{height:42px;width:18px;transform:translateX(-50%) rotate(-1.5deg)}
  100%{height:38px;width:16px;transform:translateX(-50%) rotate(1.5deg)}
}
@keyframes cvFlammeInner{
  0%{height:22px;width:8px;transform:translateX(-50%) rotate(1deg)}
  100%{height:19px;width:7px;transform:translateX(-50%) rotate(-1deg)}
}
/* Glow halo around flame */
.cv-bougie-halo{
  position:absolute;
  top:-15px;
  left:50%;
  transform:translateX(-50%);
  width:80px;
  height:80px;
  border-radius:50%;
  background:radial-gradient(circle, rgba(255,180,50,0.12) 0%, rgba(255,120,20,0.05) 40%, transparent 70%);
  pointer-events:none;
  animation:cvHaloFlick 0.5s ease-in-out infinite alternate;
}
@keyframes cvHaloFlick{
  0%{opacity:0.8;transform:translateX(-50%) scale(1)}
  100%{opacity:1;transform:translateX(-50%) scale(1.05)}
}
/* Candle body */
.cv-bougie-body{
  width:20px;
  height:44px;
  background:linear-gradient(180deg,#f5e6d0 0%,#e8d5b8 30%,#dcc8a8 100%);
  border-radius:3px 3px 2px 2px;
  position:relative;
  box-shadow:0 4px 12px rgba(0,0,0,0.3),inset -3px 0 6px rgba(0,0,0,0.08),inset 3px 0 6px rgba(255,255,255,0.15);
}
.cv-bougie-body::after{
  content:'';
  position:absolute;
  top:0;
  left:50%;
  transform:translateX(-50%);
  width:3px;
  height:6px;
  background:#333;
  border-radius:1px;
}
.cv-bougie-total{
  font-size:0.9em;
  color:var(--cv-gold);
  letter-spacing:1px;
  margin-top:4px;
}
.cv-bougie-label{
  font-size:0.72em;
  color:var(--cv-text-muted);
  font-style:italic;
}

/* ============ LEVEL 3 — ALCOVE INDIVIDUELLE ============ */
#cv-level3{
  position:absolute;
  top:52px;
  left:0;
  right:0;
  bottom:0;
  z-index:50;
  display:none;
  opacity:0;
  transition:opacity 0.8s,transform 0.8s;
  transform:scale(0.95);
  overflow-y:auto;
  overflow-x:hidden;
  background:linear-gradient(180deg,#1a2233 0%,#232f3e 40%,#1a2233 100%);
  scrollbar-width:thin;
  scrollbar-color:rgba(160,170,184,0.3) transparent;
}
#cv-level3::-webkit-scrollbar{width:6px}
#cv-level3::-webkit-scrollbar-thumb{background:rgba(160,170,184,0.3);border-radius:4px}
#cv-level3::-webkit-scrollbar-track{background:transparent}
#cv-level3.show{
  display:flex;
  flex-direction:column;
  align-items:center;
}
#cv-level3.visible{
  opacity:1;
  transform:scale(1);
}

.cv-alcove{
  max-width:800px;
  width:95%;
  margin:30px auto 40px;
  background:
    repeating-conic-gradient(rgba(140,150,165,0.08) 0% 25%, transparent 0% 50%) 0 0 / 3px 3px,
    repeating-conic-gradient(rgba(0,0,0,0.1) 0% 25%, transparent 0% 50%) 1px 1px / 3px 3px,
    radial-gradient(ellipse at 50% 0%, rgba(160,170,184,0.06), transparent 50%),
    radial-gradient(ellipse at 30% 60%, rgba(55,75,95,0.08), transparent 35%),
    linear-gradient(180deg, var(--cv-stone-dark) 0%, var(--cv-stone) 40%, var(--cv-stone) 60%, var(--cv-stone-dark) 100%);
  border:1px solid rgba(90,101,117,0.25);
  border-radius:16px;
  padding:40px;
  overflow:visible;
  position:relative;
  box-shadow:0 20px 60px rgba(0,0,0,0.5),inset 0 4px 20px rgba(0,0,0,0.3),inset 0 -4px 20px rgba(0,0,0,0.3);
}

.cv-alcove-portrait{
  width:200px;
  height:200px;
  margin:0 auto 25px;
  border-radius:8px;
  overflow:hidden;
  border:3px solid rgba(160,170,184,0.3);
  box-shadow:0 8px 30px rgba(0,0,0,0.4),0 0 40px rgba(160,170,184,0.08);
}
.cv-alcove-portrait img,.cv-alcove-portrait .alc-photo{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.cv-alcove-info{
  text-align:center;
  margin-bottom:30px;
}
.cv-alcove-info h2{
  color:var(--cv-gold);
  font-size:1.7em;
  font-weight:400;
  letter-spacing:2px;
}
.cv-alcove-info .alc-dates{
  color:var(--cv-text-muted);
  font-size:1em;
  margin-top:6px;
}
.cv-alcove-info .alc-epi{
  color:var(--cv-text);
  font-size:0.95em;
  margin-top:12px;
  font-style:italic;
  line-height:1.5;
  max-width:500px;
  margin-left:auto;
  margin-right:auto;
}

/* Bougie */
.cv-alcove-bougie{
  text-align:center;
  margin:20px 0;
}
.cv-bougie-btn{
  padding:10px 28px;
  background:linear-gradient(135deg,var(--cv-silver),#7a8a9c);
  border:none;
  border-radius:25px;
  color:#1a2030;
  font-size:0.95em;
  font-family:Georgia,serif;
  cursor:pointer;
  box-shadow:0 0 20px rgba(160,170,184,0.2);
  transition:0.3s;
}
.cv-bougie-btn:hover{
  transform:scale(1.05);
  box-shadow:0 0 30px rgba(160,170,184,0.4);
}

/* ── CAGNOTTE — Bouton tombe ── */
.cv-cagnotte-btn {
  padding: 10px 28px;
  background: linear-gradient(135deg, #e8567c, #c94b8c);
  border: none;
  border-radius: 25px;
  color: #fff;
  font-size: 0.9em;
  font-family: Georgia, serif;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(232,86,124,0.2);
  transition: 0.3s;
  margin-left: 8px;
}
.cv-cagnotte-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 30px rgba(232,86,124,0.4);
}
.cv-alcove-bougie {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

/* ── CAGNOTTE — Modal overlay ── */
.cv-cagnotte-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}
.cv-cagnotte-overlay.active { opacity: 1; }

.cv-cagnotte-dialog {
  background: linear-gradient(145deg, #1e2a3a, #2b3545);
  border: 1px solid rgba(180,160,120,0.2);
  border-radius: 16px;
  width: 90%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 28px;
  position: relative;
  color: #d4d8e0;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.cv-cagnotte-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: #7a8599;
  font-size: 24px;
  cursor: pointer;
}

.cv-cagnotte-header { text-align: center; margin-bottom: 20px; }
.cv-cagnotte-icon { font-size: 2.5em; margin-bottom: 8px; }
.cv-cagnotte-header h3 { font-family: Georgia, serif; color: #e8dcc8; margin: 0 0 10px; font-size: 1.2em; }

.cv-cagnotte-stats {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  font-size: 0.9em;
}
.cv-cagnotte-solde { font-size: 1.4em; font-weight: bold; color: #e8567c; }
.cv-cagnotte-nb { color: #7a8599; }

.cv-cagnotte-info { font-size: 0.8em; color: #7a8599; margin-bottom: 16px; text-align: center; }

.cv-cagnotte-amounts { display: flex; gap: 8px; justify-content: center; margin-bottom: 16px; flex-wrap: wrap; }
.cv-cagnotte-preset {
  padding: 8px 18px;
  border: 1px solid rgba(180,160,120,0.3);
  border-radius: 20px;
  background: transparent;
  color: #d4d8e0;
  cursor: pointer;
  font-size: 0.9em;
  transition: 0.2s;
}
.cv-cagnotte-preset:hover, .cv-cagnotte-preset.active {
  background: rgba(232,86,124,0.2);
  border-color: #e8567c;
  color: #fff;
}

.cv-cagnotte-custom { margin-bottom: 16px; }
.cv-cagnotte-custom label { display: block; font-size: 0.8em; color: #7a8599; margin-bottom: 6px; }
.cv-cagnotte-input-wrap { display: flex; align-items: center; gap: 4px; }
.cv-cagnotte-input {
  flex: 1;
  padding: 10px 14px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(180,160,120,0.2);
  border-radius: 10px;
  color: #d4d8e0;
  font-size: 1em;
}
.cv-cagnotte-currency { color: #7a8599; font-size: 1.1em; }

.cv-cagnotte-msg-wrap { margin-bottom: 16px; }
.cv-cagnotte-textarea {
  width: 100%;
  padding: 10px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(180,160,120,0.2);
  border-radius: 10px;
  color: #d4d8e0;
  font-size: 0.85em;
  resize: vertical;
  min-height: 60px;
  box-sizing: border-box;
}

.cv-cagnotte-summary {
  background: rgba(0,0,0,0.2);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 16px;
  font-size: 0.85em;
}
.cv-cagnotte-summary div { display: flex; justify-content: space-between; margin-bottom: 4px; }

.cv-cagnotte-submit {
  display: block;
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #e8567c, #c94b8c);
  border: none;
  border-radius: 25px;
  color: #fff;
  font-size: 1em;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
}
.cv-cagnotte-submit:hover:not(:disabled) { transform: scale(1.02); box-shadow: 0 4px 20px rgba(232,86,124,0.4); }
.cv-cagnotte-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.cv-cagnotte-success { text-align: center; padding: 30px 0; }
.cv-cagnotte-success-icon { font-size: 3em; margin-bottom: 12px; }
.cv-cagnotte-success-text { font-size: 1.2em; font-weight: bold; color: #e8dcc8; }
.cv-cagnotte-success-sub { color: #7a8599; margin-top: 8px; }

.cv-cagnotte-login { text-align: center; padding: 20px 0; }
.cv-cagnotte-login p { margin-bottom: 16px; }
.cv-cagnotte-login-btns { display: flex; gap: 12px; justify-content: center; }

.cv-cagnotte-donors { margin-top: 20px; border-top: 1px solid rgba(180,160,120,0.15); padding-top: 16px; }
.cv-cagnotte-donors h4 { font-family: Georgia, serif; color: #e8dcc8; margin-bottom: 12px; font-size: 0.95em; }
.cv-cagnotte-donor {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.cv-cagnotte-donor-info { display: flex; justify-content: space-between; align-items: center; font-size: 0.85em; }
.cv-cagnotte-donor-date { color: #7a8599; font-size: 0.8em; }
.cv-cagnotte-donor-amount { color: #e8567c; font-weight: bold; font-size: 0.9em; margin-top: 2px; }
.cv-cagnotte-donor-msg { font-size: 0.8em; color: #a0a8b8; font-style: italic; margin-top: 4px; }
.cv-cagnotte-empty { color: #7a8599; font-style: italic; text-align: center; font-size: 0.85em; }

/* Crédits insuffisants — écran de choix */
.cv-cagnotte-insufficient { text-align: center; padding: 16px 0; }
.cv-cagnotte-insufficient-icon { font-size: 2.5em; margin-bottom: 12px; }
.cv-cagnotte-insufficient-msg { color: #fc8181; font-size: 0.9em; margin-bottom: 12px; }
.cv-cagnotte-insufficient-btns { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.cv-cagnotte-insufficient-btn {
  display: block;
  padding: 12px 20px;
  border-radius: 25px;
  font-size: 0.95em;
  font-weight: bold;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: 0.3s;
  border: none;
}
.cv-cagnotte-btn-wallet {
  background: linear-gradient(135deg, #d4a54a, #b8922e);
  color: #1a2030;
}
.cv-cagnotte-btn-wallet:hover { transform: scale(1.02); }
.cv-cagnotte-btn-woo {
  background: linear-gradient(135deg, #4a90d4, #2e6eb8);
  color: #fff;
}
.cv-cagnotte-btn-woo:hover:not(:disabled) { transform: scale(1.02); }
.cv-cagnotte-btn-woo:disabled { opacity: 0.5; cursor: not-allowed; }

/* Galerie */
.cv-alcove-section{
  margin-top:30px;
}
.cv-alcove-section h3{
  color:var(--cv-gold);
  font-size:0.9em;
  text-transform:uppercase;
  letter-spacing:2px;
  margin-bottom:12px;
  padding-bottom:8px;
  border-bottom:1px solid rgba(160,170,184,0.15);
}

.cv-alc-gallery{
  display:flex;
  gap:10px;
  overflow-x:auto;
  padding-bottom:8px;
}
.cv-alc-gallery-item{
  flex:0 0 120px;
  height:90px;
  border-radius:6px;
  overflow:hidden;
  border:1px solid rgba(90,74,56,0.2);
  cursor:pointer;
  transition:0.3s;
}
.cv-alc-gallery-item:hover{
  border-color:rgba(160,170,184,0.4);
  transform:scale(1.05);
}
.cv-alc-gallery-item img,.cv-alc-gallery-ph{
  width:100%;
  height:100%;
  object-fit:cover;
}

/* Toggle condoléances button */
.cv-btn-toggle-condo:hover{
  background:var(--cv-gold,#c9a84c) !important;
  color:#fff !important;
}
.cv-condo-accordion{
  animation:cvCondoSlide 0.4s ease;
}
@keyframes cvCondoSlide{
  from{opacity:0;transform:translateY(-10px)}
  to{opacity:1;transform:translateY(0)}
}

/* Condoleances */
.cv-alc-messages{
  display:flex;
  flex-direction:column;
  gap:10px;
  max-height:400px;
  overflow-y:auto;
  scrollbar-width:thin;
  scrollbar-color:rgba(160,170,184,0.3) transparent;
}
.cv-alc-messages::-webkit-scrollbar{width:5px}
.cv-alc-messages::-webkit-scrollbar-thumb{background:rgba(160,170,184,0.3);border-radius:4px}
.cv-alc-messages::-webkit-scrollbar-track{background:transparent}
.cv-alc-msg{
  display:flex;
  gap:10px;
  padding:12px;
  background:rgba(255,255,255,0.03);
  border-radius:10px;
  border-left:2px solid rgba(160,170,184,0.3);
}
.cv-alc-msg-av{
  width:36px;
  height:36px;
  border-radius:50%;
  background:linear-gradient(135deg,var(--cv-gold),#8B7355);
  display:flex;
  align-items:center;
  justify-content:center;
  color:#1a0a00;
  font-weight:700;
  font-size:0.7em;
  flex-shrink:0;
}
.cv-alc-msg-body{
  flex:1;
}
.cv-alc-msg-author{
  color:var(--cv-gold);
  font-size:0.78em;
  font-weight:700;
}
.cv-alc-msg-text{
  font-size:0.82em;
  margin-top:3px;
  line-height:1.4;
  color:var(--cv-text);
}
.cv-alc-msg-time{
  font-size:0.65em;
  color:var(--cv-text-muted);
  margin-top:3px;
}

/* Produits */
/* Boutique button (replaces old product grid) */
.cv-alcove-boutique{
  text-align:center;
  padding:10px 0;
}
.cv-boutique-btn{
  display:inline-block;
  background:linear-gradient(135deg, rgba(200,180,140,0.15), rgba(200,180,140,0.08));
  border:1px solid rgba(200,180,140,0.35);
  border-radius:12px;
  padding:14px 24px;
  color:#e0d8c8;
  font-size:0.9em;
  font-weight:500;
  text-decoration:none;
  transition:all 0.3s ease;
  letter-spacing:0.3px;
}
.cv-boutique-btn:hover{
  background:linear-gradient(135deg, rgba(200,180,140,0.25), rgba(200,180,140,0.15));
  border-color:rgba(200,180,140,0.55);
  color:#f0e8d8;
  transform:translateY(-1px);
  box-shadow:0 4px 16px rgba(0,0,0,0.2);
}

/* QR section */
.cv-alc-qr{
  text-align:center;
  padding:20px;
  background:rgba(160,170,184,0.04);
  border-radius:10px;
  border:1px solid rgba(160,170,184,0.1);
}
.cv-alc-qr-box{
  width:140px;
  height:140px;
  margin:0 auto 12px;
  background:#fff;
  border-radius:10px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:10px;
  box-shadow:0 2px 12px rgba(0,0,0,0.08);
}
.cv-alc-qr-box img{
  display:block;
  width:120px !important;
  height:120px !important;
}
.cv-alc-qr-box canvas{
  display:block;
  width:120px !important;
  height:120px !important;
}
.cv-alc-qr p{
  font-size:0.8em;
  color:var(--cv-text-muted);
}

/* Condolence form */
.cv-condo-form{
  margin-top:14px;
  padding:18px;
  background:rgba(255,255,255,0.03);
  border:1px solid rgba(160,170,184,0.12);
  border-radius:12px;
}
.cv-condo-form-row{
  display:flex;
  gap:10px;
  margin-bottom:10px;
}
.cv-condo-form-row.full{
  flex-direction:column;
}
.cv-condo-input{
  flex:1;
  padding:9px 12px;
  background:rgba(255,255,255,0.12);
  border:1px solid rgba(160,170,184,0.25);
  border-radius:8px;
  color:#e8eaee;
  font-family:Georgia,serif;
  font-size:0.82em;
  outline:none;
  transition:border-color 0.3s,box-shadow 0.3s;
}
.cv-condo-input::placeholder{
  color:var(--cv-text-muted);
  font-style:italic;
}
.cv-condo-input:focus{
  border-color:var(--cv-silver);
  box-shadow:0 0 10px rgba(160,170,184,0.15);
  background:rgba(255,255,255,0.18);
}
.cv-condo-textarea{
  width:100%;
  min-height:80px;
  padding:10px 12px;
  resize:vertical;
  background:rgba(255,255,255,0.12);
  border:1px solid rgba(160,170,184,0.25);
  border-radius:8px;
  color:#e8eaee;
  font-family:Georgia,serif;
  font-size:0.82em;
  outline:none;
  transition:border-color 0.3s,box-shadow 0.3s;
  line-height:1.5;
}
.cv-condo-textarea::placeholder{
  color:var(--cv-text-muted);
  font-style:italic;
}
.cv-condo-textarea:focus{
  border-color:var(--cv-silver);
  box-shadow:0 0 10px rgba(160,170,184,0.15);
  background:rgba(255,255,255,0.18);
}
.cv-condo-submit{
  padding:10px 24px;
  background:linear-gradient(135deg,var(--cv-silver),#7a8a9c);
  border:none;
  border-radius:20px;
  color:#1c2535;
  font-family:Georgia,serif;
  font-size:0.85em;
  font-weight:600;
  cursor:pointer;
  transition:0.3s;
  letter-spacing:0.5px;
  display:flex;
  align-items:center;
  gap:6px;
  margin-top:4px;
}
.cv-condo-submit:hover{
  transform:scale(1.03);
  box-shadow:0 4px 15px rgba(160,170,184,0.25);
}
.cv-condo-submit:active{
  transform:scale(0.98);
}
.cv-condo-success{
  display:none;
  text-align:center;
  padding:16px;
  animation:cvCondoSuccessIn 0.5s ease both;
}
.cv-condo-success.show{
  display:block;
}
.cv-condo-success-icon{
  font-size:2em;
  margin-bottom:6px;
}
.cv-condo-success-text{
  font-size:0.85em;
  color:var(--cv-silver-light);
}
.cv-condo-success-sub{
  font-size:0.72em;
  color:var(--cv-text-muted);
  margin-top:4px;
  font-style:italic;
}
@keyframes cvCondoSuccessIn{
  from{opacity:0;transform:translateY(10px)}
  to{opacity:1;transform:translateY(0)}
}

/* New message animation */
.cv-alc-msg-new{
  border-left-color:var(--cv-silver);
  background:rgba(160,170,184,0.06);
  animation:cvNewMsgGlow 2s ease both;
}
@keyframes cvNewMsgGlow{
  0%{box-shadow:0 0 15px rgba(160,170,184,0.2)}
  100%{box-shadow:none}
}

/* ============ LIVE FEED POPUP — chatbot style bottom-left ============ */
/* Legacy popup feed — now integrated into panel sidebar */
#cv-live-feed{
  display:none !important;
  transform-origin:bottom left;
}
#cv-live-feed.minimized{
  max-height:42px;
  border-radius:21px;
  width:auto;
  cursor:pointer;
}
#cv-live-feed.minimized .feed-body,
#cv-live-feed.minimized .feed-header-minimize{
  display:none;
}

.cv-feed-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:10px 14px;
  border-bottom:1px solid rgba(160,170,184,0.1);
  flex-shrink:0;
}
.cv-feed-header-left{
  display:flex;
  align-items:center;
  gap:8px;
}
.cv-feed-pulse{
  width:8px;
  height:8px;
  border-radius:50%;
  background:#6bbd6b;
  box-shadow:0 0 6px rgba(107,189,107,0.5);
  animation:cvFeedPulse 2s ease infinite;
}
@keyframes cvFeedPulse{
  0%,100%{opacity:0.6;transform:scale(0.9)}
  50%{opacity:1;transform:scale(1.1)}
}
.cv-feed-title{
  font-size:0.75em;
  color:var(--cv-silver-light);
  letter-spacing:1px;
  font-weight:600;
}
.cv-feed-header-minimize{
  background:none;
  border:none;
  color:var(--cv-text-muted);
  cursor:pointer;
  font-size:1.1em;
  padding:2px 4px;
  transition:color 0.3s;
  line-height:1;
}
.cv-feed-header-minimize:hover{
  color:var(--cv-silver-light);
}

.cv-feed-body{
  flex:1;
  overflow:hidden;
  position:relative;
  padding:8px 0;
}
.cv-feed-messages{
  display:flex;
  flex-direction:column;
  gap:6px;
  padding:0 12px;
  transition:transform 0.6s ease;
}

/* Individual feed message */
.cv-feed-msg{
  display:flex;
  gap:8px;
  align-items:flex-start;
  padding:8px 10px;
  border-radius:10px;
  background:rgba(255,255,255,0.03);
  border-left:2px solid rgba(160,170,184,0.2);
  animation:cvFeedMsgIn 0.5s ease both;
  position:relative;
  overflow:visible;
}
@keyframes cvFeedMsgIn{
  from{opacity:0;transform:translateY(20px) scale(0.95)}
  to{opacity:1;transform:translateY(0) scale(1)}
}
.cv-feed-msg-exit{
  animation:cvFeedMsgOut 0.4s ease both;
}
@keyframes cvFeedMsgOut{
  to{opacity:0;transform:translateY(-15px) scale(0.95)}
}
.cv-feed-msg-avatar{
  width:28px;
  height:28px;
  border-radius:50%;
  flex-shrink:0;
  background:linear-gradient(135deg,var(--cv-silver),#6a7a8c);
  display:flex;
  align-items:center;
  justify-content:center;
  color:#1c2535;
  font-size:0.6em;
  font-weight:700;
}
.cv-feed-msg-content{
  flex:1;
  min-width:0;
}
.cv-feed-msg-top{
  display:flex;
  align-items:baseline;
  gap:6px;
  margin-bottom:2px;
}
.cv-feed-msg-author{
  font-size:0.7em;
  color:var(--cv-silver-light);
  font-weight:600;
  white-space:nowrap;
}
.cv-feed-msg-for{
  font-size:0.6em;
  color:var(--cv-text-muted);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.cv-feed-msg-text{
  font-size:0.72em;
  color:var(--cv-text);
  line-height:1.35;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

/* Floating hearts */
.cv-feed-heart{
  position:absolute;
  font-size:0.9em;
  pointer-events:none;
  z-index:900;
  animation:cvHeartFloat 3s ease-out forwards;
}
@keyframes cvHeartFloat{
  0%{opacity:1;transform:translateY(0) scale(0.5) rotate(0deg)}
  20%{opacity:1;transform:translateY(-25px) scale(1) rotate(-8deg)}
  50%{opacity:0.8;transform:translateY(-60px) scale(1.1) rotate(5deg)}
  80%{opacity:0.4;transform:translateY(-100px) scale(0.9) rotate(-3deg)}
  100%{opacity:0;transform:translateY(-140px) scale(0.6) rotate(10deg)}
}

/* ============ TRANSITIONS ============ */
.fade-out{
  opacity:0;
  transform:scale(1.05);
  pointer-events:none;
}
.fade-in{
  opacity:1;
  transform:scale(1);
}

/* ============ RESPONSIVE ============ */

/* Large desktop (>1400px) — 5 rows, large frames */
@media(min-width:1401px){
  :root{--rows:5;--wall-gap:14px;--wall-pad:15px 60px}
  .cv-frame-card{width:130px}
  .cv-mur-title{padding-top:55px}
}

/* Desktop (1024-1400) — 5 rows, standard */
@media(min-width:1024px) and (max-width:1400px){
  :root{--rows:5;--wall-gap:10px;--wall-pad:12px 40px}
  .cv-frame-card{width:115px}
}

/* Small desktop / landscape tablet (768-1023) — 4 rows */
@media(min-width:768px) and (max-width:1023px){
  :root{--rows:4;--wall-gap:10px;--wall-pad:10px 30px}
  .cv-frame-card{width:105px}
  .cv-frame-name{font-size:0.58em}
  .cv-frame-outer{padding:6px 6px 4px}
  .cv-mur-title{padding-top:50px}
  .cv-mur-title h2{font-size:1.15em}
}

/* Tablet portrait (600-767) — 3 rows */
@media(min-width:600px) and (max-width:767px){
  :root{--rows:3;--wall-gap:10px;--wall-pad:10px 25px}
  .cv-frame-card{width:110px}
  .cv-frame-name{font-size:0.58em}
  .cv-frame-dates{font-size:0.46em}
  .cv-frame-outer{padding:5px 5px 4px}
  .cv-mur-title{padding-top:48px}
  .cv-mur-title h2{font-size:1.1em;letter-spacing:2px}
  .cv-chambre-grid{grid-template-columns:repeat(auto-fit,minmax(170px,1fr))}
}

/* Feed popup — tablet */
@media(max-width:767px){
  #cv-live-feed{width:250px;max-height:280px;bottom:15px;left:15px}
  .cv-feed-title{font-size:0.65em}
  .cv-feed-msg-text{font-size:0.68em}
  .cv-feed-msg-author{font-size:0.65em}
}

/* Large mobile (430-599) — 2 rows */
@media(min-width:430px) and (max-width:599px){
  :root{--rows:2;--wall-gap:8px;--wall-pad:8px 15px}
  .cv-frame-card{width:100px}
  .cv-frame-name{font-size:0.55em}
  .cv-frame-dates{font-size:0.42em}
  .cv-frame-outer{padding:5px 5px 3px}
  .cv-frame-recess{padding:2px}
  .cv-mur-title{padding-top:45px;gap:10px}
  .cv-mur-title h2{font-size:1em;letter-spacing:2px}
  .cv-mur-title p{font-size:0.7em}
  .cv-search-input{width:200px;font-size:0.75em;padding:7px 30px 7px 10px}
  .cv-chambre{padding:25px;margin-top:15px}
  .cv-chambre-grid{grid-template-columns:repeat(auto-fit,minmax(140px,1fr))}
  .cv-alcove{padding:20px;margin-top:20px}
  .cv-alcove-portrait{width:150px;height:150px}
  .cv-nav-brand{font-size:0.9em}
  .cv-nav-crumbs{font-size:0.7em}
  #hud{font-size:0.75em;padding:5px 14px}
}

/* Small mobile (<430) — 2 rows, compact */
@media(max-width:429px){
  :root{--rows:2;--wall-gap:6px;--wall-pad:6px 10px}
  .cv-frame-card{width:82px}
  .cv-frame-name{font-size:0.5em}
  .cv-frame-dates{font-size:0.38em}
  .cv-frame-outer{padding:4px 4px 3px;border-width:1.5px}
  .cv-frame-recess{padding:2px;border-width:1px}
  .cv-mur-title{padding-top:42px;flex-direction:column;gap:6px}
  .cv-mur-title h2{font-size:0.9em;letter-spacing:1px}
  .cv-mur-title p{font-size:0.65em}
  .cv-search-input{width:180px;font-size:0.72em;padding:6px 28px 6px 9px}
  .cv-search-results{max-height:160px}
  #cv-live-feed{width:220px;max-height:240px;bottom:10px;left:10px;border-radius:10px}
  .cv-feed-msg-for{display:none}
  .cv-scroll-hint{font-size:0.68em;bottom:12px}
  #amb-bar{bottom:10px;padding:5px 10px;gap:4px}
  .amb-btn{padding:4px 10px;font-size:0.7em}
  .cv-chambre{padding:18px;margin-top:10px}
  .cv-chambre-header h2{font-size:1.15em}
  .cv-chambre-grid{grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:15px}
  .cv-ch-photo-wrap{width:90px;height:90px}
  .cv-ch-name{font-size:0.9em}
  .cv-ch-epitaphe{font-size:0.7em}
  .cv-alcove{padding:15px;margin-top:15px}
  .cv-alcove-portrait{width:130px;height:130px;border-radius:6px}
  .cv-alcove-info h2{font-size:1.3em}
  .cv-nav-brand{font-size:0.85em;letter-spacing:1px}
  .cv-nav-brand span{display:none}
  .cv-nav-crumbs{font-size:0.65em}
  .cv-nav-home{font-size:0.7em;padding:5px 10px}
  #cv-nav-bar{padding:8px 12px}
  #hud{font-size:0.7em;padding:5px 12px;top:12px}
}

/* ============ RESPONSIVE HAUTEUR — Réduction des rangées selon la hauteur d'écran ============ */

/* Écran très court (<500px de hauteur) — 2 rangées, cartes compactes */
@media(max-height:500px){
  :root{--rows:2;--wall-gap:6px}
  .cv-frame-card{width:90px}
  .cv-frame-outer{padding:4px 4px 3px}
  .cv-frame-name{font-size:0.52em}
  .cv-frame-dates{font-size:0.4em}
  .cv-mur-title{padding-top:42px;gap:6px}
  .cv-mur-title h2{font-size:0.95em}
  .cv-mur-title p{font-size:0.65em}
}

/* Écran court (500-650px de hauteur) — 3 rangées max */
@media(min-height:501px) and (max-height:650px){
  :root{--rows:3;--wall-gap:8px}
  .cv-frame-card{width:100px}
  .cv-frame-outer{padding:5px 5px 3px}
  .cv-frame-name{font-size:0.55em}
  .cv-frame-dates{font-size:0.42em}
  .cv-mur-title{padding-top:45px}
}

/* Écran moyen-court (651-800px de hauteur) — 4 rangées max */
@media(min-height:651px) and (max-height:800px){
  :root{--rows:4;--wall-gap:10px}
}

/* Mode paysage mobile — forcer 2 rangées */
@media(max-height:450px) and (orientation:landscape){
  :root{--rows:2;--wall-gap:5px;--wall-pad:5px 20px}
  .cv-frame-card{width:85px}
  .cv-frame-outer{padding:3px 3px 2px}
  .cv-frame-name{font-size:0.5em}
  .cv-frame-dates{display:none}
  .cv-mur-title{padding-top:38px;gap:4px}
  .cv-mur-title h2{font-size:0.85em}
  .cv-mur-title p{display:none}
  #cv-nav-bar{padding:5px 10px}
  #cv-level1{top:36px}
}

/* ============ FAMILLE MEMBRES ============ */

.cv-famille-status-msg {
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
  color: #1c2535;
}
.cv-famille-status-pending {
  background: rgba(255, 193, 7, 0.15);
  border: 1px solid rgba(255, 193, 7, 0.3);
}

/* Member list */
.cv-famille-members-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
}
.cv-famille-member {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(28, 37, 53, 0.06);
  border-radius: 8px;
}
.cv-famille-member-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.cv-famille-member-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.cv-famille-member-name {
  font-size: 14px;
  font-weight: 600;
  color: #0d1520;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cv-famille-member-role {
  font-size: 12px;
  color: #4f5d6d;
  font-weight: 500;
}

/* Pending requests (gardien view) */
.cv-famille-requests-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cv-famille-request {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 193, 7, 0.08);
  border: 1px solid rgba(255, 193, 7, 0.2);
  border-radius: 8px;
}
.cv-famille-request-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.cv-famille-request-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.cv-famille-request-name {
  font-size: 14px;
  font-weight: 600;
  color: #0d1520;
}
.cv-famille-request-date {
  font-size: 11px;
  color: #6b7a8d;
}
.cv-famille-request-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.cv-btn-sm {
  padding: 4px 10px !important;
  font-size: 12px !important;
  min-height: auto !important;
}
.cv-famille-empty {
  font-size: 13px;
  color: #6b7a8d;
  padding: 8px 0;
  text-align: center;
}

/* ============================================
   ARBRE GÉNÉALOGIQUE
   ============================================ */

.cv-arbre {
  margin: 16px auto 24px;
  padding: 20px 16px;
  background: rgba(20, 28, 40, 0.55);
  border: 1px solid rgba(180, 160, 120, 0.2);
  border-radius: 12px;
  backdrop-filter: blur(6px);
  max-width: 700px;
}

.cv-arbre-titre {
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  color: #d4c9a8;
  margin-bottom: 18px;
  letter-spacing: 0.5px;
}

/* --- Génération --- */
.cv-arbre-gen {
  margin-bottom: 4px;
}

.cv-arbre-gen-label {
  text-align: center;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #8a96a8;
  margin-bottom: 8px;
}

.cv-arbre-gen-row {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}

/* --- Couple (deux conjoints) --- */
.cv-arbre-couple {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cv-arbre-lien-epoux {
  color: #c9a96e;
  font-size: 18px;
  font-weight: bold;
  line-height: 1;
  margin-top: -18px;
}

/* --- Carte défunt --- */
.cv-arbre-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 90px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  padding: 8px 6px;
  border-radius: 8px;
  background: rgba(40, 50, 70, 0.5);
  border: 1px solid rgba(180, 160, 120, 0.15);
}

.cv-arbre-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 16px rgba(180, 160, 120, 0.2);
  border-color: rgba(180, 160, 120, 0.4);
}

.cv-arbre-card-photo {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(180, 160, 120, 0.3);
  margin-bottom: 6px;
  background: rgba(60, 70, 90, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cv-arbre-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cv-arbre-initials {
  font-size: 16px;
  font-weight: 600;
  color: #8a96a8;
  text-transform: uppercase;
}

.cv-arbre-card-nom {
  font-size: 11px;
  font-weight: 600;
  color: #e8e0d0;
  text-align: center;
  line-height: 1.3;
  word-break: break-word;
}

.cv-arbre-nee {
  font-size: 9px;
  color: #c9a96e;
  font-style: italic;
  margin-top: 1px;
}

.cv-arbre-card-dates {
  font-size: 9px;
  color: #6b7a8d;
  margin-top: 2px;
  text-align: center;
}

/* --- Connecteur vertical entre générations --- */
.cv-arbre-connector {
  display: flex;
  justify-content: center;
  padding: 4px 0;
}

.cv-arbre-vline {
  width: 2px;
  height: 20px;
  background: linear-gradient(to bottom, rgba(180, 160, 120, 0.4), rgba(180, 160, 120, 0.15));
  border-radius: 1px;
}

/* --- Liens externes (inter-familles) --- */
.cv-arbre-externes {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed rgba(180, 160, 120, 0.2);
}

.cv-arbre-ext-titre {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #8a96a8;
  text-align: center;
  margin-bottom: 8px;
}

.cv-arbre-ext-lien {
  text-align: center;
  font-size: 12px;
  color: #bbb;
  margin-bottom: 4px;
}

.cv-arbre-ext-nom {
  color: #e8e0d0;
}

.cv-arbre-ext-arrow {
  color: #8a96a8;
  font-style: italic;
}

.cv-arbre-ext-famille {
  color: #c9a96e;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dashed;
  text-underline-offset: 2px;
}

.cv-arbre-ext-famille:hover {
  color: #e0c080;
  text-decoration-style: solid;
}

/* --- Badge liaison inter-famille sur cartes arbre --- */
.cv-arbre-link-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.15), rgba(56, 142, 60, 0.25));
  border: 1px solid rgba(76, 175, 80, 0.4);
  color: #81c784;
  font-size: 9px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  margin-top: 3px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  line-height: 1.3;
}

.cv-arbre-link-badge:hover {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.3), rgba(56, 142, 60, 0.45));
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.cv-arbre-card.cv-arbre-card-linked {
  border-color: rgba(76, 175, 80, 0.35);
  box-shadow: 0 0 10px rgba(76, 175, 80, 0.1);
}

/* Distinction vivant / décédé dans l'arbre */
.cv-arbre-card-deceased {
  position: relative;
  border-color: rgba(0, 0, 0, 0.6);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.4);
}
.cv-arbre-mourning-band {
  position: absolute;
  top: 0;
  left: -4px;
  right: -4px;
  height: 14px;
  background: repeating-linear-gradient(
    -45deg,
    rgba(0,0,0,0.85),
    rgba(0,0,0,0.85) 3px,
    rgba(30,30,30,0.7) 3px,
    rgba(30,30,30,0.7) 6px
  );
  border-radius: 8px 8px 0 0;
  z-index: 2;
  pointer-events: none;
}
.cv-arbre-card-deceased .cv-arbre-card-photo {
  border-color: rgba(0, 0, 0, 0.5);
}
.cv-arbre-card-living {
  border-color: rgba(100, 200, 120, 0.35);
  background: rgba(40, 60, 50, 0.5);
}
.cv-arbre-card-living .cv-arbre-card-photo {
  border-color: rgba(100, 200, 120, 0.4);
}
.cv-arbre-card-living .cv-arbre-card-nom {
  color: #a8e6b0;
}

/* --- Responsive arbre --- */
@media (max-width: 480px) {
  .cv-arbre {
    padding: 14px 10px;
    margin: 12px 8px 18px;
  }
  .cv-arbre-card {
    width: 72px;
    padding: 6px 4px;
  }
  .cv-arbre-card-photo {
    width: 42px;
    height: 42px;
  }
  .cv-arbre-card-nom {
    font-size: 10px;
  }
  .cv-arbre-gen-row {
    gap: 10px;
  }
  .cv-arbre-couple {
    gap: 4px;
  }
}

/* ══════════════════════════════════════════════════
   ONGLETS BIOGRAPHIE / CONDOLÉANCES (Alcove L3)
   ══════════════════════════════════════════════════ */

.cv-alc-tabs{
  display:flex;
  justify-content:center;
  gap:0;
  margin:20px 0 0;
  border-bottom:2px solid rgba(200,168,76,0.2);
}
.cv-alc-tab{
  flex:1;
  max-width:220px;
  padding:14px 20px;
  background:transparent;
  border:none;
  border-bottom:3px solid transparent;
  color:#7a8599;
  font-size:16px;
  font-weight:600;
  cursor:pointer;
  transition:all 0.3s;
  font-family:inherit;
}
.cv-alc-tab:hover{
  color:var(--cv-gold,#c9a84c);
}
.cv-alc-tab.active{
  color:var(--cv-gold,#c9a84c);
  border-bottom-color:var(--cv-gold,#c9a84c);
}
.cv-alc-tab-content{
  padding:24px 0;
  animation:cvFadeIn 0.4s ease;
}
@keyframes cvFadeIn{
  from{opacity:0;transform:translateY(8px)}
  to{opacity:1;transform:translateY(0)}
}

/* ══════════════════════════════════════════════════
   TOMBE — Passerelle (gateway vers page dédiée)
   ══════════════════════════════════════════════════ */

.cv-tomb-gateway{
  text-align:center;
  padding:30px 16px;
}
.cv-tomb-gateway-text{
  font-size:15px;
  line-height:1.7;
  color:#b0b8c8;
  margin:0 0 24px;
  max-width:420px;
  margin-left:auto;
  margin-right:auto;
}
.cv-tomb-gateway-text strong{
  color:#e0d8c8;
}
.cv-tomb-see-all-link{
  display:inline-block;
  font-size:14px;
  color:var(--cv-gold,#c9a84c);
  text-decoration:none;
  font-weight:500;
  padding:8px 0;
  transition:opacity 0.2s;
}
.cv-tomb-see-all-link:hover{
  opacity:0.8;
  text-decoration:underline;
}

/* ══════════════════════════════════════════════════
   BIOGRAPHIE — Éléments
   ══════════════════════════════════════════════════ */

.cv-bio-empty{
  text-align:center;
  color:#7a8599;
  font-style:italic;
  padding:20px 0;
}
.cv-bio-el{
  margin-bottom:24px;
  padding-bottom:20px;
  border-bottom:1px solid rgba(200,168,76,0.1);
}
.cv-bio-el:last-child{
  border-bottom:none;
}
.cv-bio-el h4{
  font-size:1.05em;
  color:var(--cv-gold,#c9a84c);
  margin:0 0 10px;
  font-weight:600;
}
.cv-bio-el-content{
  line-height:1.75;
  color:#1a1f2e;
  font-size:15px;
}
.cv-bio-photo{
  max-width:100%;
  border-radius:10px;
  margin:8px 0;
  box-shadow:0 4px 16px rgba(0,0,0,0.08);
}
.cv-bio-caption{
  text-align:center;
  font-size:13px;
  color:#7a8599;
  margin-top:6px;
  font-style:italic;
}
.cv-bio-video-frame{
  width:100%;
  aspect-ratio:16/9;
  border-radius:10px;
  border:none;
}
.cv-bio-video-player{
  width:100%;
  border-radius:10px;
}
.cv-bio-audio-player{
  width:100%;
  margin:8px 0;
}
.cv-bio-link{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:10px 18px;
  background:rgba(200,168,76,0.08);
  border:1px solid rgba(200,168,76,0.2);
  border-radius:8px;
  color:var(--cv-gold,#c9a84c);
  text-decoration:none;
  font-weight:500;
  transition:all 0.2s;
}
.cv-bio-link:hover{
  background:rgba(200,168,76,0.15);
}

/* ══════════════════════════════════════════════════
   BIOGRAPHIE — Œuvres
   ══════════════════════════════════════════════════ */

.cv-bio-section-title{
  font-size:1.15em;
  color:var(--cv-gold,#c9a84c);
  margin:30px 0 16px;
  padding-top:20px;
  border-top:2px solid rgba(200,168,76,0.15);
  font-weight:600;
}
.cv-bio-oeuvres-list{
  display:flex;
  flex-direction:column;
  gap:12px;
}
.cv-bio-oeuvre-card{
  display:flex;
  align-items:center;
  gap:16px;
  padding:16px;
  background:rgba(248,244,232,0.6);
  border:1px solid rgba(200,168,76,0.15);
  border-radius:12px;
  cursor:pointer;
  transition:all 0.3s;
}
.cv-bio-oeuvre-card:hover{
  background:rgba(248,244,232,1);
  border-color:rgba(200,168,76,0.4);
  transform:translateY(-2px);
  box-shadow:0 4px 16px rgba(200,168,76,0.1);
}
.cv-bio-oeuvre-img{
  flex-shrink:0;
  width:70px;
  height:70px;
  border-radius:10px;
  overflow:hidden;
}
.cv-bio-oeuvre-img img{
  width:100%;
  height:100%;
  object-fit:cover;
}
.cv-bio-oeuvre-info{
  flex:1;
  min-width:0;
}
.cv-bio-oeuvre-info h4{
  margin:0 0 4px;
  font-size:1em;
  color:#2b3545;
  font-weight:600;
}
.cv-bio-oeuvre-info p{
  margin:0;
  font-size:13px;
  color:#7a8599;
  line-height:1.4;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.cv-bio-oeuvre-arrow{
  flex-shrink:0;
  font-size:18px;
  color:var(--cv-gold,#c9a84c);
  font-weight:600;
}

/* Lien vers page biographie complète */
.cv-bio-full-link{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:14px 28px;
  background:var(--cv-gold,#c9a84c);
  color:#fff;
  border-radius:12px;
  font-size:16px;
  font-weight:600;
  text-decoration:none;
  transition:all 0.3s;
  box-shadow:0 4px 16px rgba(201,168,76,0.2);
}
.cv-bio-full-link:hover{
  background:#b8963e;
  transform:translateY(-2px);
  box-shadow:0 6px 24px rgba(201,168,76,0.3);
}

/* ══════════════════════════════════════════════════
   ŒUVRE DETAIL (page dédiée dans le tab)
   ══════════════════════════════════════════════════ */

.cv-oeuvre-detail{
  animation:cvFadeIn 0.4s ease;
}
.cv-oeuvre-back{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:8px 16px;
  background:transparent;
  border:1px solid rgba(200,168,76,0.3);
  border-radius:8px;
  color:var(--cv-gold,#c9a84c);
  font-size:14px;
  font-weight:500;
  cursor:pointer;
  margin-bottom:20px;
  transition:all 0.2s;
  font-family:inherit;
}
.cv-oeuvre-back:hover{
  background:rgba(200,168,76,0.08);
}
.cv-oeuvre-header{
  text-align:center;
  margin-bottom:24px;
}
.cv-oeuvre-hero{
  max-width:100%;
  max-height:300px;
  object-fit:cover;
  border-radius:12px;
  margin-bottom:16px;
  box-shadow:0 4px 20px rgba(0,0,0,0.1);
}
.cv-oeuvre-header h3{
  font-size:1.4em;
  color:#2b3545;
  margin:0 0 8px;
}
.cv-oeuvre-resume{
  color:#7a8599;
  font-size:15px;
  line-height:1.6;
  margin:0 0 8px;
}
.cv-oeuvre-defunt{
  color:var(--cv-gold,#c9a84c);
  font-style:italic;
  font-size:14px;
  margin:0;
}
.cv-oeuvre-contenu{
  line-height:1.75;
  color:#1a1f2e;
  font-size:15px;
  margin-bottom:24px;
}
.cv-oeuvre-elements{
  margin-top:20px;
}

/* ══════════════════════════════════════════════════
   RESPONSIVE — Tabs & Bio
   ══════════════════════════════════════════════════ */

@media(max-width:600px){
  .cv-alc-tab{
    font-size:14px;
    padding:12px 10px;
  }
  .cv-bio-oeuvre-card{
    padding:12px;
    gap:10px;
  }
  .cv-bio-oeuvre-img{
    width:50px;
    height:50px;
  }
}
