/* ========================================================================
   YouRSS by TROOVER — Stylesheet bi-thème
   data-theme="troover"  → charte TROOVER (bleu marine, rouge, fond clair)
   data-theme="osint"    → terminal/matrix (noir, vert phosphore, mono)
   ======================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700;9..144,900&family=JetBrains+Mono:wght@400;500;600;700&family=Inter:wght@400;500;600;700&family=Share+Tech+Mono&display=swap');

/* ============================================================
   THÈME CLASSIQUE — TROOVER
   ============================================================
   Inspiration logo : bleu marine profond #1a2e6e, accent rouge #c8102e,
   fond crème, lunettes/observateur, ton chaleureux et lisible.
*/
:root,
[data-theme="troover"] {
  --bg:           #f7f4ec;
  --bg-elev:      #ffffff;
  --bg-elev-2:    #efeadd;
  --bg-canvas:    #ffffff;
  --border:       #d8d0bf;
  --border-soft:  #e8e2d2;
  --text:         #1a2e6e;
  --text-strong:  #0d1a45;
  --text-dim:     #5e6a91;
  --text-mute:    #8a8676;
  --accent:       #c8102e;
  --accent-soft:  #e63946;
  --accent-bg:    rgba(200, 16, 46, 0.10);
  --primary:      #1a2e6e;
  --primary-soft: #2b4296;
  --primary-bg:   rgba(26, 46, 110, 0.08);
  --success:      #2d6a4f;
  --error:        #c8102e;
  --warn:         #c97b16;

  --serif:        'Fraunces', 'Iowan Old Style', Georgia, serif;
  --mono:         'JetBrains Mono', ui-monospace, monospace;
  --sans:         'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --shadow-sm:    0 1px 2px rgba(26, 46, 110, 0.06);
  --shadow-md:    0 4px 12px rgba(26, 46, 110, 0.08);
  --shadow-lg:    0 16px 40px rgba(26, 46, 110, 0.12);

  --grain-opacity: 0;
  --selection-bg: var(--accent-bg);
}

/* ============================================================
   THÈME OSINT — terminal / matrix
   ============================================================ */
[data-theme="osint"] {
  --bg:           #050807;
  --bg-elev:      #0a100d;
  --bg-elev-2:    #111a16;
  --bg-canvas:    #0a100d;
  --border:       #1b2e25;
  --border-soft:  #142019;
  --text:         #c8e6cf;
  --text-strong:  #e8ffef;
  --text-dim:     #5d8170;
  --text-mute:    #3a5547;
  --accent:       #00ff41;
  --accent-soft:  #4dff7a;
  --accent-bg:    rgba(0, 255, 65, 0.08);
  --primary:      #00ff41;
  --primary-soft: #4dff7a;
  --primary-bg:   rgba(0, 255, 65, 0.10);
  --success:      #00ff41;
  --error:        #ff3b3b;
  --warn:         #ffb800;

  --serif:        'Share Tech Mono', 'JetBrains Mono', monospace;
  --mono:         'JetBrains Mono', ui-monospace, monospace;
  --sans:         'JetBrains Mono', ui-monospace, monospace;

  --shadow-sm:    0 0 0 1px rgba(0, 255, 65, 0.15);
  --shadow-md:    0 0 24px rgba(0, 255, 65, 0.10);
  --shadow-lg:    0 0 48px rgba(0, 255, 65, 0.18);

  --grain-opacity: 0.04;
  --selection-bg: rgba(0, 255, 65, 0.25);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s, color 0.3s;
}

::selection { background: var(--selection-bg); color: var(--text-strong); }

body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: var(--grain-opacity);
  z-index: 9999;
  mix-blend-mode: overlay;
}

[data-theme="osint"] body::after {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  background: linear-gradient(transparent 50%, rgba(0,255,65,0.02) 50%);
  background-size: 100% 4px;
  z-index: 9998;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, select, textarea {
  font-family: var(--sans);
  font-size: 14px;
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 9px 12px;
  width: 100%;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-bg);
}
input::placeholder { color: var(--text-mute); }

label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}
[data-theme="osint"] label::before { content: '> '; color: var(--accent); }

code, .mono { font-family: var(--mono); font-size: 0.92em; }

/* ============================================================
   BOUTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  border-radius: 4px;
  font-size: 14px; font-weight: 500;
  font-family: var(--sans);
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, transform 0.05s, box-shadow 0.15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--primary); color: var(--bg-elev);
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-soft); border-color: var(--primary-soft); }
.btn-ghost {
  background: transparent; color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg-elev-2); border-color: var(--text-dim); }
.btn-danger {
  background: transparent; color: var(--error);
  border-color: var(--error);
  opacity: 0.7;
}
.btn-danger:hover { opacity: 1; background: rgba(200, 16, 46, 0.1); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 14px 26px; font-size: 15px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

[data-theme="osint"] .btn-primary {
  background: var(--accent);
  color: #000;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 13px;
}
[data-theme="osint"] .btn-primary:hover {
  box-shadow: 0 0 16px rgba(0, 255, 65, 0.5);
}
[data-theme="osint"] .btn-ghost {
  background: var(--bg-elev);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 13px;
}

/* ============================================================
   HEADER + THEME TOGGLE
   ============================================================ */
header.app-header {
  border-bottom: 1px solid var(--border);
  padding: 14px 32px;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg);
  position: sticky; top: 0; z-index: 100;
  gap: 16px;
}

.brand {
  display: flex; align-items: center;
  gap: 10px;
}

.brand-logo {
  height: 38px;
  width: auto;
  display: block;
}

[data-theme="osint"] .brand-logo { display: none; }
[data-theme="osint"] .brand::before {
  content: '> ./yourss';
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.04em;
}
[data-theme="osint"] .brand::after {
  content: '_';
  color: var(--accent);
  animation: blink 1s step-end infinite;
  font-weight: 700;
  font-size: 18px;
}
@keyframes blink { 50% { opacity: 0; } }

.user-menu {
  display: flex; align-items: center; gap: 12px;
  font-size: 13px; color: var(--text-dim);
}
.user-menu a { color: var(--text-dim); }
.user-menu .user-email { font-family: var(--mono); font-size: 12px; }

.theme-toggle {
  display: inline-flex;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px;
  gap: 0;
}
.theme-toggle button {
  padding: 5px 12px;
  font-size: 11px;
  font-family: var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  border-radius: 3px;
  transition: background 0.15s, color 0.15s;
}
.theme-toggle button.active {
  background: var(--bg);
  color: var(--text-strong);
  box-shadow: var(--shadow-sm);
}
[data-theme="osint"] .theme-toggle button.active {
  background: var(--accent);
  color: #000;
  font-weight: 700;
}

/* ============================================================
   AUTH SCREEN
   ============================================================ */
.auth-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
}

.theme-toggle-floating {
  position: fixed;
  top: 24px; right: 24px;
  z-index: 200;
}

.auth-screen .left {
  background: var(--bg);
  display: flex; flex-direction: column;
  justify-content: center;
  padding: 64px;
  border-right: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.auth-screen .left::after {
  content: '';
  position: absolute;
  bottom: -200px; right: -200px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, var(--primary-bg) 0%, transparent 60%);
  pointer-events: none;
}

[data-theme="osint"] .auth-screen .left::after {
  background: radial-gradient(circle, var(--accent-bg) 0%, transparent 60%);
}

[data-theme="osint"] .auth-screen .left::before {
  content: '01001110 01001111 00100000 01010011 01001001 01000111 01001110 01000001 01001100 00001010 01010100 01001000 01001001 01010011 00100000 01001001 01010011 00100000 01000110 01001100 01010101 01011000 01001001 01001111 01001110 00001010 01000110 01001100 01010101 01011000 01001001 01001111 01001110';
  position: absolute;
  inset: 0;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  opacity: 0.04;
  word-spacing: 0;
  line-height: 1.4;
  padding: 32px;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
}

.auth-screen .right {
  background: var(--bg-elev);
  display: flex; align-items: center; justify-content: center;
  padding: 64px;
}

.auth-brand {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 56px;
  position: relative;
  z-index: 1;
}
.auth-brand .brand-logo { height: 72px; width: auto; }

.auth-hero {
  font-family: var(--serif);
  font-size: 60px; font-weight: 600;
  line-height: 1.05; letter-spacing: -2px;
  margin: 0 0 24px;
  max-width: 85%;
  color: var(--text-strong);
  position: relative;
  z-index: 1;
}
.auth-hero em {
  color: var(--accent); font-style: italic;
  font-weight: 500;
}

[data-theme="osint"] .auth-hero {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
  font-family: var(--mono);
  color: var(--text-strong);
  text-transform: uppercase;
}
[data-theme="osint"] .auth-hero em {
  color: var(--accent);
  font-style: normal;
}
[data-theme="osint"] .auth-hero::before {
  content: '// mission';
  display: block;
  font-size: 14px;
  color: var(--accent);
  letter-spacing: 0.15em;
  margin-bottom: 16px;
  font-weight: 400;
  opacity: 0.6;
}

.auth-sub {
  font-size: 17px; color: var(--text-dim);
  max-width: 85%; line-height: 1.6;
  margin: 0 0 40px;
  position: relative; z-index: 1;
}
[data-theme="osint"] .auth-sub {
  font-size: 14px;
  border-left: 2px solid var(--accent);
  padding-left: 14px;
}

.auth-sub-mini {
  font-size: 13px; font-style: italic; color: var(--text-mute);
  max-width: 85%; line-height: 1.5;
  margin: 0;
  position: relative; z-index: 1;
}

.auth-card {
  width: 100%; max-width: 380px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 32px;
  box-shadow: var(--shadow-md);
}
[data-theme="osint"] .auth-card {
  border-radius: 0;
  background: var(--bg-elev);
}
[data-theme="osint"] .auth-card::before {
  content: '$ login --user';
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  margin: -8px 0 16px;
  letter-spacing: 0.05em;
}

