/* =========================================================
   0) DESIGN TOKENS (thème)
   ========================================================= */
:root{
  --bg:#000; --fg:#fff; --muted:#9ca3af; --line:#1f2937; --card:#0a0a0a;
  --fab-bg:#0a0a0a; --fab-fg:#e5e7eb; --fab-muted:#9ca3af;
  --fab-line:#1f2937; --fab-accent:#2563eb; --fab-danger:#ef4444;
}

/* =========================================================
   1) RESET / BASE
   ========================================================= */
*{ box-sizing:border-box; }

html,body{
  margin:0; padding:0;
  background:var(--bg); color:var(--fg);
  font-family:'Inter',system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  line-height:1.6;
}

a{ color:var(--fg); text-decoration:none; }
a:hover{ opacity:.9; }

code{
  background:var(--line);
  padding:.1rem .35rem;
  border-radius:.35rem;
}

/* =========================================================
   2) LAYOUT GÉNÉRAL (container, header, footer, hero)
   ========================================================= */
.container{ max-width:60%; margin:0 auto; padding:20px; }

.site-header{
  position:sticky; top:0; z-index:10;
  background:rgba(0,0,0,.9);
  backdrop-filter:saturate(120%) blur(6px);
  border-bottom:1px solid var(--line);
}
.nav{ display:flex; align-items:center; justify-content:space-between; }
.brand{ font-weight:800; letter-spacing:.5px; font-size:1.25rem; padding:.6rem 0; }
.menu a{ margin-left:1rem; color:var(--muted); }
.menu a:hover{ color:var(--fg); }

.hero{ padding:32px 0 32px; }
.hero h1{ font-size:clamp(2rem,5vw,3rem); margin:0 0 10px; line-height:1.1; }
.hero p{ color:var(--muted); max-width:64ch; margin:0 0 16px; }

.site-footer{ border-top:1px solid var(--line); margin-top:32px; }
.foot{ display:flex; align-items:center; justify-content:space-between; color:var(--muted); }
.footer-links a{ color:var(--muted); margin-left:1rem; }
.footer-links a:hover{ color:var(--fg); }

@media (max-width:640px){
  .menu{ display:none; }
  .hero{ padding:40px 0 20px; }
  .foot{ flex-direction:column; gap:8px; }
}

/* =========================================================
   3) BOUTONS & UTILITAIRES
   ========================================================= */
.btn{
  display:inline-flex; align-items:center; gap:8px;
  border:1px solid var(--fg);
  padding:.6rem 1rem; border-radius:.6rem;
  font-weight:600; color:var(--fg); background:transparent;
  cursor:pointer; transition:transform .15s ease;
}
.btn:hover{ transform:translateY(-1px); }
.btn + .btn{ margin-left:.6rem; }
.btn.outline{ background:transparent; }
.btn.block{ width:100%; }        /* pour les formulaires (ex. login) */
.btn[disabled]{ opacity:.6; cursor:not-allowed; }

.small{ font-size:12px; color:var(--muted); }

/* =========================================================
   4) CARTES / GRILLES
   ========================================================= */
.cards{
  display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,320px));
  gap:16px; justify-content:center; align-items:stretch;
}
.cards > a{ display:block; height:100%; }
.cards > a .card{
  height:100%; display:flex; flex-direction:column; justify-content:space-between;
}
.card{
  background:var(--card); border:1px solid var(--line);
  border-radius:12px; padding:16px; min-height:170px;
}
.card h2{ margin-bottom:8px; }
.card p{ margin-top:auto; color:var(--muted); }

/* =========================================================
   5) BARRE DE RECHERCHE / RÉSULTATS
   ========================================================= */
