/* ═══════════════════════════════════════════════════
   Instagram Data Lab · Design System
   ═══════════════════════════════════════════════════ */

:root {
    --bg: #FFFFFF;
    --surface: #FFFFFF;
    --surface-2: #F2F2EF;
    --border: #0A0A0A;
    --border-strong: #0A0A0A;
    --hair: #E4E4E0;

    --text: #0A0A0A;
    --text-muted: #6E6E6E;
    --text-soft: #9C9C9C;

    --accent: #0A0A0A;
    --accent-soft: #F2F2EF;
    --accent-strong: #0A0A0A;
    --lime: #C9F24A;

    --success: #0A0A0A;
    --success-soft: #F2F2EF;
    --warning: #0A0A0A;
    --warning-soft: #F2F2EF;
    --danger: #0A0A0A;
    --danger-soft: #F2F2EF;

    --grad-1: #0A0A0A;
    --grad-2: #0A0A0A;

    --radius-sm: 0px;
    --radius: 0px;
    --radius-lg: 0px;

    --shadow-sm: 2px 2px 0 #0A0A0A;
    --shadow: 4px 4px 0 #0A0A0A;
    --shadow-lg: 8px 8px 0 #0A0A0A;

    --sidebar-w: 264px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, monospace;
}

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

html, body { height: 100%; }

body {
    font-family: var(--mono);
    background: var(--bg);
    color: var(--text);
    font-size: 13.5px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
a:hover { background: var(--lime); text-decoration: none; }

code {
    font-family: var(--mono);
    background: var(--surface-2);
    padding: 2px 6px;
    border-radius: 0;
    font-size: 0.9em;
    border: 1px solid var(--border);
}

button { font-family: inherit; cursor: pointer; }

.hidden { display: none !important; }
.muted { color: var(--text-muted); font-size: 0.9em; }
.center { text-align: center; }

/* ═══ LAYOUT ═══ */

#app {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    grid-template-rows: auto 1fr;
    min-height: 100vh;
}

/* ═══ SIDEBAR ═══ */

.sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 22px 14px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 46px;
    height: calc(100vh - 46px);
    overflow-y: auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}
.brand-mark {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--grad-1), var(--grad-2));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 14px; font-weight: 700; }
.brand-text span { font-size: 11px; color: var(--text-muted); }

.nav { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.nav-section { display: flex; flex-direction: column; gap: 2px; margin-bottom: 16px; }
.nav-label {
    text-transform: uppercase;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--text-soft);
    padding: 8px 8px 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    border: none;
    background: transparent;
    text-align: left;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text);
    transition: all 0.15s;
}
.nav-item:hover { background: var(--surface-2); }
.nav-item.active {
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-weight: 600;
}
.nav-item.highlight {
    background: linear-gradient(135deg, var(--grad-1), var(--grad-2));
    color: white;
    font-weight: 600;
}
.nav-item.highlight:hover { opacity: 0.95; }
.nav-item.danger { color: var(--danger); }
.nav-item.danger:hover { background: var(--danger-soft); }
.nav-icon { font-size: 16px; }

.sidebar-footer { padding: 16px 8px 0; border-top: 1px solid var(--border); }
.privacy-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted);
}
.privacy-badge .dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 3px var(--success-soft);
}

/* ═══ MAIN ═══ */

.main {
    padding: 40px 56px;
    max-width: 1280px;
    width: 100%;
}

.page { display: none; animation: fadeIn 0.3s ease; }
.page.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-header { margin-bottom: 32px; }
.page-header h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 6px; }
.page-header .lead { color: var(--text-muted); font-size: 16px; }

/* ═══ HERO ═══ */

.hero {
    padding: 48px 0 40px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 40px;
}
.hero-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 100px;
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 16px;
}
.hero h1 {
    font-size: 48px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 16px;
    max-width: 800px;
}
.hero .grad {
    background: linear-gradient(135deg, var(--grad-1), var(--grad-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero-sub {
    font-size: 18px;
    color: var(--text-muted);
    max-width: 700px;
    margin-bottom: 28px;
}
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

/* ═══ BUTTONS ═══ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: var(--radius);
    border: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.15s;
    text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary {
    background: var(--text);
    color: white;
}
.btn-primary:hover { background: #000; transform: translateY(-1px); }
.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border-strong);
}
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost {
    background: transparent;
    color: var(--text);
}
.btn-ghost:hover { background: var(--surface-2); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ═══ CARDS ═══ */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
}
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    transition: all 0.2s;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-bottom: 16px;
}
.card h3 { font-size: 17px; margin-bottom: 8px; }
.card p { color: var(--text-muted); font-size: 14px; }
.card-link {
    display: inline-block;
    margin-top: 12px;
    font-size: 14px;
    font-weight: 600;
}

.info-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 24px;
}
.info-block h2 { font-size: 22px; margin-bottom: 12px; }
.info-block p { color: var(--text-muted); margin-bottom: 12px; }
.info-block.dark {
    background: var(--text);
    color: white;
}
.info-block.dark p { color: rgba(255,255,255,0.7); }
.info-block.dark h2 { color: white; }

/* ═══ EDU CARDS (pédagogie en haut de chaque page) ═══ */

.edu-card {
    background: var(--accent-soft);
    border: 1px solid #0A0A0A;
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    margin-bottom: 32px;
}
.edu-card h3 {
    font-size: 16px;
    margin-bottom: 16px;
    color: var(--accent-strong);
}
.edu-card p, .edu-card ol, .edu-card ul { color: var(--text); font-size: 14px; }
.edu-card p { margin-bottom: 8px; }
.edu-card ol, .edu-card ul { padding-left: 20px; margin-top: 8px; }
.edu-card li { margin-bottom: 4px; }
.edu-card .tip {
    background: white;
    padding: 12px 14px;
    border-radius: var(--radius);
    margin-top: 12px;
    font-size: 13px;
}
.edu-card .warning {
    background: var(--warning-soft);
    padding: 12px 14px;
    border-radius: var(--radius);
    border: 1px solid #F5D89A;
    margin-top: 12px;
    font-size: 13px;
    color: #92400E;
}
.edu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}
.edu-grid strong { display: block; font-size: 13px; color: var(--accent-strong); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.file-checklist { list-style: none !important; padding: 0 !important; }
.file-checklist li { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; }
.check { display: inline-block; min-width: 18px; }

/* ═══ UPLOAD / DROPZONE ═══ */

.dropzone {
    position: relative;
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 60px 24px;
    text-align: center;
    background: var(--surface);
    transition: all 0.2s;
    cursor: pointer;
    margin-bottom: 24px;
}
.dropzone:hover, .dropzone.drag-over {
    border-color: var(--accent);
    background: var(--accent-soft);
}
.dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}
.dropzone-icon { font-size: 48px; margin-bottom: 12px; }
.dropzone h2 { font-size: 20px; font-weight: 600; }
.dropzone p { color: var(--text-muted); margin-top: 6px; }