.auth-card h2 {
  font-family: var(--serif);
  font-size: 26px; font-weight: 600;
  margin: 0 0 4px;
  color: var(--text-strong);
}
[data-theme="osint"] .auth-card h2 {
  font-family: var(--mono);
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.auth-card .sub {
  color: var(--text-dim); font-size: 14px;
  margin: 0 0 24px;
}
.auth-card .field { margin-bottom: 16px; }
.auth-card .btn { width: 100%; justify-content: center; }
.auth-toggle {
  text-align: center; margin-top: 20px;
  font-size: 13px; color: var(--text-dim);
}
.auth-toggle a { cursor: pointer; }

.kpi-strip {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 24px; margin-top: 56px;
  font-family: var(--mono);
  position: relative; z-index: 1;
}
.kpi-strip .kpi-num {
  font-family: var(--serif);
  font-size: 38px; font-weight: 600;
  color: var(--accent);
  line-height: 1;
}
[data-theme="osint"] .kpi-strip .kpi-num {
  font-family: var(--mono);
  font-size: 28px;
  color: var(--accent);
}
.kpi-strip .kpi-lab {
  font-size: 11px; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.1em;
  margin-top: 6px;
}

.kpi-strip { position: relative; }
[data-theme="troover"] .kpi-strip::before,
:root .kpi-strip::before {
  content: '';
  position: absolute;
  top: -20px; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
}
[data-theme="osint"] .kpi-strip::before {
  content: '// stats';
  display: block;
  position: absolute;
  top: -28px; left: 0;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.15em;
  opacity: 0.7;
  background: none;
  height: auto;
}

/* ============================================================
   TERMINAL HERO (visible uniquement en OSINT)
   ============================================================ */
.terminal-hero {
  display: none;
  background: #000;
  border: 1px solid var(--accent);
  margin-top: 32px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  box-shadow: 0 0 32px rgba(0, 255, 65, 0.15);
  position: relative;
  overflow: hidden;
  z-index: 1;
}
[data-theme="osint"] .terminal-hero { display: block; }

.terminal-hero .tm-bar {
  background: var(--bg-elev-2);
  border-bottom: 1px solid var(--accent);
  padding: 6px 12px;
  font-size: 11px;
  color: var(--text-dim);
  display: flex;
  gap: 8px;
  align-items: center;
}
.terminal-hero .tm-bar::before {
  content: '● ● ●';
  color: var(--accent);
  letter-spacing: 4px;
  margin-right: 8px;
  opacity: 0.6;
  font-size: 10px;
}
.terminal-hero .tm-body {
  padding: 16px 18px;
  line-height: 1.7;
  white-space: pre-wrap;
}
.terminal-hero .tm-body .cmd { color: var(--accent); }
.terminal-hero .tm-body .out { color: var(--text); opacity: 0.85; }
.terminal-hero .tm-body .ok  { color: var(--accent); }
.terminal-hero .tm-body .crit { color: var(--error); }
.terminal-hero .tm-cursor::after {
  content: '_';
  animation: blink 1s step-end infinite;
}

/* ============================================================
   TABLEAU DE BORD
   ============================================================ */
.dashboard {
  max-width: 1280px;
  margin: 0 auto;
  padding: 48px 32px;
}

.dash-head {
  display: flex; align-items: end; justify-content: space-between;
  margin-bottom: 40px;
  gap: 24px;
}
.dash-head h1 {
  font-family: var(--serif);
  font-size: 44px; font-weight: 600;
  margin: 0; letter-spacing: -1.5px;
  line-height: 1;
  color: var(--text-strong);
}
[data-theme="osint"] .dash-head h1 {
  font-family: var(--mono);
  font-size: 28px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.dash-head .crumb {
  font-family: var(--mono); font-size: 11px;
  color: var(--text-mute);
  letter-spacing: 0.15em; text-transform: uppercase;
  margin-bottom: 12px;
}
[data-theme="osint"] .dash-head .crumb::before {
  content: '// '; color: var(--accent);
}

.feeds-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
[data-theme="osint"] .feeds-table { border-radius: 0; }

.feeds-table th {
  text-align: left;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-mute);
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev-2);
}
.feeds-table td {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
  font-size: 14px;
}
.feeds-table tr:last-child td { border-bottom: none; }
.feeds-table tr:hover td { background: var(--bg-elev-2); }

.feed-name {
  font-family: var(--serif);
  font-size: 17px; font-weight: 600;
  color: var(--text-strong);
}
[data-theme="osint"] .feed-name {
  font-family: var(--mono);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
}
[data-theme="osint"] .feed-name::before {
  content: '> ';
  opacity: 0.6;
}

.feed-source {
  display: block;
  font-family: var(--mono); font-size: 12px;
  color: var(--text-mute);
  margin-top: 3px;
  max-width: 320px;
  overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap;
}
.feed-rss-url {
  font-family: var(--mono); font-size: 12px;
  color: var(--accent);
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer;
}
.feed-rss-url:hover { text-decoration: underline; }
.feed-rss-url .copy-ic { opacity: 0.5; transition: opacity 0.15s; }
.feed-rss-url:hover .copy-ic { opacity: 1; }

.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono);
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  padding: 4px 9px;
  border-radius: 3px;
}
.status-pill::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
}
.status-ok    { background: rgba(45, 106, 79, 0.12);  color: var(--success); }
.status-ok::before { background: var(--success); }
.status-error { background: rgba(200, 16, 46, 0.12);  color: var(--error); }
.status-error::before { background: var(--error); }
.status-warn  { background: rgba(201, 123, 22, 0.12); color: var(--warn); }
.status-warn::before { background: var(--warn); }

[data-theme="osint"] .status-ok    { background: rgba(0, 255, 65, 0.10); color: var(--accent); }
[data-theme="osint"] .status-ok::before { background: var(--accent); box-shadow: 0 0 6px var(--accent); }
[data-theme="osint"] .status-error { background: rgba(255, 59, 59, 0.10); color: var(--error); }
[data-theme="osint"] .status-warn  { background: rgba(255, 184, 0, 0.10); color: var(--warn); }

.empty-state {
  text-align: center;
  padding: 80px 32px;
  background: var(--bg-elev);
  border: 1px dashed var(--border);
  border-radius: 6px;
}
.empty-state h3 {
  font-family: var(--serif);
  font-size: 26px; font-weight: 600;
  margin: 0 0 8px;
  color: var(--text-strong);
}
[data-theme="osint"] .empty-state h3 {
  font-family: var(--mono);
  font-size: 18px;
  text-transform: uppercase;
}
[data-theme="osint"] .empty-state h3::before { content: '$ '; color: var(--accent); }
.empty-state p {
  color: var(--text-dim);
  margin: 0 0 24px;
}

.action-cell {
  display: flex; gap: 6px;
  justify-content: flex-end;
}

/* ============================================================
   BUILDER
   ============================================================ */
