/* =====================================================
   PULSE — Platform for Urgent Live Scenario Exercises
   ===================================================== */

*{box-sizing:border-box;margin:0;padding:0}

:root{
  /* Brand */
  --brand:#22c55e;          /* PULSE green */
  --brand-2:#16a34a;        /* darker green */
  --brand-soft:#dcfce7;     /* very light green */
  --brand-tint:rgba(34,197,94,.08);

  /* Surfaces */
  --bg:#fafafa;
  --bg2:#ffffff;
  --bg3:#f3f4f6;

  /* Ink */
  --text:#0f172a;
  --text2:#475569;
  --text3:#94a3b8;

  /* Lines */
  --border:#e5e7eb;
  --border2:#d1d5db;

  /* Shape */
  --radius:14px;
  --radius-sm:8px;
  --shadow-sm:0 1px 2px rgba(15,23,42,.04), 0 1px 3px rgba(15,23,42,.06);
  --shadow-md:0 4px 12px rgba(15,23,42,.06), 0 2px 4px rgba(15,23,42,.04);
  --shadow-lg:0 12px 32px rgba(15,23,42,.10), 0 4px 8px rgba(15,23,42,.04);

  /* Channels */
  --x:#000;
  --of:#e30613;
  --blue:#1d9bf0;
}

html,body{height:100%;overflow:hidden}
body{
  font-family:'Inter','Segoe UI',system-ui,-apple-system,sans-serif;
  background-color:#f8fafc;
  color:var(--text);
  -webkit-font-smoothing:antialiased;
  display:flex;
  flex-direction:column;
  height:100vh;
}
/* Subtle hex pattern is restored only on the newsroom (not on home, simulation room, or configurator) */
#newsroom{
  background-image:url("../img/hex-pattern.svg");
  background-repeat:repeat;
  background-size:240px 208px;
  background-attachment:fixed;
}

/* ─── App header (global) ─── */
.app-header{
  display:flex;align-items:center;gap:1rem;
  padding:.75rem 1.25rem;
  background:rgba(255,255,255,.85);
  backdrop-filter:saturate(180%) blur(10px);
  -webkit-backdrop-filter:saturate(180%) blur(10px);
  border-bottom:1px solid var(--border);
  position:sticky;top:0;z-index:100;
  flex-wrap:wrap;
}
.app-brand{display:flex;align-items:center;gap:.65rem;text-decoration:none;color:inherit;cursor:pointer}
.app-brand:hover{opacity:.85}
.app-logo{width:40px;height:40px;display:block;flex-shrink:0}
.app-brand-text{display:flex;flex-direction:column;line-height:1.15}
.app-brand-text strong{font-size:20px;font-weight:800;letter-spacing:.04em;color:var(--text)}
.app-brand-text small{font-size:11px;font-weight:500;color:var(--brand-2);letter-spacing:.01em}
.app-context{
  font-size:13px;font-weight:600;color:var(--text2);
  margin-left:.5rem;padding-left:.85rem;border-left:1px solid var(--border);
  display:flex;align-items:center;gap:.4rem;
}
.app-context svg{width:14px;height:14px}
.app-spacer{flex:1}
.app-controls{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}