.scan-status {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 16px;
}
.scan-status h3 { font-size: 15px; margin-bottom: 12px; }
.progress-bar {
    height: 8px;
    background: var(--surface-2);
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 8px;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--grad-1), var(--grad-2));
    transition: width 0.2s;
    border-radius: 100px;
}

.log-details { margin-top: 24px; }
.log-details summary {
    cursor: pointer;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 13px;
    color: var(--text-muted);
}
.console {
    background: #1A1A1A;
    color: #D4D4D4;
    font-family: var(--mono);
    font-size: 12px;
    padding: 16px;
    border-radius: var(--radius);
    margin-top: 8px;
    max-height: 300px;
    overflow-y: auto;
}
.console .log-entry { padding: 2px 0; }
.console .log-entry.success { color: #6EE7B7; }
.console .log-entry.info { color: #93C5FD; }
.console .log-entry.warn { color: #FBBF24; }
.console .log-entry.error { color: #FCA5A5; }

/* ═══ META BANNER ═══ */

.meta-banner {
    background: linear-gradient(135deg, var(--surface) 0%, var(--accent-soft) 100%);
    border: 1px solid #0A0A0A;
    border-radius: var(--radius-lg);
    padding: 16px 22px;
    margin-bottom: 32px;
}
.meta-banner-row {
    display: grid;
    grid-template-columns: auto auto auto 1fr;
    gap: 22px;
    align-items: center;
}
@media (max-width: 900px) {
    .meta-banner-row { grid-template-columns: 1fr 1fr; }
    .meta-item-grow { grid-column: 1 / -1; }
}
.meta-item { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.meta-item-grow { flex: 1; }
.meta-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 600;
}
.meta-label small { text-transform: none; font-weight: 400; letter-spacing: 0; opacity: 0.7; }
.meta-item strong {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}
.meta-label-input {
    background: transparent;
    border: 1px solid transparent;
    border-bottom: 1px dashed var(--accent);
    padding: 4px 6px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    transition: border 0.15s;
    margin-top: 2px;
    width: 100%;
}
.meta-label-input:hover { border-bottom-color: var(--accent-strong); }
.meta-label-input:focus {
    outline: none;
    border: 1px solid var(--accent);
    background: white;
    border-radius: 6px;
}

/* ═══ FOLDER ILLUSTRATION ═══ */

.folder-illustration {
    background: white;
    border: 1px solid #0A0A0A;
    border-radius: var(--radius);
    padding: 16px 20px;
    font-family: var(--mono);
    font-size: 13px;
    margin-top: 12px;
}
.folder-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
    color: var(--text);
}
.folder-row.root {
    background: var(--accent-soft);
    margin: -16px -20px 8px;
    padding: 12px 20px;
    border-radius: var(--radius) var(--radius) 0 0;
    border-bottom: 1px solid #0A0A0A;
    font-size: 14px;
}
.folder-row.root strong { color: var(--accent-strong); }
.folder-row.child { padding-left: 24px; }
.folder-row.muted-row { color: var(--text-soft); }
.folder-tag {
    background: var(--accent);
    color: white;
    padding: 3px 10px;
    border-radius: 100px;
    font-family: var(--font);
    font-size: 11px;
    font-weight: 700;
    margin-left: auto;
}
.folder-meta {
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 12px;
    margin-left: 6px;
}

/* ═══ SCAN DASHBOARD ═══ */

.scan-dashboard {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-top: 20px;
    margin-bottom: 20px;
}
.scan-dash-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.scan-dash-header h3 { font-size: 16px; }
.scan-dash-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 16px;
    margin-top: 20px;
}
@media (max-width: 700px) {
    .scan-dash-grid { grid-template-columns: 1fr; }
}
.scan-3cols {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 20px;
}
.scan-3cols:has(#zips-block[style*="display:none"]),
.scan-3cols:has(#zips-block[style*="display: none"]) {
    grid-template-columns: repeat(2, 1fr);
}
@media (max-width: 900px) {
    .scan-3cols { grid-template-columns: 1fr; }
}
.muted-num {
    background: var(--accent-soft);
    color: var(--accent-strong);
    padding: 1px 8px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    font-family: var(--font);
}
.scan-zips-list {
    list-style: none;
    max-height: 240px;
    overflow-y: auto;
    font-family: var(--mono);
    font-size: 11.5px;
}
.scan-zips-list li {
    padding: 7px 8px;
    border-radius: 6px;
    margin-bottom: 4px;
    background: var(--bg);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 6px;
}
.scan-zips-list li .zip-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.scan-zips-list li .zip-state { font-size: 10px; flex-shrink: 0; }
.scan-zips-list li.pending { opacity: 0.7; }
.scan-zips-list li.extracting {
    background: var(--accent-soft);
    border-color: #0A0A0A;
    color: var(--accent-strong);
    font-weight: 600;
}
.scan-zips-list li.extracting::before { content: '⏳'; }
.scan-zips-list li.done { background: var(--success-soft); border-color: #A7E3CE; }
.scan-zips-list li.done::before { content: '✅'; }
.scan-zips-list li.error { background: var(--danger-soft); border-color: #F5B5B5; color: #B91C1C; }
.scan-zips-list li.error::before { content: '❌'; }
.scan-zips-list li.pending::before { content: '⏸'; }
.placeholder {
    color: var(--text-soft);
    font-style: italic;
    padding: 8px;
    text-align: center;
}
.scan-dash-block {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
}
.scan-dash-block h4 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.scan-folders-list, .scan-files-list {
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
    font-family: var(--mono);
    font-size: 12px;
}
.scan-folders-list li {
    padding: 5px 0;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.scan-folders-list li .check { font-size: 14px; }
.scan-folders-list li.scanning { color: var(--accent-strong); font-weight: 600; }
.scan-folders-list li.scanning::after {
    content: '⏳';
    margin-left: auto;
}
.scan-folders-list li.done::after {
    content: '✅';
    margin-left: auto;
}
.scan-files-list li {
    padding: 3px 0;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    animation: fadeInUp 0.25s ease;
}
.scan-files-list li.found {
    color: var(--success);
    font-weight: 600;
}
.scan-files-list li.skip {
    color: var(--text-soft);
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}
.scan-current {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    font-family: var(--mono);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.scan-current-label {
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-family: var(--font);
    font-weight: 600;
}
.scan-current-file {
    color: var(--accent-strong);
    word-break: break-all;
    flex: 1;
}

/* ═══ DEBUG ═══ */

.debug-pre {
    background: #1A1A1A;
    color: #D4D4D4;
    font-family: var(--mono);
    font-size: 12px;
    padding: 16px;
    border-radius: var(--radius);
    overflow-x: auto;
    margin-top: 8px;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre;
}

/* ═══ DIAGNOSTIC CARD ═══ */

.diag-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--danger);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    margin-top: 12px;
}
.diag-card h3 {
    font-size: 17px;
    margin-bottom: 12px;
}
.diag-reason {
    font-size: 17px;
    font-weight: 600;
    color: var(--danger);
    margin-bottom: 6px;
}
.diag-details {
    color: var(--text-muted);
    margin-bottom: 16px;
    font-size: 14px;
}
.diag-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 16px;
}
.diag-stats > div {
    display: flex;
    flex-direction: column;
}
.diag-stats .label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.diag-stats strong {
    font-size: 22px;
    font-weight: 700;
}
.diag-folder-list {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    font-size: 13px;
    margin-bottom: 16px;
}
.diag-folder-list code {
    display: inline-block;
    margin: 2px 0;
    background: var(--accent-soft);
    color: var(--accent-strong);
    padding: 2px 8px;
}
.diag-suggestion {
    background: var(--warning-soft);
    border: 1px solid #F5D89A;
    border-radius: var(--radius);
    padding: 14px 16px;
    color: #92400E;
}
.diag-suggestion p { color: #78350F; margin-top: 6px; }
.diag-summary-toggle {
    cursor: pointer;
    color: var(--accent-strong);
    font-weight: 600;
    font-size: 13px;
}

/* ═══ STATS ═══ */

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 32px;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}
.stat-card .stat-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    margin-bottom: 8px;
}
.stat-card strong {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.stat-card.accent { background: var(--accent-soft); border-color: #0A0A0A; }
.stat-card.accent strong { color: var(--accent-strong); }
.stat-card.warning { background: var(--warning-soft); border-color: #F5D89A; }
.stat-card.warning strong { color: #B45309; }
.stat-card.success { background: var(--success-soft); border-color: #A7E3CE; }
.stat-card.success strong { color: #047857; }
.stat-card.danger { background: var(--danger-soft); border-color: #F5B5B5; }
.stat-card.danger strong { color: #B91C1C; }

/* ═══ LISTS ═══ */

.two-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 24px;
    margin-top: 8px;
}
.two-cols > div h3 { margin-bottom: 8px; font-size: 17px; }
.two-cols .muted { margin-bottom: 12px; font-size: 13px; }

.user-list {
    list-style: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    max-height: 600px;
    overflow-y: auto;
}
.user-list .user-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    transition: background 0.1s;
}
.user-list .user-item:last-child { border-bottom: none; }
.user-list .user-item:hover { background: var(--surface-2); }
.user-list .user-item a { color: var(--text); display: flex; align-items: center; gap: 10px; flex: 1; }
.user-list .user-item .avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--grad-1), var(--grad-2));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
}
.user-list .user-item .username { font-weight: 500; }
.user-list .user-item .meta { color: var(--text-muted); font-size: 12px; margin-left: auto; }
.user-list .empty-list { padding: 24px; text-align: center; color: var(--text-muted); font-size: 14px; }
.user-list .more {
    padding: 12px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    background: var(--surface-2);
}

.feed-list { list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); max-height: 600px; overflow-y: auto; }
.feed-list li { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; gap: 12px; }
.feed-list li:last-child { border-bottom: none; }
.feed-list .title { font-weight: 500; flex: 1; }
.feed-list .date { color: var(--text-muted); font-size: 12px; white-space: nowrap; }

.thread-list { list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.thread-list li { padding: 12px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 14px; }
.thread-list li:last-child { border-bottom: none; }
.thread-list .rank { font-weight: 700; color: var(--text-muted); width: 28px; flex-shrink: 0; }
.thread-list .title { flex: 1; font-weight: 500; }
.thread-list .thread-title-wrap { flex: 1; min-width: 0; }
.thread-list .thread-title { font-weight: 500; }
.thread-list .thread-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.thread-list .thread-sub.recovered { color: var(--accent-strong); font-style: italic; }
.thread-list .thread-sub code { font-size: 10px; }
.thread-list .count { color: var(--accent-strong); font-weight: 600; white-space: nowrap; }
.thread-list .range { color: var(--text-muted); font-size: 12px; margin-left: 12px; white-space: nowrap; }
.tag.accent { background: var(--accent-soft); color: var(--accent-strong); padding: 2px 8px; border-radius: 100px; font-weight: 600; }
.tag-blocked {
    display: inline-block;
    background: var(--danger-soft);
    color: #B91C1C;
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 10px;
    font-weight: 700;
    margin-left: 6px;
    border: 1px solid #F5B5B5;
    cursor: help;
}
.user-label {
    display: inline-block;
    background: var(--warning-soft);
    color: #92400E;
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 6px;
    border: 1px solid #F5D89A;
}
.btn-label, .btn-share {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    padding: 3px 10px;
    border-radius: 100px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-label:hover {
    background: var(--accent-soft);
    color: var(--accent-strong);
    border-color: var(--accent);
}
/* Bouton partage : minimaliste, tout à droite, visible au hover de la ligne */
.btn-share {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin: 0 0 0 8px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-soft);
    font-size: 14px;
    cursor: pointer;
    flex-shrink: 0;
    opacity: 0.35;
    transition: all 0.15s;
}
.thread-list li:hover .btn-share { opacity: 0.85; }
.btn-share:hover {
    background: var(--surface-2);
    color: var(--accent-strong);
    opacity: 1 !important;
}
.btn-share-placeholder {
    display: inline-block;
    width: 28px;
    margin-left: 8px;
    flex-shrink: 0;
}

/* ═══ SHARE MODAL ═══ */
.share-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.share-modal.hidden { display: none; }
.share-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    cursor: pointer;
}
.share-modal-content {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    width: 90%;
    max-width: 540px;
    box-shadow: var(--shadow-lg);
    z-index: 1;
}
.share-modal-content header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.share-modal-content h2 {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}
.share-modal-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 8px;
}
.share-modal-close:hover {
    background: var(--surface-2);
    color: var(--text);
}
.share-modal-sub {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 12px;
}
.share-modal-content textarea {
    width: 100%;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 12px 14px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    margin-bottom: 16px;
    background: var(--bg);
}
.share-modal-content textarea:focus {
    outline: 2px solid var(--accent);
    background: white;
}
.share-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}
.share-modal-hint {
    color: var(--text-muted);
    font-size: 12px;
    background: var(--surface-2);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    margin: 0;
}
.thread-clues {
    margin-top: 8px;
    font-size: 12px;
}
.thread-clues summary {
    cursor: pointer;
    color: var(--accent-strong);
    font-weight: 600;
    padding: 4px 0;
}
.clues-body {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-top: 6px;
}
.clues-body > div {
    margin-bottom: 6px;
    line-height: 1.4;
}
.clues-body > div:last-child { margin-bottom: 0; }
.clues-body em {
    color: var(--text);
    background: white;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

/* ═══ TABLES ═══ */

.table-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th {
    background: var(--surface-2);
    text-align: left;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}
.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface-2); }
.data-table .tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
}
.data-table .tag.success { background: var(--success-soft); color: #047857; }
.data-table .tag.warning { background: var(--warning-soft); color: #B45309; }
.data-table .hidden-text { color: var(--text-soft); font-style: italic; }
.data-table .user-link { color: var(--accent); }

/* ═══ FILTERS BAR ═══ */

.filters-bar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.select, .input {
    padding: 8px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    background: var(--surface);
    color: var(--text);
}
.input { flex: 1; min-width: 180px; }
.select:focus, .input:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.checkbox { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.sort-btns { display: flex; gap: 4px; }
.sort-btn {
    background: var(--surface);
    border: 1px solid var(--border-strong);
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
}
.sort-btn.active { background: var(--text); color: white; border-color: var(--text); }

/* ═══ CONNECTIONS PAGE ═══ */

.conn-insights {
    margin-bottom: 20px;
}
.conn-insights .info-block {
    padding: 18px 22px;
}
.conn-insights .insight {
    padding: 6px 0;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
}
.conn-insights .insight:last-child { border-bottom: none; }

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.chip {
    background: var(--surface);
    border: 1px solid var(--border-strong);
    padding: 7px 14px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: var(--text);
    transition: all 0.15s;
}
.chip:hover { background: var(--surface-2); }
.chip.active {
    background: var(--text);
    color: white;
    border-color: var(--text);
}

.conn-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 8px;
    margin-top: 16px;
}
.conn-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.15s;
}
.conn-card:hover {
    background: var(--surface-2);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
}
.conn-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--grad-1), var(--grad-2));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}
.conn-info {
    flex: 1;
    min-width: 0;
}
.conn-name {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.conn-date {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 3px;
}
.conn-date-label {
    color: var(--text-soft);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.03em;
}

.pill {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 100px;
    font-size: 10px;
    font-weight: 700;
    border: 1px solid;
}
.pill-mutual {
    background: var(--success-soft);
    color: #047857;
    border-color: #A7E3CE;
}
.pill-fan {
    background: var(--accent-soft);
    color: var(--accent-strong);
    border-color: #0A0A0A;
}
.pill-notback {
    background: var(--warning-soft);
    color: #92400E;
    border-color: #F5D89A;
}

/* ═══ TAGS CLOUD ═══ */

.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud .tag {
    display: inline-block;
    padding: 8px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s;
}
.tag-cloud .tag:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    transform: translateY(-1px);
}

