:root{
  --bg:#020617;
  --panel:rgba(15,23,42,.72);
  --border:rgba(148,163,184,.18);
  --muted:rgba(203,213,225,.55);
  --row-h:46px;
  --scan:rgba(59,130,246,.20);
  --scan-line:rgba(96,165,250,.92);
  --sel:rgba(59,130,246,.18);
  --sel-line:rgba(96,165,250,.95);
  --flash:rgba(96,165,250,1);
  --glow:rgba(96,165,250,.45);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background: transparent;
  color:#e2e8f0;
  overflow:hidden;
}

/* ============================================
   WELCOME SCREEN
   ============================================ */

.welcome-screen{
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.welcome-content{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.welcome-logo{
  font-size: 72px;
  filter: drop-shadow(0 0 30px rgba(96,165,250,.5));
  animation: welcomePulse 2s ease-in-out infinite;
}

@keyframes welcomePulse{
  0%, 100%{ transform: scale(1); filter: drop-shadow(0 0 30px rgba(96,165,250,.5)); }
  50%{ transform: scale(1.05); filter: drop-shadow(0 0 50px rgba(96,165,250,.7)); }
}

.welcome-brand{
  font-size: 32px;
  font-weight: 950;
  letter-spacing: 0.12em;
  color: rgba(226,232,240,.98);
}

.welcome-tagline{
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(148,163,184,.85);
  text-transform: uppercase;
  margin-bottom: 24px;
}

.welcome-buttons{
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.welcome-btn{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px 48px;
  border: 1px solid rgba(148,163,184,.25);
  border-radius: 24px;
  background: rgba(15,23,42,.6);
  color: rgba(226,232,240,.95);
  cursor: pointer;
  transition: all 200ms ease;
}

.welcome-btn:hover{
  background: rgba(59,130,246,.15);
  border-color: rgba(96,165,250,.5);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0,0,0,.3);
}

.welcome-btn-icon{
  font-size: 48px;
}

.welcome-btn-label{
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.welcome-screen.hidden{
  display: none;
}

.mono{font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace}

.shell{
  min-height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:28px;
}

.frame{
  position:relative;
  width:min(1200px, 96vw);
  border:none;
  background: transparent;
  box-shadow: none;
  border-radius:0;
  overflow:visible;
}

/* Floating refresh button */
.refresh-btn{
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(148,163,184,.3);
  background: rgba(15,23,42,.7);
  color: rgba(226,232,240,.8);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: all 200ms ease;
  backdrop-filter: blur(8px);
}

.refresh-btn:hover{
  background: rgba(59,130,246,.3);
  border-color: rgba(96,165,250,.5);
  color: rgba(226,232,240,1);
  transform: rotate(180deg);
}

.frame-top{
  display:none;
}

.dots{display:flex;gap:8px}
.dot{width:10px;height:10px;border-radius:999px;background:rgba(148,163,184,.25)}

.brand{display:flex;align-items:center;gap:10px;font-weight:900;letter-spacing:.02em}
.brand-badge{
  width:30px;height:30px;border-radius:12px;
  display:grid;place-items:center;
  border:1px solid rgba(148,163,184,.22);
  background: linear-gradient(135deg, rgba(59,130,246,.22), rgba(168,85,247,.18));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}
.brand-name{font-size:14px}
.brand-tagline{font-size:10px;font-weight:700;color:rgba(148,163,184,.85);text-transform:uppercase;letter-spacing:.12em}

.kpi{display:flex;align-items:baseline;gap:10px;font-weight:900}
.kpi #counter{font-size:13px;color:rgba(226,232,240,.96)}
.kpi small{font-size:10px;color:rgba(148,163,184,.85);font-weight:700}

.content{
  display:grid;
  grid-template-columns: 1.6fr 1.2fr; /* wider PAX column */
  gap:14px;
  padding:22px 16px 16px;
}

/* Desktop: render right column as a phone */
#paxPanel{
  background: transparent;
  border: none;
  box-shadow: none;
  overflow: visible;
  padding: 0;
  display:flex;
  align-items:center;
  justify-content:center;
}
#paxPanel .phone-shell{ width: min(380px, 100%); }

.phone{
  position:relative;
  width:100%;
  aspect-ratio: 390 / 844;
  border-radius: 48px;
  background: rgba(15,23,42,.55);
  border:1px solid rgba(148,163,184,.22);
  box-shadow: 0 22px 80px rgba(0,0,0,.55);
  padding: 10px;
}
.phone-screen{
  height:100%;
  border-radius: 40px;
  background: rgba(2,6,23,.55);
  border:1px solid rgba(148,163,184,.16);
  overflow:hidden;
  padding: 14px 12px 12px;
  position:relative;
}
.phone-notch{
  position:absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 44%;
  height: 26px;
  background: rgba(2,6,23,.96);
  border:1px solid rgba(148,163,184,.16);
  border-top: none;
  border-radius: 0 0 18px 18px;
  z-index: 3;
}
.phone-status{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 4px 4px 0;
}
.phone-time{font-size:12px;color:rgba(226,232,240,.92); font-weight:800;}
.phone-status-icons{display:flex;align-items:center;}
.phone-status-icons .dot{
  width:6px;height:6px;border-radius:999px;
  background: rgba(226,232,240,.80);
  margin-left:4px;
  opacity:.75;
}
.phone-topbar{
  margin-top: 10px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}
.phone-brand-name{font-size:12px;font-weight:950;letter-spacing:.08em;}
.phone-brand-sub{font-size:10px;color:rgba(148,163,184,.88);margin-top:2px}
.phone-count{font-size:12px;color:rgba(226,232,240,.88);font-weight:850}

.phone-stack{
  margin-top: 12px;
  display:flex;
  flex-direction:column;
  gap:10px;
  overflow:hidden;
  padding-bottom: 16px;
  position:relative;
}
.phone-stack:after{
  content:"";
  position:absolute;
  left:0; right:0; bottom:0;
  height:46px;
  background: linear-gradient(to bottom, rgba(2,6,23,0), rgba(2,6,23,.85));
  pointer-events:none;
}

.panel{
  border:1px solid var(--border);
  border-radius:22px;
  overflow:hidden;
  background: var(--panel);
  box-shadow: 0 18px 50px rgba(0,0,0,.35);
}

.panel-head{
  padding:14px;
  border-bottom:1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.search{
  flex:1;
  display:flex;align-items:center;gap:10px;
  background: rgba(15,23,42,.65);
  border:1px solid rgba(148,163,184,.20);
  border-radius:999px;
  padding:10px 12px;
  min-width:240px;
}
.search input{
  width:100%;
  outline:none;
  background:transparent;
  border:0;
  color:#e2e8f0;
  font-size:12px;
}
.search-ico{display:grid;place-items:center}

.scan-badge{
  display:flex;align-items:center;gap:8px;
  font-size:10px;
  color:rgba(148,163,184,.9);
}
.pulse-dot{
  width:8px;height:8px;border-radius:999px;background:rgba(96,165,250,.95);
  box-shadow: 0 0 0 0 rgba(96,165,250,.55);
  animation: pulse 1.1s ease-in-out infinite;
}
@keyframes pulse{
  0%{box-shadow: 0 0 0 0 rgba(96,165,250,.55)}
  70%{box-shadow: 0 0 0 10px rgba(96,165,250,0)}
  100%{box-shadow: 0 0 0 0 rgba(96,165,250,0)}
}

.list{
  position:relative;
  height:520px;
  overflow:hidden;
}
.rows{
  position:absolute;
  inset:0;
  will-change: transform;
}

.row{
  height: var(--row-h);
  display:grid;
  grid-template-columns: 28px 82px 1.05fr 2.35fr 70px;
  align-items:center;
  gap:10px;
  padding: 0 14px;
  border-bottom:1px solid rgba(148,163,184,.10);
  background: rgba(255,255,255,.02);
  transition: background 220ms ease, opacity 220ms ease, filter 220ms ease, transform 220ms ease, box-shadow 220ms ease;
}
.row:nth-child(2n){background: rgba(255,255,255,0)}

.avatar{
  width:26px;height:26px;border-radius:999px;
  display:grid;place-items:center;
  font-size:11px;font-weight:900;
  color: rgba(2,6,23,.95);
  border:1px solid rgba(255,255,255,.12);
  box-shadow: 0 10px 25px rgba(0,0,0,.18);
}
.from{
  font-size:12px;font-weight:800;
  color: rgba(226,232,240,.95);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.subject{
  font-size:12px;
  color: rgba(226,232,240,.92);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.time{
  text-align:right;
  font-size:11px;
  color: rgba(148,163,184,.85);
}

.muted{
  opacity:.50;
  filter: grayscale(.7);
}
.muted .from,.muted .subject,.muted .time{
  color: rgba(148,163,184,.62);
}

/* Selected baseline */
.selected{
  opacity: 1 !important;
  filter: none !important;
  background: var(--sel) !important;
  border-bottom-color: rgba(59,130,246,.30);
  box-shadow: inset 4px 0 0 var(--sel-line), 0 10px 30px rgba(0,0,0,.22);
}
.selected .subject{font-weight:800}

/* FLASH: make it obvious */
.row.flash{
  position: relative;
  transform: translateX(2px) scale(1.012);
  box-shadow:
    inset 4px 0 0 var(--flash),
    0 0 0 1px rgba(96,165,250,.45),
    0 18px 60px rgba(96,165,250,.22);
  background: rgba(96,165,250,.10) !important;
  animation: rowFlash 900ms ease-out 1;
}
@keyframes rowFlash{
  0%{background: rgba(96,165,250,.00); filter: none; opacity: 1;}
  15%{background: rgba(96,165,250,.36);}
  40%{background: rgba(96,165,250,.22);}
  100%{background: rgba(96,165,250,.10);}
}
.row.flash::after{
  content:"";
  position:absolute;
  inset:-1px;
  border-radius: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.18), transparent);
  transform: translateX(-45%);
  animation: shimmer 700ms ease-out 1;
  pointer-events:none;
  mix-blend-mode: screen;
}
@keyframes shimmer{
  0%{transform: translateX(-55%); opacity:0}
  20%{opacity:1}
  100%{transform: translateX(55%); opacity:0}
}

.scan-bar{
  pointer-events:none;
  position:absolute;
  left:0; right:0;
  height:58px;
  transform: translateY(0);
  background: linear-gradient(to bottom, transparent, var(--scan), transparent);
  border-top:1px solid rgba(96,165,250,.45);
  border-bottom:1px solid rgba(96,165,250,.25);
  box-shadow: 0 10px 35px rgba(59,130,246,.22);
  opacity:0;
  transition: opacity 260ms ease;
}
.scan-bar::after{
  content:"";
  position:absolute; left:0; right:0; top:50%;
  height:2px; transform: translateY(-1px);
  background: linear-gradient(90deg, transparent, var(--scan-line), transparent);
}
.scan-on .scan-bar{opacity:1}

/* Right panel (PAX titles) */
.pax-head{display:flex;align-items:center;gap:10px}
.pax-head-ico{
  width:34px;height:34px;border-radius:14px;
  display:grid;place-items:center;
  border:1px solid rgba(148,163,184,.18);
  background: rgba(2,6,23,.35);
}
.pax-title{font-weight:900;font-size:12px}
.pax-subtitle{font-size:10px;color:rgba(148,163,184,.82);margin-top:2px}
.pax-count{font-size:10px;color:rgba(148,163,184,.9)}

.pax-stack{padding:14px;display:flex;flex-direction:column;gap:10px}

.pax-pill{
  display:flex;flex-direction:column;align-items:stretch;gap:8px;
  padding:12px;
  border-radius:16px;
  border:1px solid rgba(148,163,184,.18);
  background: rgba(2,6,23,.35);
  transform: translateX(10px);
  opacity:0;
  animation: pillIn 420ms ease forwards;
}

.pax-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.pax-tag-top{
  align-self:flex-start;
  font-size:9px;
  padding:4px 8px;
  opacity:.95;
}
@keyframes pillIn{to{transform: translateX(0); opacity:1}}
.pax-pill .left{display:flex;align-items:center;gap:10px}
.pax-ico{
  width:34px;height:34px;border-radius:14px;
  display:grid;place-items:center;
  border:1px solid rgba(148,163,184,.18);
  background: linear-gradient(135deg, rgba(59,130,246,.20), rgba(168,85,247,.16));
}
.pax-pill .t1{font-weight:900;font-size:12px}
.pax-pill .t2{font-size:10px;color:rgba(148,163,184,.84);margin-top:2px}
.pax-tag{
  font-size:10px;
  border:1px solid rgba(148,163,184,.18);
  background: rgba(148,163,184,.08);
  color: rgba(226,232,240,.86);
  border-radius:999px;
  padding:6px 10px;
  white-space:nowrap;
}

.tag-agenda .pax-tag{
  background: rgba(34,211,238,.22);
  border-color: rgba(34,211,238,.42);
  color: rgba(236,254,255,.98);
}
.tag-decision .pax-tag{
  background: rgba(96,165,250,.22);
  border-color: rgba(96,165,250,.44);
  color: rgba(239,246,255,.98);
}
.tag-decision-rapide .pax-tag{
  background: rgba(167,139,250,.22);
  border-color: rgba(167,139,250,.44);
  color: rgba(245,243,255,.98);
}
.tag-cv-screener .pax-tag{
  background: rgba(52,211,153,.22);
  border-color: rgba(52,211,153,.42);
  color: rgba(236,253,245,.98);
}
.tag-info-importance .pax-tag{
  background: rgba(251,191,36,.22);
  border-color: rgba(251,191,36,.44);
  color: rgba(255,251,235,.98);
}


/* PAX FLASH */
.pax-pill.flash-pill{
  animation: pillFlash 950ms ease-out 1, pillIn 420ms ease forwards;
  box-shadow: 0 0 0 1px rgba(96,165,250,.40), 0 18px 60px rgba(96,165,250,.20);
}
@keyframes pillFlash{
  0%{background: rgba(2,6,23,.35)}
  18%{background: rgba(96,165,250,.24)}
  38%{background: rgba(96,165,250,.12)}
  100%{background: rgba(2,6,23,.35)}
}

/* Finale */
.finale{display:none; padding:28px}
.show-finale .finale{display:block}
.show-finale .content{display:none}

.finale-top{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:16px;
  margin-bottom:18px;
}
.finale h2{
  margin:0;
  font-size:22px;
  line-height:1.15;
  font-weight:950;
  letter-spacing:-.02em;
  color: rgba(226,232,240,.98);
}
.finale p{
  margin:4px 0 0;
  color: rgba(148,163,184,.90);
  font-size:12px;
}
.finale-actions{display:flex;align-items:center;gap:10px}

.btn{
  display:inline-flex;align-items:center;gap:8px;
  border:1px solid rgba(148,163,184,.20);
  background: rgba(2,6,23,.40);
  color: rgba(226,232,240,.92);
  font-weight:900;
  letter-spacing:.03em;
  text-transform:uppercase;
  font-size:10px;
  padding:10px 12px;
  border-radius:999px;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
  user-select:none;
}
.btn:hover{transform: translateY(-1px); border-color: rgba(96,165,250,.45); background: rgba(59,130,246,.12)}
.btn-ico{display:grid;place-items:center}

.pax-grid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap:12px;
  margin-top:14px;
}

.pax-card{
  border:1px solid rgba(148,163,184,.18);
  background: rgba(15,23,42,.55);
  border-radius:22px;
  padding:14px;
  box-shadow: 0 18px 55px rgba(0,0,0,.35);
  opacity:0;
  transform: translateY(10px);
  animation: cardUp 520ms ease forwards;
}
@keyframes cardUp{to{opacity:1; transform: translateY(0)}}
.pax-card .hdr{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
.pax-card .name{font-size:12px;font-weight:950;color: rgba(226,232,240,.98);letter-spacing:.01em}
.pax-card .desc{font-size:12px;color: rgba(148,163,184,.92);line-height:1.35;margin:0 0 10px}

.actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.badge{
  display:inline-flex;align-items:center;gap:8px;
  border:1px solid rgba(148,163,184,.20);
  background: rgba(2,6,23,.40);
  color: rgba(226,232,240,.92);
  font-weight:900;
  letter-spacing:.03em;
  text-transform:uppercase;
  font-size:9px;
  padding:8px 10px;
  border-radius:999px;
}

@media (max-width: 980px){
  .content{grid-template-columns:1fr}
  .pax-grid{grid-template-columns: repeat(2, minmax(0, 1fr))}
  .list{height:440px}
  
  /* Contain left phone properly on smaller screens */
  #inboxPanel{
    overflow: hidden;
  }
  .inbox-list{
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }
}

/* Mobile mode: same layout as desktop, just hide/show panels */
.mobile-mode #paxPanel{
  display: none;
}

.mobile-mode.scan-complete #inboxPanel{
  display: none;
}