.builder {
  display: grid;
  grid-template-columns: 1fr 420px;
  height: calc(100vh - 65px);
  overflow: hidden;
}
.builder-canvas {
  background: var(--bg-elev);
  position: relative;
  border-right: 1px solid var(--border);
  overflow: hidden;
}
.canvas-toolbar {
  height: 48px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 16px;
  gap: 12px;
  background: var(--bg);
  font-family: var(--mono);
  font-size: 12px;
}
.url-bar {
  flex: 1;
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 6px 12px;
}
.url-bar .scheme { color: var(--text-mute); }
.url-bar .url-text {
  flex: 1;
  font-family: var(--mono); font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.canvas-frame-wrap {
  position: absolute; top: 48px; left: 0; right: 0; bottom: 0;
  overflow: auto;
  background: var(--bg-canvas);
}
.canvas-frame-wrap iframe {
  width: 100%; height: 100%; border: none;
  background: #fff;
}
.canvas-overlay {
  position: absolute; inset: 48px 0 0 0;
  pointer-events: none;
}
.canvas-overlay .pick-rect {
  position: absolute;
  border: 2px solid var(--accent);
  background: var(--accent-bg);
  pointer-events: none;
  border-radius: 2px;
  transition: all 0.08s;
}
.canvas-overlay .selected-rect {
  position: absolute;
  border: 2px solid;
  pointer-events: none;
  border-radius: 2px;
}

.canvas-loader {
  position: absolute; inset: 48px 0 0 0;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  gap: 16px;
  color: var(--text-dim);
  background: var(--bg-elev);
}
.spinner {
  width: 24px; height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.canvas-error {
  position: absolute; inset: 48px 0 0 0;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  padding: 48px;
  text-align: center;
  background: var(--bg-elev);
}
.canvas-error h3 {
  font-family: var(--serif); font-size: 28px;
  margin: 0 0 12px;
  color: var(--text-strong);
}
[data-theme="osint"] .canvas-error h3 {
  font-family: var(--mono); font-size: 20px;
  text-transform: uppercase;
}
[data-theme="osint"] .canvas-error h3::before {
  content: '[ERROR] '; color: var(--error);
}
.canvas-error p { color: var(--text-dim); max-width: 480px; margin-bottom: 24px; }
.canvas-error .err-detail {
  font-family: var(--mono); font-size: 12px;
  background: var(--bg); padding: 12px 16px;
  border-radius: 4px; margin-top: 16px;
  border: 1px solid var(--border);
  color: var(--text-mute);
  max-width: 600px;
}

/* ============================================================
   PANEL LATÉRAL
   ============================================================ */
.panel {
  background: var(--bg);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.panel-head {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}
.panel-head .step-crumb {
  font-family: var(--mono);
  font-size: 11px; color: var(--text-mute);
  letter-spacing: 0.15em; text-transform: uppercase;
  margin-bottom: 4px;
}
[data-theme="osint"] .panel-head .step-crumb::before {
  content: '// '; color: var(--accent);
}
.panel-head h2 {
  font-family: var(--serif);
  font-size: 24px; font-weight: 600;
  margin: 0; letter-spacing: -0.5px;
  color: var(--text-strong);
}
[data-theme="osint"] .panel-head h2 {
  font-family: var(--mono);
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}
.panel-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; gap: 8px;
  background: var(--bg-elev);
}

.steps-rail {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
}
.step-tab {
  flex: 1;
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-mute);
  text-align: center;
  border-right: 1px solid var(--border);
  position: relative;
  cursor: pointer;
}
.step-tab:last-child { border-right: none; }
.step-tab .num {
  display: inline-block; margin-right: 6px;
  color: var(--text-mute);
}
.step-tab.active {
  color: var(--accent);
  background: var(--bg);
  font-weight: 600;
}
.step-tab.active .num { color: var(--accent); }
.step-tab.done { color: var(--text-dim); }
.step-tab.done .num::before { content: '✓ '; }

.field { margin-bottom: 18px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.help-text {
  font-size: 12px; color: var(--text-mute);
  margin-top: 4px; line-height: 1.5;
}

/* ============================================================
   SELECTOR LIST
   ============================================================ */
.selector-list {
  display: flex; flex-direction: column;
  gap: 8px;
}
.selector-row {
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-elev);
  padding: 10px 12px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  transition: border-color 0.15s;
}
.selector-row.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.selector-row.empty {
  border-style: dashed;
  background: transparent;
}
.selector-row .sw {
  width: 12px; height: 12px;
  border-radius: 2px;
  flex-shrink: 0;
}
.selector-row .lab {
  font-size: 13px; font-weight: 500;
  display: flex; flex-direction: column;
  gap: 2px;
  min-width: 0;
  color: var(--text);
}
.selector-row .lab .opt-tag {
  font-family: var(--mono); font-size: 9px;
  color: var(--text-mute); letter-spacing: 0.1em;
  text-transform: uppercase;
}
.selector-row .lab .selector-display {
  font-family: var(--mono); font-size: 11px;
  color: var(--text-mute);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 200px;
}
.selector-row .lab .selector-display.set { color: var(--accent); }
.selector-row .pick-btn {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 5px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-dim);
  white-space: nowrap;
}
.selector-row .pick-btn:hover { border-color: var(--accent); color: var(--accent); }
.selector-row.active .pick-btn { background: var(--accent); color: var(--bg); border-color: var(--accent); }
[data-theme="osint"] .selector-row.active .pick-btn { color: #000; }
.selector-row .clear-btn {
  font-size: 16px; color: var(--text-mute);
  padding: 0 4px; line-height: 1;
}
.selector-row .clear-btn:hover { color: var(--error); }

/* ============================================================
   PREVIEW
   ============================================================ */
.preview-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.preview-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.preview-head h3 {
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0;
}
.preview-head .count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
}
.preview-list {
  display: flex; flex-direction: column;
  gap: 8px;
}
.preview-item {
  background: var(--bg-elev);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  padding: 10px 12px;
  font-size: 13px;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  align-items: start;
}
.preview-item .num {
  font-family: var(--mono); font-size: 11px;
  color: var(--accent); font-weight: 600;
  padding-top: 2px;
}
.preview-item .pi-title {
  font-weight: 600;
  margin-bottom: 3px;
  line-height: 1.35;
  color: var(--text-strong);
}
.preview-item .pi-meta {
  font-size: 11px; color: var(--text-mute);
  font-family: var(--mono);
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 3px;
}
.preview-item .pi-desc {
  font-size: 12px; color: var(--text-dim);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.preview-item.warn { border-color: rgba(201, 123, 22, 0.4); background: rgba(201, 123, 22, 0.04); }
[data-theme="osint"] .preview-item.warn { border-color: var(--warn); background: rgba(255, 184, 0, 0.04); }

/* ── Keyword highlights ─────────────────────────────────────── */
mark.kw-include { background: #bbf7d0; color: inherit; border-radius: 2px; padding: 0 1px; }
mark.kw-exclude { background: #fecaca; color: inherit; border-radius: 2px; padding: 0 1px; }
[data-theme="osint"] mark.kw-include { background: #166534; color: #bbf7d0; }
[data-theme="osint"] mark.kw-exclude { background: #7f1d1d; color: #fecaca; }

/* ── Filter step ────────────────────────────────────────────── */
.filter-rule {
  background: var(--surface-2, rgba(0,0,0,0.04));
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 8px;
}
[data-theme="osint"] .filter-rule { background: rgba(255,255,255,0.03); }
.filter-rule-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.filter-rule-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-mute);
}
.mode-toggle { display: flex; gap: 4px; }
.mode-btn {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
}
.mode-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.filter-logic-row {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  margin: 8px 0;
}
.case-label { margin-left: auto; }
.field-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 13px;
  margin-top: 6px;
}
.filter-combinator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 4px 0;
}
.comb-btn {
  font-size: 12px;
  padding: 3px 14px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
}
.comb-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.kw-counter { font-size: 13px; color: var(--text-dim); }
.kw-counter strong { color: var(--text); }
.filter-preview-section { margin-top: 4px; }

.preview-warn-msg {
  font-size: 12px; color: var(--warn);
  font-family: var(--mono);
  padding: 8px 12px;
  background: rgba(201, 123, 22, 0.06);
  border-left: 2px solid var(--warn);
  margin-bottom: 12px;
}
[data-theme="osint"] .preview-warn-msg {
  background: rgba(255, 184, 0, 0.04);
}

/* ============================================================
   STEP 5 — SUCCESS CARD
   ============================================================ */
.success-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 32px;
  margin-top: 12px;
  box-shadow: var(--shadow-sm);
}
[data-theme="osint"] .success-card { border-radius: 0; }

.success-card h3 {
  font-family: var(--serif);
  font-size: 24px; font-weight: 600;
  margin: 0 0 8px;
  color: var(--text-strong);
}
[data-theme="osint"] .success-card h3 {
  font-family: var(--mono);
  font-size: 16px;
  text-transform: uppercase;
}
.success-card .check {
  width: 40px; height: 40px;
  background: var(--accent);
  color: var(--bg-elev);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700;
  margin-bottom: 16px;
}
[data-theme="osint"] .success-card .check {
  border-radius: 0;
  color: #000;
  font-family: var(--mono);
  box-shadow: 0 0 16px rgba(0, 255, 65, 0.4);
  font-size: 14px;
}

.url-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 12px 14px;
  font-family: var(--mono); font-size: 13px;
  color: var(--accent);
  display: flex; align-items: center; gap: 10px;
  margin: 16px 0;
  word-break: break-all;
}
[data-theme="osint"] .url-box {
  background: #000;
  border-color: var(--accent);
}
.url-box .copy {
  margin-left: auto; flex-shrink: 0;
  color: var(--text-dim);
}

/* ============================================================
   TOAST + MODAL
   ============================================================ */
.toast {
  position: fixed;
  bottom: 32px; left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 20px;
  border-radius: 4px;
  font-size: 13px;
  font-family: var(--mono);
  z-index: 1000;
  animation: toast-in 0.2s ease-out;
  box-shadow: var(--shadow-md);
}
.toast.success { border-color: var(--success); color: var(--success); }
.toast.error { border-color: var(--error); color: var(--error); }
.toast.warn { border-color: #d97706; color: #d97706; }
[data-theme="osint"] .toast { border-radius: 0; background: var(--bg-elev-2); }

@keyframes toast-in {
  from { transform: translateX(-50%) translateY(20px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

.modal-bg {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 500;
  display: flex; align-items: center; justify-content: center;
  animation: fade-in 0.15s;
  backdrop-filter: blur(4px);
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 100%; max-width: 540px;
  max-height: 80vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
}
[data-theme="osint"] .modal { border-radius: 0; border-color: var(--accent); }

.modal-head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.modal-head h3 {
  font-family: var(--serif); font-size: 22px; font-weight: 600;
  margin: 0;
  color: var(--text-strong);
}
[data-theme="osint"] .modal-head h3 {
  font-family: var(--mono); font-size: 16px;
  text-transform: uppercase;
}
.modal-body { padding: 24px; overflow-y: auto; }
.modal-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 8px;
}

/* ============================================================
   UTILITIES
   ============================================================ */
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-12 { margin-top: 12px; }
.mt-24 { margin-top: 24px; }
.mb-12 { margin-bottom: 12px; }
.mb-24 { margin-bottom: 24px; }
.text-dim { color: var(--text-dim); }
.text-mute { color: var(--text-mute); }
.text-mono { font-family: var(--mono); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }

.hidden { display: none !important; }

.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}
[data-theme="osint"] .divider {
  background: linear-gradient(to right, transparent, var(--accent), transparent);
  opacity: 0.2;
}

/* ============================================================
   ADMIN BACK-OFFICE
   ============================================================ */
.admin-tabs {
  display: inline-flex;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px;
  gap: 0;
}
.admin-tab {
  padding: 8px 16px;
  font-size: 12px;
  font-family: var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  border-radius: 3px;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.admin-tab:hover { color: var(--text); }
.admin-tab.active {
  background: var(--bg);
  color: var(--text-strong);
  box-shadow: var(--shadow-sm);
}
[data-theme="osint"] .admin-tabs { border-radius: 0; }
[data-theme="osint"] .admin-tab { border-radius: 0; }
[data-theme="osint"] .admin-tab.active { color: var(--accent); box-shadow: none; }

.admin-toolbar {
  display: flex; align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-dim);
}
.admin-toolbar label { display: flex; align-items: center; gap: 8px; }
.admin-counter {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-mute);
  letter-spacing: 0.06em;
}

.admin-select {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}
.admin-select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.admin-select:disabled { opacity: 0.5; cursor: not-allowed; }
[data-theme="osint"] .admin-select { border-radius: 0; font-family: var(--mono); font-size: 12px; }

#feedFilterUser {
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 13px;
  font-family: inherit;
}
[data-theme="osint"] #feedFilterUser { border-radius: 0; font-family: var(--mono); }

.pill {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-dim);
}
.pill-self {
  margin-left: 8px;
  background: rgba(0, 0, 0, 0);
  border-color: var(--accent);
  color: var(--accent);
  text-transform: uppercase;
}
[data-theme="osint"] .pill { border-radius: 0; }

.user-menu a.active {
  color: var(--accent);
  font-weight: 600;
}

/* ----- Petites variantes utilisées par l'admin ----- */
.btn-xs {
  padding: 4px 8px;
  font-size: 11px;
  font-family: var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.cell-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.cell-empty {
  text-align: center;
  padding: 32px;
  color: var(--text-mute);
}
tr[data-report-row] { cursor: pointer; }
.manager-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}
.manager-toggle input { margin: 0; cursor: pointer; }