/* ═══ EMPTY STATE ═══ */

.empty-state {
    background: var(--surface);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 48px 24px;
    text-align: center;
}
.empty-state p { color: var(--text-muted); margin-bottom: 16px; }

/* ═══ ALERT ═══ */

.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 14px;
    border: 1px solid;
}
.alert.success { background: var(--success-soft); border-color: #A7E3CE; color: #047857; }
.alert.warning { background: var(--warning-soft); border-color: #F5D89A; color: #92400E; }
.alert.info { background: var(--accent-soft); border-color: #0A0A0A; color: var(--accent-strong); }
.alert.danger { background: var(--danger-soft); border-color: #F5B5B5; color: #B91C1C; }

/* ═══ BADGES ═══ */

.badge-pro {
    display: inline-block;
    padding: 3px 10px;
    background: linear-gradient(135deg, var(--grad-1), var(--grad-2));
    color: white;
    font-size: 11px;
    font-weight: 700;
    border-radius: 100px;
    vertical-align: middle;
    margin-left: 6px;
}

/* ═══ SNAPSHOT LIBRARY ═══ */

.snap-library h2 { font-size: 18px; margin-bottom: 12px; }
.snap-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 10px;
    transition: all 0.15s;
}
.snap-card.active {
    border-color: var(--accent);
    background: var(--accent-soft);
}
.snap-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}
.snap-card-header h3 { font-size: 16px; margin: 0; }
.snap-card-label {
    font-size: 13px;
    color: var(--accent-strong);
    margin-top: 2px;
}
.snap-card-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.btn-mini {
    background: var(--surface);
    border: 1px solid var(--border-strong);
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text);
}
.btn-mini:hover { background: var(--surface-2); }
.btn-mini.danger {
    color: var(--danger);
    border-color: #F5B5B5;
}
.btn-mini.danger:hover { background: var(--danger-soft); }
.snap-card-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.snap-card-stats {
    font-size: 13px;
    color: var(--text);
}
.snap-card-stats span { font-weight: 500; }

.diff-up   { color: var(--success); font-weight: 700; }
.diff-down { color: var(--danger);  font-weight: 700; }
.diff-zero { color: var(--text-soft); font-weight: 600; }

/* ═══ SNAPSHOT ZONES (legacy, conservé) ═══ */

.snapshot-zones {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 16px;
    align-items: stretch;
}
.snapshot-zone {
    background: var(--surface);
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    transition: all 0.2s;
}
.snapshot-zone.loaded { border-style: solid; border-color: var(--success); background: var(--success-soft); }
.snapshot-zone h3 { font-size: 16px; margin-bottom: 12px; }
.snap-status { margin-top: 12px; font-size: 13px; }
.snap-status.loaded { color: var(--success); font-weight: 600; }
.snapshot-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--text-soft);
}