.mobile-mode.scan-complete #paxPanel{
  display: flex;
}

/* Mobile mode TEST V2: floating elements, no phone frame */
.mobile-mode #inboxPanel .phone-shell{
  width: min(380px, 100%);
}

.mobile-mode #inboxPanel .phone{
  aspect-ratio: 390 / 844;
  width: 100%;
  border-radius: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.mobile-mode #inboxPanel .phone-notch{
  display: none;
}

.mobile-mode #inboxPanel .phone-screen{
  flex: 1;
  height: 100%;
  border-radius: 0;
  background: transparent;
  border: none;
  padding: 0;
  gap: 12px;
  display: flex;
  flex-direction: column;
}

.mobile-mode #inboxPanel .phone-status{
  display: none;
}

.mobile-mode .intro-overlay{
  display: none !important;
}

/* ============================================
   COMPACT MODE - Half height, sequential cards
   ============================================ */

/* En mode compact, on ne bascule PAS vers paxPanel */
.compact-mode #paxPanel{
  display: none !important;
}

.compact-mode.scan-complete #inboxPanel{
  display: flex;
}

.compact-mode .content{
  gap: 8px;
}

.compact-mode #inboxPanel .phone-shell{
  width: min(450px, 100%);
}

.compact-mode #inboxPanel .phone{
  aspect-ratio: auto;
  height: 380px;
  width: 100%;
  border-radius: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.compact-mode #inboxPanel .phone-notch,