.pill-manager {
  margin-left: 8px;
  background: rgba(0, 0, 0, 0);
  border-color: var(--success, #2ecc71);
  color: var(--success, #2ecc71);
}

/* ----- Badge messages ----- */
.badge {
  display: inline-block;
  background: var(--accent);
  color: var(--bg);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 10px;
  font-family: var(--mono);
  font-weight: 700;
  margin-left: 4px;
  vertical-align: middle;
}
[data-theme="osint"] .badge { border-radius: 0; background: var(--accent); color: var(--bg); }

/* ----- Aide / texte d'admin ----- */
.admin-help {
  font-size: 13px;
  color: var(--text-dim);
  background: var(--bg-elev-2);
  border-left: 3px solid var(--accent);
  padding: 12px 16px;
  margin-bottom: 20px;
  line-height: 1.5;
}
.admin-help code {
  background: var(--bg);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 12px;
  font-family: var(--mono);
}
[data-theme="osint"] .admin-help { border-radius: 0; }
.text-error { color: var(--error, #e74c3c); }

/* ----- Cartes de templates ----- */
.template-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
[data-theme="osint"] .template-card { border-radius: 0; }
.template-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.template-head h4 {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}
.template-subject {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--text-strong);
}
.template-body {
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--mono);
  white-space: pre-wrap;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  padding: 10px 12px;
  margin: 0;
  max-height: 220px;
  overflow-y: auto;
}
[data-theme="osint"] .template-body { border-radius: 0; }

/* ----- Messages utilisateur (inbox) ----- */
.msg-item {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px;
  margin-bottom: 10px;
  background: var(--bg-elev);
}
[data-theme="osint"] .msg-item { border-radius: 0; }
.msg-item.unread { border-left: 3px solid var(--accent); }
.msg-head {
  display: flex; gap: 12px; align-items: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.msg-from { color: var(--text-dim); font-size: 12px; font-family: var(--mono); }
.msg-date { color: var(--text-mute); font-size: 11px; margin-left: auto; font-family: var(--mono); }
.msg-body {
  margin: 0;
  font-size: 13px;
  white-space: pre-wrap;
  color: var(--text);
  font-family: inherit;
  line-height: 1.5;
}

/* ----- Champs de formulaire dans modal ----- */
.modal-body .field { margin-bottom: 14px; }
.modal-body .field label {
  display: block;
  font-size: 12px;
  font-family: var(--mono);
  letter-spacing: 0.04em;
  color: var(--text-dim);
  margin-bottom: 6px;
  text-transform: uppercase;
}
.modal-body .field input[type="text"],
.modal-body .field input[type="number"],
.modal-body .field input[type="password"],
.modal-body .field textarea,
.modal-body .field select {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  box-sizing: border-box;
}
.modal-body .field textarea { resize: vertical; min-height: 100px; font-family: var(--mono); font-size: 13px; }
[data-theme="osint"] .modal-body .field input,
[data-theme="osint"] .modal-body .field textarea,
[data-theme="osint"] .modal-body .field select { border-radius: 0; }

/* ----- Page reset password ----- */
.reset-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  background: var(--bg);
  min-height: 100vh;
}
.reset-screen .auth-card { width: 100%; max-width: 420px; }
.reset-msg {
  margin-top: 12px;
  font-size: 13px;
  font-family: var(--mono);
}
.reset-msg.error   { color: var(--error, #e74c3c); }
.reset-msg.success { color: var(--success, #2ecc71); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .builder { grid-template-columns: 1fr 360px; }
  .auth-screen { grid-template-columns: 1fr; }
  .auth-screen .left {
    display: flex;
    order: 2;
    padding: 32px 24px;
    border-right: none;
    border-top: 1px solid var(--border);
  }
  .auth-screen .right { order: 1; }
}
@media (max-width: 480px) {
  .kpi-strip { grid-template-columns: 1fr; gap: 16px; }
}
@media (max-width: 768px) {
  .builder {
    grid-template-columns: 1fr;
    grid-template-rows: 50vh 50vh;
    height: calc(100vh - 65px);
  }
  .builder-canvas { border-right: none; border-bottom: 1px solid var(--border); }
  .dash-head h1 { font-size: 32px; }
  .dashboard { padding: 24px 16px; }
  .feeds-table th, .feeds-table td { padding: 12px; font-size: 13px; }
  .feed-source { max-width: 180px; }
  header.app-header { padding: 12px 16px; flex-wrap: wrap; }
  .user-menu { gap: 8px; font-size: 12px; }
}

/* ── Dashboard share column ─────────────────────────────────── */
.share-cell { text-align: center; width: 80px; }
.share-col { text-align: center; }
.share-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
  transition: background 0.15s, border-color 0.15s;
}
.share-btn:hover {
  background: var(--surface-2, rgba(0,0,0,0.04));
  border-color: var(--accent);
}
[data-theme="osint"] .share-btn:hover {
  background: rgba(255,255,255,0.04);
}

/* ── Step 4 share checkbox ──────────────────────────────────── */
.checkbox-label,
.radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  margin-bottom: 0;
}
.checkbox-label input[type="checkbox"],
.radio-label input[type="radio"] {
  width: 14px;
  height: 14px;
  margin: 0;
  flex: none;
  cursor: pointer;
}
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.cookie-badge {
  display: inline-block;
  background: var(--surface-2, rgba(0,0,0,0.04));
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 8px;
}
[data-theme="osint"] .cookie-badge { background: rgba(255,255,255,0.03); }

/* Zoning reuse banner (step 2) */
.zoning-hint {
  background: var(--surface-2, rgba(0,0,0,0.04));
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent, #d97706);
  border-radius: 4px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 13px;
}
.zoning-hint-msg { margin: 0 0 8px; color: var(--text); }
.zoning-list { display: flex; flex-direction: column; gap: 4px; }
.zoning-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 6px 10px;
  background: var(--surface-1, #fff);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.zoning-item:hover { border-color: var(--accent, #d97706); background: var(--surface-hover, rgba(217,119,6,0.06)); }
.zoning-name { font-size: 13px; font-weight: 600; color: var(--text); }
.zoning-preview { font-size: 11px; color: var(--text-dim); font-family: monospace; }
[data-theme="osint"] .zoning-hint { background: rgba(255,255,255,0.03); border-left-color: #00ff41; }
[data-theme="osint"] .zoning-item { background: transparent; }
[data-theme="osint"] .zoning-item:hover { border-color: #00ff41; background: rgba(0,255,65,0.05); }
.zoning-auto { margin-top: 10px; }
.zoning-auto .zoning-hint-msg { margin-bottom: 8px; }

/* Hero H1 differentiel par thème (auth screen) */
.hero-osint { display: none; }
[data-theme="osint"] .hero-troover { display: none; }
[data-theme="osint"] .hero-osint { display: block; }

/* Cookie emoji caché en OSINT (terminal style sans emoji) */
[data-theme="osint"] .ic-cookie { display: none; }

/* Titre de section (page cookies + admin) */
.section-title {
  font-size: 14px;
  margin: 24px 0 8px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Live login modal */
.live-modal-bg {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.75);
  display: flex; align-items: center; justify-content: center;
}
.live-modal {
  background: var(--bg-elev);
  border-radius: 8px;
  border: 1px solid var(--border);
  width: 90vw; max-width: 1320px;
  display: flex; flex-direction: column;
  max-height: 95vh;
  overflow: hidden;
}
.live-toolbar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev-2);
}
.live-url {
  flex: 1; font-size: 13px; font-family: var(--mono);
}
.live-status {
  font-size: 12px; color: var(--text-dim);
  margin: 0 8px;
}
.live-canvas-wrap {
  flex: 1;
  background: #000;
  display: flex; align-items: center; justify-content: center;
  overflow: auto;
}
.live-canvas-wrap canvas {
  max-width: 100%; max-height: 100%;
  cursor: crosshair;
  outline: none;
}
.live-footer {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-elev-2);
}
.live-footer .live-label {
  flex: 1; font-size: 13px;
}
.link-btn {
  background: transparent;
  border: none;
  color: #fff;
  text-decoration: underline;
  cursor: pointer;
  font-size: inherit;
  padding: 0;
}
/* .report-link : boutons "Signaler un probleme" (Tasks 6-9) places hors du
   fond sombre de .live-modal — .link-btn seul (blanc) est invisible sur le
   theme troover (fond clair). var(--warn) lisible dans les deux themes. */
.report-link {
  color: var(--warn);
}

/* ===== Stats admin (modal user/groupe) ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.stat {
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--border, #2a2a2a);
  border-radius: 6px;
  background: var(--surface-2, rgba(127,127,127,.06));
}
.stat-k { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; opacity: .65; }
.stat-v { font-size: 15px; font-weight: 600; }
.agg-quotas-form {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  max-width: 800px;
}
.stats-tl-title { margin: 14px 0 6px; font-size: 13px; opacity: .8; }
.timeline { display: flex; gap: 2px; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
.tl-bar { width: 6px; height: 22px; border-radius: 2px; display: inline-block; flex: 0 0 auto; }
.tl-empty { background: var(--border, rgba(127,127,127,.18)); }
.tl-ok    { background: #2ea043; }
.tl-error { background: #d9534f; }
.tl-login { background: #3b82f6; }
.tl-legend { font-size: 11px; opacity: .7; margin-left: 8px; }
.tl-legend .tl-bar { width: 8px; height: 8px; margin: 0 3px; vertical-align: middle; }
.user-stats-link { cursor: pointer; text-decoration: underline dotted; }
.user-stats-link:hover { opacity: .8; }
.auth-notice { max-width: 420px; margin: 12px auto 0; padding: 12px 14px; border-radius: 8px; font-size: 14px; text-align: center; }
.auth-notice.info { background: rgba(59,130,246,.12); border: 1px solid rgba(59,130,246,.4); }
.auth-notice.warn { background: rgba(201,123,22,.12); border: 1px solid rgba(201,123,22,.4); }
.auth-notice .link-btn { display: inline-block; margin-top: 6px; }
.account-block { max-width: 900px; margin: 0 auto 22px; padding: 18px 20px; border: 1px solid var(--border, #2a2a2a); border-radius: 10px; background: var(--surface-2, rgba(127,127,127,.04)); }
.account-block h3 { margin: 0 0 12px; font-size: 15px; }
.account-block-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.account-form { display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.account-form select { padding: 8px 10px; border-radius: 6px; }
.cookie-wall-hint {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.cookie-wall-hint .link-btn { font-size: 12px; }

/* ============================================================
   LECTEUR 3 COLONNES (agrégateur SP-1) — reader.html / reader.js
   Variables thème uniquement (troover / osint).
   ============================================================ */
.reader-offline {
  max-width: 560px;
  margin: 80px auto;
  padding: 28px 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elev);
  text-align: center;
}
[data-theme="osint"] .reader-offline { border-radius: 0; border-color: var(--accent); }
.reader-offline h3 { margin: 0 0 10px; color: var(--text-strong); }
.reader-offline p { color: var(--text-dim); margin: 0; }

.reader {
  display: grid;
  grid-template-columns: var(--col-spaces, 300px) 6px var(--col-items, minmax(280px, 1fr)) 6px minmax(320px, 1.4fr);
  gap: 0;
  height: calc(100vh - 64px);
  border-top: 1px solid var(--border);
}
.reader-resizer { cursor: col-resize; background: transparent; touch-action: none; }
.reader-resizer:hover { background: var(--border); }
.reader-col {
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0; /* évite que le grid item dépasse son track (sinon overflow-x: hidden inefficace) */
  height: 100%;
  background: var(--bg);
}
.reader-spaces { border-right: 1px solid var(--border); background: var(--bg-elev); padding: 8px 0 24px; }
.reader-items  { border-right: 1px solid var(--border); }
.reader-detail { background: var(--bg-elev); }

.reader-loading { padding: 16px; font-family: var(--mono); font-size: 12px; }
.reader-empty {
  display: flex; align-items: center; justify-content: center;
  height: 100%; padding: 24px; text-align: center;
}

/* ---- colonne gauche : espaces + abonnements ---- */
.reader-space { margin-bottom: 4px; }
.reader-space-head {
  display: flex; flex-direction: column; gap: 6px;
  padding: 12px 14px 8px;
  border-bottom: 1px solid var(--border-soft);
}
.reader-space-name {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-mute); font-weight: 600;
}
[data-theme="osint"] .reader-space-name::before { content: '# '; color: var(--accent); }
.reader-space-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.reader-space-actions .btn-sm { font-size: 11px; padding: 4px 8px; }

.reader-subs { list-style: none; margin: 0; padding: 0; }
.reader-sub {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px;
  cursor: pointer;
  color: var(--text-dim);
  border-left: 2px solid transparent;
  font-size: 13px;
}
.reader-sub:hover { background: var(--bg-elev-2); }
.reader-sub.selected {
  background: var(--bg-elev-2);
  border-left-color: var(--accent);
  color: var(--text-strong);
}
.reader-sub.unread { color: var(--text-strong); font-weight: 600; }
.reader-sub-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reader-sub-empty { padding: 8px 14px; font-size: 12px; font-style: italic; }
.reader-unread-badge {
  flex-shrink: 0;
  min-width: 20px; text-align: center;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--bg-elev);
  font-size: 11px; font-weight: 700; font-family: var(--mono);
}
[data-theme="osint"] .reader-unread-badge { border-radius: 0; color: var(--bg); }