/* ═══ FOOTER ═══ */

.page-footer {
    margin-top: 64px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
}

/* ═══ RESPONSIVE ═══ */

/* Les media queries mobiles sont placées en toute fin de fichier
   pour primer sur les blocs de composants (brutaliste, messages, debug). */

/* ═══════════════════════════════════════════════════
   NAVIGATION MOBILE · barre flottante + sous-menus
   ═══════════════════════════════════════════════════ */

/* --- Sous-menu horizontal (caché sur desktop) --- */
.subnav { display: none; }
.subnav {
    grid-column: 1 / -1;
    align-items: center;
    gap: 10px;
    position: sticky;
    top: 46px;
    z-index: 50;
    background: var(--surface);
    border-bottom: 1px solid var(--text);
    padding: 8px 12px;
    overflow: hidden;
}
.subnav-cat {
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-soft);
    flex-shrink: 0;
}
.subnav-pills {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.subnav-pills::-webkit-scrollbar { display: none; }
.subnav-pill {
    flex-shrink: 0;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    padding: 7px 12px;
    border: 1px solid var(--text);
    background: #fff;
    color: var(--text);
    white-space: nowrap;
}
.subnav-pill.active { background: var(--text); color: #fff; }
.subnav-pill-danger { border-style: dashed; }

/* --- Barre flottante en bas (cachée sur desktop) --- */
.bottombar { display: none; }
.bottombar {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 200;
    background: var(--surface);
    border: 1.5px solid var(--text);
    box-shadow: 4px 4px 0 var(--text);
}
.bottombar-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 9px 4px 7px;
    border: none;
    border-right: 1px solid var(--hair);
    background: transparent;
    color: var(--text);
}
.bottombar-tab:last-child { border-right: none; }
.bt-icon { font-size: 19px; line-height: 1; }
.bt-label {
    font-family: var(--mono);
    font-size: 8.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.bottombar-tab.active { background: var(--lime); }

/* ═══════════════════════════════════════════════════
   PAGE D'ACCUEIL · grille de modules + CTA
   ═══════════════════════════════════════════════════ */

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}
.feature-card {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
    border: 1px solid var(--text);
    background: #fff;
    color: var(--text);
    padding: 18px 20px;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.12s, box-shadow 0.12s;
}
.feature-card:hover {
    transform: translate(-3px, -3px);
    box-shadow: 5px 5px 0 var(--text);
}
.fc-ic { font-size: 24px; margin-bottom: 6px; }
.feature-card h3 { font-size: 14px; margin: 4px 0 2px; }
.feature-card p { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

.welcome-cta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 22px;
    flex-wrap: wrap;
    border: 1px solid var(--text);
    background: var(--lime);
    padding: 24px 28px;
    margin-bottom: 24px;
}
.welcome-cta h2 { font-size: 20px; margin-bottom: 4px; }
.welcome-cta p { font-family: var(--mono); font-size: 13px; color: var(--text); max-width: 52ch; }
.welcome-cta-btns { display: flex; gap: 10px; flex-wrap: wrap; }

/* ═══════════════════════════════════════════════════
   FOOTER GLOBAL
   ═══════════════════════════════════════════════════ */

.site-footer {
    border: 1px solid var(--text);
    background: var(--surface);
    margin-top: 56px;
}
.sf-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    flex-wrap: wrap;
    padding: 26px 26px 22px;
    border-bottom: 1px solid var(--hair);
}
.sf-brand { display: flex; align-items: center; gap: 12px; }
.sf-mark {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    background: var(--text);
    color: #fff;
    font-family: var(--mono);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sf-brand strong { display: block; font-family: var(--mono); font-size: 14px; }
.sf-brand span { font-family: var(--mono); font-size: 11px; color: var(--text-muted); }
.sf-tagline {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--text-muted);
    max-width: 400px;
    line-height: 1.6;
}