.compact-mode #inboxPanel .phone-status{
  display: none;
}

.compact-mode #inboxPanel .phone-screen{
  flex: 1;
  height: 100%;
  border-radius: 0;
  background: transparent;
  border: none;
  padding: 0;
  gap: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.compact-mode .intro-overlay{
  display: none !important;
}

/* Compact header bar */
.compact-mode .inbox-phone-head{
  padding: 10px 16px;
  background: rgba(15,23,42,.75);
  border: 1px solid rgba(148,163,184,.2);
  border-radius: 12px;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
}

.compact-mode .inbox-phone-head .scan-badge span.mono{
  font-size: 0;
}
.compact-mode .inbox-phone-head .scan-badge span.mono::after{
  content: "AI Dispatch Engine";
  font-size: 11px;
}

.compact-mode .inbox-phone-head .scan-badge .pulse-dot{
  background: rgba(34,197,94,.9);
}

/* Connector icons - hidden by default, shown in compact mode */
.connector-icons{
  display: none;
}

.compact-mode .inbox-phone-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.compact-mode .connector-icons{
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.connector-icon{
  width: 20px;
  height: 20px;
  border-radius: 4px;
  opacity: 0.9;
}

/* Hide header counter in compact mode (it's in the decisions bar) */
.compact-mode .inbox-phone-head .phone-count{
  display: none;
}

/* Inline counter in decisions bar - hidden by default */
.phone-count-inline{
  display: none;
}

/* Compact mode: show counter next to decisions text */
.compact-mode .scan-header-top{
  display: flex;
  align-items: center;
  width: 100%;
  gap: 8px;
}

.compact-mode .phone-count-inline{
  display: flex;
  font-size: 12px;
  color: rgba(148,163,184,.8);
  margin-left: auto;
}

/* Compact decision header */
.compact-mode .scan-header{
  margin: 0;
  padding: 8px 12px;
  background: rgba(15,23,42,.65);
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 12px;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
}

/* Compact email list - smaller */
.compact-mode .inbox-list{
  flex: 1;
  min-height: 0;
  height: 180px;
  margin: 0;
  border-radius: 12px;
  background: transparent;
  border: none;
  backdrop-filter: none;
  box-shadow: none;
  position: relative;
}

/* After scan complete, hide only email list content */
.compact-mode.scan-complete .inbox-list .phone-inbox{
  display: none !important;
}

.compact-mode.scan-complete .inbox-list .scan-bar{
  display: none !important;
}

.compact-mode.scan-complete .inbox-list .phone-fx-layer{
  display: none !important;
}

.compact-mode.scan-complete .inbox-list{
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

/* Compact rows - smaller text */
.compact-mode .phone-inbox .row{
  padding: 6px 10px;
  font-size: 11px;
}

.compact-mode .phone-inbox .row .from{
  font-size: 12px;
}

.compact-mode .phone-inbox .row .subj{
  font-size: 11px;
}

.compact-mode .phone-inbox .row .time{
  font-size: 10px;
}

/* Compact flash effect */
.compact-mode .phone-fx-layer{
  border-radius: 12px;
}

/* ============================================
   COMPACT CARDS - Stacked vertically after scan
   ============================================ */

/* Container for cards - CACHE qui couvre tout et contient les cartes */
.compact-mode .compact-cards-container{
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  flex-direction: column;
  gap: 10px;
  padding: 0;
  overflow: hidden;
  z-index: 200;
  background: transparent;
}

/* Texte de transition */
.transition-text{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  padding-bottom: 80px;
  text-align: center;
  opacity: 0;
  transform: scale(0.9);
  animation: transitionFadeIn 0.6s ease forwards;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
  z-index: 10;
}

.transition-text.fade-out{
  animation: transitionFadeOut 0.4s ease forwards;
}

@keyframes transitionFadeIn {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes transitionFadeOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(1.05);
  }
}

.transition-number{
  font-size: 80px;
  font-weight: 800;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.transition-label{
  font-size: 24px;
  font-weight: 600;
  color: #e2e8f0;
  margin-top: 8px;
}

.transition-sub{
  font-size: 16px;
  color: rgba(148,163,184,.85);
  margin-top: 12px;
}

.compact-mode.scan-complete .compact-cards-container{
  display: flex;
}

/* Cards in compact mode - stacked, not absolute */
.compact-mode .compact-cards-container .pax-pill{
  position: relative;
  left: auto;
  right: auto;
  top: auto;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease-out, transform 0.4s ease-out;
  pointer-events: none;
  animation: none !important;
  flex-shrink: 0;
  margin: 0;
}

.compact-mode .compact-cards-container .pax-pill.card-visible{
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.compact-mode .compact-cards-container .pax-pill.card-exit{
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Floating header bar - original mobile mode */
.mobile-mode .inbox-phone-head{
  padding: 12px 18px;
  background: rgba(15,23,42,.75);
  border: 1px solid rgba(148,163,184,.2);
  border-radius: 14px;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
}

.mobile-mode .inbox-phone-head .scan-badge span.mono{
  font-size: 0;
}
.mobile-mode .inbox-phone-head .scan-badge span.mono::after{
  content: "AI Engine";
  font-size: 11px;
}

.mobile-mode .inbox-phone-head .scan-badge .pulse-dot{
  background: rgba(34,197,94,.9);
}

/* Floating decision header */
.mobile-mode .scan-header{
  margin: 0;
  background: rgba(15,23,42,.65);
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 14px;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0,0,0,.25);
}

/* Floating email list - fills remaining space */
.mobile-mode .inbox-list{
  flex: 1;
  min-height: 0;
  margin: 0;
  border-radius: 16px;
  background: rgba(15,23,42,.55);
  border: 1px solid rgba(148,163,184,.15);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0,0,0,.35);
}

/* Adjust flash effect for no-frame mode */
.mobile-mode .phone-fx-layer{
  border-radius: 16px;
}

/* Keep phone frame for paxPanel (report) in mobile mode */
.mobile-mode #paxPanel .phone-shell{
  width: min(380px, 100%);
}

.mobile-mode #paxPanel .phone{
  aspect-ratio: 390 / 844;
  border-radius: 48px;
  background: rgba(15,23,42,.55);
  border: 1px solid rgba(148,163,184,.22);
  box-shadow: 0 22px 80px rgba(0,0,0,.55);
  padding: 10px;
}