/* SP-2b : menu contextuel d'un abonnement + bouton ⋯ */
.reader-sub-menu-btn {
  flex-shrink: 0;
  background: none; border: none;
  color: var(--text-mute); cursor: pointer;
  padding: 0 4px; font-weight: 700; line-height: 1;
  opacity: .45; transition: opacity .12s;
}
.reader-sub:hover .reader-sub-menu-btn,
.reader-sub-menu-btn:focus { opacity: 1; }
.reader-sub-menu-btn:hover { color: var(--text-strong); }
.reader-ctxmenu {
  position: fixed; z-index: 1000;
  background: var(--bg-elev);
  border: 1px solid var(--border); border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  min-width: 200px; padding: 4px;
}
[data-theme="osint"] .reader-ctxmenu { border-radius: 0; }
.reader-ctxmenu button {
  display: block; width: 100%; text-align: left;
  padding: 7px 12px;
  background: none; border: none;
  color: var(--text); cursor: pointer; font-size: 13px;
}
.reader-ctxmenu button:hover { background: var(--bg-elev-2); }

/* propriétés (valeurs lecture seule) */
.reader-prop-val { font-size: 13px; color: var(--text); word-break: break-all; }
/* demandes de suppression */
.reader-delreq-list { list-style: none; margin: 0; padding: 0; }
.reader-delreq { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.reader-delreq-text { flex: 1; font-size: 13px; }
.reader-delreq-actions { flex-shrink: 0; display: flex; gap: 6px; }

/* ---- colonne centrale : items ---- */
.reader-item-list { list-style: none; margin: 0; padding: 0; }
.reader-item {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  align-items: baseline;
  gap: 8px;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-dim);
}
.reader-item:hover { background: var(--bg-elev-2); }
.reader-item.active { background: var(--bg-elev-2); border-left: 2px solid var(--accent); padding-left: 14px; }
.reader-item.unread { color: var(--text-strong); font-weight: 600; }
.reader-item .unread-dot { color: var(--accent); font-size: 18px; line-height: 0; }
.reader-item-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reader-item-date {
  font-family: var(--mono); font-size: 11px; color: var(--text-mute); white-space: nowrap;
}

/* ---- colonne droite : détail ---- */
.reader-detail-inner { padding: 28px 32px; max-width: 760px; }
.reader-detail-title {
  margin: 0 0 8px; font-family: var(--serif); font-size: 26px; line-height: 1.25;
  color: var(--text-strong);
}
[data-theme="osint"] .reader-detail-title { font-family: var(--mono); font-size: 18px; text-transform: uppercase; }
.reader-detail-meta { font-family: var(--mono); font-size: 12px; margin-bottom: 18px; }
.reader-detail-img { max-width: 100%; height: auto; border-radius: 6px; margin-bottom: 18px; display: block; }
[data-theme="osint"] .reader-detail-img { border-radius: 0; border: 1px solid var(--border); }
.reader-detail-body { color: var(--text); line-height: 1.65; font-size: 15px; }
.reader-detail-body img { max-width: 100%; height: auto; }
.reader-detail-body a { color: var(--accent); }
.reader-detail-link {
  display: inline-block; margin-top: 22px;
  font-family: var(--mono); font-size: 13px; color: var(--accent);
}

/* ---- rapport d'import (modale) ---- */
.reader-import-report { list-style: none; margin: 12px 0 0; padding: 0; font-family: var(--mono); font-size: 12px; }
.reader-import-report li { padding: 4px 0; border-bottom: 1px solid var(--border-soft); word-break: break-all; }
.reader-import-report .imp-status {
  display: inline-block; min-width: 70px;
  text-transform: uppercase; font-weight: 700; margin-right: 8px;
}
.reader-import-report .imp-added .imp-status { color: var(--success); }
.reader-import-report .imp-duplicate .imp-status { color: var(--text-mute); }
.reader-import-report .imp-quota .imp-status,
.reader-import-report .imp-error .imp-status { color: var(--error); }

@media (max-width: 860px) {
  .reader { grid-template-columns: 1fr; height: auto; }
  .reader-col { height: auto; max-height: 60vh; }
  .reader-spaces, .reader-items { border-right: none; border-bottom: 1px solid var(--border); }
}

/* Tableau de bord — lien "Mes flux créés" en tête de colonne gauche */
.reader-myfeeds-link {
  display: block;
  margin: 0 0 12px;
  padding: 8px 12px;
  font-weight: 600;
  color: var(--text);
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
}
.reader-myfeeds-link:hover { border-color: var(--accent); }

/* Tableau de bord — river agrégée par espace */
.reader-space-river { font-weight: 600; }
.reader-item-feed { display: inline-block; margin-left: 8px; font-size: 11px; color: var(--text-mute); font-weight: 400; }

/* Tableau de bord — arbre de dossiers (SP-2a) */
.reader-folder { font-weight: 400; cursor: pointer; display: flex; align-items: center; gap: 4px; padding: 3px 6px; }
.reader-folder.unread { font-weight: 600; }
.reader-folder.selected { background: var(--bg-elev-2); }
.reader-folder-children { margin-left: 14px; list-style: none; padding-left: 0; }
.reader-folder.collapsed + .reader-folder-children { display: none; }
.reader-folder-toggle { display: inline-block; width: 12px; color: var(--text-mute); cursor: pointer; }
.reader-folder-name { flex: 1; }
.reader-folder-hint { margin: 8px 6px; font-size: 12px; color: var(--text-mute); list-style: none; }
.reader-folder-hint a { color: var(--accent); }
.reader-folder-node { list-style: none; }

/* Tableau de bord — vue graphique (SP-2c) */
.graph-overlay { position: fixed; inset: 0; z-index: 2000; background: var(--bg-canvas); display: flex; flex-direction: column; }
.graph-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--border); color: var(--text); font-size: 13px; }
.graph-legend { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; color: var(--text-mute); font-size: 12px; }
.graph-legend-badge { color: var(--text); border: 1px solid var(--border); border-radius: 3px; padding: 0 5px; font-size: 11px; }
.graph-scroll { flex: 1; overflow: auto; padding: 16px; }
.graph-node { cursor: pointer; }
.graph-node rect { transition: stroke .1s; }
.graph-feed:hover rect, .graph-folder:hover rect { stroke: var(--accent); }
.graph-drop-ok rect { stroke: var(--success); stroke-width: 2.5; }
.graph-ghost { position: fixed; pointer-events: none; z-index: 2100; background: var(--bg-elev-2); border: 1px solid var(--accent); border-radius: 5px; padding: 3px 8px; font-size: 11px; color: var(--text); }