.sf-secure {
    display: flex;
    gap: 16px;
    padding: 22px 26px;
    background: var(--text);
    color: #fff;
}
.sf-secure-icon { font-size: 26px; flex-shrink: 0; }
.sf-secure h3 { font-family: var(--mono); font-size: 14px; color: #fff; margin-bottom: 7px; }
.sf-secure p {
    font-family: var(--mono);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.75;
    max-width: 78ch;
}

.sf-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
}
.sf-col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
    padding: 22px 24px;
    border-right: 1px solid var(--hair);
    border-bottom: 1px solid var(--hair);
}
.sf-col h4 {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 700;
    color: var(--text-soft);
    letter-spacing: 0.04em;
    margin-bottom: 3px;
}
.sf-col a,
.sf-col button,
.sf-col span {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text);
    background: none;
    border: none;
    padding: 2px 0;
    margin: 0;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    line-height: 1.45;
}
.sf-col a:hover,
.sf-col button:hover { background: var(--lime); }
.sf-col span { color: var(--text-muted); cursor: default; }

.sf-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 26px;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.sf-status .online {
    background: var(--lime);
    color: var(--text);
    font-weight: 700;
    padding: 2px 8px;
    margin-left: 6px;
}

/* ═══════════════════════════════════════════════════
   STYLE QUENTINRENAUX.COM · BRUTALISTE ÉDITORIAL
   Noir & blanc, monospace, accent lime, angles nets.
   ═══════════════════════════════════════════════════ */

/* --- Titres : grotesque lourd en capitales --- */
h1, h2, h3, h4 {
    font-family: var(--font);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

/* --- TOPBAR --- */
.topbar {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 46px;
    padding: 0 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--text);
    position: sticky;
    top: 0;
    z-index: 60;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}