.mobile-mode #paxPanel .phone-screen{
  height: 100%;
  border-radius: 40px;
  background: rgba(2,6,23,.55);
  border: 1px solid rgba(148,163,184,.16);
  padding: 14px 12px 12px;
  gap: 10px;
}

.mobile-mode #paxPanel .phone-notch{
  display: block;
}

.mobile-mode #paxPanel .phone-status{
  display: flex;
}
@media (max-width: 520px){
  .pax-grid{grid-template-columns:1fr}
}


/* FX layer */
.fx-layer{
  position:absolute;
  inset:0;
  pointer-events:none;
  overflow:hidden;
  z-index:50;
}

.fx-wash{
  position:absolute;
  inset:0;
  background: radial-gradient(900px 500px at 50% 40%, rgba(255,255,255,.35), rgba(96,165,250,.20) 35%, rgba(2,6,23,0) 70%),
              linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,0));
  opacity:0;
  mix-blend-mode: screen;
  filter: blur(0.2px);
}

.fx-flare{
  position:absolute;
  width: 420px;
  height: 420px;
  border-radius:999px;
  left:0; top:0;
  transform: translate(-9999px, -9999px) scale(.15);
  opacity:0;
  background:
    radial-gradient(circle at 50% 50%, rgba(255,255,255,.95), rgba(255,255,255,.55) 18%, rgba(96,165,250,.45) 38%, rgba(96,165,250,.18) 58%, rgba(96,165,250,0) 72%);
  filter: blur(0.6px);
  mix-blend-mode: screen;
}