/* SP-3 pastille d'état item */
:root{ --p-red:#e23b3b; --p-grey:#9aa0a6; --p-green:#2faa55; }
[data-theme="osint"]{ --p-red:#ff3b3b; --p-grey:#5c6b5c; --p-green:#39ff14; }
.agg-pastille{ display:inline-block; width:11px; height:11px; border-radius:50%; flex:0 0 auto; cursor:pointer; vertical-align:middle; }
.agg-pastille[data-state="unread"]{ background:var(--p-red); }
.agg-pastille[data-state="read"]{ background:var(--p-grey); }
.agg-pastille[data-state="treated"]{ background:var(--p-green); }
.agg-pastille[data-state="half-unread"]{ background:linear-gradient(135deg, var(--p-green) 0 50%, var(--p-red) 50% 100%); }
.agg-pastille[data-state="half-read"]{ background:linear-gradient(135deg, var(--p-green) 0 50%, var(--p-grey) 50% 100%); }

/* SP-4 étoile favori + pastilles collection */
:root{ --fav-user:#e8b400; --fav-group:#2f7de2; }
[data-theme="osint"]{ --fav-user:#ffd000; --fav-group:#2fd0ff; }
.agg-fav{ display:inline-block; width:14px; text-align:center; cursor:pointer; vertical-align:middle; opacity:.35; }
.agg-fav[data-fav="user"]{ opacity:1; color:var(--fav-user); }
.agg-fav[data-fav="group"]{ opacity:1; color:var(--fav-group); }
.agg-fav[data-fav="both"]{ opacity:1; background:linear-gradient(90deg,var(--fav-user) 50%,var(--fav-group) 50%); -webkit-background-clip:text; background-clip:text; color:transparent; }
.coll-dot{ display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:6px; vertical-align:middle; }
.coll-dot[data-scope="user"]{ background:var(--fav-user); }
.coll-dot[data-scope="group"]{ background:var(--fav-group); }

/* SP-4 entrées transverses colonne gauche (Favoris + Collections) */
.reader-fav-entry, .reader-coll-entry {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 14px; cursor: pointer; font-size: 13px;
  color: var(--text-dim); border-left: 2px solid transparent;
}
.reader-fav-entry:hover, .reader-coll-entry:hover { background: var(--bg-elev-2); }
.reader-fav-entry.selected, .reader-coll-entry.selected {
  background: var(--bg-elev-2); border-left-color: var(--accent); color: var(--text-strong);
}
.reader-colls-head {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 14px; font-size: 13px; color: var(--text-dim);
}
.reader-coll-entry { padding-left: 22px; }
.reader-coll-add {
  margin-left: auto; cursor: pointer;
  background: transparent; border: 1px solid var(--border); color: var(--text-dim);
  border-radius: 4px; width: 20px; height: 20px; line-height: 1; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center; padding: 0;
}
.reader-coll-add:hover { background: var(--bg-elev-2); color: var(--text); }

/* SP-5 surlignage recherche + entrées transverses */
mark, .reader-item-title mark { background: #ffe680; color: inherit; border-radius: 2px; padding: 0 1px; }
[data-theme="osint"] mark { background: #2f5d2f; color: #d6ffd6; }
.reader-search-entry, .reader-unread-entry { display:flex; align-items:center; gap:6px; padding:9px 14px; cursor:pointer; font-size:13px; color:var(--text-dim); border-left:2px solid transparent; }
.reader-search-entry:hover, .reader-unread-entry:hover { background: var(--bg-elev-2); }
.reader-search-bar { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:6px 12px; font-size:12px; color:var(--text-dim); background:var(--bg-elev-2); border-bottom:1px solid var(--border); }

/* ── Onglets compte ────────────────────────────── */
.account-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
  overflow-x: auto;
  scrollbar-width: none;
}
.account-tabs::-webkit-scrollbar { display: none; }
.account-tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: 10px 18px;
  font: inherit;
  font-size: 14px;
  color: var(--text-dim);
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.account-tab-btn:hover { color: var(--text-strong); }
.account-tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}
.account-panel { display: none; }
.account-panel.active { display: block; }

/* Stats sections */
.stats-section-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 20px 0 10px;
}
.stats-advanced-wrap { position: relative; }
.stat-gated { filter: blur(4px); pointer-events: none; user-select: none; }
.gated-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--text-dim);
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  border-radius: 6px;
}

/* Quota bar */
.quota-bar-wrap { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.quota-bar { flex: 1; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.quota-bar-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width .3s; }
.quota-bar-fill.warn { background: #e8a020; }
.quota-bar-fill.danger { background: #e55; }
.quota-label { font-size: 12px; color: var(--text-dim); white-space: nowrap; }

/* NL stats table */
.nl-stats-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.nl-stats-table th, .nl-stats-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); text-align: left; }
.nl-stats-table th { font-size: 11px; text-transform: uppercase; color: var(--text-dim); font-weight: 600; }

/* Membres groupe */
.member-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.member-table th, .member-table td { padding: 6px 10px; border-bottom: 1px solid var(--border); text-align: left; }
.member-table th { font-size: 11px; text-transform: uppercase; color: var(--text-dim); font-weight: 600; }
.member-inactive td { color: var(--text-dim); }
.member-inactive td:first-child::before { content: "●"; color: #e55; margin-right: 6px; font-size: 8px; }
.reader-search-entry.selected, .reader-unread-entry.selected { background: var(--bg-elev-2); border-left-color: var(--accent); color: var(--text-strong); }
.search-panel .field { margin-bottom: 10px; }
.search-row { display:flex; gap:10px; flex-wrap:wrap; }

/* SP-6 règles : entrée colonne gauche + lignes builder conditions/actions */
.reader-rules-entry { display:flex; align-items:center; gap:6px; padding:9px 14px; cursor:pointer; font-size:13px; color:var(--text-dim); border-left:2px solid transparent; }
.reader-rules-entry:hover { background: var(--bg-elev-2); }
.reader-rules-entry.selected { background: var(--bg-elev-2); border-left-color: var(--accent); color: var(--text-strong); }

.reader-error-entry { display:flex; align-items:center; justify-content:space-between; gap:6px; padding:9px 14px; cursor:pointer; font-size:13px; color:var(--text-dim); border-left:2px solid transparent; }
.reader-error-entry:hover { background: var(--bg-elev-2); }
.reader-error-entry.selected { background: var(--bg-elev-2); border-left-color: var(--accent); color: var(--text-strong); }
.reader-error-row { display:flex; flex-direction:column; gap:2px; padding:10px 14px; border-bottom:1px solid var(--border-soft); cursor:pointer; }
.reader-error-row:hover { background: var(--bg-elev-2); }
.reader-error-row.active { background: var(--accent-bg); }
.reader-error-row-title { font-weight:600; color:var(--text-strong); }
.reader-error-row-meta { font-size:12px; color:var(--text-dim); }
.reader-error-space-tag { display:inline-block; font-size:11px; padding:1px 6px; border-radius:3px; background:var(--bg-elev-2); color:var(--text-dim); margin-right:4px; }
.reader-error-detail-motif { background:var(--bg-elev-2); border:1px solid var(--border-soft); border-radius:6px; padding:10px 12px; font-size:13px; margin:8px 0; white-space:pre-wrap; }
.reader-error-detail-actions { display:flex; gap:8px; flex-wrap:wrap; }
.rule-row { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:6px; align-items:center; }
.rule-row select, .rule-row input[type="text"], .rule-row input[type="email"] { min-width:0; }
.rule-int-disabled { opacity:.5; }
.rule-item { display:flex; align-items:center; gap:8px; flex-wrap:wrap; padding:7px 0; border-bottom:1px solid var(--border); }
.rule-item label { display:flex; align-items:center; gap:6px; flex:1; }
.modal-wide { max-width: 720px; }

/* SP-7 barre de modes */
.reader-viewbar{ display:flex; gap:4px; padding:6px 10px; border-bottom:1px solid var(--border); }
.reader-viewbar .view-btn{ background:none; border:1px solid transparent; border-radius:6px; cursor:pointer; font-size:15px; padding:2px 8px; color:var(--text-dim); }
.reader-viewbar .view-btn:hover{ background:var(--bg-elev-2); }
.reader-viewbar .view-btn.active{ color:var(--text-strong); border-color:var(--accent); }
.viewbar-legend-wrap { position: relative; margin-left: 8px; display: inline-flex; align-items: center; }
.pastille-legend {
  position: absolute; left: 0; top: calc(100% + 6px); z-index: 200;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 6px; padding: 10px 14px;
  font-size: 13px; white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
}
.pastille-legend ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pastille-legend li { display: flex; align-items: center; gap: 8px; }
/* détaillé */
.view-detailed .reader-item-detailed{ display:flex; gap:10px; align-items:flex-start; padding:10px 14px; }
.reader-item-detailed .reader-item-marks{ display:flex; gap:6px; flex:0 0 auto; padding-top:2px; }
.reader-item-detailed .reader-item-main{ flex:1; min-width:0; }
.reader-item-detailed .reader-item-excerpt{ font-size:12.5px; color:var(--text-dim); margin:3px 0; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.reader-item-thumb{ flex:0 0 auto; width:72px; height:54px; object-fit:cover; border-radius:6px; }
/* galerie */
.reader-cards{ display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:12px; padding:12px; box-sizing:border-box; width:100%; }
.reader-card{ position:relative; border:1px solid var(--border); border-radius:10px; overflow:hidden; cursor:pointer; background:var(--bg-elev); }
.reader-card .reader-card-img{ height:110px; background:var(--bg-elev-2); }
.reader-card .reader-card-img img{ width:100%; height:100%; object-fit:cover; display:block; }
.reader-card .reader-card-img.noimg{ display:flex; align-items:center; justify-content:center; }
.reader-card .reader-card-img.noimg::after{ content:'📄'; font-size:28px; opacity:.4; }
.reader-card .reader-card-marks{ position:absolute; top:6px; right:6px; display:flex; gap:4px; background:var(--bg-elev); border-radius:10px; padding:2px 5px; }
.reader-card .reader-card-body{ padding:8px 10px; display:flex; flex-direction:column; gap:4px; }
.reader-card .reader-card-body .reader-item-title{ font-size:13px; font-weight:600; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
.reader-card .reader-card-body .reader-item-date{ font-size:11px; color:var(--text-dim); }
.reader-card.unread .reader-item-title{ color:var(--text-strong); }
[data-theme="osint"] .reader-card .reader-card-img.noimg::after{ content:'▓'; color:#2f7d2f; }

/* Badge « actions à faire » sur les onglets admin */
.admin-tab.admin-tab-alert{ color:#e23b3b; font-weight:600; }
[data-theme="osint"] .admin-tab.admin-tab-alert{ color:#ff5b5b; }

/* Colonne gauche : hiérarchie typo (espaces dominent dossiers/flux) */
.reader-space-name { font-size: 15px; font-weight: 700; }
.reader-folder-name { font-size: 13px; }
.reader-sub-title { font-size: 13px; }
.reader-space-name, .reader-colls-head, .reader-fav-entry, .reader-coll-entry { text-transform: none; }
/* Séparateur discret entre blocs de la colonne */
.reader-sep { height: 1px; background: var(--border); margin: 10px 4px; opacity: .6; }
.reader-colls-head.unread, .reader-coll-entry.unread { font-weight: 700; }
.reader-colls-head { cursor: pointer; }
.reader-coll-entry { padding-left: 22px; }
.reader-add-any { width: 100%; margin-bottom: 10px; }
.addany-types { display: flex; gap: 14px; flex-wrap: wrap; }
.addany-types label { font-weight: 400; cursor: pointer; }

.reader-sub[draggable="true"] { cursor: grab; }
.drop-target { outline: 2px dashed var(--accent); outline-offset: -2px; border-radius: 4px; }

/* Vue full : 2 colonnes (espaces + items), détail masqué */
.reader.reader-fullview { grid-template-columns: var(--col-spaces, 300px) 6px 1fr; }
.reader-fullview #aggDetail, .reader-fullview .reader-resizer.r2 { display: none; }
/* Cartes magazine plein contenu */
.reader-cards-full { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; padding: 14px; }
.reader-cardfull { display: block; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 8px; padding: 14px; cursor: pointer; position: relative; }
.reader-cardfull:hover { border-color: var(--accent); }
.reader-cardfull .reader-card-marks { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; }
.reader-cardfull-img img { max-width: 100%; border-radius: 6px; margin-bottom: 8px; display: block; }
.reader-cardfull-body .reader-item-title { font-size: 15px; font-weight: 700; display: block; }
.reader-card-full-body { margin-top: 8px; font-size: 13px; line-height: 1.6; color: var(--text-dim); overflow-wrap: anywhere; }
.reader-card-full-body img { max-width: 100%; height: auto; }

/* Menu : dropdown «+» */
.menu-add { position: relative; display: inline-block; }
.menu-add-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 50; min-width: 200px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 8px; padding: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.menu-add-pop a, .menu-add-pop .menu-add-soon { display: block; padding: 8px 10px; border-radius: 6px; color: var(--text-dim); text-decoration: none; font-size: 13px; }
.menu-add-pop a:hover { background: var(--bg-elev-2); color: var(--text-strong); }
.menu-add-soon { color: var(--text-mute); cursor: default; opacity: .55; }
#messagesBadge.badge { display: inline-block; min-width: 16px; padding: 0 4px; border-radius: 8px; background: var(--accent); color: #fff; font-size: 11px; text-align: center; }
/* Compte : mot de passe | accès rapides côte à côte */
.account-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; max-width: 900px; margin: 0 auto 22px; }
@media (max-width: 760px) { .account-2col { grid-template-columns: 1fr; } }
.account-2col .account-block { max-width: none; margin: 0; }
.account-col { display: flex; flex-direction: column; gap: 16px; }

/* ---- Comparatif des niveaux (levels-table.js) ---- */
.levels-table { width: 100%; border-collapse: collapse; margin: 8px 0 24px; font-size: 0.92rem; }
.levels-table th, .levels-table td {
  border: 1px solid var(--border, #2a2a2a); padding: 8px 10px; text-align: center; vertical-align: middle;
}
.levels-table thead th { background: var(--surface-2, rgba(255,255,255,0.04)); font-weight: 700; }
.levels-table th[scope="row"] { text-align: left; font-weight: 500; }
.levels-table .lvl-section td {
  text-align: left; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  background: var(--surface-2, rgba(255,255,255,0.06)); font-size: 0.82rem;
}
.levels-table .lvl-badge {
  display: inline-block; padding: 1px 7px; margin-left: 8px; border-radius: 10px;
  font-size: 0.72rem; background: var(--border, #333); color: var(--text-mute, #999); letter-spacing: 0;
}
.levels-table .lvl-planned, .levels-table .lvl-planned th, .levels-table .lvl-planned td { opacity: 0.55; }
.levels-table .lvl-note { font-size: 0.78rem; color: var(--text-mute, #888); font-weight: 400; margin-top: 2px; }
.levels-table .lvl-footnote td {
  text-align: left; font-size: 0.78rem; color: var(--text-mute, #888); font-weight: 400; font-style: italic;
}
/* Colonne du niveau de l'utilisateur connecté (compte.html uniquement) */
.levels-table .lvl-active-col { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.levels-table thead th.lvl-active-col { color: var(--accent); }

/* Bannière offre de lancement (au-dessus du comparatif) */
.promo-banner {
  margin: 0 0 14px; padding: 10px 14px; border-radius: 8px;
  background: color-mix(in srgb, var(--error) 10%, transparent);
  border: 1px solid var(--error); font-size: 0.9rem;
}
.promo-banner strong { color: var(--error); }
.levels-table .promo-old { display: block; text-decoration: line-through; color: var(--text-mute, #888); }
.levels-table .promo-new { display: block; color: var(--error); font-weight: 700; }

/* Newsletter / recipients status badge — shared by newsletter.html and compte.html */
.nl-status { font-size: 12px; font-family: var(--mono); padding: 1px 7px; border-radius: 3px; border: 1px solid var(--border); color: var(--text-dim); }
.nl-status.verified { color: var(--accent); border-color: var(--accent); }
.nl-status.blocked { color: var(--error); border-color: var(--error); }

/* Monitor zones et modaux (MON-2) */
.monitor-zones-list { list-style: none; padding: 0; margin: .4rem 0; display: flex; flex-wrap: wrap; gap: .3rem; }
.monitor-zones-list li { display: flex; align-items: center; gap: .4rem; padding: .2rem .5rem; border-radius: 4px; font-size: .8rem; }
.monitor-zone-include { background: var(--color-success-bg, rgba(0,200,80,.12)); }
.monitor-zone-exclude { background: var(--color-warn-bg, rgba(255,180,0,.15)); }
.monitor-zone-rm { background: none; border: none; cursor: pointer; color: var(--color-muted, #888); font-size: .9rem; padding: 0; line-height: 1; }
.monitor-preview { background: var(--color-bg-2, #f5f5f5); border-radius: 4px; padding: .5rem; margin: .5rem 0; }
.monitor-preview-label { font-size: .72rem; color: var(--color-muted, #888); display: block; }
.monitor-preview-text { font-size: .8rem; max-height: 5rem; overflow: auto; margin: .2rem 0 0; white-space: pre-wrap; }
[data-theme="osint"] .monitor-zone-include { background: rgba(0,255,100,.1); }
[data-theme="osint"] .monitor-zone-exclude { background: rgba(255,200,0,.1); }
[data-theme="osint"] .monitor-preview { background: var(--color-bg-2, #111); }

/* Diff monitor : ajouts vert, suppressions rouge (MON-2 corrections) */
.reader-detail-body ins { background: rgba(0,180,80,.18); text-decoration: none; border-radius: 2px; padding: 0 2px; color: inherit; }
.reader-detail-body del { background: rgba(200,40,40,.12); color: #c00; text-decoration: line-through; border-radius: 2px; padding: 0 2px; }
.reader-detail-body .diff-ellipsis { display: block; color: var(--text-muted, #888); font-style: italic; font-size: .85em; margin: .25em 0; }
[data-theme="osint"] .reader-detail-body ins { background: rgba(0,255,100,.12); }
[data-theme="osint"] .reader-detail-body del { background: rgba(255,60,60,.12); color: #f66; }
.monitor-diff-count { font-style: normal; font-size: .8em; color: var(--accent, #e74c3c); font-weight: 600; }
/* MON-5 : diff prose dans le détail item monitor */
.monitor-diff-body { line-height: 1.9; }
.monitor-diff-body ins { background: rgba(0,160,60,.25); text-decoration: none;
  border-radius: 3px; padding: 1px 3px; color: #0a6e1e; font-weight: 600; }
.monitor-diff-body del { background: rgba(200,30,30,.18); text-decoration: none;
  color: #a01010; font-weight: 600; border-radius: 3px; padding: 1px 3px; }
.monitor-diff-sep { color: var(--color-muted, #999); font-style: italic; margin: 0 .25rem; }
[data-theme="osint"] .monitor-diff-body ins { background: rgba(0,255,100,.18); color: #0f0; }
[data-theme="osint"] .monitor-diff-body del { background: rgba(255,60,60,.18); color: #f66; }

/* MON-5 : pastille statut monitor */
.monitor-status-badge { font-size: .8em; margin-left: .3rem; vertical-align: middle; }
.monitor-status-err { color: var(--color-error, #c00); }
.monitor-status-robots { opacity: .8; }
.monitor-status-pending { opacity: .7; }

/* MON-5 : quota hint 1min */
.monitor-quota-hint { font-size: .78rem; margin-left: .5rem; vertical-align: middle; }
.monitor-diff-legend { font-size: .75rem; margin-top: .4rem; color: var(--color-muted, #888); display: flex; gap: .8rem; }
.monitor-legend-ins { color: #0a6e1e; }
.monitor-legend-del { color: #a01010; }
[data-theme="osint"] .monitor-legend-ins { color: #0f0; }
[data-theme="osint"] .monitor-legend-del { color: #f66; }
/* MON-B2 : iframe snapshot html */
.monitor-snapshot-frame { width: 100%; height: 500px; border: 1px solid var(--border, #ddd);
  border-radius: 6px; background: #fff; display: block; margin-top: .5rem; }
[data-theme="osint"] .monitor-snapshot-frame { border-color: #2a3a2a; background: #0d1a0d; }
/* MON-4 : modale versions/comparaison */
.monitor-versions-compare-row { display:flex; align-items:center; gap:.5rem; margin:.75rem 0; flex-wrap:wrap; }
.monitor-versions-vs { color:var(--color-muted,#888); font-size:1.1rem; }
.monitor-versions-stats { font-size:.8rem; color:var(--color-muted,#888); margin:.25rem 0 0; }
.monitor-versions-diff { font-size:.85rem; max-height:420px; overflow:auto;
  background:var(--color-bg-2,#f5f5f5); border-radius:4px; padding:.75rem;
  margin-top:.5rem; line-height:1.6; word-wrap:break-word; }
.monitor-version-url { font-size:.75rem; color:var(--color-muted,#888); word-break:break-all; margin:.25rem 0; }
.monitor-versions-link { font-size:.8rem; display:block; margin-top:.5rem; color:var(--color-link,#2563eb); }
[data-theme="osint"] .monitor-versions-diff { background:var(--color-bg-2,#111); }
.monitor-versions-diff ins { background:rgba(0,180,80,.18); text-decoration:none; border-radius:2px; padding:0 2px; color:inherit; }
.monitor-versions-diff del { background:rgba(200,40,40,.12); color:#c00; text-decoration:line-through; border-radius:2px; padding:0 2px; }
[data-theme="osint"] .monitor-versions-diff ins { background:rgba(0,255,100,.12); }
[data-theme="osint"] .monitor-versions-diff del { background:rgba(255,60,60,.12); color:#f66; }

/* ----- Page dashboard newsletter (publique, sans auth) ----- */
.nl-muted { color: var(--text-dim); font-size: 13px; }
.dash-screen { max-width: 960px; margin: 0 auto; padding: 24px 16px; }
.dash-header { margin-bottom: 20px; }
.dash-view-toggle { margin-top: 8px; display: flex; gap: 8px; }
.dash-view-toggle .btn.active { background: var(--accent); color: #fff; }
.dash-columns { display: flex; gap: 20px; overflow-x: auto; }
.dash-col { flex: 1 1 260px; min-width: 240px; }
.dash-item { padding: 10px 0; border-bottom: 1px solid var(--border); }
.dash-view-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dash-card { border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.dash-card-image img { width: 100%; height: 100px; object-fit: cover; display: block; }
.dash-card-body { padding: 8px; font-size: 13px; }

/* ---- Footer légal (mentions-legales.html, toutes pages) ---- */
.site-footer {
  max-width: 960px; margin: 32px auto 16px; padding: 16px;
  text-align: center; font-size: 0.82rem; color: var(--text-dim);
  border-top: 1px solid var(--border);
}
.site-footer a { color: var(--text-dim); text-decoration: underline; }
.site-footer a:hover { color: var(--accent); }

/* ── Page d'aide ────────────────────────────────────────────── */
.aide-intro {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 24px;
  font-size: 14px;
  color: var(--text-strong);
  line-height: 1.6;
}
.aide-intro p { margin: 0; }
.aide-intro a { text-decoration: underline; }

.aide-layout { display: flex; gap: 32px; align-items: flex-start; }

.aide-toc {
  position: sticky;
  top: 16px;
  flex: 0 0 240px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  border-right: 1px solid var(--border-soft);
  padding-right: 16px;
}
.aide-toc ul { list-style: none; margin: 0; padding: 0; }
.aide-toc > ul > li { margin-top: 10px; }
.aide-toc a {
  display: block;
  padding: 5px 8px;
  font-size: 13px;
  color: var(--text-strong);
  border-left: 2px solid transparent;
  border-radius: 0 4px 4px 0;
  font-weight: 600;
}
.aide-toc a.aide-toc-sub {
  padding-left: 18px;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--text-dim);
}
.aide-toc a:hover { background: var(--bg-elev-2); color: var(--accent); }
.aide-toc a.active { color: var(--accent); border-left-color: var(--accent); background: var(--accent-bg); }

.aide-content { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 56px; }
.aide-section { scroll-margin-top: 16px; }
.aide-section h2 { margin: 0 0 4px; }
.aide-sub { margin-top: 32px; scroll-margin-top: 16px; }
.aide-sub h3 { margin-bottom: 8px; }
.aide-sub h4 { margin: 20px 0 6px; }

.aide-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  margin: 12px 0 20px;
}
.aide-card-icon { font-size: 22px; line-height: 1; }
.aide-card p { margin: 0; color: var(--text-dim); font-size: 14px; }

.aide-diagram {
  background: var(--bg-elev-2);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  padding: 12px 14px;
  font-family: monospace;
  font-size: 12px;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre;
  margin: 12px 0;
}

.aide-callout {
  border-left: 3px solid var(--accent);
  background: var(--accent-bg);
  padding: 10px 14px;
  border-radius: 0 6px 6px 0;
  font-size: 13px;
  margin: 12px 0;
}

.aide-table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 13px; }
.aide-table th, .aide-table td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; vertical-align: top; }
.aide-table th { background: var(--bg-elev-2); }

.aide-sub img { max-width: 100%; border: 1px solid var(--border); border-radius: 6px; margin: 10px 0; display: block; }

.aide-shot-grid { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0; }
.aide-shot-grid .aide-shot { margin: 0; }
.aide-shot {
  width: 160px;
  height: 100px;
  object-fit: cover;
  object-position: top;
  cursor: zoom-in;
  transition: border-color .15s, transform .1s;
}
.aide-shot:hover { border-color: var(--accent); transform: scale(1.02); }

.aide-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .82);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  cursor: zoom-out;
  padding: 24px;
}
.aide-lightbox.hidden { display: none; }
.aide-lightbox img {
  max-width: 92vw;
  max-height: 92vh;
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
}

@media (max-width: 860px) {
  .aide-layout { flex-direction: column; }
  .aide-toc {
    position: static;
    flex: none;
    width: 100%;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--border-soft);
    padding-right: 0;
    padding-bottom: 12px;
  }
}

/* ============================================================
   WORKFLOWS — canvas Drawflow + palette + panneau config nœud
   ============================================================
   Les variables (--bg-elev, --border, --accent, --text, --mono...) sont déjà
   scopées par thème via les blocs [data-theme="troover"]/[data-theme="osint"]
   en tête de fichier : une seule règle utilisant ces variables suffit pour les
   deux thèmes (pas de duplication troover/osint pour une simple couleur).
   Les blocs [data-theme="osint"] ci-dessous n'ajoutent QUE ce que les
   variables seules ne peuvent pas exprimer (glow, majuscules), comme pour
   .btn-primary plus haut dans ce fichier.
   ============================================================ */
.workflow-page { display: flex; gap: 1rem; align-items: flex-start; }

.workflow-list {
  width: 260px;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.workflow-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.workflow-item span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.workflow-canvas-wrap { display: flex; flex: 1; gap: 0.5rem; }

.workflow-drawflow {
  flex: 1;
  height: 70vh;
  background: var(--bg-canvas);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.workflow-palette, .workflow-node-config {
  width: 220px;
  flex: none;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px;
  overflow-y: auto;
  max-height: 70vh;
}
.workflow-palette h3 { font-size: 13px; color: var(--text-dim); margin: 12px 0 6px; }
.workflow-palette h3:first-child { margin-top: 0; }
.workflow-node-config label { display: block; font-size: 13px; margin-bottom: 10px; }
.workflow-node-config input, .workflow-node-config select {
  display: block; width: 100%; margin-top: 4px;
  padding: 6px 8px; font-family: var(--sans);
  background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 4px;
}

.palette-node {
  padding: 0.5rem;
  margin-bottom: 0.25rem;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: grab;
  font-size: 13px;
}
.palette-node:active { cursor: grabbing; }

.workflow-hint { text-align: center; opacity: 0.7; font-size: 0.9em; }

/* Le thème par défaut de Drawflow (drawflow.css : fond cyan, bordure noire, sélection
   rouge) écrase toute charte — on le remplace entièrement via les variables du site. */
.drawflow .drawflow-node {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 4px;
  box-shadow: var(--shadow-sm);
  font-family: var(--sans);
  font-size: 13px;
}
.drawflow .drawflow-node.selected {
  background: var(--bg-elev);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}
.drawflow .drawflow-node .input,
.drawflow .drawflow-node .output {
  background: var(--bg-elev);
  border-color: var(--border);
}
.drawflow .connection .main-path {
  stroke: var(--text-dim);
}
.drawflow .connection .main-path:hover,
.drawflow .connection .main-path.selected {
  stroke: var(--accent);
}

[data-theme="osint"] .drawflow .drawflow-node {
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
[data-theme="osint"] .drawflow .drawflow-node.selected {
  box-shadow: 0 0 16px rgba(0, 255, 65, 0.5);
}

/* ── Icônes "i" contextuelles ──────────────────────────────────── */
.help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elev-2);
  color: var(--text-dim);
  font-size: 10px;
  font-style: italic;
  font-family: Georgia, serif;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  margin-left: 4px;
  vertical-align: middle;
}
.help-icon:hover { border-color: var(--accent); color: var(--accent); }

.help-popover {
  position: absolute;
  z-index: 2000;
  max-width: 260px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text-strong);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .15);
}
.help-popover p { margin: 0 0 6px; }
.help-popover a { font-size: 12px; }

/* ============================================================
   MONITOR — clauses de filtre structurées (étape 4 du wizard,
   sous-projet 1 filter-engine.js). Une clause = opérateur + valeur ;
   un connecteur relie deux clauses adjacentes (ET/OU/PRÈS DE).
   ============================================================ */
.mw-clause {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
}
.mw-clause select { flex: 0 0 auto; width: auto; }
.mw-clause input[type="text"] { flex: 1 1 auto; }
.mw-connector {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 4px 16px;
}
.mw-connector select { flex: 0 0 auto; width: auto; }
.mw-connector input[type="number"] { flex: 0 0 auto; width: 5rem; }

/* ============================================================
   TUTORIEL — planche BD
   ============================================================ */
.tuto-intro { max-width: 760px; margin: 0 0 32px; color: var(--text-dim); }
.tuto-intro p { margin: 0 0 8px; }

.tuto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.tuto-case {
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  break-inside: avoid;
}

.tuto-illus { width: 100%; height: 120px; display: block; }
.tuto-mascotte-body { fill: var(--primary); }
.tuto-mascotte-eye { fill: var(--bg-elev); }
.tuto-mascotte-mouth { stroke: var(--bg-elev); }
.tuto-mascotte-wave { stroke: var(--accent); }

.tuto-prop {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 22px;
  line-height: 1;
}

.tuto-bubble {
  position: relative;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text);
}
.tuto-bubble::after {
  content: '';
  position: absolute;
  top: -8px; left: 20px;
  border-width: 0 8px 8px 8px;
  border-style: solid;
  border-color: transparent transparent var(--bg-elev-2) transparent;
}

.tuto-caption { margin: 0; font-size: 13px; color: var(--text-dim); }
.tuto-caption strong { color: var(--accent); }

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

@media print {
  .app-header, .tuto-footer { display: none; }
  .tuto-case { page-break-inside: avoid; border-color: #999; }
}