.topbar-id { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.topbar-id b { font-weight: 700; }
.topbar-status { display: inline-flex; align-items: center; flex-shrink: 0; }
.topbar-status .online {
    background: var(--lime);
    color: var(--text);
    font-weight: 700;
    padding: 3px 9px;
    margin-left: 8px;
}
.topbar-cmd { font-weight: 700; flex-shrink: 0; }
@media (max-width: 700px) {
    .topbar-status { display: none; }
}

/* --- SIDEBAR --- */
.brand { border-bottom: 1px solid var(--text); padding-bottom: 18px; }
.brand-mark {
    border-radius: 0;
    background: var(--text);
    color: #fff;
    font-family: var(--mono);
    font-weight: 700;
}
.brand-text strong { font-family: var(--mono); font-size: 13px; letter-spacing: -0.02em; }
.brand-text span { font-family: var(--mono); }

.nav-label { font-family: var(--mono); color: var(--text-soft); }
.nav-label::before { content: "// "; opacity: 0.6; }
.nav-item {
    border-radius: 0;
    font-family: var(--mono);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.03em;
    font-weight: 500;
}
.nav-item:hover { background: var(--surface-2); }
.nav-item.active { background: var(--text); color: #fff; }
.nav-item.highlight { background: var(--lime); color: var(--text); }
.nav-item.highlight:hover { background: var(--lime); opacity: 1; }
.nav-item.danger:hover { background: var(--surface-2); }

.sidebar-footer { border-top: 1px solid var(--text); }
.privacy-badge { font-family: var(--mono); font-size: 10px; letter-spacing: 0.02em; }
.privacy-badge .dot {
    border-radius: 0;
    width: 8px; height: 8px;
    background: var(--lime);
    box-shadow: none;
}

/* --- BOUTONS : [ COMMANDE ] --- */
.btn {
    border-radius: 0;
    font-family: var(--mono);
    text-transform: uppercase;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.05em;
    border: 1px solid var(--text);
    gap: 6px;
    padding: 11px 18px;
}
.btn::before { content: "["; opacity: 0.55; }
.btn::after  { content: "]"; opacity: 0.55; }
.btn-primary { background: var(--text); color: #fff; }
.btn-primary:hover { background: var(--lime); color: var(--text); transform: none; }
.btn-secondary { background: #fff; color: var(--text); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: #fff; color: var(--text); }
.btn-ghost:hover { background: var(--lime); }

/* --- PAGE HEADER --- */
.page-header h1 { font-size: 32px; font-weight: 900; line-height: 1.05; }
.page-header .lead { font-family: var(--mono); }

/* --- HERO --- */
.hero { border-bottom: 1px solid var(--text); padding-top: 36px; }
.term-file {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 22px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 26px;
}
.term-file b { color: var(--text); font-weight: 700; }
.term-file .k { color: var(--text-soft); }

.hero-tag {
    font-family: var(--mono);
    text-transform: uppercase;
    border-radius: 0;
    background: var(--text);
    color: #fff;
    letter-spacing: 0.05em;
    padding: 5px 10px;
}
.hero-tag::before { content: "[ "; }
.hero-tag::after  { content: " ]"; }

.hero h1 {
    font-size: clamp(40px, 6.5vw, 90px);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.045em;
    line-height: 0.9;
    margin: 22px 0 24px;
    max-width: none;
}
.hero .grad {
    background: none;
    -webkit-background-clip: border-box;
    background-clip: border-box;
    color: transparent;
    -webkit-text-stroke: 2px var(--text);
}
.hero-sub { font-family: var(--mono); font-size: 15px; color: var(--text); line-height: 1.7; }
.xmltag { color: var(--text-soft); }

/* --- CARTES --- */
.card {
    border: 1px solid var(--text);
    border-radius: 0;
    transition: transform 0.12s, box-shadow 0.12s;
}
.card:hover { transform: translate(-3px, -3px); box-shadow: 5px 5px 0 var(--text); }
.card-icon { border-radius: 0; background: var(--text); color: #fff; font-family: var(--mono); }
.card h3 { font-size: 15px; }
.card-link { font-family: var(--mono); text-transform: uppercase; font-size: 12px; }

.info-block { border: 1px solid var(--text); border-radius: 0; }
.info-block.dark { background: var(--text); border-color: var(--text); }
.info-block.dark a { color: var(--lime); }

/* --- EDU CARDS --- */
.edu-card {
    background: var(--surface-2);
    border: 1px solid var(--text);
    border-left: 5px solid var(--text);
    border-radius: 0;
}
.edu-card h3 { font-family: var(--mono); color: var(--text); }
.edu-card .tip { background: #fff; border: 1px solid var(--text); border-radius: 0; }
.edu-card .warning {
    background: var(--lime);
    border: 1px solid var(--text);
    border-radius: 0;
    color: var(--text);
}
.edu-grid strong { color: var(--text); }

/* --- DROPZONE --- */
.dropzone { border: 2px dashed var(--text); border-radius: 0; }
.dropzone:hover, .dropzone.drag-over { background: var(--lime); border-color: var(--text); }
.dropzone h2 { font-family: var(--font); font-weight: 900; }

/* --- META BANNER --- */
.meta-banner { background: var(--surface-2); border: 1px solid var(--text); border-radius: 0; }
.meta-label, .stat-label, .scan-dash-block h4,
.badge-pro, .data-table th { font-family: var(--mono); }
.meta-label-input { border-radius: 0; }

/* --- STATS --- */
.stat-card { border: 1px solid var(--text); border-radius: 0; background: #fff; }
.stat-card strong { font-family: var(--font); font-weight: 900; }
.stat-card.accent { background: var(--lime); }
.stat-card.warning, .stat-card.success, .stat-card.danger { background: var(--surface-2); }
.stat-card.accent strong, .stat-card.warning strong,
.stat-card.success strong, .stat-card.danger strong { color: var(--text); }

/* --- TABLEAUX --- */
.table-wrap { border: 1px solid var(--text); border-radius: 0; }
.data-table th { background: var(--text); color: #fff; }
.data-table td { border-bottom: 1px solid var(--hair); }
.data-table tr:hover td { background: var(--surface-2); }
.data-table .tag {
    border-radius: 0;
    border: 1px solid var(--text);
    background: #fff;
    color: var(--text);
}
.data-table .tag.success { background: var(--lime); color: var(--text); }
.data-table .user-link { color: var(--text); }

/* --- FILTRES / INPUTS --- */
.filters-bar { border: 1px solid var(--text); border-radius: 0; }
.input, .select { border: 1px solid var(--text); border-radius: 0; font-family: var(--mono); }
.input:focus, .select:focus { outline: 2px solid var(--text); outline-offset: -2px; }
.chip {
    border: 1px solid var(--text);
    border-radius: 0;
    font-family: var(--mono);
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 500;
}
.chip.active { background: var(--text); color: #fff; }
.sort-btn { border-radius: 0; border: 1px solid var(--text); font-family: var(--mono); }
.sort-btn.active { background: var(--text); color: #fff; }

/* --- LISTES --- */
.user-list, .feed-list, .thread-list {
    border: 1px solid var(--text);
    border-radius: 0;
}
.user-list .user-item, .feed-list li, .thread-list li {
    border-bottom: 1px solid var(--hair);
}
.user-list .user-item a { color: var(--text); }
.user-list .user-item .avatar, .conn-avatar { border-radius: 0; background: var(--text); }
.thread-list .count { color: var(--text); font-weight: 700; }
.tag.accent { background: var(--lime); color: var(--text); border-radius: 0; }
.user-list .more { background: var(--surface-2); }

/* --- CONNECTIONS --- */
.conn-card { border: 1px solid var(--text); border-radius: 0; }
.conn-card:hover {
    background: var(--surface-2);
    transform: translate(-2px, -2px);
    box-shadow: 3px 3px 0 var(--text);
}
.conn-insights .insight { border-bottom: 1px solid var(--hair); }

/* --- PILLS / BADGES --- */
.pill { border-radius: 0; font-family: var(--mono); border: 1px solid var(--text); }
.pill-mutual, .pill-notback { background: #fff; color: var(--text); }
.pill-fan { background: var(--lime); color: var(--text); }
.badge-pro { border-radius: 0; background: var(--lime); color: var(--text); font-family: var(--mono); }
.tag-blocked, .user-label {
    border-radius: 0;
    border: 1px solid var(--text);
    background: #fff;
    color: var(--text);
}

/* --- TAG CLOUD --- */
.tag-cloud .tag { border-radius: 0; border: 1px solid var(--text); }
.tag-cloud .tag:hover { background: var(--lime); border-color: var(--text); transform: none; }

/* --- ALERTES --- */
.alert {
    border-radius: 0;
    border: 1px solid var(--text);
    border-left: 5px solid var(--text);
    background: var(--surface-2);
    color: var(--text);
}

/* --- EMPTY STATE --- */
.empty-state { border: 2px dashed var(--text); border-radius: 0; }

/* --- PROGRESS / SCAN --- */
.progress-bar { border-radius: 0; border: 1px solid var(--text); background: #fff; }
.progress-fill { border-radius: 0; background: var(--lime); }
.scan-dashboard, .scan-status { border: 1px solid var(--text); border-radius: 0; }
.scan-dash-block { border: 1px solid var(--text); border-radius: 0; background: var(--surface-2); }
.muted-num { border-radius: 0; background: var(--lime); color: var(--text); }
.log-details summary { border-radius: 0; border: 1px solid var(--text); }
.console, .debug-pre { border-radius: 0; }

/* --- ILLUSTRATION DOSSIER --- */
.folder-illustration { border: 1px solid var(--text); border-radius: 0; }
.folder-row.root { background: var(--surface-2); }
.folder-tag { border-radius: 0; background: var(--text); color: #fff; font-weight: 700; }

/* --- SNAPSHOTS --- */
.snap-card { border: 1px solid var(--text); border-radius: 0; }
.snap-card.active { border-width: 2px; background: var(--lime); }
.btn-mini { border-radius: 0; border: 1px solid var(--text); font-family: var(--mono); }
.diff-up { background: var(--lime); color: var(--text); padding: 0 5px; font-weight: 700; }
.diff-down { color: var(--text); font-weight: 700; }

/* --- SHARE MODAL --- */
.share-modal-content {
    border-radius: 0;
    border: 1px solid var(--text);
    box-shadow: 10px 10px 0 var(--text);
}
.share-modal-content textarea { border-radius: 0; }
.btn-share, .btn-label { border-radius: 0; }

/* --- DIAGNOSTIC --- */
.diag-card { border: 1px solid var(--text); border-left: 5px solid var(--text); border-radius: 0; }
.diag-stats, .diag-folder-list, .diag-suggestion { border-radius: 0; }

/* --- FOOTER --- */
.page-footer { font-family: var(--mono); border-top: 1px solid var(--text); }
.page-footer::before {
    content: "// EOF";
    display: block;
    color: var(--text-soft);
    margin-bottom: 8px;
    letter-spacing: 0.08em;
}
.page-footer a { color: var(--text); }

/* --- ARTICLES LIÉS --- */
.articles-section { margin-bottom: 28px; }
.section-label {
    font-family: var(--mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-soft);
    margin-bottom: 4px;
}
.section-label::before { content: "// "; }
.articles-section > h2 { font-size: 26px; margin-bottom: 18px; }

.article-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--text);
    padding: 22px 24px;
    text-decoration: none;
    color: var(--text);
    background: #fff;
    transition: transform 0.12s, box-shadow 0.12s;
}
.article-card:hover {
    text-decoration: none;
    transform: translate(-3px, -3px);
    box-shadow: 5px 5px 0 var(--text);
}
.article-card h3 { font-size: 16px; margin: 12px 0 8px; line-height: 1.2; }
.article-card p { color: var(--text-muted); font-size: 13px; flex: 1; }
.ac-tag-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.ac-tag {
    align-self: flex-start;
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: var(--text);
    color: #fff;
    padding: 3px 8px;
}
.ac-tag-lime { background: var(--lime); color: var(--text); }
.ac-file {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.ac-link {
    align-self: flex-start;
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 14px;
}
.article-card:hover .ac-link { background: var(--lime); }

.article-card-feat { margin-bottom: 14px; }
.article-card-feat h3 { font-size: 23px; margin-top: 16px; }
.article-card-feat p { font-size: 14px; max-width: 74ch; }

.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(238px, 1fr));
    gap: 14px;
}

/* --- MESSAGES : conversations mieux rangées --- */
.thread-list li {
    display: grid;
    grid-template-columns: 44px 1fr auto 30px;
    grid-template-areas:
        "rank title count share"
        "rank range range share";
    column-gap: 12px;
    row-gap: 2px;
    align-items: start;
    padding: 11px 16px;
}
.thread-list .rank {
    grid-area: rank;
    width: auto;
    font-family: var(--mono);
    font-weight: 700;
    color: var(--text-soft);
    font-size: 12px;
    padding-top: 1px;
}
.thread-list .thread-title-wrap { grid-area: title; }
.thread-list .thread-title { font-weight: 600; line-height: 1.35; }
.thread-list .thread-sub { margin-top: 3px; }
.thread-list .count {
    grid-area: count;
    font-family: var(--mono);
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    text-align: right;
}
.thread-list .range {
    grid-area: range;
    margin-left: 0;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-muted);
}
.thread-list .btn-share,
.thread-list .btn-share-placeholder { grid-area: share; align-self: start; }
.thread-list .empty-list { display: block; padding: 20px; text-align: center; color: var(--text-muted); }

/* Section repliée : conversations masquées par Instagram */
.msg-anon-section {
    border: 1px solid var(--text);
    margin-top: 22px;
}
.msg-anon-section > summary {
    cursor: pointer;
    list-style: none;
    padding: 13px 16px;
    background: var(--surface-2);
    font-family: var(--mono);
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.msg-anon-section > summary::-webkit-details-marker { display: none; }
.msg-anon-section > summary::before { content: "\25B8  "; }
.msg-anon-section[open] > summary { content: ""; border-bottom: 1px solid var(--text); }
.msg-anon-section[open] > summary::before { content: "\25BE  "; }
.msg-anon-intro {
    margin: 0;
    padding: 12px 16px;
    font-size: 12px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--hair);
}
.msg-anon-section .thread-list { border: none; }

@media (max-width: 640px) {
    .thread-list li {
        grid-template-columns: 34px 1fr auto;
        grid-template-areas:
            "rank title share"
            "rank count share"
            "rank range range";
        column-gap: 10px;
    }
    .thread-list .count { text-align: left; }
}

/* --- PAGE DEBUG : rapport de diagnostic --- */
.diag-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    border: 1px solid var(--text);
    background: var(--surface-2);
    padding: 12px 16px;
    margin-bottom: 16px;
}
.diag-summary-line { display: flex; gap: 8px; flex-wrap: wrap; }
.diag-pill {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 4px 10px;
    border: 1px solid var(--text);
}
.diag-pill-ok { background: var(--lime); color: var(--text); }
.diag-pill-warn { background: #fff; color: var(--text); }
.diag-pill-fail { background: var(--text); color: #fff; }

.diag-block { border: 1px solid var(--text); margin-bottom: 14px; }
.diag-block.is-fail { border-width: 2px; }
.diag-block-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    background: var(--text);
    color: #fff;
}
.diag-name {
    font-family: var(--mono);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 14px;
}
.diag-count { font-family: var(--mono); font-size: 11px; color: var(--text-soft); }
.diag-status {
    margin-left: auto;
    font-family: var(--mono);
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.1em;
    padding: 3px 11px;
}
.diag-status-ok   { background: var(--lime); color: var(--text); }
.diag-status-warn { background: transparent; color: #fff; box-shadow: inset 0 0 0 1px #fff; }
.diag-status-fail { background: #fff; color: var(--text); }

.diag-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.diag-metrics > div {
    padding: 12px 16px;
    border-right: 1px solid var(--hair);
    border-bottom: 1px solid var(--hair);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.dm-k {
    font-family: var(--mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-soft);
}
.dm-v { font-family: var(--mono); font-size: 22px; font-weight: 700; line-height: 1; }

.diag-flag {
    margin: 14px 16px 0;
    padding: 10px 13px;
    border: 1px solid var(--text);
    border-left: 5px solid var(--text);
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.5;
}
.diag-kv { padding: 8px 16px; }
.diag-kv > div {
    display: flex;
    gap: 14px;
    padding: 7px 0;
    border-bottom: 1px solid var(--hair);
}
.diag-kv > div:last-child { border-bottom: none; }
.kv-k {
    font-family: var(--mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-soft);
    min-width: 150px;
    flex-shrink: 0;
    padding-top: 3px;
}
.kv-v { font-family: var(--mono); font-size: 12px; word-break: break-word; }
code.kv-v { background: var(--surface-2); border: 1px solid var(--hair); padding: 2px 6px; }
code.kv-v.is-null { background: var(--text); color: #fff; border-color: var(--text); }

.diag-block details { margin: 0 16px 14px; }
.diag-block details:first-of-type { margin-top: 14px; }
.diag-block details summary {
    cursor: pointer;
    font-family: var(--mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 7px 0;
    color: var(--text-muted);
}
.diag-block details[open] summary { color: var(--text); }

/* ═══════════════════════════════════════════════════
   RESPONSIVE · MOBILE  (en fin de fichier = priorité max)
   ═══════════════════════════════════════════════════ */

@media (max-width: 900px) {
    #app { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; }
    .sidebar { display: none; }
    .subnav { display: flex; }
    .subnav.subnav-empty { display: none; }
    .bottombar { display: flex; }

    .main { padding: 18px 14px 108px; max-width: 100%; }

    .page-header { margin-bottom: 20px; }
    .page-header h1 { font-size: 22px; }
    .page-header .lead { font-size: 14px; }

    .hero { padding-top: 20px; padding-bottom: 28px; margin-bottom: 28px; }
    .hero h1 { font-size: clamp(32px, 11vw, 54px); }
    .hero-sub { font-size: 14px; }
    .hero-cta { width: 100%; }
    .hero-cta .btn { flex: 1 1 44%; justify-content: center; }

    .edu-card, .info-block { padding: 18px 16px; }
    .card { padding: 20px; }

    .stats-row { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
    .stat-card { padding: 14px; }
    .stat-card strong { font-size: 21px; }

    .conn-grid { grid-template-columns: 1fr; }
    .feature-grid { grid-template-columns: 1fr 1fr; }

    .filters-bar { gap: 8px; padding: 12px; }
    .filters-bar .input,
    .filters-bar .select { flex: 1 1 100%; min-width: 0; }
    .filter-chips { width: 100%; }
    .sort-btns { width: 100%; }

    .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .data-table { min-width: 440px; }

    .btn { padding: 13px 18px; }

    .snapshot-zones { grid-template-columns: 1fr; }
    .snapshot-arrow { transform: rotate(90deg); }

    .articles-section > h2 { font-size: 20px; }
    .article-card-feat h3 { font-size: 18px; }

    .welcome-cta { flex-direction: column; align-items: flex-start; padding: 20px 18px; }
    .site-footer { margin-top: 36px; }
    .sf-top { padding: 22px 18px 18px; }
    .sf-secure { flex-direction: column; gap: 10px; padding: 20px 18px; }
    .sf-cols { grid-template-columns: 1fr 1fr; }
    .sf-bottom { padding: 14px 18px; }
}

@media (max-width: 440px) {
    .feature-grid { grid-template-columns: 1fr; }
    .sf-cols { grid-template-columns: 1fr; }
    .topbar { padding: 0 12px; font-size: 10px; }
    .page-header h1 { font-size: 20px; }
    .hero-cta .btn { flex: 1 1 100%; }
}