.fx-beam{
  position:absolute;
  width: 520px;
  height: 4px;
  border-radius: 999px;
  left:0; top:0;
  transform: translate(-9999px, -9999px) rotate(0deg);
  opacity:0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.85), rgba(96,165,250,.85), transparent);
  filter: blur(0.4px);
  mix-blend-mode: screen;
}

/* Extra glow on the pax pill when it is created */
.pax-pill.glow{
  box-shadow:
    0 0 0 1px rgba(255,255,255,.18),
    0 0 0 2px rgba(96,165,250,.25),
    0 0 60px rgba(96,165,250,.25),
    0 26px 90px rgba(0,0,0,.35);
}

/* Slight global bloom on the frame */
.frame.bloom{
  /* Disabled - was creating visible frame border */
}

/* Flash effect inside phone - at scan line position */
.phone-fx-layer{
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 120px;
  pointer-events: none;
  border-radius: 20px;
  z-index: 60;
  opacity: 0;
  background: radial-gradient(ellipse 100% 100% at 50% 50%, 
    rgba(255,255,255,.85) 0%,
    rgba(96,165,250,.5) 30%,
    rgba(96,165,250,.15) 60%,
    transparent 100%);
  mix-blend-mode: screen;
  transform: translateY(0);
}

.phone-fx-layer.flash{
  animation: phoneFlash 500ms ease-out forwards;
}

@keyframes phoneFlash{
  0%{ opacity: 0; transform: scaleY(0.5); }
  20%{ opacity: 1; transform: scaleY(1.2); }
  100%{ opacity: 0; transform: scaleY(1.5); }
}

/* FX — iris expand -> full screen -> close to PAX */
.fx-veil{
  position:absolute;
  inset:0;
  opacity:0;
  background:
    radial-gradient(1200px 700px at 50% 45%, rgba(255,255,255,.38), rgba(96,165,250,.20) 40%, rgba(2,6,23,0) 75%),
    linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,0));
  mix-blend-mode: screen;
  pointer-events:none;
}

.fx-iris{
  position:absolute;
  width: 620px;
  height: 620px;
  border-radius: 999px;
  left: 0;
  top: 0;
  opacity: 0;
  background:
    radial-gradient(circle at 50% 50%,
      rgba(255,255,255,.98) 0%,
      rgba(255,255,255,.70) 12%,
      rgba(96,165,250,.55) 30%,
      rgba(96,165,250,.22) 48%,
      rgba(96,165,250,0) 65%);
  filter: blur(0.55px);
  mix-blend-mode: screen;
  pointer-events:none;
}

/* Source badge (Gmail / Slack) */
.src-badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(148,163,184,.18);
  background: rgba(2,6,23,.35);
  color: rgba(226,232,240,.86);
  font-size:10px;
  font-weight:900;
  letter-spacing:.02em;
  white-space:nowrap;
}
.src-dot{
  width:7px;
  height:7px;
  border-radius:999px;
  background: rgba(148,163,184,.75);
}
.src-dot.gmail{ background: rgba(96,165,250,.95); }
.src-dot.slack{ background: rgba(34,197,94,.92); }

/* Hide detailed PAX cards area (removed per V2 request) */
.pax-grid{ display:none !important; }

/* V3.2: illuminated email after crossing the scan line (kept) */
.row.lit{
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.18);
  box-shadow:
    0 0 0 1px rgba(255,255,255,.10) inset,
    0 0 80px rgba(255,255,255,.10);
}
.row.lit .from{ color: rgba(255,255,255,.94); }
.row.lit .subject{ color: rgba(255,255,255,.96); }

/* V4.4b: remove the blue middle scan line */
.scan-bar::after{content:none !important; display:none !important;}

/* V7.1: show PAX actions under each detected card */
.pax-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:10px;
}
.pax-action{
  font-size:12px;
  line-height:1;
  padding:7px 10px;
  border-radius:999px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.90);
  letter-spacing: .01em;
  user-select:none;
  pointer-events:none; /* do not interfere with future click-on-card */
}

/* V7.2: force actions under the PAX pill (not on the right) */
.pax-pill{ flex-wrap: wrap; align-items: flex-start; justify-content: flex-start; }
.pax-pill .pax-tag{ margin-left: auto; }
.pax-pill .pax-actions{
  flex-basis: 100%;
  width: 100%;
  margin-top: 10px;
  padding-left: 68px; /* aligns under text (vtype + icon + gaps) */
  justify-content: flex-start;
}

/* V8.1: end-of-scan summary */
.end-summary{
  margin: 10px 0 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(0,0,0,.30);
  border: 1px solid rgba(255,255,255,.14);
  color: rgba(255,255,255,.92);
  font-size: 14px;
  letter-spacing: .01em;
  display: none;
  backdrop-filter: blur(8px);
}

/* Right phone summary - positioned at top */
.end-summary-right{
  margin: 8px 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0,0,0,.30);
  border: 1px solid rgba(255,255,255,.14);
  color: rgba(255,255,255,.92);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .01em;
  text-align: center;
  display: none;
  backdrop-filter: blur(8px);
}
.end-summary-right.show{
  display: block;
  animation: endSummaryIn 320ms ease-out both;
}

/* Ensure right phone screen is positioning context */
#paxPanel .phone-screen{
  position: relative;
}
.end-summary.show{
  display: block;
  animation: endSummaryIn 320ms ease-out both;
}
@keyframes endSummaryIn{
  from{ transform: translateY(-6px); opacity: 0; }
  to{ transform: translateY(0); opacity: 1; }
}

/* V8.2: live processed counter */
.processed-counter{
  margin: 10px 0 6px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.88);
  font-size: 13px;
  letter-spacing: .01em;
  display:none;
}
.processed-counter.show{
  display:block;
}

/* Make the end summary pop at the end */
.end-summary.show.final{
  display:block;
  background: rgba(0,0,0,.48);
  border-color: rgba(255,255,255,.22);
  box-shadow: 0 0 0 1px rgba(255,255,255,.08) inset, 0 10px 40px rgba(0,0,0,.35);
  font-size: 18px;
  padding: 14px 14px;
  text-align: center;
  color: rgba(255,255,255,.96);
}

/* Prevent right column from resizing when new PAX appears */
.pax-col{
  min-height: 0; /* allow internal scrolling */
}
.pax-list{
  max-height: 420px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px; /* space for scrollbar */
}

/* V8.2b: processed counter moved to top-left (replaces search) */
.processed-counter.in-topbar{
  flex: 1;
  display: none;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin: 0;
  height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  color: rgba(255,255,255,.92);
  font-size: 13px;
  letter-spacing: .01em;
}
.processed-counter.in-topbar.show{
  display:flex;
}