main.container{ max-width:60%; color:#f4f4f5; text-align:center; }

.search-container{ display:flex; justify-content:center; margin-top:40px; position:relative; }

.search-box{
  position:relative; display:flex; align-items:center;
  background:linear-gradient(145deg,#1a1a1a,#0f0f0f);
  border-radius:999px; width:100%; max-width:520px; padding:2px; overflow:hidden;
  box-shadow:0 0 0 1px #2a2a2a; transition:all .3s ease;
}
.search-box::before{
  content:""; position:absolute; inset:0; border-radius:inherit; padding:2px;
  background:linear-gradient(120deg,#4e9fff,#7b5eff,#00ffe7); background-size:200% 200%;
  opacity:0; transition:opacity .4s ease, background-position .8s ease;
  animation:shimmer 2s infinite linear; z-index:0;
}
@keyframes shimmer{ 0%{background-position:0 50%} 50%{background-position:100% 50%} 100%{background-position:0 50%} }
.search-box:focus-within::before{ opacity:1; }

.search-box input{
  flex:1; border:none; outline:none; background:transparent; color:#fff;
  font-size:16px; padding:14px 48px 14px 18px; position:relative; z-index:1;
}
.search-box input::placeholder{ color:#888; opacity:1; transition:color .3s ease; }
.search-box input:focus::placeholder{ color:#fff; }

.search-btn{
  position:absolute; right:4px; top:50%; transform:translateY(-50%);
  background:#4e9fff; border:none; border-radius:50%; padding:10px;
  display:flex; justify-content:center; align-items:center; cursor:pointer;
  transition:all .2s ease; z-index:1;
}
.search-btn:hover{ background:#6ab1ff; transform:translateY(-50%) scale(1.05); }
.search-btn svg{ width:20px; height:20px; color:#fff; }

.result-box{
  background:#111; margin-top:30px; padding:20px; border-radius:12px;
  text-align:left; color:#e0e0e0; box-shadow:0 2px 6px rgba(0,0,0,.4);
  max-height:400px; overflow-y:auto; white-space:pre-wrap;
}
.placeholder{ color:#666; text-align:center; }

/* =========================================================
   6) CHAT (grande fenêtre centrale)
   ========================================================= */
.chat-container{ max-width:80%; margin:2rem auto; }
.chat-window{
  background:#1b1f27; border-radius:20px; overflow:hidden;
  box-shadow:0 0 30px rgba(0,0,0,.4);
  display:flex; flex-direction:column; height:75vh;
}
.chat-header{
  background:#15191f; display:flex; align-items:center; justify-content:space-between;
  padding:.8rem 1.2rem;
}
.chat-header .btns{ display:flex; gap:.5rem; }
.chat-header .btn{ width:12px; height:12px; border-radius:50%; }
.green{ background:#00ca4e; } .yellow{ background:#ffbd44; } .red{ background:#ff605c; }

.chat-body{ flex:1; display:flex; flex-direction:column; overflow:hidden; }
.chat-history{
  flex:1; padding:1rem; overflow-y:auto; display:flex; flex-direction:column; gap:8px;
  scroll-behavior:smooth;
}
.message{ max-width:80%; padding:10px 14px; border-radius:16px; line-height:1.4; margin:4px 0; }
.user{ align-self:flex-end; background:#2563eb; color:#fff; }
.assistant{ align-self:flex-start; background:#2d3748; }
.message.assistant:first-child{ margin-top:0; }
.message.assistant{ transition:all .25s ease-in-out; }

.chat-input-zone{
  display:flex; align-items:center; gap:.5rem; padding:.6rem 1rem;
  border-top:1px solid #2d3748; background:#15191f;
}
.chat-input-zone input{
  flex:1; padding:.6rem 1rem; border-radius:12px; border:none;
  background:#2d3748; color:#fff; outline:none;
}
.chat-input-zone button{
  background:#2563eb; border:none; color:#fff; padding:.6rem 1rem; border-radius:12px;
  cursor:pointer; font-weight:bold;
}
.chat-input-zone button:hover{ background:#1d4ed8; }
.file-upload{ cursor:pointer; font-size:18px; }

/* bloc <think> */
.think-block{
  display:block; margin:8px 0; padding:8px; border:1px dashed var(--line);
  border-radius:6px; color:var(--muted); background:#0b0b0b; white-space:pre-wrap;
}
.think-label{ font-weight:700; display:block; margin-bottom:4px; color:#6b7280; }

/* =========================================================
   7) LOADER (générique)
   ========================================================= */
.loader{
  display:none; width:14px; height:14px; margin-left:6px;
  border:2px solid #374151; border-top-color:#e5e7eb;
  border-radius:50%; animation:spin .8s linear infinite;
}
@keyframes spin{ to{ transform:rotate(360deg); } }

/* scrollbars chat */
.chat-history::-webkit-scrollbar{ width:8px; }
.chat-history::-webkit-scrollbar-thumb{ background:#3b4252; border-radius:4px; }
.chat-history::-webkit-scrollbar-thumb:hover{ background:#5a6070; }

/* =========================================================
   8) MODULE TRANSLATOR / PANELS (réutilisable)
   ========================================================= */
.translator-wrap{ max-width:980px; margin:24px auto; }
.flex-2{ display:grid; grid-template-columns:1fr auto 1fr; gap:12px; align-items:stretch; }
@media (max-width:860px){ .flex-2{ grid-template-columns:1fr; } }

.panel{
  background:#0a0a0a; border:1px solid var(--line); border-radius:12px;
  padding:12px; height:380px; display:flex; flex-direction:column;
}
.panel h3{ margin:0 0 8px; font-size:14px; color:var(--muted); }
.panel textarea{
  flex:1; resize:vertical; min-height:260px; background:#0b0b0b; color:#e5e7eb;
  border:1px solid var(--line); border-radius:8px; padding:10px;
  font:14px/1.5 Menlo,Monaco,Consolas,monospace;
}
.center-col{ display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px; }

.row{ display:flex; gap:8px; align-items:center; justify-content:space-between; margin:6px 0 10px; }
select{ background:#0b0b0b; color:#e5e7eb; border:1px solid var(--line); border-radius:6px; padding:6px 8px; font-size:13px; }
.kbd{ border:1px solid #374151; border-radius:4px; padding:2px 6px; font:12px/1 Menlo,monospace; color:#9ca3af; }

/* =========================================================
   9) DEFINE DANCE (3 sorties)
   ========================================================= */
.dd-wrap{ max-width:1100px; margin-top:20px; }
.dd-toolbar{
  display:grid; grid-template-columns:1fr auto; gap:10px; position:sticky; top:0;
  background:rgba(0,0,0,.85); border:1px solid var(--line); border-radius:12px; padding:10px; backdrop-filter:blur(6px);
}
.dd-toolbar input[type="text"]{
  width:100%; padding:.7rem .9rem; border-radius:10px; border:1px solid var(--line);
  background:#0b0b0b; color:var(--fg);
}
.dd-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin-top:14px; }
@media (max-width:980px){ .dd-grid{ grid-template-columns:1fr; } }

.dd-panel{
  background:var(--card); border:1px solid var(--line); border-radius:12px;
  padding:12px; display:flex; flex-direction:column; min-height:420px;
}
.dd-panel h3{
  margin:0 0 8px; font-size:14px; color:var(--muted);
  display:flex; align-items:center; justify-content:space-between;
}
.dd-row{ display:flex; align-items:center; gap:8px; justify-content:flex-start; margin:6px 0; }
.dd-progress{ font-size:12px; color:#9ca3af; }
.dd-out{
  flex:1; resize:vertical; min-height:260px; background:#0b0b0b; color:#e5e7eb;
  border:1px solid var(--line); border-radius:8px; padding:10px;
  font:13px/1.5 Menlo,Monaco,Consolas,monospace; white-space:pre-wrap;
}
.dd-metrics{
  font:12px/1.4 Menlo,Monaco,Consolas,monospace; color:#9ca3af; padding:6px 8px;
  border:1px dashed var(--line); border-radius:8px; margin:4px 0 8px; background:#0b0b0b; white-space:pre-wrap;
}
.dd-metrics b{ color:#e5e7eb; }

/* =========================================================
   10) LOGIN
   ========================================================= */
.wrap{ min-height:100svh; display:grid; place-items:center; padding:24px; }
.card-login{ width:100%; max-width:420px; background:var(--card); border:1px solid var(--line); border-radius:14px; padding:20px; }
h1{ margin:.2rem 0 1rem; font-size:1.3rem; }
.muted{ color:var(--muted); font-size:.9rem; margin-bottom:14px; }
label{ display:block; font-size:.9rem; margin:.6rem 0 .3rem; }
input[type="email"],input[type="password"]{
  width:100%; padding:.7rem .8rem; border-radius:10px; border:1px solid var(--line); background:#0b0b0b; color:var(--fg);
}
.error{ color:#f87171; font-size:.9rem; margin-top:10px; }
.ok{ color:#34d399; font-size:.9rem; margin-top:10px; }
.foot{ margin-top:12px; color:var(--muted); font-size:.85rem; text-align:center; }

/* =========================================================
   11) GREENLIGHT (galerie d’images)
   ========================================================= */
.sd-ui{ display:flex; gap:.6rem; align-items:center; margin:12px 0; }
.sd-ui input{
  flex:1; padding:.7rem 1rem; border-radius:12px; border:1px solid var(--line);
  background:#0b0b0b; color:#e5e7eb;
}
.sd-ui button{ background:#2563eb; border:none; color:#fff; padding:.6rem 1rem; border-radius:12px; cursor:pointer; }
.sd-ui button[disabled]{ opacity:.6; cursor:not-allowed; }

.sd-gallery{
  display:flex; flex-wrap:wrap; gap:16px; justify-content:center; align-items:flex-start; margin-top:16px;
}
.sd-card{
  background:#0a0a0a; border:1px solid var(--line); border-radius:14px; overflow:hidden;
  width:min(720px,92vw); box-shadow:0 6px 24px rgba(0,0,0,.35);
}
.sd-card img{ display:block; width:100%; height:auto; }
.sd-card a{
  position:absolute; right:8px; bottom:8px; font:12px/1 Menlo,monospace;
  color:#e5e7eb; background:rgba(0,0,0,.45); padding:4px 6px; border-radius:6px; text-decoration:none;
}
.sd-row{ display:flex; gap:1rem; flex-wrap:nowrap; }

/* =========================================================
   12) FAB CHAT (bulle flottante)
   ========================================================= */
/* conteneur & bouton */
.fab-container{ position:fixed; bottom:24px; right:24px; z-index:9999; }
.fab-button{
  width:56px; height:56px; border-radius:50%; border:none; outline:none; cursor:pointer;
  font-size:32px; line-height:0; display:flex; align-items:center; justify-content:center;
  background:#1976d2; color:#fff; box-shadow:0 4px 10px rgba(0,0,0,.25);
  transition:transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.fab-button #fab-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  display: block;
  filter: drop-shadow(0 0 0 transparent);
  transition: transform .15s ease, filter .2s ease, opacity .2s ease;
}

.fab-button:hover #fab-icon {
  transform: scale(1.06);
  filter: drop-shadow(0 1px 4px rgba(0,0,0,.25));
}

.fab-button:hover{ transform:translateY(-2px); box-shadow:0 6px 14px rgba(0,0,0,.3); background:#1565c0; }
.fab-container.is-open .fab-button{ transform:rotate(45deg); }

/* panneau */
.fab-panel{
  position:fixed; right:20px; bottom:90px;
  width:min(380px,92vw); max-height:70vh;
  background:var(--fab-bg); color:var(--fab-fg);
  border:1px solid var(--fab-line); border-radius:16px;
  box-shadow:0 22px 60px rgba(0,0,0,.45);
  overflow:hidden; display:none; flex-direction:column;
}
.fab-container.is-open .fab-panel{ display:flex; }

/* header */
.fab-chat__header{
  padding:10px 12px; border-bottom:1px solid var(--fab-line);
  display:flex; justify-content:space-between; align-items:center; background:rgba(255,255,255,.03);
}
.fab-chat__title{ font-weight:700; letter-spacing:.2px; }
.fab-chat__close{ background:transparent; border:none; color:var(--fab-muted); font-size:20px; cursor:pointer; }

/* messages scrollables */
#fab-messages{
  flex:1; overflow-y:auto; padding:12px; display:flex; flex-direction:column; gap:10px;
  overscroll-behavior:contain; -webkit-overflow-scrolling:touch;
}
#fab-messages::-webkit-scrollbar{ width:8px; }
#fab-messages::-webkit-scrollbar-thumb{ background:#3b4252; border-radius:4px; }
#fab-messages::-webkit-scrollbar-thumb:hover{ background:#5a6070; }

/* bulles */
.fab-msg{ max-width:86%; padding:10px 12px; border-radius:12px; line-height:1.45; font-size:.95rem; }
.fab-msg--user{ align-self:flex-end; background:#2563eb; color:#fff; }
.fab-msg--bot{ align-self:flex-start; background:#111827; border:1px solid var(--fab-line); color:#e5e7eb; }
.fab-msg--meta{ align-self:center; color:var(--fab-muted); background:transparent; padding:0; font-size:.85rem; }

/* footer / input */
.fab-chat__footer{ border-top:1px solid var(--fab-line); padding:10px; background:rgba(255,255,255,.03); }
.fab-chat__form{ display:flex; gap:8px; }
.fab-chat__input{
  flex:1; border-radius:10px; background:#0b0b0b; color:#fff;
  border:1px solid var(--fab-line); padding:10px 12px; outline:none;
}
.fab-chat__send{
  min-width:44px; border-radius:10px; background:#2563eb; color:#fff; border:none; cursor:pointer; font-weight:700;
}
.fab-chat__send[disabled]{ opacity:.6; cursor:not-allowed; }

/* loader spécifique du fab */
.fab-loader{
  width:16px; height:16px; border-radius:50%;
  border:2px solid #374151; border-top-color:#e5e7eb;
  display:inline-block; animation:spin .8s linear infinite; vertical-align:-3px;
}

/* =========================================================
   13) PAGE LISTE / TABLEAU
   ========================================================= */
.list-page{
  max-width:80%;
}

.hero--compact{
  padding:28px 0 20px;
}

.table-card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:16px;
  padding:18px;
  box-shadow:0 10px 30px rgba(0,0,0,.22);
}

.table-toolbar{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  margin-bottom:16px;
  flex-wrap:wrap;
}

.table-title{
  margin:0;
  font-size:1.15rem;
}

.table-subtitle{
  margin:4px 0 0;
  color:var(--muted);
  font-size:.95rem;
}

.table-wrap{
  overflow-x:auto;
  border:1px solid var(--line);
  border-radius:12px;
  background:#0b0b0b;
}

.axiom-table{
  width:100%;
  border-collapse:collapse;
  min-width:860px;
  text-align:left;
}

.axiom-table thead{
  background:#111827;
}

.axiom-table th{
  color:#cbd5e1;
  font-size:.9rem;
  font-weight:700;
  letter-spacing:.2px;
  padding:14px 16px;
  border-bottom:1px solid var(--line);
  white-space:nowrap;
}

.axiom-table td{
  padding:14px 16px;
  border-bottom:1px solid rgba(255,255,255,.05);
  vertical-align:middle;
}

.axiom-table tbody tr{
  transition:background .18s ease, transform .12s ease;
  cursor:pointer;
}

.axiom-table tbody tr:hover{
  background:rgba(37,99,235,.08);
}

.axiom-table tbody tr:focus{
  outline:none;
  background:rgba(37,99,235,.12);
  box-shadow:inset 0 0 0 1px #2563eb;
}

.axiom-table tbody tr:last-child td{
  border-bottom:none;
}

.col-name{
  min-width:220px;
}

.item-name{
  font-weight:700;
  color:var(--fg);
}

.score-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:64px;
  padding:6px 10px;
  border-radius:999px;
  background:rgba(255,255,255,.06);
  border:1px solid var(--line);
  color:#e5e7eb;
  font-weight:700;
  font-size:.92rem;
}

.score-badge--final{
  background:rgba(37,99,235,.15);
  border-color:rgba(37,99,235,.35);
  color:#dbeafe;
}

.status{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:34px;
  height:34px;
  border-radius:50%;
  font-size:1rem;
  font-weight:800;
}

.status--ok{
  color:#86efac;
  background:rgba(34,197,94,.12);
  border:1px solid rgba(34,197,94,.28);
}

.status--ko{
  color:#fca5a5;
  background:rgba(239,68,68,.12);
  border:1px solid rgba(239,68,68,.28);
}

.col-observation{
  width:360px;
  min-width:360px;
  max-width:360px;
}

.observation-scroll{
  max-width:100%;
  overflow-x:auto;
  overflow-y:hidden;
  white-space:nowrap;
  padding-bottom:4px;
  scrollbar-width:thin;
  scrollbar-color:#3b4252 transparent;
}

.observation-scroll::-webkit-scrollbar{
  height:8px;
}

.observation-scroll::-webkit-scrollbar-thumb{
  background:#3b4252;
  border-radius:4px;
}

.observation-scroll::-webkit-scrollbar-thumb:hover{
  background:#5a6070;
}

.observation-text{
  display:inline-block;
  min-width:max-content;
  color:var(--muted);
}

@media (max-width:860px){
  .list-page{
    max-width:95%;
  }

  .table-card{
    padding:14px;
  }
}

/* =========================================================
   14) PAGE DETAIL / VUE UNIQUE
   ========================================================= */
.detail-page{
  max-width:80%;
}

.detail-card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:18px;
  padding:22px;
  box-shadow:0 14px 36px rgba(0,0,0,.26);
  margin-top:28px;
}

.detail-topbar{
  display:flex;
  justify-content:flex-start;
  margin-bottom:18px;
}

.detail-header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:20px;
  margin-bottom:22px;
  padding-bottom:18px;
  border-bottom:1px solid var(--line);
}

.detail-kicker{
  margin:0 0 6px;
  color:var(--muted);
  font-size:.92rem;
  letter-spacing:.2px;
}

.detail-header h1{
  margin:0 0 8px;
  font-size:clamp(1.7rem, 4vw, 2.4rem);
  line-height:1.1;
}

.detail-subtitle{
  margin:0;
  color:var(--muted);
}

.detail-status-wrap{
  flex-shrink:0;
}

.status-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:10px 14px;
  border-radius:999px;
  font-weight:700;
  white-space:nowrap;
}

.status-pill--ok{
  color:#86efac;
  background:rgba(34,197,94,.12);
  border:1px solid rgba(34,197,94,.28);
}

.status-pill--ko{
  color:#fca5a5;
  background:rgba(239,68,68,.12);
  border:1px solid rgba(239,68,68,.28);
}

.detail-grid{
  display:grid;
  grid-template-columns:1.4fr .9fr;
  gap:16px;
  margin-bottom:16px;
}

.detail-info-card,
.detail-file-card,
.detail-observation-card{
  background:#0b0b0b;
  border:1px solid var(--line);
  border-radius:14px;
  padding:18px;
}

.detail-info-card h2,
.detail-file-card h2,
.detail-observation-card h2{
  margin:0 0 14px;
  font-size:1rem;
}

.info-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.info-row{
  display:grid;
  grid-template-columns:180px 1fr;
  gap:14px;
  align-items:center;
  padding:10px 0;
  border-bottom:1px solid rgba(255,255,255,.05);
}

.info-row:last-child{
  border-bottom:none;
  padding-bottom:0;
}

.info-label{
  color:var(--muted);
  font-size:.95rem;
}

.info-value{
  color:var(--fg);
  font-weight:500;
  word-break:break-word;
}

.status-inline{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-weight:700;
}

.status-inline--ok{
  color:#86efac;
}

.status-inline--ko{
  color:#fca5a5;
}

.file-box{
  display:flex;
  align-items:center;
  gap:14px;
  background:#111827;
  border:1px solid var(--line);
  border-radius:12px;
  padding:14px;
  margin-bottom:16px;
}

.file-icon{
  width:48px;
  height:48px;
  border-radius:12px;
  display:grid;
  place-items:center;
  background:rgba(255,255,255,.05);
  font-size:1.35rem;
}

.file-meta{
  min-width:0;
}

.file-name{
  font-weight:700;
  color:var(--fg);
  word-break:break-word;
}

.file-help{
  color:var(--muted);
  font-size:.92rem;
  margin-top:4px;
}

.file-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.observation-box{
  min-height:140px;
  background:#111;
  border:1px solid var(--line);
  border-radius:12px;
  padding:14px;
  color:#d1d5db;
  line-height:1.7;
  white-space:pre-wrap;
}

.empty-state{
  padding:20px 4px 4px;
}

@media (max-width:900px){
  .detail-page{
    max-width:95%;
  }

  .detail-card{
    padding:16px;
  }

  .detail-header{
    flex-direction:column;
    align-items:flex-start;
  }

  .detail-grid{
    grid-template-columns:1fr;
  }

  .info-row{
    grid-template-columns:1fr;
    gap:6px;
  }

  .file-actions .btn{
    width:100%;
    justify-content:center;
  }
}

/* SINGLE DIRECTIVE INDICATEURS */

.note-tooltip{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:64px;
  padding:6px 10px;
  border-radius:999px;
  background:rgba(255,255,255,.06);
  border:1px solid var(--line);
  color:#e5e7eb;
  font-weight:700;
  font-size:.92rem;
  cursor:help;
}

.details-compact-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:10px;
}

.detail-chip{
  background:#111827;
  border:1px solid var(--line);
  border-radius:12px;
  padding:10px;
  display:flex;
  flex-direction:column;
  gap:6px;
}

.detail-chip--full{
  grid-column:1 / -1;
}

.detail-chip-label{
  color:var(--muted);
  font-size:.78rem;
  line-height:1.2;
}

.detail-chip-value{
  display:flex;
  align-items:center;
  min-height:32px;
}

@media (max-width:640px){
  .details-compact-grid{
    grid-template-columns:1fr;
  }
}


/* =========================================================
   15) OCR / EXTRACT IMAGES TEXT
   ========================================================= */

.ocr-page{
  max-width:80%;
  text-align:left;
}

.ocr-card{
  margin-top:10px;
}

.ocr-form{
  width:100%;
}

.ocr-page .form-group{
  margin-bottom:16px;
}

.ocr-page label{
  color:#e5e7eb;
  font-weight:700;
  margin-bottom:8px;
}

.ocr-page textarea{
  width:100%;
  resize:vertical;
  background:#0b0b0b;
  color:#e5e7eb;
  border:1px solid var(--line);
  border-radius:10px;
  padding:12px;
  font:14px/1.5 Menlo, Monaco, Consolas, monospace;
}

.ocr-page textarea:focus{
  border-color:#2563eb;
  box-shadow:0 0 0 1px rgba(37,99,235,.45);
  outline:none;
}

.ocr-drop{
  position:relative;
  min-height:280px;
  border:3px dashed var(--line);
  border-radius:16px;
  background:#0b0b0b;
  overflow:hidden;
  display:grid;
  place-items:center;
  text-align:center;
  transition:border-color .25s ease, background .25s ease, transform .15s ease;
}

.ocr-drop:hover,
.ocr-drop.is-dragover{
  border-color:#2563eb;
  background:rgba(37,99,235,.08);
  transform:translateY(-1px);
}

.ocr-drop-content{
  color:var(--muted);
  pointer-events:none;
  padding:24px;
  transition:color .25s ease;
}

.ocr-drop:hover .ocr-drop-content,
.ocr-drop.is-dragover .ocr-drop-content{
  color:#dbeafe;
}

.ocr-drop-icon{
  font-size:3rem;
  margin-bottom:8px;
}

.ocr-drop-title{
  font-size:1.7rem;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.5px;
  color:#e5e7eb;
}

.ocr-drop-desc{
  margin-top:6px;
  color:var(--muted);
}

.ocr-drop-browse{
  display:inline-flex;
  margin-top:14px;
  padding:8px 14px;
  border-radius:999px;
  background:#2563eb;
  color:#fff;
  font-weight:700;
  font-size:.9rem;
}

.ocr-drop input[type="file"]{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  opacity:0;
  cursor:pointer;
}

.ocr-preview-list{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(86px, 1fr));
  gap:10px;
  margin-top:14px;
}

.ocr-thumb-wrap{
  background:#111827;
  border:1px solid var(--line);
  border-radius:12px;
  padding:8px;
  overflow:hidden;
}

.ocr-thumb{
  width:100%;
  height:76px;
  object-fit:cover;
  display:block;
  border-radius:8px;
}

.ocr-thumb-name{
  display:block;
  margin-top:6px;
  color:var(--muted);
  font-size:.75rem;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.ocr-actions{
  margin-top:16px;
}

.ocr-message{
  margin-top:16px;
  background:rgba(239,68,68,.08);
  border:1px solid rgba(239,68,68,.28);
  border-radius:12px;
  padding:12px 14px;
}

.ocr-result-card{
  margin-top:16px;
}

.ocr-result{
  width:100%;
  min-height:360px;
  background:#111;
  color:#d1d5db;
  border:1px solid var(--line);
  border-radius:12px;
  padding:14px;
  font:14px/1.6 Menlo, Monaco, Consolas, monospace;
  white-space:pre-wrap;
}

@media (max-width:900px){
  .ocr-page{
    max-width:95%;
  }

  .ocr-drop{
    min-height:220px;
  }

  .ocr-drop-title{
    font-size:1.35rem;
  }
}

/* =========================================================
   16) OCR COMPARAISON / SKELETON
   ========================================================= */

.compare-grid{
  display:none;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:16px;
  margin-top:18px;
}

.compare-grid.is-loading,
.compare-grid.has-result{
  display:grid;
}

.compare-card{
  background:#0b0b0b;
  border:1px solid var(--line);
  border-radius:14px;
  padding:18px;
}

.compare-card h2{
  margin:0 0 14px;
  font-size:1rem;
}

.compare-output{
  display:block;
}

.compare-grid.is-loading .compare-output{
  display:none;
}

.compare-grid.has-result .skeleton-wrap{
  display:none;
}

.skeleton-wrap{
  display:none;
  flex-direction:column;
  gap:10px;
  padding:10px 0;
}

.compare-grid.is-loading .skeleton-wrap{
  display:flex;
}

.skeleton-line{
  height:14px;
  border-radius:999px;
  background:linear-gradient(
    90deg,
    #111827 0%,
    #1f2937 45%,
    #374151 50%,
    #1f2937 55%,
    #111827 100%
  );
  background-size:220% 100%;
  animation:skeleton-loading 1.2s ease-in-out infinite;
}

.w-100{ width:100%; }
.w-95{ width:95%; }
.w-90{ width:90%; }
.w-85{ width:85%; }
.w-80{ width:80%; }
.w-75{ width:75%; }
.w-70{ width:70%; }
.w-65{ width:65%; }

@keyframes skeleton-loading{
  0%{ background-position:120% 0; }
  100%{ background-position:-120% 0; }
}

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


.ocr-thumb-wrap{
  position:relative;
}

.ocr-thumb-remove{
  position:absolute;
  top:4px;
  right:4px;
  z-index:2;
  width:24px;
  height:24px;
  border-radius:50%;
  border:1px solid rgba(239,68,68,.45);
  background:rgba(127,29,29,.9);
  color:#fff;
  cursor:pointer;
  font-weight:800;
  line-height:1;
}

.ocr-thumb-remove:hover{
  background:#ef4444;
}

.compare-card.is-loading-one .skeleton-wrap{
  display:flex;
}

.compare-card.is-loading-one .compare-output{
  display:block;
}

.compare-card.has-started .skeleton-wrap{
  display:none;
}

.compare-card:not(.is-loading-one) .skeleton-wrap{
  display:none;
}

.compare-output{
  display:block;
}