/* Mode toggle pill (home page top-right) */
.mode-toggle{
  display:inline-flex;align-items:center;gap:.45rem;
  padding:.4rem .85rem;
  background:#fff;color:var(--text);
  border:1px solid var(--border2);border-radius:8px;
  font-size:12.5px;font-weight:500;cursor:pointer;
  transition:background .15s, border-color .15s, transform .1s;
}
.mode-toggle:hover{background:#f8fafc;border-color:#9ca3af}
.mode-toggle:active{transform:scale(.97)}
.mode-toggle.active{background:var(--brand);color:#fff;border-color:var(--brand)}
.mode-toggle.active:hover{background:var(--brand-2)}
.mode-toggle svg{width:14px;height:14px;color:var(--text2)}

/* ─── Buttons ─── */
.btn{
  display:inline-flex;align-items:center;gap:.4rem;
  background:var(--bg2);border:1px solid var(--border2);border-radius:var(--radius-sm);
  padding:.45rem .85rem;font-size:12.5px;font-weight:500;font-family:inherit;
  color:var(--text);cursor:pointer;white-space:nowrap;
  transition:background .12s, border-color .12s, box-shadow .12s, transform .08s;
}
.btn:hover{background:var(--bg3);border-color:#9ca3af}
.btn:active{transform:translateY(1px)}
.btn-primary{background:var(--brand);border-color:var(--brand);color:#fff}
.btn-primary:hover{background:var(--brand-2);border-color:var(--brand-2)}
.btn-red{background:var(--of);border-color:var(--of);color:#fff}
.btn-red:hover{background:#c5040f;border-color:#c5040f}
.btn-ghost{background:transparent;border-color:transparent}
.btn-ghost:hover{background:var(--bg3)}
.btn-loading{opacity:.6;pointer-events:none}

/* Live indicator */
.wall-live-indicator{
  display:inline-flex;align-items:center;gap:.4rem;
  font-size:11px;font-weight:700;letter-spacing:.1em;color:var(--brand-2);
  background:var(--brand-soft);border:1px solid rgba(34,197,94,.3);
  border-radius:100px;padding:.3rem .75rem;
}
.wall-live-dot{
  width:7px;height:7px;border-radius:50%;background:var(--brand);
  box-shadow:0 0 6px var(--brand);animation:pulse 1.5s infinite;
}

/* Timer card */
.wall-timer-card{
  display:flex;flex-direction:column;align-items:center;
  background:#fff;border:1px solid var(--border);border-radius:12px;
  box-shadow:var(--shadow-sm);
  padding:.45rem 1.1rem .35rem;
  min-width:110px;
}
.ex-timer{
  font-size:17px;font-family:'JetBrains Mono','Cascadia Code',Consolas,monospace;
  font-weight:700;letter-spacing:.06em;color:var(--text);line-height:1.2;
}
.wall-timer-label{
  font-size:10px;font-weight:400;color:var(--text3);letter-spacing:.01em;margin-top:1px;
}

/* ─── Footer ─── */
.app-footer{
  display:flex;align-items:center;gap:1rem;flex-wrap:wrap;
  padding:.85rem 1.5rem;background:rgba(255,255,255,.7);
  border-top:1px solid var(--border);
  font-size:12px;color:var(--text2);
  margin-top:auto;
}
.app-footer a{color:var(--text2);text-decoration:none;padding:0 .45rem}
.app-footer a:hover{color:var(--brand-2)}
.app-footer-nav{display:flex;flex:1;justify-content:center;gap:.5rem}
.app-footer-version{display:inline-flex;align-items:center;gap:.4rem}
.app-footer-version::after{
  content:"";width:7px;height:7px;border-radius:50%;background:var(--brand);
  box-shadow:0 0 6px var(--brand);
}

/* ─── HOME ─── */
#home{flex:1;display:flex;flex-direction:column;min-height:0;background:#f8fafc;overflow-y:auto}

/* Suite banner — embedded in the home header */
.home-suite-banner{
  flex:1;min-width:0;display:flex;flex-direction:column;
  align-items:center;justify-content:center;
  padding:0 1rem;text-align:center;
}
.home-suite-eyebrow{
  font-size:10px;letter-spacing:.32em;font-weight:500;color:var(--brand-2);
  text-transform:uppercase;margin-bottom:.35rem;
}
.home-suite-nav{
  display:flex;justify-content:center;align-items:center;
  gap:.6rem;flex-wrap:wrap;
}
.suite-item{
  position:relative;display:inline-flex;align-items:center;gap:.5rem;
  padding:.5rem .8rem;
  font-size:13px;font-weight:500;letter-spacing:.18em;
  color:#cbd5e1;cursor:not-allowed;user-select:none;line-height:1;
}
.suite-icon{width:18px;height:18px;flex:0 0 18px;display:block}
.suite-label{display:inline-block;line-height:1}
.suite-item--active{
  color:#16a34a;font-weight:600;cursor:default;
}
.suite-item--active::after{
  content:"";position:absolute;left:.8rem;right:.8rem;bottom:-2px;
  height:2px;border-radius:2px;background:var(--brand);
}
.suite-sep{color:#e2e8f0;font-size:13px;user-select:none;line-height:1}

/* Main hero block */
.home-content{
  position:relative;flex:1;display:flex;flex-direction:column;
  align-items:center;justify-content:center;
  padding:3rem 2rem 2.5rem;gap:1.25rem;overflow:hidden;
}
.home-inner{
  position:relative;z-index:2;
  display:flex;flex-direction:column;align-items:center;
  width:100%;max-width:1100px;
}

/* Decorative background SVGs */
.home-decor{position:absolute;pointer-events:none;z-index:1}
.home-decor--radar{
  left:-8rem;top:25%;width:34rem;height:34rem;
  color:var(--brand);opacity:.07;
}
.home-decor--radar svg{width:100%;height:100%}
.home-decor--waves{
  right:-6rem;top:18%;width:42rem;height:22rem;
  color:#64748b;opacity:.06;
}
.home-decor--waves svg{width:100%;height:100%}

/* Headline */
.home-headline{
  font-size:clamp(34px,5vw,60px);font-weight:800;letter-spacing:-.025em;
  text-align:center;line-height:1.05;color:var(--text);
}
.home-headline-dot{color:var(--brand)}
.home-pulse-line{
  margin-top:1.75rem;display:flex;justify-content:center;
  color:var(--brand);
}
.home-tagline{
  margin-top:1rem;font-size:17px;color:var(--text2);text-align:center;
  letter-spacing:.005em;
}

/* Cards */
.role-cards{
  margin-top:3.5rem;display:grid;grid-template-columns:repeat(2,1fr);
  gap:1.75rem;width:100%;max-width:880px;
}
.role-card{
  position:relative;background:#fff;border:1px solid var(--border);
  border-radius:20px;padding:2.25rem 2rem 1.75rem;text-align:center;
  display:flex;flex-direction:column;
  box-shadow:0 1px 2px rgba(15,23,42,.04);
  transition:transform .25s ease, box-shadow .25s ease;
}
.role-card:hover{transform:translateY(-4px);box-shadow:var(--shadow-lg)}
.rc-icon{
  width:56px;height:56px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  margin:0 auto;
}
.rc-icon svg{width:26px;height:26px;stroke-width:1.8;stroke:currentColor;fill:none;stroke-linecap:round;stroke-linejoin:round}
.rc-title{
  margin-top:1.25rem;font-size:22px;font-weight:600;letter-spacing:-.005em;
}
.rc-divider{
  width:32px;height:1px;margin:.65rem auto 0;
}
.rc-text{
  margin-top:1.1rem;font-size:14.5px;line-height:1.65;color:var(--text2);
  flex:1;
}
.rc-cta{
  margin-top:1.75rem;width:100%;display:inline-flex;align-items:center;
  justify-content:center;gap:.5rem;
  border:none;cursor:pointer;color:#fff;
  font-family:inherit;font-size:14.5px;font-weight:500;
  padding:.95rem 1.25rem;border-radius:12px;
  transition:background .15s ease, transform .08s ease, box-shadow .15s ease;
}
.rc-cta svg{width:14px;height:14px}
.rc-cta:active{transform:translateY(1px)}
.rc-cta:focus-visible{outline:2px solid var(--text);outline-offset:2px}

/* Green variant */
.role-card--green .rc-icon{background:#dcfce7;color:var(--brand)}
.role-card--green .rc-title{color:#16a34a}
.role-card--green .rc-divider{background:var(--brand)}
.role-card--green .rc-cta{background:var(--brand)}
.role-card--green .rc-cta:hover{background:var(--brand-2)}

/* Blue variant */
.role-card--blue .rc-icon{background:#dbeafe;color:#2563eb}
.role-card--blue .rc-title{color:#2563eb}
.role-card--blue .rc-divider{background:#2563eb}
.role-card--blue .rc-cta{background:#2563eb}
.role-card--blue .rc-cta:hover{background:#1d4ed8}

/* Educational banner */
.home-banner{
  margin-top:3rem;display:inline-flex;align-items:center;gap:.55rem;
  background:#f1f5f9;color:var(--text2);
  font-size:13px;padding:.55rem 1.1rem;border-radius:100px;
  border:1px solid var(--border);
}
.home-banner svg{width:14px;height:14px;color:#94a3b8}

/* Responsive */
@media (max-width: 760px){
  .role-cards{grid-template-columns:1fr;max-width:480px}
  .home-content{padding:2rem 1.25rem}
  .home-decor{display:none}
}

/* ─── Sources live ─── */
/* ─── Inject cards (new design) ─── */
.inject-card{
  background:#fff;border:1px solid var(--border);border-radius:14px;
  padding:1rem 1.15rem;margin-bottom:.7rem;
  box-shadow:var(--shadow-sm);
  transition:border-color .12s,box-shadow .12s;
}
.inject-card:hover{border-color:#d8b4fe;box-shadow:var(--shadow-md)}
.inject-card:last-child{margin-bottom:0}

.inject-row{display:flex;align-items:center;gap:.85rem}
.inject-channel{
  width:36px;height:36px;border-radius:50%;flex-shrink:0;
  display:inline-flex;align-items:center;justify-content:center;
  color:#fff;font-weight:800;font-size:11.5px;letter-spacing:.02em;
}
.inject-channel--x{background:#000}
.inject-channel--x svg{width:14px;height:14px;fill:#fff}
.inject-channel--of{background:var(--of)}

.inject-cat{
  display:inline-flex;align-items:center;flex-shrink:0;
  font-size:10.5px;font-weight:700;letter-spacing:.08em;
  padding:4px 11px;border-radius:6px;
}
.inject-cat--social{background:#f3e8ff;color:#7e22ce}
.inject-cat--media{background:#dbeafe;color:#1e40af}

.inject-content{flex:1;min-width:0;font-size:13.5px;line-height:1.55;color:var(--text)}
.inject-content strong{font-weight:700;color:var(--text);display:block;margin-bottom:2px}

.inject-meta{display:flex;align-items:center;gap:.85rem;flex-shrink:0}
.inject-time{font-size:12px;color:var(--text3);white-space:nowrap;font-weight:500}
.inject-use-btn{
  padding:.45rem 1.05rem;font-size:12.5px;font-weight:600;
  border-radius:8px;white-space:nowrap;
}

.inject-justif{
  margin-top:.6rem;padding-left:50px;
  font-size:11.5px;color:var(--text2);font-style:italic;line-height:1.45;
  display:flex;align-items:flex-start;gap:.4rem;
}
.inject-justif-icon{color:#f59e0b;flex-shrink:0;margin-top:1px;width:14px;height:14px}

.inject-card-img{margin:.55rem 0 0 50px;border-radius:6px;overflow:hidden}
.inject-card-img img{width:100%;max-height:110px;object-fit:cover;display:block}

/* Inject card header pieces */
.injects-count-pill{
  display:inline-flex;align-items:center;justify-content:center;
  min-width:20px;height:20px;padding:0 7px;border-radius:100px;
  background:var(--brand);color:#fff;
  font-size:11px;font-weight:700;letter-spacing:0;text-transform:none;
}

.manualpubs-count{
  display:inline-flex;align-items:center;justify-content:center;
  min-width:18px;height:18px;padding:0 5px;border-radius:100px;
  background:var(--brand);color:#fff;font-size:10px;font-weight:700;
}

.src-cols{display:grid;grid-template-columns:1fr 1fr;gap:1.5rem;margin-top:.25rem}
.src-col{min-width:0}
.src-col-head{
  font-size:11px;font-weight:700;color:var(--text2);
  text-transform:uppercase;letter-spacing:.12em;
  margin-bottom:.7rem;display:flex;align-items:center;gap:.5rem;
}
.src-col-label{color:var(--text2)}
.src-col-suffix{color:var(--text3);font-weight:500;text-transform:lowercase;letter-spacing:0;font-size:10.5px}
.src-count{
  display:inline-flex;align-items:center;justify-content:center;
  min-width:18px;height:18px;padding:0 6px;border-radius:100px;
  background:var(--brand-soft);color:var(--brand-2);
  font-size:10.5px;font-weight:700;letter-spacing:0;text-transform:none;
}
.src-list{display:flex;flex-wrap:wrap;gap:6px;min-height:28px;margin-bottom:.5rem}
.src-item{
  display:inline-flex;align-items:center;gap:4px;
  background:#fff;border:1px solid var(--border2);
  border-radius:100px;padding:5px 5px 5px 12px;
  transition:background .12s,border-color .12s,box-shadow .12s;
}
.src-item:hover{background:#f8fafc;border-color:#cbd5e1;box-shadow:var(--shadow-sm)}
.src-tag{font-size:12px;color:var(--text);font-family:'JetBrains Mono',monospace;line-height:1;white-space:nowrap}
.src-del{
  background:none;border:none;cursor:pointer;color:var(--text3);
  font-size:11px;line-height:1;padding:0 4px;flex-shrink:0;
  border-radius:50%;width:16px;height:16px;
  display:inline-flex;align-items:center;justify-content:center;
}
.src-del:hover{color:#dc2626;background:rgba(220,38,38,.1)}
.src-empty{font-size:11px;color:var(--text3);font-style:italic;padding:2px 0}

/* "+ Ajouter" pill */
.src-add-pill{
  display:inline-flex;align-items:center;justify-content:center;
  font-family:inherit;font-size:12px;font-weight:500;
  color:var(--text2);background:#fff;
  border:1px dashed var(--border2);
  border-radius:100px;padding:5px 14px;
  cursor:pointer;line-height:1;
  transition:background .12s,border-color .12s,color .12s;
}
.src-add-pill:hover{background:var(--brand-soft);color:var(--brand-2);border-color:var(--brand);border-style:solid}

/* Inline add input (revealed by + Ajouter) */
.src-add-row{display:none;gap:4px;margin-top:.4rem;align-items:center}
.src-cancel-btn{
  background:none;border:1px solid var(--border2);
  border-radius:var(--radius-sm);
  cursor:pointer;color:var(--text3);
  font-size:14px;line-height:1;
  width:32px;height:32px;flex-shrink:0;
}
.src-cancel-btn:hover{color:#dc2626;border-color:#fca5a5}

/* Collapsible suggestions */
.src-suggestions{margin-top:.65rem}
.src-suggestions summary{
  font-size:9.5px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;
  color:var(--text3);cursor:pointer;padding:2px 0;list-style:none;
  display:inline-flex;align-items:center;gap:.3rem;
}
.src-suggestions summary::-webkit-details-marker{display:none}
.src-suggestions summary::before{content:"▸";font-size:8px;transition:transform .15s}
.src-suggestions[open] summary::before{transform:rotate(90deg)}
.src-suggestions[open] summary{margin-bottom:.4rem}
.src-add-row input{flex:1;min-width:0}
.src-sugg-head{
  font-size:9.5px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;
  color:var(--text3);margin:.7rem 0 .35rem;
}
.src-sugg-grid{display:flex;flex-wrap:wrap;gap:4px}
.src-sugg-chip{
  font-size:11px;font-weight:600;
  background:var(--bg2);color:var(--text2);
  border:1px solid var(--border);border-radius:100px;
  padding:3px 9px;cursor:pointer;
  transition:all .12s;white-space:nowrap;
  font-family:inherit;
}
.src-sugg-chip:hover{background:#eff6ff;border-color:#93c5fd;color:#1d4ed8}
.src-sugg-chip.added{
  background:#f0fdf4;border-color:#bbf7d0;color:#16a34a;
  cursor:default;opacity:.85;
}
.src-add-btn{padding:.4rem .6rem;font-size:14px;font-weight:700;line-height:1}

/* ─── NEWSROOM ─── */
#newsroom{flex:1;display:flex;flex-direction:column;min-height:0}
.nr-layout{display:grid;grid-template-columns:1fr 1fr;flex:1;overflow:hidden;min-height:0}

/* Columns */
.nr-col{
  overflow-y:auto;overflow-x:hidden;background:var(--bg);
  padding:1rem;
  display:flex;flex-direction:column;gap:.85rem;
  border-right:1px solid var(--border);
  /* Grid items default to min-height:auto, which prevents the column from
     scrolling when its content exceeds the layout height. Force min-* to 0. */
  min-height:0;min-width:0;
  /* Reserve gutter so layout doesn't shift when scrollbar appears */
  scrollbar-gutter:stable;
  /* Firefox: thin always-visible scrollbar */
  scrollbar-width:thin;
  scrollbar-color:#cbd5e1 transparent;
}
.nr-col:last-child{border-right:none}
/* WebKit/Chromium/Edge: always-visible thin scrollbar */
.nr-col::-webkit-scrollbar{width:10px;height:10px}
.nr-col::-webkit-scrollbar-track{background:transparent}
.nr-col::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:6px;border:2px solid var(--bg)}
.nr-col::-webkit-scrollbar-thumb:hover{background:#94a3b8}

/* Cards keep their natural height — never let the column compress them */
.nr-card{flex-shrink:0}

/* Cards */
.nr-card{
  background:var(--bg2);
  border:1px solid var(--border);
  border-radius:18px;
  box-shadow:var(--shadow-sm);
  overflow:hidden;
  display:flex;flex-direction:column;
}
.section-context  {border-top:3px solid #3b82f6}
.section-composer {border-top:3px solid var(--brand)}
.section-injects  {border-top:3px solid #a855f7}
.section-sources  {border-top:3px solid #06b6d4}
.section-timeline {border-top:3px solid #f59e0b}

/* Card header */
.nr-card-head{
  display:flex;align-items:center;gap:.65rem;
  padding:.85rem 1.25rem;
  border-bottom:1px solid var(--border);
  background:var(--bg2);flex-shrink:0;
}
.nr-card-icon-wrap{
  width:28px;height:28px;border-radius:8px;flex-shrink:0;
  display:inline-flex;align-items:center;justify-content:center;
}
.nr-card-icon-wrap svg{width:14px;height:14px}
.section-context  .nr-card-icon-wrap{background:#dbeafe;color:#1e40af}
.section-composer .nr-card-icon-wrap{background:var(--brand-soft);color:var(--brand-2)}
.section-injects  .nr-card-icon-wrap{background:#f3e8ff;color:#7e22ce}
.section-sources  .nr-card-icon-wrap{background:#cffafe;color:#0e7490}
.section-timeline .nr-card-icon-wrap{background:#fef3c7;color:#b45309}
.nr-card-title{font-size:12.5px;font-weight:700;color:var(--text);flex:1;text-transform:uppercase;letter-spacing:.08em}
.nr-card-chevron{font-size:10px;color:var(--text3);transition:transform .2s;margin-left:auto}

/* Card body */
.nr-card-body{padding:1.1rem 1.25rem;flex:1}
.nr-card-actions{display:flex;align-items:center;gap:8px;margin-top:1rem;flex-wrap:wrap}

/* Context: 4-column horizontal layout with icons + vertical dividers */
.ctx-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:0;align-items:start}
.ctx-field{
  display:flex;flex-direction:column;gap:.55rem;min-width:0;
  padding:0 1.25rem;
  border-left:1px solid var(--border);
}
.ctx-field:first-child{border-left:none;padding-left:0}
.ctx-field:last-child{padding-right:0}
.ctx-field-icon{
  width:26px;height:26px;display:inline-flex;align-items:center;justify-content:center;
  color:#94a3b8;
}
.ctx-field-icon svg{width:20px;height:20px}
.ctx-field-label{
  font-size:10.5px;font-weight:700;letter-spacing:.1em;
  text-transform:uppercase;color:var(--text3);margin:0;
}

/* View mode (default): inputs styled as flowing text, non-interactive */
.ctx-field input[type=text],
.ctx-field textarea{
  width:100%;border:none;background:transparent;
  padding:.1rem 0;font-size:13.5px;color:var(--text);
  font-family:inherit;line-height:1.5;font-weight:500;
  resize:none;border-radius:0;
  pointer-events:none;cursor:default;
}
.ctx-field input[type=text]::placeholder,
.ctx-field textarea::placeholder{color:var(--text3);font-weight:400}
.ctx-field textarea{min-height:46px}

/* Edit mode: inputs become real form fields */
#ctx-panel.ctx-edit-mode .ctx-field input[type=text],
#ctx-panel.ctx-edit-mode .ctx-field textarea{
  border:1px solid var(--border2);background:#fff;
  padding:.5rem .75rem;border-radius:var(--radius-sm);
  pointer-events:auto;cursor:text;
  transition:border-color .12s,box-shadow .12s;
}
#ctx-panel.ctx-edit-mode .ctx-field input[type=text]:focus,
#ctx-panel.ctx-edit-mode .ctx-field textarea:focus{
  border-color:var(--brand);box-shadow:0 0 0 3px var(--brand-tint);
}

/* Body action row: always visible — header "Éditer" controls only field editability */
#ctx-panel .nr-card-actions{margin-top:1.25rem}
/* Hide "Sauvegarder" body button when not in edit mode to avoid duplication with header */
#ctx-panel:not(.ctx-edit-mode) #btn-save-context{display:none}

/* Edit toggle button in card header */
.ctx-edit-btn{
  margin-left:auto;
  padding:.4rem .85rem;font-size:12px;font-weight:500;
  text-transform:none;letter-spacing:0;border-radius:8px;
}
.ctx-edit-btn svg{flex-shrink:0}
@media (max-width:1100px){
  .ctx-grid{grid-template-columns:repeat(2,1fr)}
  .ctx-field{padding:0 .75rem}
  .ctx-field:nth-child(odd){border-left:none;padding-left:0}
  .ctx-field:nth-child(2n){padding-right:0}
}

/* Composer side-by-side grid (form left, preview right) */
.nr-composer-grid{
  display:grid;grid-template-columns:minmax(0,1fr) 240px;gap:1rem;align-items:start;
}
.nr-composer-form-col{min-width:0}
.nr-composer-preview-col{
  position:sticky;top:0;
  background:#f8fafc;border:1px solid var(--border);
  border-radius:12px;padding:.85rem;
  display:flex;flex-direction:column;gap:.5rem;
}
@media (max-width:1200px){
  .nr-composer-grid{grid-template-columns:1fr}
  .nr-composer-preview-col{position:static}
}

.nr-preview-label{
  font-size:10px;font-weight:700;letter-spacing:.1em;
  text-transform:uppercase;color:var(--text3);
  margin-bottom:.5rem;display:flex;align-items:center;gap:.4rem;
}
.nr-preview-label svg{width:12px;height:12px}
.nr-preview-tweet-card{
  background:#000;border:1px solid #2f3336;border-radius:12px;
  padding:.75rem;font-size:12px;color:#e7e9ea;
}
.nr-preview-tweet-name{font-weight:700;color:#fff;font-size:12.5px}
.nr-preview-tweet-handle{color:#71767b;font-size:11.5px}
.nr-preview-tweet-body{
  margin-top:.4rem;line-height:1.45;color:#e7e9ea;
  font-size:12.5px;word-break:break-word;white-space:pre-wrap;
}
.nr-preview-tweet-img{width:100%;border-radius:8px;margin-top:.5rem;max-height:120px;object-fit:cover;display:block}
.nr-preview-of-card{
  background:#fff;border:1px solid var(--border);border-radius:12px;overflow:hidden;
  box-shadow:var(--shadow-sm);
}
.nr-preview-of-source{
  display:flex;align-items:center;gap:.4rem;padding:.6rem .75rem .35rem;
}
.nr-preview-of-srclogo{
  width:18px;height:18px;border-radius:4px;background:var(--of);
  color:#fff;font-size:9px;font-weight:800;
  display:inline-flex;align-items:center;justify-content:center;
}
.nr-preview-of-srcname{font-size:12px;font-weight:600;color:var(--of)}
.nr-preview-of-rubrique{
  font-size:9.5px;font-weight:700;text-transform:uppercase;letter-spacing:.08em;
  color:var(--text3);margin-left:auto;
}
.nr-preview-of-headline{
  font-size:14px;font-weight:700;color:var(--text);
  padding:.1rem .75rem .35rem;line-height:1.3;
}
.nr-preview-of-chapo{font-size:11.5px;color:var(--text2);padding:0 .75rem .55rem;line-height:1.45}
.nr-preview-of-img{width:100%;max-height:140px;object-fit:cover;display:block}

/* Timeline */
.nr-timeline-body{padding:0}
.nr-timeline-section{padding:.85rem 1.25rem}
.nr-timeline-section+.nr-timeline-section{border-top:1px solid var(--border)}
.nr-timeline-section-head{
  display:flex;align-items:center;gap:.5rem;
  font-size:11px;font-weight:700;letter-spacing:.06em;
  text-transform:uppercase;color:var(--text2);
  margin-bottom:.65rem;
}
.nr-timeline-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}
.nr-timeline-dot--sent{background:#16a34a;box-shadow:0 0 0 3px #dcfce7}
.nr-timeline-dot--pending{background:#f59e0b;box-shadow:0 0 0 3px #fef3c7}

/* Timeline filter tabs */
.timeline-filters{display:flex;align-items:center;gap:.25rem;margin-left:auto}
.tl-filter{
  display:inline-flex;align-items:center;justify-content:center;
  font-family:inherit;font-size:12px;font-weight:500;line-height:1;
  cursor:pointer;white-space:nowrap;
  height:30px;padding:0 .9rem;border-radius:100px;
  background:transparent;color:var(--text2);
  border:1.5px solid transparent;
  transition:background .15s,color .15s,border-color .15s;
}
.tl-filter:hover{color:var(--text)}
.tl-filter.is-active{background:#fff;color:var(--brand-2);border-color:var(--brand);font-weight:600}

/* Timeline rows (unified sent + pending) */
.tl-list{display:flex;flex-direction:column}
.tl-row{
  display:flex;align-items:center;gap:.85rem;
  padding:.85rem 1.25rem;border-bottom:1px solid var(--border);
  transition:background .12s;
}
.tl-row:last-child{border-bottom:none}
.tl-row:hover{background:#fafbfc}
.tl-time-col{
  flex-shrink:0;width:70px;
  display:flex;flex-direction:column;gap:1px;line-height:1.3;
}
.tl-tplus{font-size:12px;font-weight:600;color:var(--text2)}
.tl-clock{font-size:11px;color:var(--text3);font-family:'JetBrains Mono','Cascadia Code',monospace}
.tl-channel{
  width:30px;height:30px;border-radius:50%;flex-shrink:0;
  display:inline-flex;align-items:center;justify-content:center;
  color:#fff;font-weight:800;font-size:10px;letter-spacing:.02em;
}
.tl-channel--x{background:#000}
.tl-channel--x svg{width:12px;height:12px;fill:#fff}
.tl-channel--of{background:var(--of)}
.tl-content{
  flex:1;min-width:0;font-size:13px;color:var(--text);line-height:1.45;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.tl-status{
  display:inline-flex;align-items:center;flex-shrink:0;
  font-size:11.5px;font-weight:600;
  padding:4px 14px;border-radius:8px;
}
.tl-status--sent{background:#dcfce7;color:#15803d}
.tl-status--pending{background:#ffedd5;color:#c2410c}
.tl-actions{display:flex;align-items:center;gap:.35rem;flex-shrink:0}

/* Reaction count buttons (sent items) */
.tl-reaction-btn{
  display:inline-flex;align-items:center;gap:.3rem;
  background:#f8fafc;border:1px solid var(--border);
  border-radius:6px;padding:3px 8px;
  cursor:pointer;font-family:inherit;font-size:11.5px;color:var(--text2);
  transition:background .12s,border-color .12s,transform .08s;
}
.tl-reaction-btn:hover{background:#f1f5f9;border-color:var(--border2)}
.tl-reaction-btn:active{transform:scale(.96)}
.tl-reaction-btn.reacting{opacity:.5;pointer-events:none;animation:pulse .9s ease-in-out infinite}
.tl-reaction-icon{font-size:13px;line-height:1}

/* Edit / delete icon buttons (pending items) */
.tl-icon-btn{
  width:30px;height:30px;border-radius:6px;
  display:inline-flex;align-items:center;justify-content:center;
  background:#fff;border:1px solid var(--border);
  cursor:pointer;color:var(--text2);
  transition:background .12s,border-color .12s,color .12s;
}
.tl-icon-btn:hover{background:#f8fafc;border-color:var(--border2);color:var(--text)}
.tl-icon-btn--del:hover{color:#dc2626;border-color:#fca5a5;background:#fef2f2}
.tl-icon-btn svg{width:13px;height:13px}

.tl-more-btn{
  background:none;border:none;cursor:pointer;
  color:var(--text3);font-size:18px;line-height:1;
  padding:4px 8px;border-radius:6px;font-family:inherit;
}
.tl-more-btn:hover{background:#f1f5f9;color:var(--text)}

/* Footer "Voir tout" */
.tl-footer{
  padding:.85rem 1.25rem;display:flex;justify-content:flex-end;
  border-top:1px solid var(--border);
}
.tl-voir-tout{
  display:inline-flex;align-items:center;gap:.4rem;
  background:none;border:none;cursor:pointer;
  font-family:inherit;font-size:12.5px;font-weight:500;color:var(--text2);
  padding:.3rem .25rem;
}
.tl-voir-tout:hover{color:var(--brand-2)}

/* Legacy aliases — kept for JS-rendered content that uses old class names */
.nr-inner{background:var(--bg2);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow-sm);padding:1.1rem 1.25rem}
.panel-head{font-size:13.5px;font-weight:700;color:var(--text);margin-bottom:.95rem;display:flex;align-items:center;gap:.55rem}
.panel-icon{width:24px;height:24px;border-radius:7px;flex-shrink:0;display:inline-flex;align-items:center;justify-content:center}
.panel-icon svg{width:13px;height:13px}

/* Platform tabs */
.plat-tabs{display:flex;gap:6px;margin-bottom:1.25rem}
.plat-tab{
  display:flex;align-items:center;gap:6px;padding:.45rem .95rem;
  border:1px solid var(--border2);border-radius:100px;
  font-size:13px;cursor:pointer;background:#fff;color:var(--text2);
  transition:all .12s;font-family:inherit;
}
.plat-tab:hover{background:var(--bg3)}
.plat-tab.active-x{background:#000;border-color:#000;color:#fff}
.plat-tab.active-of{background:var(--of);border-color:var(--of);color:#fff}

/* Forms */
label{display:block;font-size:11px;font-weight:600;color:var(--text2);margin-bottom:.35rem;margin-top:1rem;text-transform:uppercase;letter-spacing:.06em}
label:first-of-type,.nr-inner label:first-of-type{margin-top:0}
input[type=text],input[type=number],input[type=password],textarea,select{
  width:100%;background:#fff;border:1px solid var(--border2);
  border-radius:var(--radius-sm);padding:.55rem .8rem;font-size:13px;color:var(--text);
  font-family:inherit;resize:vertical;outline:none;
  transition:border-color .12s, box-shadow .12s;
}
input:focus,textarea:focus,select:focus{border-color:var(--brand);box-shadow:0 0 0 3px var(--brand-tint)}
textarea{min-height:90px}
.char-count{font-size:11px;color:var(--text3);text-align:right;margin-top:.25rem}
.row2{display:grid;grid-template-columns:1fr 1fr;gap:8px}

/* Engagement metrics — 4-column grid with icon-prefixed inputs */
.num-grid{
  display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.65rem;
  margin-top:.85rem;
}
.num-field{min-width:0;display:flex;flex-direction:column}
.num-field label{margin-top:0;margin-bottom:.4rem}
.num-input{
  position:relative;display:flex;align-items:center;
}
.num-icon{
  position:absolute;left:.6rem;width:14px;height:14px;
  color:var(--text3);pointer-events:none;
}
.num-input input{padding-left:1.85rem}
.num-field select{padding-right:1.5rem}
@media (max-width:1100px){
  .num-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
.img-row{display:flex;gap:6px;align-items:stretch}
.img-row input{flex:1;min-width:0}
.find-img-btn{flex-shrink:0;font-size:12px;padding:.5rem .75rem}
.form-actions{display:flex;align-items:center;gap:8px;margin-top:1.25rem;flex-wrap:wrap}
.offset-field{display:flex;align-items:center;gap:6px;font-size:13px;color:var(--text2)}
.offset-field input{width:64px;text-align:right}
.divider{border:none;border-top:1px solid var(--border);margin:1.1rem 0}

/* Scenario */
.scenario-empty{text-align:center;padding:2.75rem 1rem;color:var(--text3);font-size:13px}
.scene-item{
  background:#fff;border:1px solid var(--border);border-radius:10px;
  padding:.65rem .9rem;margin-bottom:.5rem;display:flex;align-items:flex-start;gap:.7rem;
  transition:border-color .15s;
}
.scene-item:hover{border-color:var(--border2)}
.scene-badge{display:inline-flex;align-items:center;font-size:10px;font-weight:700;padding:2px 7px;border-radius:100px;white-space:nowrap;flex-shrink:0;margin-top:2px;letter-spacing:.04em}
.badge-x{background:#000;color:#fff}
.badge-of{background:var(--of);color:#fff}
.scene-text{font-size:12px;color:var(--text);flex:1;line-height:1.4}
.scene-time{font-size:11px;color:var(--text3);white-space:nowrap;flex-shrink:0;font-family:monospace}
.scene-del{background:none;border:none;cursor:pointer;color:var(--text3);font-size:15px;line-height:1;padding:0 2px;flex-shrink:0}
.scene-del:hover{color:#dc2626}
/* En-têtes de groupe (À venir / Envoyées) */
.scene-group-head{
  display:flex;align-items:center;gap:.5rem;
  font-size:10.5px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;
  padding:.5rem .25rem .35rem;margin-top:.25rem;
  border-bottom:1px solid var(--border);margin-bottom:.55rem;
}
.scene-group-head:first-child{margin-top:0}
.scene-group-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}
.scene-group-pending{color:#b45309}
.scene-group-pending .scene-group-dot{background:#f59e0b;box-shadow:0 0 0 3px #fef3c7}
.scene-group-sent{color:#16a34a;margin-top:.9rem}
.scene-group-sent .scene-group-dot{background:#16a34a}
.scene-group-count{
  margin-left:auto;background:rgba(0,0,0,.06);color:var(--text2);
  font-size:10px;font-weight:700;padding:1px 7px;border-radius:100px;letter-spacing:0;
}

/* Item envoyé : visuellement très atténué + strikethrough */
.scene-item-sent{
  background:#f9fafb;border-color:#e5e7eb;
  border-left:3px solid #16a34a;padding-left:calc(.9rem - 2px);
}
.scene-item-sent .scene-badge{opacity:.55}
.scene-item-sent .scene-text{
  color:var(--text3);text-decoration:line-through;text-decoration-color:#9ca3af;
}
.scene-sent-mark{
  font-size:10px;font-weight:800;color:#fff;background:#16a34a;
  padding:3px 8px;border-radius:100px;
  white-space:nowrap;flex-shrink:0;letter-spacing:.04em;
}
.reaction-btns{display:flex;gap:3px;flex-shrink:0}
.reaction-btn{
  background:none;border:1px solid var(--border);border-radius:6px;
  padding:2px 6px;cursor:pointer;font-size:13px;line-height:1.4;
  transition:background .1s,border-color .1s,transform .08s;
}
.reaction-btn:hover{background:var(--bg3);border-color:var(--border2);transform:scale(1.15)}
.reaction-btns.reacting .reaction-btn{opacity:.35;pointer-events:none;animation:pulse .9s ease-in-out infinite}
.ex-controls{
  margin:auto -.85rem -.85rem;
  padding:.95rem 1.25rem;background:var(--bg3);border-top:1px solid var(--border);
  display:flex;align-items:center;gap:8px;flex-wrap:wrap;
}
.ex-status{font-size:12px;color:var(--text2)}
.ex-status.running{color:var(--brand-2);font-weight:600}

/* ─── CRISIS WALL ─── */
#wall{flex:1;display:flex;flex-direction:column;min-height:0;background:#f8fafc}
.wall-content{display:flex;flex:1;overflow:hidden;min-height:0}
.wall-col{display:flex;flex-direction:column;overflow:hidden;border-right:1px solid var(--border);background:var(--bg2);position:relative;min-width:0}
.wall-col--twitter{flex:0 0 42%;}
.wall-col--press{flex:1;}
@media (max-width:1100px){
  .wall-col--twitter{flex:0 0 46%}
}

/* Pastille "X nouvelles publications" */
.new-items-pill{
  position:absolute;top:54px;left:50%;transform:translateX(-50%);
  z-index:50;
  background:var(--brand);color:#fff;border:none;border-radius:100px;
  padding:.45rem 1.05rem;font-size:12.5px;font-weight:700;
  font-family:inherit;cursor:pointer;
  box-shadow:0 4px 14px rgba(34,197,94,.45),0 1px 3px rgba(0,0,0,.15);
  display:inline-flex;align-items:center;gap:.4rem;
  animation:pillpop .25s cubic-bezier(.16,1,.3,1.2),pillpulse 1.6s ease-in-out infinite .25s;
}
.new-items-pill:hover{background:var(--brand-2)}
@keyframes pillpop{from{opacity:0;transform:translate(-50%,-12px)}to{opacity:1;transform:translate(-50%,0)}}
@keyframes pillpulse{0%,100%{box-shadow:0 4px 14px rgba(34,197,94,.45),0 1px 3px rgba(0,0,0,.15)}50%{box-shadow:0 4px 22px rgba(34,197,94,.7),0 1px 3px rgba(0,0,0,.15)}}

/* Tweet "hot" — fort engagement ou viral */
.tweet.tweet-hot{box-shadow:0 0 0 2px #f59e0b,0 4px 18px rgba(245,158,11,.35)}
.tweet.tweet-hot::before{
  content:"FORT ENGAGEMENT";
  position:absolute;top:-9px;right:14px;
  background:#f59e0b;color:#000;font-size:9.5px;font-weight:800;
  letter-spacing:.08em;padding:2px 8px;border-radius:100px;
}
.tweet{position:relative}

/* Double horodatage T+ / heure réelle */
.time-tplus{font-weight:700;color:var(--brand-2)}
.tweet-time .time-tplus{color:#1d9bf0}
.time-real{opacity:.85}
.wall-col:last-child{border-right:none}
.wall-col-head{
  padding:.7rem 1.1rem;border-bottom:1px solid var(--border);
  display:flex;align-items:center;gap:.75rem;flex-shrink:0;background:#fff;
  min-height:48px;
}
.wall-col-title{display:flex;align-items:center;gap:.55rem;flex:1;min-width:0}
.wall-col-titles{display:flex;flex-direction:column;flex:1;min-width:0;line-height:1.2}
.chan-label{font-size:13px;font-weight:800;letter-spacing:.16em;color:var(--text)}
.chan-sublabel{font-size:11px;font-weight:400;color:var(--text3);letter-spacing:0;margin-top:2px}
.chan-live{
  display:inline-flex;align-items:center;gap:.4rem;
  font-size:10px;font-weight:700;
  background:#fff1f2;color:#e11d48;border:1px solid #fecdd3;
  padding:4px 10px;border-radius:100px;
  letter-spacing:.14em;flex-shrink:0;
}
.chan-live-dot{
  width:6px;height:6px;border-radius:50%;background:#e11d48;
  animation:pulse 1.5s infinite;
}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.55}}
.wall-feed{flex:1;overflow-y:auto;padding:1rem;background:#f8fafc;min-height:0}
/* Twitter column: slightly darker tint so black tweet cards have visible depth */
.wall-feed--twitter{background:#eef0f3}
.wall-empty{
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  text-align:center;padding:3.5rem 1rem;font-size:13px;color:var(--text3);gap:.6rem;
}
.wall-empty--dark{color:#64748b}
.wall-empty::before{
  content:"";width:48px;height:48px;border-radius:50%;
  background:var(--brand-tint);
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2322c55e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><polyline points='12 6 12 12 16 14'/></svg>");
  background-size:24px 24px;background-position:center;background-repeat:no-repeat;
}

/* Press toolbar — filters + sort */
.wall-press-toolbar{
  display:flex;align-items:center;justify-content:space-between;gap:.75rem;
  padding:.6rem 1.1rem;background:#fff;border-bottom:1px solid var(--border);
  flex-shrink:0;flex-wrap:wrap;
}
.press-filters{display:flex;align-items:center;gap:.35rem;flex-wrap:wrap}
.press-filter{
  display:inline-flex;align-items:center;justify-content:center;
  font-family:inherit;font-size:11.5px;font-weight:500;line-height:1;
  cursor:pointer;white-space:nowrap;
  height:28px;padding:0 .85rem;border-radius:100px;
  background:#fff;color:var(--text2);
  border:1.5px solid var(--border2);
  transition:background .15s,color .15s,border-color .15s;
}
.press-filter:hover{background:#f1f5f9;border-color:#9ca3af}
.press-filter.is-active{background:#fff;color:var(--brand-2);border-color:var(--brand);font-weight:600}
.press-filter.is-active:hover{background:#f0fdf4;border-color:var(--brand-2)}
.press-sort{
  display:inline-flex;align-items:center;justify-content:center;gap:.35rem;
  font-family:inherit;font-size:11.5px;font-weight:500;line-height:1;
  cursor:pointer;white-space:nowrap;
  height:28px;padding:0 .85rem;border-radius:100px;
  background:#fff;color:var(--text2);border:1.5px solid var(--border2);
  transition:background .15s,border-color .15s;
}
.press-sort:hover{background:#f8fafc;border-color:#9ca3af}
.press-sort svg{width:13px;height:13px;flex-shrink:0}

/* Twitter column footer — auto-refresh toggle */
.wall-col-footer{
  display:flex;align-items:center;justify-content:space-between;gap:.75rem;
  padding:.55rem 1.1rem;background:#fff;border-top:1px solid var(--border);
  flex-shrink:0;
}
.wall-col-footer-label{font-size:11.5px;color:var(--text2)}

/* Toggle switch */
.toggle-switch{
  position:relative;width:40px;height:22px;
  background:#cbd5e1;border:none;border-radius:100px;
  cursor:pointer;padding:0;flex-shrink:0;
  transition:background .2s;
}
.toggle-switch.is-on{background:var(--brand)}
.toggle-knob{
  position:absolute;top:2px;left:2px;
  width:18px;height:18px;border-radius:50%;
  background:#fff;
  box-shadow:0 1px 2px rgba(0,0,0,.15);
  transition:transform .2s;
}
.toggle-switch.is-on .toggle-knob{transform:translateX(18px)}

/* Legacy sim-warn — hidden (replaced by app-footer) */
.sim-warn{display:none}

/* ─── TWEET (dark themed, like Twitter) ─── */
.tweet{background:#000;border:1px solid #2f3336;border-radius:16px;padding:1rem 1rem .85rem;margin-bottom:.85rem;animation:slide-in .35s ease}
.tweet-header{display:flex;align-items:flex-start;gap:.65rem;margin-bottom:.55rem}
.tweet-avatar{width:42px;height:42px;border-radius:50%;flex-shrink:0;background:#1d3a52;display:flex;align-items:center;justify-content:center;font-size:15px;font-weight:700;color:#fff}
.tweet-names{flex:1;min-width:0}
.tweet-name-row{display:flex;align-items:center;gap:4px;flex-wrap:wrap}
.tweet-name{font-size:14px;font-weight:700;color:#fff}
.tweet-verified{color:var(--blue);font-size:14px}
.tweet-handle{font-size:13px;color:#71767b}
.tweet-body{font-size:14px;line-height:1.55;color:#e7e9ea;margin-bottom:.6rem;word-break:break-word}
.tweet-img{width:100%;border-radius:12px;margin-bottom:.65rem;max-height:260px;object-fit:cover;display:block}
.tweet-time{font-size:12px;color:#71767b;margin-bottom:.6rem}
.tweet-stats{display:flex;gap:1.25rem;border-top:1px solid #2f3336;padding-top:.6rem;flex-wrap:wrap}
.tweet-stat{display:flex;align-items:center;gap:.3rem;font-size:13px;color:#71767b;position:relative}
.tweet-stat svg{width:15px;height:15px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
/* Stat numbers — transition-based highlight (no layout reflow) */
.tweet-stat-n{
  display:inline-block;
  font-variant-numeric:tabular-nums;
  transition: color .15s ease-out, transform .15s ease-out, text-shadow .15s ease-out, font-weight .1s;
}
.stat-flash{
  color:#f59e0b !important;
  transform:scale(1.18);
  text-shadow:0 0 6px rgba(245,158,11,.5);
}
.stat-flash-haineux{
  color:#ef4444 !important;
  transform:scale(1.45);
  text-shadow:0 0 10px rgba(239,68,68,.75);
  font-weight:800;
}

/* Badge "+N" */
@keyframes statPop {
  0%   { opacity:0; transform:translate(-50%, 4px) scale(.5) }
  20%  { opacity:1; transform:translate(-50%, -12px) scale(1.05) }
  100% { opacity:0; transform:translate(-50%, -36px) scale(.9) }
}
.tweet-stat-pop{
  position:absolute; top:-2px; left:50%;
  pointer-events:none;
  font-size:11px; font-weight:700; color:#f59e0b;
  background:rgba(245,158,11,.2);
  border:1px solid rgba(245,158,11,.5);
  padding:1px 7px; border-radius:100px;
  white-space:nowrap;
  animation: statPop 1.3s ease-out forwards;
  font-variant-numeric:tabular-nums;
  z-index:5;
}
.tweet-stat-pop.pop-haineux{
  color:#fff; background:#ef4444; border-color:#c00;
  font-size:13px; font-weight:900;
  text-shadow:0 0 4px rgba(0,0,0,.4);
  box-shadow:0 0 12px rgba(239,68,68,.6);
}

/* Aura tweet haineux — transition, pas d'animation (pas de reflow) */
.tweet{ transition: box-shadow .2s ease-out }
.tweet-hate-pulse{ box-shadow:0 0 28px 4px rgba(239,68,68,.6) !important }
.viral-badge{background:#ff4500;color:#fff;font-size:10px;font-weight:700;padding:2px 6px;border-radius:4px;margin-left:5px;letter-spacing:.04em}
.tweet-live-badge{background:var(--brand);color:#fff;font-size:9px;font-weight:700;padding:2px 6px;border-radius:4px;margin-left:5px;letter-spacing:.06em;text-transform:uppercase}

.tweet-link-card{border:1px solid #2f3336;border-radius:12px;overflow:hidden;margin-bottom:.65rem;cursor:pointer;transition:background .15s}
.tweet-link-card:hover{background:#0d0d0d}
.tweet-link-card-img{width:100%;max-height:200px;object-fit:cover;display:block}
.tweet-link-card-meta{padding:.5rem .75rem;background:#000}
.tweet-link-card-domain{font-size:12px;color:#71767b;margin-bottom:.2rem}
.tweet-link-card-title{font-size:13px;color:#e7e9ea;line-height:1.35;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}

.tweet-quote-card{border:1px solid #2f3336;border-radius:14px;padding:.6rem .75rem;margin-bottom:.65rem;cursor:pointer;background:#000;transition:background .15s}
.tweet-quote-card:hover{background:#0d0d0d}
.tweet-quote-header{display:flex;align-items:center;gap:.4rem;margin-bottom:.3rem;font-size:13px}
.tweet-quote-avatar{width:20px;height:20px;border-radius:50%;object-fit:cover;flex-shrink:0}
.tweet-quote-avatar-fallback{width:20px;height:20px;border-radius:50%;background:#2f3336;display:flex;align-items:center;justify-content:center;font-size:10px;color:#e7e9ea;flex-shrink:0}
.tweet-quote-name{color:#e7e9ea;font-weight:700}
.tweet-quote-handle{color:#71767b}
.tweet-quote-body{font-size:13px;color:#e7e9ea;line-height:1.4;margin-bottom:.5rem;white-space:pre-wrap;word-break:break-word}
.tweet-quote-media{width:100%;max-height:240px;object-fit:cover;border-radius:10px;display:block}

.tweet-reply-context{margin:0 0 .55rem;padding:.4rem .6rem;border-left:2px solid #2f3336;cursor:pointer;transition:border-color .15s}
.tweet-reply-context:hover{border-left-color:var(--blue)}
.tweet-reply-line{font-size:12px;color:#71767b;margin-bottom:.2rem}
.tweet-reply-to{color:var(--blue)}
.tweet-reply-excerpt{font-size:12px;color:#8b98a5;line-height:1.4;font-style:italic;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}

/* ─── PRESS CARD (horizontal layout — image left, content right) ─── */
.of-card{
  background:#fff;border:1px solid var(--border);border-radius:12px;
  margin-bottom:.85rem;overflow:hidden;animation:slide-in .35s ease;
  box-shadow:var(--shadow-sm);
  display:flex;gap:1rem;padding:.9rem 1rem;
  transition:box-shadow .15s,border-color .15s;
}
.of-card:hover{box-shadow:var(--shadow-md);border-color:#cbd5e1}
.of-thumb{
  width:140px;height:90px;flex-shrink:0;
  border-radius:8px;overflow:hidden;
  background:#f1f5f9;border:1px solid var(--border);
  display:flex;align-items:center;justify-content:center;
}
.of-img{width:100%;height:100%;object-fit:cover;display:block}
.of-thumb-empty{font-size:24px;opacity:.4}
.of-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:.25rem}
.of-source{display:flex;align-items:center;gap:.45rem;margin-bottom:.1rem}
.of-source-logo{
  width:18px;height:18px;border-radius:4px;
  display:inline-flex;align-items:center;justify-content:center;
  font-size:9px;font-weight:800;color:#fff;flex-shrink:0;
  background:var(--of);
}
.of-source-name{font-size:11.5px;font-weight:600;color:var(--of)}
.of-headline{
  font-size:14px;font-weight:700;font-family:'Inter','Segoe UI',system-ui,-apple-system,sans-serif;
  line-height:1.35;color:var(--text);
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
}
.of-chapo{
  font-size:12px;color:var(--text2);line-height:1.45;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
}
.of-meta{
  font-size:11px;color:var(--text3);
  display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:.4rem;
  margin-top:auto;padding-top:.3rem;
}
.of-meta .time-tplus{color:var(--brand-2);font-weight:600}
.of-meta .time-real{color:var(--text3)}
/* Legacy classes kept for the article modal (vertical full layout) */
.of-header{background:var(--of);padding:.45rem .95rem;display:flex;align-items:center}
.of-logo-text{color:#fff;font-size:12px;font-weight:800;font-family:Georgia,serif;letter-spacing:.03em}
.of-rubrique{font-size:10px;color:rgba(255,255,255,.85);text-transform:uppercase;letter-spacing:.1em;margin-left:auto}
.of-kicker{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.1em;color:var(--of);margin-bottom:.3rem}

@keyframes slide-in{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:none}}
@keyframes spin{to{transform:rotate(360deg)}}
.spinning{display:inline-block;animation:spin .8s linear infinite}
.live-sep{display:flex;align-items:center;gap:.5rem;margin:.5rem 0;font-size:10px;color:#555;letter-spacing:.08em}
.live-sep::before,.live-sep::after{content:'';flex:1;border-top:1px solid #2f3336}

/* ─── OF ZOOM MODAL ─── */
/* ─── Auth modal ─── */
#auth-modal{
  display:none;position:fixed;inset:0;z-index:900;
  background:rgba(15,23,42,.7);backdrop-filter:blur(6px);
  align-items:center;justify-content:center;padding:1.5rem;
}
#auth-modal.open{display:flex}
.auth-modal-box{
  background:var(--bg2);border:1px solid var(--border);
  border-radius:var(--radius);box-shadow:var(--shadow-lg);
  padding:2.25rem 2rem;width:100%;max-width:360px;text-align:center;
  position:relative;
}
.auth-modal-close{
  position:absolute;top:.7rem;right:.7rem;
  background:var(--bg3);border:1px solid var(--border);border-radius:50%;
  width:28px;height:28px;cursor:pointer;font-size:14px;color:var(--text2);
  display:flex;align-items:center;justify-content:center;padding:0;line-height:1;
}
.auth-modal-close:hover{background:var(--border);color:var(--text)}
.auth-modal-logo{margin-bottom:1.1rem}
.auth-modal-title{font-size:17px;font-weight:700;color:var(--text);margin-bottom:.3rem}
.auth-modal-sub{font-size:12.5px;color:var(--text2);margin-bottom:1.5rem;line-height:1.55}
#auth-password{text-align:center;font-size:15px;letter-spacing:.2em;margin-bottom:.6rem;width:100%}
#auth-error{font-size:12px;color:#dc2626;min-height:1.3em;margin-bottom:.7rem}
@keyframes shake{
  0%,100%{transform:translateX(0)}
  20%,60%{transform:translateX(-7px)}
  40%,80%{transform:translateX(7px)}
}
.auth-modal-box.shake{animation:shake .35s ease}

.of-card{cursor:pointer}
.of-card:hover{box-shadow:var(--shadow-md)}

#of-modal{display:none;position:fixed;inset:0;z-index:500;background:rgba(15,23,42,.6);backdrop-filter:blur(4px);align-items:center;justify-content:center;padding:1.5rem}
#of-modal.open{display:flex}
#of-modal-inner{background:#fff;border-radius:16px;max-width:600px;width:100%;max-height:90vh;overflow-y:auto;position:relative;box-shadow:var(--shadow-lg)}
#of-modal-close{position:sticky;top:.75rem;float:right;margin:.75rem .75rem 0 0;background:rgba(255,255,255,.9);border:1px solid var(--border2);border-radius:50%;width:32px;height:32px;cursor:pointer;font-size:16px;display:flex;align-items:center;justify-content:center;z-index:10;flex-shrink:0;backdrop-filter:blur(4px)}
#of-modal-close:hover{background:var(--bg3)}
.of-article-img{width:100%;max-height:300px;object-fit:cover;display:block}
.of-article-body{padding:1.5rem 1.75rem 2rem}
.of-article-kicker{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.12em;color:var(--of);margin-bottom:.5rem}
.of-article-headline{font-size:clamp(20px,4vw,26px);font-weight:700;font-family:Georgia,'Times New Roman',serif;line-height:1.25;color:var(--text);margin-bottom:.85rem}
.of-article-lead{font-size:15px;color:var(--text);line-height:1.7;margin-bottom:1.25rem;font-weight:400}
.of-article-meta{font-size:12px;color:var(--text3);display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:.35rem;border-top:1px solid var(--border);padding-top:.75rem}

/* ═══════════════════════════════════════════════════════
   PULSE CONFIGURATOR — admin dashboard (redesigned)
   ═══════════════════════════════════════════════════════ */
#configurator{flex:1;display:flex;flex-direction:column;min-height:0;background:#f7f9fb}
#configurator{background-image:none}
.cfg-layout{display:grid;grid-template-columns:260px 1fr;flex:1;overflow:hidden;background:transparent}

/* ─── Header buttons ─── */
.cfg-header-btn{display:inline-flex;align-items:center;gap:.45rem;padding:.55rem 1rem;border-radius:10px;font-weight:500;font-size:13px}
.cfg-header-btn svg{width:14px;height:14px}

/* ─── Sidebar ─── */
.cfg-sidebar{
  background:transparent;border-right:1px solid var(--border);
  padding:1.5rem 1rem;overflow-y:auto;
  display:flex;flex-direction:column;gap:3px;
}
.cfg-sidebar-label{
  font-size:10.5px;font-weight:700;text-transform:uppercase;letter-spacing:.16em;
  color:#94a3b8;padding:.5rem .85rem .55rem;
}
.cfg-sidebar-label--spaced{margin-top:1.25rem}
.cfg-nav-item{
  display:flex;align-items:center;gap:.75rem;
  width:100%;padding:.7rem .85rem;
  background:transparent;border:1px solid transparent;border-radius:10px;
  font-size:13.5px;font-weight:500;color:var(--text2);
  cursor:pointer;text-align:left;
  transition:background .15s,color .15s,border-color .15s;
}
.cfg-nav-item:hover{background:#eef2f6;color:var(--text)}
.cfg-nav-item.active{
  background:#ecfdf5;color:#15803d;font-weight:600;
  border-color:#bbf7d0;
}
.cfg-nav-item.active svg{color:var(--brand-2)}
.cfg-nav-item svg{width:17px;height:17px;flex-shrink:0;color:var(--text3)}

/* ─── Main panel ─── */
.cfg-main{
  overflow-y:auto;padding:2.25rem 2.5rem 3rem;
  display:flex;flex-direction:column;
}
.cfg-page{max-width:1080px;width:100%;margin:0 auto}
.cfg-page--wide{max-width:1200px}
.cfg-page-head{margin-bottom:1.75rem}
.cfg-page-head h2{font-size:26px;font-weight:700;color:#0f172a;margin-bottom:.4rem;letter-spacing:-.015em}
.cfg-page-head p{font-size:14px;color:var(--text2);line-height:1.55}
.cfg-page-head code{font-size:12px;background:var(--bg3);padding:1px 6px;border-radius:4px;font-family:'JetBrains Mono',monospace;color:var(--text)}

/* ─── Cards ─── */
.cfg-card{
  background:#fff;border:1px solid var(--border);border-radius:18px;
  padding:1.5rem 1.75rem;box-shadow:0 1px 2px rgba(15,23,42,.03);
}
.cfg-card--accent{border-color:#bbf7d0;box-shadow:0 0 0 1px rgba(34,197,94,.15)}
.cfg-card-narrow{max-width:560px}
.cfg-card-head{display:flex;align-items:center;gap:.9rem;margin-bottom:1.25rem}
.cfg-card-head--space{justify-content:space-between;align-items:flex-start;gap:1rem}
.cfg-card-head-left{display:flex;align-items:center;gap:.9rem;min-width:0}
.cfg-card-head-right{display:flex;flex-direction:column;align-items:flex-end;gap:.35rem;flex-shrink:0}
.cfg-card-icon{
  display:inline-flex;align-items:center;justify-content:center;
  width:40px;height:40px;border-radius:12px;
  background:#dcfce7;color:var(--brand-2);flex-shrink:0;
}
.cfg-card-icon--soft{background:#dcfce7;color:#15803d}
.cfg-card-icon--violet{background:#ede9fe;color:#7c3aed}
.cfg-card-icon--blue-soft{background:#dbeafe;color:#2563eb}
.cfg-card-icon svg{width:20px;height:20px}
.cfg-card-title{font-size:16.5px;font-weight:700;color:var(--text);line-height:1.2;letter-spacing:-.005em}
.cfg-card-sub{font-size:12px;color:var(--text2);margin-top:3px}

/* ─── Pills ─── */
.cfg-pill{
  display:inline-flex;align-items:center;gap:.35rem;
  padding:.32rem .8rem;border-radius:100px;
  font-size:12px;font-weight:600;white-space:nowrap;
}
.cfg-pill svg{width:13px;height:13px}
.cfg-pill--ok{background:#dcfce7;color:#15803d;border:1px solid #bbf7d0}
.cfg-pill--off{background:#f1f5f9;color:#64748b;border:1px solid #e2e8f0}
.cfg-pill--warn{background:#fef3c7;color:#92400e;border:1px solid #fde68a}

/* ─── Grid layouts ─── */
.cfg-grid-2{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:1.25rem;margin-bottom:1.25rem;align-items:stretch;width:100%}
.cfg-grid-2 > *{min-width:0;width:100%;box-sizing:border-box}
.cfg-page > .cfg-card + .cfg-card{margin-top:1.25rem}

/* ─── État du système — APIs externes list ─── */
.cfg-api-list{display:flex;flex-direction:column;gap:.85rem;margin-bottom:1.25rem}
.cfg-api-row{
  display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:1rem;
  padding:.95rem 1.1rem;
  background:#fff;border:1px solid var(--border);border-radius:14px;
}
.cfg-api-logo{
  display:inline-flex;align-items:center;justify-content:center;
  width:38px;height:38px;border-radius:50%;flex-shrink:0;
  font-weight:700;font-size:13px;
}
.cfg-api-logo--sm{width:32px;height:32px;font-size:12px}
.cfg-api-logo--x{background:#000;color:#fff}
.cfg-api-logo--anthropic{background:#c79c7e;color:#3f1f0a}
.cfg-api-info{min-width:0}
.cfg-api-name{font-size:14px;font-weight:600;color:var(--text)}
.cfg-api-sub{font-size:12px;color:var(--text2);margin-top:1px}
.cfg-api-sub.is-ok{color:#15803d;font-weight:500}

/* ─── Banner (operational status) ─── */
.cfg-banner{
  display:flex;align-items:center;gap:.55rem;
  padding:.75rem 1rem;border-radius:12px;
  font-size:13px;font-weight:500;
}
.cfg-banner--ok{background:#dcfce7;color:#15803d;border:1px solid #bbf7d0}
.cfg-banner--ko{background:#fee2e2;color:#991b1b;border:1px solid #fecaca}
.cfg-banner-dot{
  width:9px;height:9px;border-radius:50%;background:currentColor;flex-shrink:0;
  box-shadow:0 0 0 3px rgba(34,197,94,.15);
}
.cfg-banner--ko .cfg-banner-dot{box-shadow:0 0 0 3px rgba(239,68,68,.15)}

/* ─── Stat tiles ─── */
.cfg-stat-tiles{
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.7rem;margin-bottom:1.25rem;
}
.cfg-stat-tile{
  display:flex;flex-direction:column;align-items:center;text-align:center;
  padding:1.35rem .4rem 1.1rem;min-width:0;
  background:#fafbfc;border:1px solid var(--border);border-radius:14px;
}
.cfg-stat-tile-icon{
  display:inline-flex;align-items:center;justify-content:center;
  width:46px;height:46px;border-radius:14px;margin-bottom:.85rem;
}
.cfg-stat-tile-icon svg{width:22px;height:22px}
.cfg-stat-tile-icon--blue{background:#dbeafe;color:#2563eb}
.cfg-stat-tile-icon--violet{background:#ede9fe;color:#7c3aed}
.cfg-stat-tile-icon--green{background:#dcfce7;color:#15803d}
.cfg-stat-tile-num{font-size:30px;font-weight:700;color:var(--text);line-height:1.1;letter-spacing:-.01em}
.cfg-stat-tile-num--small{font-size:30px;color:#16a34a;letter-spacing:-.005em}
.cfg-stat-tile-num.is-stopped{color:#dc2626}
.cfg-stat-tile-num.is-idle{color:#64748b}
.cfg-stat-tile-label{font-size:12px;color:var(--text2);margin-top:.4rem;line-height:1.3;padding:0 .15rem}
.cfg-stat-tile-hint{font-size:11px;color:var(--text3);margin-top:.2rem;font-style:italic}

/* ─── Informations système ─── */
.cfg-sysinfo-grid{
  display:grid;grid-template-columns:repeat(4,1fr);gap:1rem;
}
.cfg-sysinfo-item{
  display:flex;align-items:center;gap:.85rem;min-width:0;
}
.cfg-sysinfo-icon{
  display:inline-flex;align-items:center;justify-content:center;
  width:36px;height:36px;border-radius:10px;flex-shrink:0;
  background:#f1f5f9;color:#64748b;
}
.cfg-sysinfo-icon svg{width:17px;height:17px}
.cfg-sysinfo-label{font-size:11.5px;color:var(--text3);text-transform:none;letter-spacing:0;font-weight:500}
.cfg-sysinfo-val{font-size:13.5px;font-weight:600;color:var(--text);margin-top:1px}

/* ─── Tests page ─── */
.cfg-tests-grid{display:grid;grid-template-columns:1fr 1.1fr;gap:1.25rem;align-items:start;min-height:0}
.cfg-tests-card,.cfg-tests-output-card{padding:1.5rem;display:flex;flex-direction:column}

.cfg-step-head{
  display:flex;align-items:center;gap:.7rem;margin-bottom:1.25rem;
}
.cfg-step-head--right{justify-content:flex-start}
.cfg-step-head--right .cfg-clear-btn{margin-left:auto}
.cfg-step-num{
  display:inline-flex;align-items:center;justify-content:center;
  width:26px;height:26px;border-radius:50%;
  background:#dcfce7;color:#15803d;font-size:13px;font-weight:700;
}
.cfg-step-title{font-size:15px;font-weight:600;color:var(--text)}
.cfg-clear-btn{
  font-size:12px;font-weight:500;padding:.4rem .8rem;border-radius:8px;
  color:var(--text2);
}

.cfg-test-block{padding:.5rem 0}
.cfg-test-block-head{
  display:flex;align-items:center;gap:.75rem;margin-bottom:1rem;
}
.cfg-test-block-title{font-size:14px;font-weight:600;color:var(--text)}
.cfg-test-block-sub{font-size:12px;color:var(--text2);margin-top:1px}
.cfg-test-sep{border:none;border-top:1px solid var(--border);margin:1.25rem -1.5rem 1.25rem;padding:0;width:auto}

.cfg-help{
  display:inline-flex;align-items:center;justify-content:center;
  width:14px;height:14px;border-radius:50%;background:#e2e8f0;
  color:var(--text3);font-size:10px;font-weight:600;cursor:help;margin-left:.2rem;
  font-family:'Inter',system-ui,sans-serif;
}
.cfg-input-hint{font-size:11.5px;color:var(--text3);margin-top:.3rem}

.cfg-test-btn{
  width:100%;justify-content:center;
  margin-top:1rem;padding:.75rem 1rem;
  font-size:13.5px;font-weight:600;border-radius:10px;
}

/* Response area */
.cfg-resp-tabs{
  display:flex;gap:.4rem;margin-bottom:.85rem;
}
.cfg-resp-tab{
  padding:.45rem 1rem;border-radius:8px;cursor:pointer;
  background:#f1f5f9;border:1px solid var(--border);
  font-size:12.5px;font-weight:500;color:var(--text2);
  transition:background .15s,color .15s,border-color .15s;
}
.cfg-resp-tab:hover{background:#e2e8f0}
.cfg-resp-tab.active{background:#0f172a;color:#fff;border-color:#0f172a}

.cfg-tests-output{
  background:#0d1117;border:1px solid #21262d;border-radius:14px;
  display:flex;flex-direction:column;overflow:hidden;position:relative;
  min-height:340px;flex:1;
}
.cfg-response-body{
  flex:1;overflow-y:auto;padding:1.1rem 1.3rem;margin:0;
  font-size:12px;font-family:'JetBrains Mono','Cascadia Code','Fira Code',Consolas,monospace;
  color:#e6edf3;white-space:pre-wrap;word-break:break-all;line-height:1.7;
  counter-reset:line;
}
.cfg-response-body .cfg-resp-line{
  display:block;padding-left:2.4rem;position:relative;
}
.cfg-response-body .cfg-resp-line::before{
  counter-increment:line;content:counter(line);
  position:absolute;left:0;width:2rem;text-align:right;
  color:#5b6470;user-select:none;
}
.cfg-resp-placeholder{color:#5b6470;font-style:italic}

.cfg-resp-status-overlay{
  position:absolute;top:.75rem;right:.75rem;
  display:flex;align-items:center;gap:.5rem;
}
.cfg-resp-time{font-size:11px;color:#8b949e;font-family:'JetBrains Mono',monospace}
.cfg-badge{padding:3px 11px;border-radius:100px;font-size:10.5px;font-weight:700;letter-spacing:.04em;display:inline-flex;align-items:center;gap:.25rem}
.cfg-badge.ok{background:rgba(34,197,94,.18);color:#3fb950;border:1px solid rgba(34,197,94,.3)}
.cfg-badge.ok::before{content:"";width:6px;height:6px;border-radius:50%;background:#3fb950}
.cfg-badge.ko{background:rgba(239,68,68,.18);color:#f85149;border:1px solid rgba(239,68,68,.3)}
.cfg-badge.loading{background:rgba(88,166,255,.18);color:#58a6ff;border:1px solid rgba(88,166,255,.3)}

.cfg-resp-footer{
  display:flex;align-items:center;gap:.55rem;
  padding:.7rem 1rem;margin-top:.75rem;
  background:#dcfce7;color:#15803d;border:1px solid #bbf7d0;
  border-radius:10px;font-size:12.5px;font-weight:500;
}
.cfg-resp-footer.is-ko{background:#fee2e2;color:#991b1b;border-color:#fecaca}
.cfg-resp-footer-time{margin-left:auto;font-size:11.5px;color:var(--text2);font-family:'JetBrains Mono',monospace;font-weight:400}

/* ─── Mot de passe ─── */
.cfg-pwd-card{padding:1.5rem 1.75rem}
.cfg-pwd-status{
  display:flex;align-items:center;gap:.75rem;
  padding:.85rem 1rem;border-radius:12px;
  background:#dcfce7;color:#15803d;border:1px solid #bbf7d0;
  margin-bottom:1.5rem;
}
.cfg-pwd-status-icon{
  display:inline-flex;align-items:center;justify-content:center;
  width:24px;height:24px;border-radius:50%;background:#22c55e;color:#fff;
  flex-shrink:0;
}
.cfg-pwd-status-icon svg{width:14px;height:14px}
.cfg-pwd-status-title{font-size:13px;font-weight:600;color:#15803d}
.cfg-pwd-status-sub{font-size:11.5px;color:#16a34a;margin-top:1px}

.cfg-pwd-input{
  position:relative;display:flex;align-items:stretch;
}
.cfg-pwd-input input{flex:1;padding-right:2.6rem}
.cfg-pwd-eye{
  position:absolute;right:.6rem;top:50%;transform:translateY(-50%);
  background:transparent;border:none;cursor:pointer;
  display:flex;align-items:center;justify-content:center;
  padding:.3rem;color:var(--text3);border-radius:6px;
  transition:color .15s,background .15s;
}
.cfg-pwd-eye:hover{color:var(--text);background:var(--bg3)}
.cfg-pwd-eye svg{width:16px;height:16px}

.cfg-pwd-strength{margin-top:.5rem}
.cfg-pwd-bar{display:flex;gap:4px;margin-bottom:.35rem}
.cfg-pwd-bar-i{
  flex:1;height:5px;background:#e5e7eb;border-radius:100px;
  transition:background .2s;
}
.cfg-pwd-strength.is-1 .cfg-pwd-bar-i[data-i="0"]{background:#ef4444}
.cfg-pwd-strength.is-2 .cfg-pwd-bar-i[data-i="0"],
.cfg-pwd-strength.is-2 .cfg-pwd-bar-i[data-i="1"]{background:#f59e0b}
.cfg-pwd-strength.is-3 .cfg-pwd-bar-i[data-i="0"],
.cfg-pwd-strength.is-3 .cfg-pwd-bar-i[data-i="1"],
.cfg-pwd-strength.is-3 .cfg-pwd-bar-i[data-i="2"]{background:#eab308}
.cfg-pwd-strength.is-4 .cfg-pwd-bar-i{background:#22c55e}
.cfg-pwd-strength-label{font-size:11.5px;color:var(--text3)}
.cfg-pwd-strength-label strong{color:var(--text);font-weight:600}
.cfg-pwd-strength.is-1 .cfg-pwd-strength-label strong{color:#dc2626}
.cfg-pwd-strength.is-2 .cfg-pwd-strength-label strong{color:#d97706}
.cfg-pwd-strength.is-3 .cfg-pwd-strength-label strong{color:#ca8a04}
.cfg-pwd-strength.is-4 .cfg-pwd-strength-label strong{color:#15803d}

.cfg-pwd-match{
  display:flex;align-items:center;gap:.4rem;
  margin-top:.4rem;font-size:12px;font-weight:500;
}
.cfg-pwd-match.is-ok{color:#15803d}
.cfg-pwd-match.is-ko{color:#dc2626}
.cfg-pwd-match::before{content:"";display:inline-block;width:14px;height:14px;border-radius:50%;flex-shrink:0}
.cfg-pwd-match.is-ok::before{background:#22c55e url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") center/10px no-repeat}
.cfg-pwd-match.is-ko::before{background:#ef4444 url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'><line x1='18' y1='6' x2='6' y2='18'/><line x1='6' y1='6' x2='18' y2='18'/></svg>") center/10px no-repeat}

.cfg-pwd-save{
  width:100%;justify-content:center;margin-top:1.25rem;
  padding:.95rem 1rem;font-size:14px;font-weight:600;border-radius:12px;
}

/* ─── Tip card (Bonnes pratiques / Bon à savoir) ─── */
.cfg-tip{
  display:flex;align-items:flex-start;gap:.85rem;
  padding:1.1rem 1.3rem;border-radius:14px;
  background:#eff6ff;border:1px solid #bfdbfe;
  margin-top:1.25rem;position:relative;
}
.cfg-tip-icon{
  display:inline-flex;align-items:center;justify-content:center;
  width:32px;height:32px;border-radius:50%;
  background:#3b82f6;color:#fff;flex-shrink:0;
}
.cfg-tip-icon svg{width:16px;height:16px}
.cfg-tip-body{flex:1;min-width:0}
.cfg-tip-title{font-size:13.5px;font-weight:700;color:#1e3a8a;margin-bottom:.5rem}
.cfg-tip-text{font-size:12.5px;color:#1e40af;line-height:1.55}
.cfg-tip-list{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:.4rem}
.cfg-tip-list li{display:flex;align-items:center;gap:.55rem;font-size:12.5px;color:#1e40af}
.cfg-tip-check{
  display:inline-flex;align-items:center;justify-content:center;
  width:16px;height:16px;border-radius:50%;background:#3b82f6;color:#fff;
  font-size:9px;font-weight:700;flex-shrink:0;
}
.cfg-tip-shield{
  display:inline-flex;align-items:center;justify-content:center;
  width:48px;height:48px;border-radius:14px;background:#dbeafe;color:#2563eb;flex-shrink:0;
  align-self:center;
}
.cfg-tip-shield svg{width:24px;height:24px}

/* ─── Clés API ─── */
.cfg-key-card{padding:1.5rem 1.75rem}
.cfg-key-card-desc{font-size:12.5px;color:var(--text2);margin-top:3px;line-height:1.4}
.cfg-key-updated{font-size:11.5px;color:var(--text3)}
.cfg-key-current{
  position:relative;display:flex;align-items:center;
  background:#f8fafc;border:1px solid var(--border);border-radius:10px;
  padding:.15rem;
}
.cfg-key-current input{
  flex:1;background:transparent;border:none;padding:.55rem .8rem;
  font-family:'JetBrains Mono',monospace;font-size:12.5px;color:var(--text);
}
.cfg-key-current input:focus{box-shadow:none}
.cfg-key-icon-btn{
  display:inline-flex;align-items:center;justify-content:center;
  width:32px;height:32px;border-radius:8px;flex-shrink:0;
  background:transparent;border:none;color:var(--text3);cursor:pointer;
  transition:color .15s,background .15s;
}
.cfg-key-icon-btn:hover{color:var(--text);background:#fff}
.cfg-key-icon-btn svg{width:15px;height:15px}

.cfg-key-update-row{display:flex;gap:.6rem}
.cfg-key-update-row input{flex:1;min-width:0;font-family:'JetBrains Mono',monospace;font-size:12.5px}
.cfg-paste-btn{
  display:inline-flex;align-items:center;gap:.4rem;
  padding:.5rem .9rem;border-radius:10px;
  background:#fff;border:1px solid var(--border2);color:var(--text2);
  font-size:12px;font-weight:500;flex-shrink:0;
}
.cfg-paste-btn:hover{background:var(--bg3);color:var(--text)}

.cfg-key-update-foot{
  display:flex;align-items:center;justify-content:space-between;gap:1rem;
  margin-top:.85rem;flex-wrap:wrap;
}
.cfg-key-update-hint{
  display:flex;align-items:center;gap:.4rem;
  font-size:11.5px;color:var(--text3);
}
.cfg-key-update-hint svg{flex-shrink:0;color:var(--text3)}
.cfg-key-save{
  display:inline-flex;align-items:center;gap:.4rem;
  padding:.6rem 1.1rem;font-size:13px;font-weight:600;border-radius:10px;
}

.cfg-msg{font-size:12px;min-height:1.3em;margin-top:.5rem;font-weight:500}

/* ─── Sources prédéfinies ─── */
.cfg-src-tabs{
  display:flex;gap:0;margin-bottom:1.5rem;
  border-bottom:1px solid var(--border);padding:0;
}
.cfg-src-tab{
  display:inline-flex;align-items:center;gap:.5rem;
  padding:.85rem 1.25rem;
  background:transparent;border:none;border-bottom:2px solid transparent;
  font-size:13.5px;font-weight:500;color:var(--text2);
  cursor:pointer;transition:color .15s,border-color .15s;margin-bottom:-1px;
  font-family:inherit;
}
.cfg-src-tab:hover{color:var(--text)}
.cfg-src-tab.active{color:#15803d;border-bottom-color:#22c55e;font-weight:600}

.cfg-src-grid{
  display:grid;grid-template-columns:1.15fr 1fr;gap:1.25rem;align-items:start;
}
.cfg-src-side{display:flex;flex-direction:column;gap:1.25rem}

.cfg-src-list-card{padding:1.5rem 1.75rem;display:flex;flex-direction:column}
.cfg-src-list-head{
  display:flex;align-items:center;justify-content:space-between;gap:1rem;
  margin-bottom:.4rem;
}
.cfg-src-list-title{
  display:flex;align-items:center;gap:.5rem;
  font-size:15.5px;font-weight:700;color:var(--text);
}
.cfg-src-count-badge{
  display:inline-flex;align-items:center;justify-content:center;
  min-width:22px;height:22px;padding:0 7px;
  background:#22c55e;color:#fff;border-radius:100px;
  font-size:11.5px;font-weight:700;
}
.cfg-src-list-sub{font-size:12.5px;color:var(--text2);margin-bottom:1rem}
.cfg-src-list-foot{
  font-size:12px;color:var(--text3);text-align:left;
  margin-top:.9rem;padding-top:.9rem;border-top:1px solid var(--border);
}
.cfg-sort-btn{
  display:inline-flex;align-items:center;gap:.4rem;
  padding:.45rem .85rem;border-radius:8px;
  font-size:12px;font-weight:500;color:var(--text2);
}

.cfg-sugg-list{
  display:flex;flex-direction:column;gap:.5rem;
  max-height:420px;overflow-y:auto;
}
.cfg-sugg-item{
  display:flex;align-items:center;gap:.85rem;
  padding:.7rem .85rem;
  background:#fff;border:1px solid var(--border);border-radius:12px;
  font-size:13px;min-width:0;
  transition:border-color .15s,box-shadow .15s;
}
.cfg-sugg-item:hover{border-color:#cbd5e1;box-shadow:var(--shadow-sm)}
.cfg-sugg-logo{
  display:inline-flex;align-items:center;justify-content:center;
  width:36px;height:36px;border-radius:50%;
  background:#0f172a;color:#fff;font-size:11px;font-weight:700;flex-shrink:0;
  text-transform:uppercase;
  background-size:cover;background-position:center;
}
.cfg-sugg-info{flex:1;min-width:0;display:flex;flex-direction:column;line-height:1.25}
.cfg-sugg-name{font-size:13px;font-weight:600;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cfg-sugg-handle{font-size:11.5px;color:var(--text3);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cfg-sugg-item .src-del{
  display:inline-flex;align-items:center;justify-content:center;
  width:32px;height:32px;border-radius:8px;
  background:#fef2f2;border:1px solid #fee2e2;color:#ef4444;
  cursor:pointer;flex-shrink:0;font-size:13px;
  transition:background .15s,color .15s;
}
.cfg-sugg-item .src-del::before{
  content:"";width:14px;height:14px;
  background:currentColor;
  -webkit-mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='3 6 5 6 21 6'/><path d='M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6'/><path d='M10 11v6'/><path d='M14 11v6'/><path d='M9 6V4a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2'/></svg>") center/contain no-repeat;
          mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='3 6 5 6 21 6'/><path d='M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6'/><path d='M10 11v6'/><path d='M14 11v6'/><path d='M9 6V4a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2'/></svg>") center/contain no-repeat;
}
.cfg-sugg-item .src-del:hover{background:#ef4444;color:#fff;border-color:#ef4444}
.src-empty{padding:1.5rem;text-align:center;color:var(--text3);font-size:13px}

/* Add card (right column) */
.cfg-src-add-card{padding:1.5rem 1.75rem}
.cfg-src-add-title{font-size:15.5px;font-weight:700;color:var(--text);margin-bottom:.3rem}
.cfg-src-add-sub{font-size:12.5px;color:var(--text2);margin-bottom:1.1rem}
.cfg-src-add-grid{
  display:grid;grid-template-columns:1fr 1fr;gap:.75rem;margin-bottom:1rem;
}
.cfg-src-add-grid label{
  margin-top:0;margin-bottom:.35rem;
  font-size:12px;font-weight:500;color:var(--text2);text-transform:none;letter-spacing:0;
  display:flex;align-items:center;
}
.cfg-src-add-grid input{font-size:13px;width:100%}
.cfg-add-source-btn{
  display:inline-flex;align-items:center;gap:.45rem;
  padding:.7rem 1.1rem;border-radius:10px;
  background:#fff;border:1.5px solid #22c55e;color:#15803d;
  font-size:13px;font-weight:600;
  transition:background .15s;
}
.cfg-add-source-btn:hover{background:#dcfce7;border-color:#16a34a}

/* Suggestions populaires */
.cfg-src-popular-card{padding:1.5rem 1.75rem}
.cfg-src-popular-title{font-size:15.5px;font-weight:700;color:var(--text);margin-bottom:.3rem}
.cfg-src-popular-sub{font-size:12.5px;color:var(--text2);margin-bottom:1.1rem}
.cfg-src-popular-grid{
  display:grid;grid-template-columns:repeat(3,1fr);gap:.55rem;
}
.cfg-popular-chip{
  display:flex;align-items:center;gap:.45rem;
  padding:.55rem .7rem;
  background:#f8fafc;border:1px solid var(--border);border-radius:10px;
  font-size:12px;color:var(--text);cursor:pointer;
  transition:background .15s,border-color .15s;min-width:0;
  font-family:inherit;
}
.cfg-popular-chip:hover{background:#fff;border-color:#22c55e}
.cfg-popular-chip-logo{
  display:inline-flex;align-items:center;justify-content:center;
  width:22px;height:22px;border-radius:50%;background:#0f172a;color:#fff;
  font-size:9px;font-weight:700;flex-shrink:0;
  background-size:cover;background-position:center;
}
.cfg-popular-chip-text{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500}
.cfg-popular-chip-plus{
  display:inline-flex;align-items:center;justify-content:center;
  font-size:14px;color:var(--text3);flex-shrink:0;line-height:1;
}
.cfg-popular-chip:hover .cfg-popular-chip-plus{color:#22c55e}

.cfg-popular-more{
  display:flex;align-items:center;justify-content:center;gap:.4rem;
  width:100%;margin-top:.85rem;
  padding:.6rem 1rem;border-radius:10px;
  background:#f8fafc;border:1px solid var(--border);
  font-size:12.5px;font-weight:500;color:var(--text2);cursor:pointer;
  font-family:inherit;
  transition:background .15s;
}
.cfg-popular-more:hover{background:#f1f5f9}
.cfg-popular-more svg{transition:transform .2s}
.cfg-popular-more.is-open svg{transform:rotate(180deg)}

/* ─── À propos modal ─── */
#about-modal{display:none;position:fixed;inset:0;z-index:800;background:rgba(15,23,42,.7);backdrop-filter:blur(6px);align-items:center;justify-content:center;padding:1.5rem}
#about-modal.open{display:flex}
.about-box{background:var(--bg2);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow-lg);padding:2rem;width:100%;max-width:480px;position:relative;max-height:90vh;overflow-y:auto}
.about-close{position:absolute;top:.9rem;right:.9rem;background:var(--bg3);border:1px solid var(--border);border-radius:50%;width:28px;height:28px;cursor:pointer;font-size:14px;display:flex;align-items:center;justify-content:center}
.about-close:hover{background:var(--border)}
.about-header{display:flex;align-items:center;gap:1rem;margin-bottom:1.1rem}
.about-logo{width:48px;height:48px;flex-shrink:0}
.about-title{font-size:22px;font-weight:800;letter-spacing:.04em;color:var(--text)}
.about-subtitle{font-size:11.5px;color:var(--brand-2);font-weight:500}
.about-desc{font-size:13.5px;color:var(--text2);line-height:1.65;margin-bottom:1.25rem}
.about-features{display:grid;grid-template-columns:1fr 1fr;gap:.65rem;margin-bottom:1.5rem}
.about-feat{display:flex;align-items:flex-start;gap:.6rem;background:var(--bg3);border:1px solid var(--border);border-radius:var(--radius-sm);padding:.7rem .8rem;font-size:12.5px;line-height:1.45}
.about-feat strong{display:block;margin-bottom:.1rem;font-size:12.5px;color:var(--text)}
.about-feat-icon{font-size:18px;flex-shrink:0;line-height:1;margin-top:2px}
.about-footer{display:flex;justify-content:space-between;align-items:center;font-size:12px;color:var(--text3);padding-top:.85rem;border-top:1px solid var(--border)}
.about-version{font-family:monospace;font-size:11px;background:var(--bg3);padding:2px 8px;border-radius:100px}

/* ─── Documentation modal ─── */
#doc-modal{display:none;position:fixed;inset:0;z-index:800;background:rgba(15,23,42,.7);backdrop-filter:blur(6px);align-items:center;justify-content:center;padding:1.5rem}
#doc-modal.open{display:flex}
.doc-box{background:var(--bg2);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow-lg);width:100%;max-width:760px;max-height:90vh;display:flex;flex-direction:column;position:relative}
.doc-close{position:absolute;top:.9rem;right:.9rem;background:rgba(255,255,255,.9);border:1px solid var(--border);border-radius:50%;width:30px;height:30px;cursor:pointer;font-size:15px;display:flex;align-items:center;justify-content:center;z-index:2}
.doc-close:hover{background:var(--bg3)}
.doc-header{padding:1.5rem 1.75rem 0;flex-shrink:0;border-bottom:1px solid var(--border)}
.doc-title{font-size:18px;font-weight:800;color:var(--text);margin-bottom:1rem}
.doc-tabs{display:flex;gap:6px;padding-bottom:0;margin-bottom:-1px}
.doc-tab{padding:.5rem 1.1rem;background:transparent;border:1px solid var(--border);border-bottom:none;border-radius:8px 8px 0 0;font-size:13px;font-weight:600;color:var(--text2);cursor:pointer;transition:background .15s,color .15s}
.doc-tab:hover{background:var(--bg3)}
.doc-tab.active{background:var(--bg2);color:var(--text);border-bottom:1px solid var(--bg2);margin-bottom:-1px;position:relative;z-index:1}
.doc-body{flex:1;overflow-y:auto;padding:1.75rem}
.doc-section{margin-bottom:2rem}
.doc-section:last-child{margin-bottom:0}
.doc-section h3{font-size:14.5px;font-weight:700;color:var(--text);margin-bottom:.65rem;padding-bottom:.5rem;border-bottom:1px solid var(--border)}
.doc-section p{font-size:13px;color:var(--text2);line-height:1.65;margin-bottom:.5rem}
.doc-warn{background:#fef3c7;border:1px solid #fcd34d;border-radius:var(--radius-sm);padding:.75rem 1rem;font-size:12.5px;color:#92400e;line-height:1.5;margin-top:.75rem}
.doc-list{padding-left:1.3rem;font-size:13px;color:var(--text2);line-height:1.9}
.doc-list li{margin-bottom:.15rem}
.doc-cols{display:grid;grid-template-columns:1fr 1fr;gap:.75rem;margin-top:.65rem}
.doc-col-card{background:var(--bg3);border:1px solid var(--border);border-radius:var(--radius-sm);padding:.9rem 1rem;font-size:12.5px;color:var(--text2);line-height:1.55}
.doc-col-head{display:flex;align-items:center;gap:.45rem;font-weight:700;font-size:13px;margin-bottom:.4rem;color:var(--text)}
.doc-indicators{display:flex;flex-direction:column;gap:.5rem;margin-top:.5rem}
.doc-indicator{display:flex;align-items:flex-start;gap:.65rem;font-size:12.5px;color:var(--text2);line-height:1.55}
.doc-ind-badge{flex-shrink:0;padding:2px 10px;border-radius:100px;font-size:11.5px;font-weight:600;white-space:nowrap;border:1px solid transparent}
.doc-two-col{display:grid;grid-template-columns:1fr 1fr;gap:1rem;font-size:13px;color:var(--text2);line-height:1.6}
.doc-two-col strong{display:block;color:var(--text);margin-bottom:.3rem}

/* ─── Responsive tweaks ─── */
@media (max-width: 1100px){
  .cfg-tests-grid{grid-template-columns:1fr}
  .cfg-tests-output{min-height:340px}
  .cfg-grid-2{grid-template-columns:1fr}
  .cfg-stat-tiles{grid-template-columns:1fr 1fr 1fr}
  .cfg-sysinfo-grid{grid-template-columns:1fr 1fr}
  .cfg-src-grid{grid-template-columns:1fr}
  .cfg-src-popular-grid{grid-template-columns:1fr 1fr}
}
@media (max-width: 760px){
  .role-cards{grid-template-columns:1fr;max-width:320px}
  .nr-layout,.wall-content,.cfg-layout{grid-template-columns:1fr}
  .nr-panel,.wall-col{border-right:none;border-bottom:1px solid var(--border)}
  .app-brand-text{display:none}
  .app-context{margin-left:0;padding-left:0;border-left:none}
  .cfg-sidebar{
    flex-direction:row;flex-wrap:wrap;
    border-right:none;border-bottom:1px solid var(--border);
    padding:.6rem .75rem;gap:.3rem;
  }
  .cfg-sidebar-label{display:none}
  .cfg-nav-item{width:auto;padding:.45rem .75rem;font-size:12.5px}
  .cfg-main{padding:1.25rem 1rem}
  .cfg-page-head h2{font-size:17px}
  .cfg-stat-tiles{grid-template-columns:1fr}
  .cfg-sysinfo-grid{grid-template-columns:1fr 1fr}
  .cfg-src-add-grid{grid-template-columns:1fr}
  .cfg-src-popular-grid{grid-template-columns:1fr}
  .about-features,.doc-cols,.doc-two-col{grid-template-columns:1fr}
  .about-box{padding:1.5rem 1.25rem}
  .doc-body{padding:1.25rem 1rem}
}

/* ── Toast notification ── */
.app-toast{
  position:fixed;bottom:1.5rem;left:50%;transform:translateX(-50%);
  background:var(--bg2);color:var(--text);
  border:1px solid var(--border);border-radius:var(--radius-sm);
  padding:.55rem 1.25rem;font-size:.875rem;
  z-index:9999;opacity:0;transition:opacity .2s;pointer-events:none;
  max-width:min(90vw,480px);text-align:center;white-space:pre-wrap;
}
.app-toast.visible{opacity:1}
.app-toast.toast-error{border-color:#ef4444;color:#ef4444}
.app-toast.toast-ok{border-color:#22c55e;color:#22c55e}