/* V8.2c: processed counter in frame-top left */
.left-top{
  display:flex;
  align-items:center;
  gap:12px;
}
.processed-counter.in-topbar{
  flex: 0 0 auto;
  width: 220px;
  max-width: 32vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* V8.2d: move the counter (mails analysés) to top-left */
.left-top .kpi{
  display:flex;
  align-items:baseline;
  gap:8px;
  padding: 8px 12px;
  height: 38px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  color: rgba(255,255,255,.92);
}
.left-top .kpi #counter{
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .02em;
}
.left-top .kpi small{
  font-size: 12px;
  opacity: .80;
}

/* Hide any stray processed counter styles */
.processed-counter{ display:none !important; }

/* V8.2d2: after swapping, keep dots subtle */
.left-top .dots{ opacity: .45; }

/* V8.2d3: counter in the top-left corner (replaces the 3 dots) */
.frame-top{ position: relative; }
.frame-top .dots{ display:none !important; }

.frame-top .kpi{
  position: absolute !important;
  left: 22px !important;
  top: 14px !important;
  margin: 0 !important;
}

/* keep tagline/brand centered as-is */

/* V8.2d4: center the logo/tagline in the top bar */
.frame-top{ position: relative; }
.frame-top .brand{
  position: absolute !important;
  left: 50% !important;
  top: 12px !important;
  transform: translateX(-50%) !important;
  margin: 0 !important;
  text-align: center;
}

/* V8.2d5: smaller end summary + live updates */
.end-summary{
  font-size: 12px !important;
  padding: 8px 10px !important;
  border-radius: 14px !important;
}
.end-summary.show.final{
  font-size: 13px !important;
  padding: 10px 12px !important;
}

/* V8.2d6: keep summary always visible */
.end-summary{
  display: block !important;
}

/* V9.1: colored PAX type tag */
.pax-pill[class*="tag-"] .pax-tag{
  font-weight: 700;
  letter-spacing: .06em;
  box-shadow: 0 0 0 1px rgba(0,0,0,.10) inset, 0 10px 24px rgba(0,0,0,.10);
}

.pax-pill.pax-pill.pax-pill.pax-pill.pax-pill/* V9.3: vertical centering in header */
.frame-top{ position: relative; }
.frame-top .kpi{
  top: 50% !important;
  transform: translateY(-50%) !important;
}
.frame-top .brand{
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
}

/* V10.3: end summary slides in from the left and briefly glows */
.end-summary{
  width: fit-content;
  max-width: calc(100% - 12px);
  margin: 10px auto 10px; /* center */
  text-align: center;
}

.end-summary.final-slide{
  animation: endSlideGlow 520ms ease-out both;
}

@keyframes endSlideGlow{
  0%{
    transform: translateX(-34px);
    filter: brightness(1);
    box-shadow: 0 0 0 1px rgba(255,255,255,.10) inset, 0 0 0 rgba(255,255,255,0);
    background: rgba(255,255,255,.05);
    border-color: rgba(255,255,255,.12);
  }
  45%{
    transform: translateX(-8px);
    filter: brightness(1.25);
    box-shadow: 0 0 0 1px rgba(255,255,255,.18) inset, 0 0 60px rgba(255,255,255,.18);
    background: rgba(255,255,255,.12);
    border-color: rgba(255,255,255,.22);
  }
  100%{
    transform: translateX(0);
    filter: brightness(1.05);
    box-shadow: 0 0 0 1px rgba(255,255,255,.14) inset, 0 14px 50px rgba(0,0,0,.22);
    background: rgba(255,255,255,.08);
    border-color: rgba(255,255,255,.18);
  }
}

/* V11.1: PAX layout alignment (tag always top-right, actions always bottom) */
.pax-pill{
  display: grid !important;
  grid-template-columns: 34px 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 10px;
  row-gap: 10px;
  align-items: start;
}

.pax-pill .pax-ico{
  grid-column: 1;
  grid-row: 1;
}

.pax-pill .pax-main{
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

.pax-pill .pax-tag{
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  align-self: start;
  margin-left: 0 !important;
}

.pax-pill .pax-actions{
  grid-column: 2 / 4;
  grid-row: 2;
  width: 100%;
  margin-top: 0 !important;
  padding-left: 0 !important;
  justify-content: flex-start;
}

.pax-pill .pax-actions .pax-action{
  white-space: nowrap;
}

/* Prevent accidental extra line under the header row */
.pax-pill .pax-sub{ margin-top: 2px; }

/* V11.2: revert grid layout; keep tag top-right and actions bottom without breaking text flow */
.pax-pill{
  display:flex !important;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-start;
  position: relative;
  padding-right: 120px; /* reserve space for the tag on the right */
}

.pax-ico{ flex: 0 0 auto; }
.pax-main{
  flex: 1 1 auto;
  min-width: 0;
}

.pax-sub{
  white-space: normal;
  word-break: normal;
  overflow-wrap: anywhere;
}

.pax-tag{
  position: absolute !important;
  top: 14px;
  right: 14px;
  margin-left: 0 !important;
}

.pax-actions{
  flex-basis: 100%;
  width: 100%;
  margin-top: 10px;
  padding-left: 44px; /* align under text */
  justify-content: flex-start;
}

/* V11.3: improve description readability + keep actions on one line */
.pax-sub{
  font-size: 13px; /* was a bit small */
  line-height: 1.25;
  opacity: .88;
}

.pax-actions{
  flex-wrap: nowrap;   /* keep in one line */
  overflow: hidden;
  gap: 10px;
}

.pax-action{
  flex: 0 1 auto;
  min-width: 0;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

/* V11.4: bigger description + show full button text */
.pax-sub{
  font-size: 14px;
  line-height: 1.3;
}

.pax-actions{
  flex-wrap: wrap;      /* allow wrapping to avoid truncation */
  overflow: visible;
  gap: 10px;
}

.pax-action{
  flex: 0 0 auto;       /* do not shrink */
  min-width: max-content;
  white-space: nowrap;
  text-overflow: clip;
  overflow: visible;
  padding: 8px 12px;    /* a touch more space */
}

/* V11.6: actions stay on one line + keep full text by freeing width (reserve tag space only for header text) */
.pax-pill{
  padding-right: 16px !important; /* remove the global right reservation that was shrinking actions */
}
.pax-main{
  padding-right: 120px; /* reserve space for the tag only on header text area */
}

.pax-actions{
  flex-wrap: nowrap !important;
  gap: 10px;
  overflow: visible !important;
}

.pax-action{
  flex: 0 0 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

/* V12.2: Center KPI overlay (decisions vs processed) */
.center-kpi{
  position: fixed;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%) scale(.98);
  width: min(620px, calc(100% - 56px));
  padding: 18px 18px;
  border-radius: 22px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 0 0 1px rgba(0,0,0,.18) inset, 0 30px 120px rgba(0,0,0,.45);
  color: rgba(255,255,255,.96);
  text-align: center;
  letter-spacing: .01em;
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  backdrop-filter: blur(10px);
}

.center-kpi .big{
  font-weight: 900;
  font-size: 30px;
  line-height: 1.05;
}

.center-kpi .sub{
  margin-top: 8px;
  font-weight: 700;
  font-size: 14px;
  opacity: .88;
}

.center-kpi.show{
  animation: centerKpiIn 560ms ease-out both;
}

@keyframes centerKpiIn{
  0%{
    opacity: 0;
    transform: translate(-50%, -50%) scale(.96);
    filter: brightness(1);
  }
  45%{
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.02);
    filter: brightness(1.25);
    box-shadow: 0 0 0 1px rgba(255,255,255,.18) inset, 0 0 80px rgba(255,255,255,.18), 0 30px 120px rgba(0,0,0,.45);
    background: rgba(255,255,255,.12);
    border-color: rgba(255,255,255,.22);
  }
  100%{
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    filter: brightness(1.05);
  }
}


/* --- Desktop: smartphone cards layout fix (readability + tag top-left + buttons bottom) --- */
.pax-pill{
  padding:14px;
}

.pax-tag-top{
  font-size:9px;
  padding:4px 8px;
  align-self:flex-start; /* force top-left */
}

.pax-row{
  flex-direction:column;      /* stack content then actions */
  align-items:stretch;
  gap:12px;
}

.pax-pill .left{
  align-items:flex-start;
}

.pax-pill .left > div{
  min-width:0;
}

.pax-pill .t1{
  font-size:13px;
  font-weight:900;
  line-height:1.15;
}

.pax-pill .t2{
  font-size:12px;
  line-height:1.25;
  color: rgba(148,163,184,.92);
}

.pax-actions{
  width:100%;
  justify-content:flex-start;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
  margin-top:2px; /* keeps buttons visually at bottom of card */
}

.pax-actions .btn{
  padding:8px 12px;
  font-size:12px;
}

/* Keep icon readable */
.pax-ico{
  width:36px;
  height:36px;
  border-radius:14px;
}


/* --- v6 tweak: avoid overlap with type tag (top-right) --- */
.pax-pill .left{
  padding-right:84px; /* reserve space for the top-right type tag */
}
.pax-pill .t2{
  margin-top:4px; /* push description slightly down */
}


/* --- v8 inbox phone: scan inside smartphone (desktop) --- */
#inboxPanel{
  background: transparent;
  border: none;
  box-shadow: none;
  overflow: visible;
  padding: 0;
  display:flex;
  align-items:center;
  justify-content:center;
}
#inboxPanel .inbox-phone-shell{ width: min(380px, 100%); }

.inbox-phone-shell{display:flex;justify-content:center;align-items:flex-start;padding:0}
.phone-inbox{width:100%; aspect-ratio: 390 / 844;}
.phone-inbox .phone-screen{display:flex;flex-direction:column;gap:10px;padding-bottom:12px; position:relative;}
.inbox-phone-head{display:flex;align-items:center;justify-content:space-between;padding:0 14px 2px}
.inbox-phone-head .phone-count{opacity:.85;font-size:12px}
.inbox-list{
  flex:1;
  height:auto;
  margin:0 12px 12px 12px;
  border-radius:18px;
}

/* Compact but readable Gmail-like rows (keep text + time visible) */
.phone-inbox .row{
  display:grid;
  grid-template-columns: 30px 1fr auto;
  grid-template-areas:
    "av from time"
    "av subj time";
  column-gap:10px;
  row-gap:2px;
  padding:10px 10px;
}
.phone-inbox .row .avatar{
  grid-area:av;
  width:26px;height:26px;font-size:10px;
}
.phone-inbox .row .src-badge{display:none}

.phone-inbox .row .from{
  grid-area:from;
  font-size:12px;
  font-weight:850;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.phone-inbox .row .subject{
  grid-area:subj;
  font-size:12px;
  color: rgba(226,232,240,.92);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.phone-inbox .row .subject span{display:none} /* hide snippet helper only */

.phone-inbox .row .time{
  grid-area:time;
  display:block;
  font-size:11px;
  opacity:.75;
  align-self:start;
  justify-self:end;
}



/* --- v10 scan mini pile (LEFT phone) --- */
.scan-mini-pile{
  position:absolute;
  left:16px;
  right:16px;
  bottom:18px;
  height:44px;
  pointer-events:none;
  display:flex;
  align-items:flex-end;
}
.scan-mini{
  width:82px;
  height:38px;
  border-radius:10px;
  border:1px solid rgba(148,163,184,.28);
  box-shadow: 0 12px 32px rgba(0,0,0,.45);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:11px;
  font-weight:900;
  color:#e5edff;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  margin-left:-18px;
  transform: translateY(0) translateZ(0);
  opacity:0;
  animation: miniIn 240ms ease forwards;
}
.scan-mini:first-child{margin-left:0}
@keyframes miniIn{to{opacity:1;}}

/* --- v12 scan header (LEFT phone) - positioned at top below inbox-phone-head --- */
.scan-header{
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 14px;
  margin: 0 12px 8px;
  background: rgba(15,23,42,.6);
  border: 1px solid rgba(148,163,184,.15);
  border-radius: 14px;
}

.scan-header-top{
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Logo icon */
.scan-header-logo{
  position: relative;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 8px;
  background: rgba(15,23,42,.85);
  border: 1px solid rgba(148,163,184,.28);
  display: flex;
  align-items: center;
  justify-content: center;
}

.scan-header-logo .logo-icon{
  font-size: 14px;
  line-height: 1;
  color: rgba(226,232,240,.95);
}

.scan-header-badge{
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #2563eb;
  color: white;
  font-size: 9px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Summary text */
.scan-header-summary{
  flex: 1;
  font-size: 12px;
  font-weight: 700;
  color: rgba(226,232,240,.88);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mini squares container (right side of card row) - stack right to left */
.scan-header-squares{
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  margin-left: auto;
}

.scan-header-square{
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(59,130,246,.4);
  border: 1px solid rgba(148,163,184,.3);
}

/* Square colors by tag type */
.scan-header-square.tag-agenda{
  background: rgba(34,211,238,.5);
  border-color: rgba(34,211,238,.6);
}
.scan-header-square.tag-decision,
.scan-header-square.tag-decision-rapide{
  background: rgba(96,165,250,.5);
  border-color: rgba(96,165,250,.6);
}
.scan-header-square.tag-a-lire,
.scan-header-square.tag-cv-screener{
  background: rgba(167,139,250,.5);
  border-color: rgba(167,139,250,.6);
}
.scan-header-square.tag-important,
.scan-header-square.tag-info-importance{
  background: rgba(251,191,36,.5);
  border-color: rgba(251,191,36,.6);
}

/* Temporary card row (appears on detection) */
.scan-header-card-row{
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
}

/* Temporary card */
.scan-header-card{
  height: 32px;
  padding: 0 12px;
  border-radius: 10px;
  background: rgba(59,130,246,.28);
  border: 1px solid rgba(148,163,184,.28);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  color: #e5edff;
  flex-shrink: 0;
}

.scan-header-card.show{
  display: inline-flex;
}

/* Card colors by tag type - matching right panel tags */
.scan-header-card.tag-agenda{
  background: rgba(34,211,238,.28);
  border-color: rgba(34,211,238,.42);
  color: rgba(236,254,255,.98);
}
.scan-header-card.tag-decision,
.scan-header-card.tag-decision-rapide{
  background: rgba(96,165,250,.28);
  border-color: rgba(96,165,250,.44);
  color: rgba(239,246,255,.98);
}
.scan-header-card.tag-a-lire,
.scan-header-card.tag-cv-screener{
  background: rgba(167,139,250,.28);
  border-color: rgba(167,139,250,.44);
  color: rgba(245,243,255,.98);
}
.scan-header-card.tag-important,
.scan-header-card.tag-info-importance{
  background: rgba(251,191,36,.28);
  border-color: rgba(251,191,36,.44);
  color: rgba(255,251,235,.98);
}

/* Ensure phone-screen is positioning context */
.phone-inbox .phone-screen{
  position: relative;
}

/* ============================================
   INTRO OVERLAY WITH SLIDER
   ============================================ */

.intro-overlay{
  position: absolute;
  inset: 0;
  z-index: 100;
  background: linear-gradient(165deg, 
    rgba(15,23,42,.98) 0%, 
    rgba(2,6,23,.99) 50%,
    rgba(15,23,42,.98) 100%);
  border-radius: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 24px;
  opacity: 1;
  transition: opacity 500ms ease, transform 500ms ease;
}

.intro-overlay.hiding{
  opacity: 0;
  transform: scale(0.96);
  pointer-events: none;
}

.intro-overlay.hidden{
  display: none;
}

.intro-content{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.intro-logo{
  font-size: 48px;
  margin-bottom: 8px;
  filter: drop-shadow(0 0 20px rgba(96,165,250,.4));
  animation: introPulse 2s ease-in-out infinite;
}

@keyframes introPulse{
  0%, 100%{ transform: scale(1); filter: drop-shadow(0 0 20px rgba(96,165,250,.4)); }
  50%{ transform: scale(1.05); filter: drop-shadow(0 0 30px rgba(96,165,250,.6)); }
}

.intro-brand{
  font-size: 18px;
  font-weight: 950;
  letter-spacing: 0.12em;
  color: rgba(226,232,240,.98);
}

.intro-tagline{
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(148,163,184,.85);
  text-transform: uppercase;
}

.intro-message{
  margin-top: 24px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(226,232,240,.92);
  line-height: 1.4;
}

.intro-message span{
  color: rgba(96,165,250,1);
  font-weight: 900;
}

/* Slider container - Modern Design */
.slider-container{
  width: 100%;
  max-width: 280px;
  padding: 0 8px;
}

.slider-track{
  position: relative;
  height: 56px;
  background: linear-gradient(135deg, rgba(30,41,59,.95), rgba(15,23,42,.98));
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 
    inset 0 2px 4px rgba(0,0,0,.3),
    0 4px 20px rgba(0,0,0,.25);
}

/* Shimmer effect on track */
.slider-track::before{
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(255,255,255,.03) 50%, 
    transparent 100%);
  pointer-events: none;
}

.slider-progress{
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, 
    rgba(59,130,246,.15) 0%,
    rgba(96,165,250,.25) 100%);
  border-radius: 28px;
  transition: width 50ms linear;
}

/* Glow effect following progress */
.slider-progress::after{
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 60px;
  height: 100%;
  background: radial-gradient(ellipse at right, rgba(96,165,250,.3), transparent 70%);
}

.slider-thumb{
  position: absolute;
  left: 4px;
  top: 4px;
  width: 48px;
  height: 48px;
  background: linear-gradient(145deg, #60a5fa, #3b82f6);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    0 0 0 1px rgba(255,255,255,.1) inset,
    0 4px 12px rgba(59,130,246,.5),
    0 2px 4px rgba(0,0,0,.2);
  z-index: 2;
  transition: left 50ms linear, transform 150ms ease, box-shadow 150ms ease;
}

/* Bounce animation for idle state */
.slider-thumb.bouncing{
  animation: sliderBounce 1.5s ease-in-out infinite;
}

@keyframes sliderBounce{
  0%, 100%{ 
    transform: translateX(0); 
    box-shadow: 
      0 0 0 1px rgba(255,255,255,.1) inset,
      0 4px 12px rgba(59,130,246,.5),
      0 2px 4px rgba(0,0,0,.2);
  }
  50%{ 
    transform: translateX(8px); 
    box-shadow: 
      0 0 0 1px rgba(255,255,255,.15) inset,
      0 4px 20px rgba(59,130,246,.6),
      0 2px 4px rgba(0,0,0,.2);
  }
}

.slider-thumb.sliding{
  animation: none;
  box-shadow: 
    0 0 0 1px rgba(255,255,255,.15) inset,
    0 6px 20px rgba(59,130,246,.6),
    0 2px 4px rgba(0,0,0,.2);
}

.slider-thumb.complete{
  background: linear-gradient(145deg, #4ade80, #22c55e);
  box-shadow: 
    0 0 0 1px rgba(255,255,255,.15) inset,
    0 4px 16px rgba(34,197,94,.5),
    0 2px 4px rgba(0,0,0,.2);
  animation: none;
}

/* Arrow icon */
.slider-arrow{
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.slider-arrow svg{
  width: 20px;
  height: 20px;
  stroke: white;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.2));
}

.slider-label{
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: rgba(148,163,184,.7);
  pointer-events: none;
  transition: opacity 400ms ease, transform 400ms ease;
}

.slider-track.sliding .slider-label{
  opacity: 0;
  transform: translateX(20px);
}

.slider-track.complete .slider-label{
  opacity: 0;
  transform: translateX(30px);
}
