/* TechBros.Space */
:root {
    --bg: #0b0d10;
    --surface: #12161b;
    --surface-2: #181d24;
    --border: #232a33;
    --text: #e8ecf1;
    --muted: #9aa5b1;
    --accent: #22d3ee;
    --accent-ink: #04222a;
    --danger: #f87171;
    --ok: #4ade80;
    --radius: 10px;
    --max: 1120px;
}

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

html { font-size: 16px; scroll-behavior: smooth; scroll-padding-top: 76px; }

body {
    font-family: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: none; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }

.skip-link { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 6px; z-index: 200; }
.skip-link:focus { left: 8px; }

/* Header */
.header { position: sticky; top: 0; z-index: 100; background: rgba(11, 13, 16, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; letter-spacing: 0.04em; font-size: 1rem; }
.brand:hover { text-decoration: none; }
.brand img { width: 30px; height: 30px; border-radius: 6px; }
.nav-menu { display: flex; align-items: center; gap: 28px; }
.nav-menu a { color: var(--muted); font-size: 0.95rem; }
.nav-menu a:hover { color: var(--text); text-decoration: none; }
.menu-toggle { display: none; background: none; border: 1px solid var(--border); color: var(--text); width: 42px; height: 42px; border-radius: 8px; cursor: pointer; align-items: center; justify-content: center; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600; font-size: 0.95rem; padding: 12px 22px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: background 0.15s, border-color 0.15s; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover, #67e3f5); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--muted); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn-sm { padding: 8px 16px; font-size: 0.88rem; }

/* Hero */
.hero { padding: clamp(64px, 12vw, 128px) 0 clamp(48px, 8vw, 88px); border-bottom: 1px solid var(--border); }
.eyebrow { font-family: "Space Mono", monospace; font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 18px; }
.hero h1 { font-size: clamp(2.1rem, 5.5vw, 3.8rem); line-height: 1.1; font-weight: 700; max-width: 18ch; letter-spacing: -0.02em; }
.hero p.lead { margin-top: 22px; color: var(--muted); font-size: clamp(1.02rem, 2vw, 1.2rem); max-width: 56ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* Sections */
.section { padding: clamp(56px, 9vw, 96px) 0; border-bottom: 1px solid var(--border); }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head h2 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); line-height: 1.2; letter-spacing: -0.01em; }
.section-head p { margin-top: 12px; color: var(--muted); }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); align-items: stretch; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.card h3 { font-size: 1.1rem; margin: 14px 0 8px; }
.card p { color: var(--muted); font-size: 0.95rem; }
.icon { width: 28px; height: 28px; color: var(--accent); stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.steps { counter-reset: step; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.steps li { counter-increment: step; border-top: 2px solid var(--accent); padding-top: 14px; }
.steps li::before { content: "0" counter(step); font-family: "Space Mono", monospace; color: var(--accent); font-size: 0.85rem; }
.steps h3 { font-size: 1.05rem; margin: 6px 0; }
.steps p { color: var(--muted); font-size: 0.95rem; }

.about-grid { display: grid; gap: 40px; grid-template-columns: 1.4fr 1fr; align-items: start; }
.about-grid p { color: var(--muted); margin-bottom: 16px; }
.facts { display: grid; gap: 12px; }
.fact { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; }
.fact strong { display: block; font-size: 1.05rem; }
.fact span { color: var(--muted); font-size: 0.9rem; }

.banner { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(24px, 5vw, 44px); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.banner h2 { font-size: clamp(1.3rem, 3vw, 1.8rem); max-width: 28ch; }
.banner p { color: var(--muted); margin-top: 8px; max-width: 52ch; }

/* Forms */
.form { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.field > label, .fieldset legend { font-weight: 600; font-size: 0.95rem; }
.hint { color: var(--muted); font-size: 0.85rem; font-weight: 400; }
input[type="text"], input[type="email"], input[type="tel"], select, textarea {
    width: 100%; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 11px 13px;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.fieldset { border: 0; display: grid; gap: 10px; }
.fieldset legend { margin-bottom: 8px; }
.options { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.option { display: flex; align-items: flex-start; gap: 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 11px 13px; cursor: pointer; font-size: 0.95rem; }
.option:hover { border-color: var(--muted); }
.option input { margin-top: 4px; accent-color: var(--accent); }
.option:has(input:checked) { border-color: var(--accent); background: var(--surface-2); }
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.scale .option { justify-content: center; }
.scale-legend { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.82rem; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-msg { padding: 12px 14px; border-radius: 8px; font-size: 0.95rem; display: none; }
.form-msg.show { display: block; }
.form-msg.ok { background: rgba(74, 222, 128, 0.1); border: 1px solid var(--ok); color: var(--ok); }
.form-msg.err { background: rgba(248, 113, 113, 0.1); border: 1px solid var(--danger); color: var(--danger); }
.field-error { color: var(--danger); font-size: 0.85rem; }

/* Survey */
.survey-wrap { max-width: 760px; margin: 0 auto; padding: clamp(32px, 6vw, 64px) 20px 80px; }
.survey-wrap h1 { font-size: clamp(1.8rem, 4.5vw, 2.6rem); line-height: 1.15; letter-spacing: -0.01em; }
.survey-wrap > p { color: var(--muted); margin-top: 12px; }
.progress { margin: 28px 0 8px; height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.progress > div { height: 100%; width: 0; background: var(--accent); }
.progress-label { font-family: "Space Mono", monospace; font-size: 0.8rem; color: var(--muted); margin-bottom: 24px; }
.step { display: none; }
.step.active { display: grid; gap: 22px; }
.step h2 { font-size: 1.3rem; }
.step-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; }
.thanks { display: none; text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }
.thanks.show { display: block; }
.thanks h2 { margin-bottom: 10px; }
.thanks p { color: var(--muted); margin-bottom: 18px; }

/* Footer */
.footer { padding: 40px 0; color: var(--muted); font-size: 0.9rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; }
.footer a { color: var(--muted); text-decoration: underline; }
.footer a:hover { color: var(--text); }
.footer ul { display: grid; gap: 4px; }
.footer .brand { margin-bottom: 8px; }

/* Legal */
.legal { max-width: 860px; margin: 0 auto; padding: clamp(32px, 6vw, 64px) 20px; }
.legal h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); line-height: 1.2; }
.legal .updated { color: var(--muted); font-size: 0.85rem; margin: 10px 0 32px; }
.legal-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(20px, 4vw, 32px); margin-bottom: 20px; }
.legal-card h2 { font-size: 1.35rem; margin-bottom: 16px; }
.legal-card h3 { font-size: 1.02rem; margin: 22px 0 8px; }
.legal-card h3:first-of-type { margin-top: 0; }
.legal-card p, .legal-card li { color: var(--muted); font-size: 0.97rem; }
.legal-card ul { list-style: disc; margin: 0 0 12px 20px; }
.legal-card li { margin-bottom: 6px; }

@media (max-width: 760px) {
    .menu-toggle { display: inline-flex; }
    .nav-menu { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--bg); border-bottom: 1px solid var(--border); padding: 8px 20px 16px; }
    .nav-menu.open { display: flex; }
    .nav-menu li a { display: block; padding: 12px 0; }
    .about-grid { grid-template-columns: 1fr; }
    .scale { grid-template-columns: repeat(5, 1fr); gap: 4px; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Admin */
.admin { padding-top: 40px; padding-bottom: 80px; }
.admin h1 { font-size: 1.6rem; margin-bottom: 16px; }
.admin h2 { font-size: 1.2rem; margin: 36px 0 12px; }
.admin-box { max-width: 420px; margin: 40px auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }
.admin-box .hint { margin-bottom: 16px; }
.admin-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin: 16px 0 24px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.kpi strong { display: block; font-size: 1.8rem; }
.kpi span { color: var(--muted); font-size: 0.85rem; }
.chart h3 { font-size: 0.95rem; margin-bottom: 12px; }
.bar-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: 0.85rem; margin-bottom: 8px; }
.bar-row .track { grid-column: 1 / -1; height: 6px; background: var(--surface-2); border-radius: 3px; }
.bar-row .fill { height: 100%; background: var(--accent); border-radius: 3px; }
.list { display: grid; gap: 10px; }
.item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; font-size: 0.92rem; }
.item .meta { color: var(--muted); font-size: 0.8rem; margin-bottom: 6px; }
.item p { white-space: pre-wrap; overflow-wrap: anywhere; }
.item .btn { margin-top: 10px; }
.empty { color: var(--muted); }
[hidden] { display: none !important; }

/* Fixes and SEO pages */
ol, ul { list-style: none; }
.nav-menu a.btn-primary { color: var(--accent-ink); }
.nav-menu a.btn-primary:hover { color: var(--accent-ink); }
.crumbs { font-size: 0.85rem; color: var(--muted); margin-bottom: 18px; }
.crumbs a { color: var(--muted); text-decoration: underline; }
.prose { max-width: 760px; }
.prose h2 { font-size: clamp(1.35rem, 3vw, 1.8rem); margin: 40px 0 12px; line-height: 1.25; }
.prose p { color: var(--muted); margin-bottom: 14px; }
.prose ul { list-style: disc; margin: 0 0 16px 22px; color: var(--muted); }
.prose li { margin-bottom: 6px; }
.faq details { border-top: 1px solid var(--border); padding: 16px 0; }
.faq details:last-child { border-bottom: 1px solid var(--border); }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { color: var(--muted); margin-top: 10px; }
.card a.more { display: inline-block; margin-top: 12px; font-size: 0.9rem; }
.page-title { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.12; letter-spacing: -0.02em; }

.lead-text { color: var(--muted); max-width: 60ch; margin: 12px 0 32px; }
.projects { margin-bottom: 32px; }
.projects .eyebrow { margin-bottom: 8px; }
.cta-line { margin-top: 8px; }
.project-form { max-width: 560px; margin-bottom: 20px; }

/* Admin console and tester portal */
.nav-user { display: flex; align-items: center; gap: 12px; min-width: 0; }
.nav-user .hint { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 38vw; }
.narrow { max-width: 760px; margin: 0 auto; }
.tabs { display: flex; gap: 4px; overflow-x: auto; overflow-y: hidden; border-bottom: 1px solid var(--border); margin-bottom: 24px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: 0 0 auto; padding: 12px 16px; color: var(--muted); font-weight: 600; font-size: 0.95rem; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.subtabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 20px; }
.subtab { font: inherit; font-size: 0.9rem; font-weight: 600; background: var(--surface); color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 8px 16px; cursor: pointer; }
.subtab.active { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.admin h1 { overflow-wrap: anywhere; }
.admin .card h2 { margin-top: 0; }
.admin .card + .card, .admin .card + .list, .admin .list + .card { margin-top: 16px; }
.admin .card h3 { margin: 18px 0 6px; }
.badge { display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.badge.ok { color: var(--ok); border-color: var(--ok); }
.badge.warn { color: var(--warn, #fbbf24); border-color: var(--warn, #fbbf24); }
.badge.bad { color: var(--danger); border-color: var(--danger); }
.badge.info { color: var(--accent); border-color: var(--accent); }
.item-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 4px; }
.item-head h2 { font-size: 1.15rem; margin: 0; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.item .row-actions .btn, .item > .btn { margin-top: 0; }
.item.done { opacity: 0.7; }
.mail-row { display: grid; gap: 4px; width: 100%; text-align: left; font: inherit; color: var(--text); cursor: pointer; }
.mail-row:hover { border-color: var(--muted); }
.mail-row.unread strong { color: var(--accent); }
.mail-text, .pre { white-space: pre-wrap; overflow-wrap: anywhere; font-family: inherit; color: var(--text); margin: 12px 0; }
.pre.secret { font-family: "Space Mono", monospace; font-size: 0.85rem; background: var(--bg); border: 1px dashed var(--border); border-radius: 8px; padding: 10px 12px; }
.kpi { text-align: left; font: inherit; color: var(--text); }
button.kpi { cursor: pointer; }
button.kpi:hover { border-color: var(--muted); }
.filters { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: end; margin-bottom: 16px; }
.comment { border-left: 3px solid var(--border); padding: 4px 0 4px 12px; margin: 12px 0; }
.comment.admin { border-left-color: var(--accent); }
.linkbox { display: grid; gap: 8px; margin-top: 12px; padding: 12px; border: 1px solid var(--accent); border-radius: var(--radius); background: var(--surface-2); }
.linkbox input { font-family: "Space Mono", monospace; font-size: 0.8rem; }
.nda { max-height: 320px; overflow-y: auto; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 16px; font-size: 0.92rem; }
.nda h3 { font-size: 1.05rem; margin-bottom: 8px; }
.nda h4 { font-size: 0.95rem; margin: 14px 0 4px; }
.nda p { color: var(--muted); margin-bottom: 8px; }
.qr { width: 220px; height: 220px; margin: 16px auto; background: #fff; border-radius: 10px; padding: 6px; }
.qr img { width: 100%; height: 100%; }
.secret { display: block; font-family: "Space Mono", monospace; word-break: break-all; padding: 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; }
.manual { margin: 8px 0 16px; color: var(--muted); font-size: 0.9rem; }
.manual summary { cursor: pointer; }
.code-input { font-family: "Space Mono", monospace; font-size: 1.4rem !important; letter-spacing: 0.2em; text-align: center; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 16px 0; }
.codes li { font-family: "Space Mono", monospace; text-align: center; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px; letter-spacing: 0.1em; }
input[type="number"], input[type="password"] { width: 100%; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 11px 13px; }
input[readonly] { opacity: 0.8; }
.compose textarea { min-height: 220px; }
.project-card .btn { margin-top: 0; }

@media (max-width: 760px) {
    .admin { padding-top: 24px; }
    .admin-box { margin: 16px auto; padding: 20px; }
    .nav-user .hint { display: none; }
    .kpis { grid-template-columns: repeat(2, 1fr); }
    .filters { grid-template-columns: 1fr; }
    .row-actions .btn { flex: 1 1 auto; }
    .codes { grid-template-columns: 1fr; }
    .tab { padding: 10px 12px; font-size: 0.9rem; }
}
@media (max-width: 380px) { .kpis { grid-template-columns: 1fr; } }

/* Framed tester viewer (beta portal) */
body.viewer-open { overflow: hidden; }
.viewer { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; background: var(--bg); }
.viewer-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 14px; background: var(--surface); border-bottom: 2px solid var(--accent); flex-wrap: wrap; }
.viewer-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.viewer-tag { background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 11px; letter-spacing: .08em; padding: 3px 8px; border-radius: 6px; }
.viewer-note { color: var(--muted); font-size: 12px; }
.viewer-right { display: flex; align-items: center; gap: 12px; }
.viewer-time { font-family: "Space Mono", monospace; font-size: 14px; color: var(--text); }
.viewer-time.low { color: var(--danger); }
.viewer-stage { position: relative; flex: 1; min-height: 0; }
.viewer-frame { width: 100%; height: 100%; border: 0; background: #fff; display: block; }
.viewer-mark { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 2; }
.viewer-mark::before { content: var(--mark); position: absolute; inset: -50%; transform: rotate(-28deg); color: #808080; opacity: .16; font-size: 15px; font-weight: 700; line-height: 5.2; letter-spacing: .08em; white-space: pre-wrap; text-align: center; }
.viewer-mark::after { content: attr(data-who) " | TESTEUR | CONFIDENTIEL"; position: absolute; right: 10px; bottom: 8px; font-size: 11px; color: #000; opacity: 1; background: rgba(255,255,255,.55); padding: 2px 6px; border-radius: 4px; }
.viewer-ended { margin: auto; max-width: 420px; text-align: center; padding: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
@media (max-width: 640px) { .viewer-note { display: none; } }

/* Export du sondage */
.check { align-items: center; color: var(--muted); display: flex; font-size: 0.92rem; gap: 8px; margin: 12px 0; }
.check input { height: 18px; width: 18px; }

/* Guide du testeur */
.guide { max-width: 900px; }
.guide-section { margin: 28px 0; }
.guide-section h2 { margin-bottom: 10px; }
.guide-section h3 { margin: 18px 0 8px; }
.guide-section p { color: var(--muted); line-height: 1.6; margin: 0 0 12px; }
.guide-list { color: var(--muted); display: grid; gap: 8px; line-height: 1.55; margin: 0 0 12px; padding-left: 22px; }
ul.guide-list { list-style: disc; }
ol.guide-list { list-style: decimal; }
.guide .card h3 { margin-top: 0; }
.viewer-report { background: var(--surface); border-left: 2px solid var(--accent); bottom: 0; box-shadow: -8px 0 24px rgba(0,0,0,.35); max-width: 440px; overflow-y: auto; padding: 18px; position: absolute; right: 0; top: 0; width: 100%; z-index: 5; }
.viewer-report[hidden] { display: none; }
.viewer-report h2 { margin: 0 0 6px; }
.viewer-report .narrow { max-width: none; }
.viewer-thanks { background: var(--accent); border-radius: var(--radius); bottom: 16px; color: var(--accent-ink); font-weight: 600; left: 16px; padding: 12px 16px; position: absolute; right: 16px; z-index: 6; }
@media (max-width: 640px) { .viewer-report { border-left: 0; border-top: 2px solid var(--accent); box-shadow: 0 -8px 24px rgba(0,0,0,.35); max-width: none; top: 18%; } }

.viewer-shield { align-items: center; background: #000; color: #9a9a9a; display: flex; inset: 0; justify-content: center; padding: 24px; position: absolute; text-align: center; z-index: 10; }
.viewer-shield[hidden] { display: none; }
.viewer, .viewer * { -webkit-user-select: none; user-select: none; }
.viewer input, .viewer textarea { -webkit-user-select: text; user-select: text; }
@media print { body.viewer-open * { visibility: hidden !important; } body.viewer-open::after { content: "Impression impossible pendant une session de test."; visibility: visible; position: fixed; inset: 0; background: #fff; color: #000; display: flex; align-items: center; justify-content: center; } }

/* Carte des sites (admin) */
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { margin-left: 11px; padding-left: 18px; border-left: 2px dashed var(--border); }
.tree li { position: relative; }
.tree ul > li::before { content: ""; position: absolute; left: -18px; top: 22px; width: 14px; border-top: 2px dashed var(--border); }
.tree summary { align-items: center; cursor: pointer; display: flex; gap: 10px; list-style: none; min-height: 44px; padding: 4px 6px; border-radius: 8px; }
.tree summary::-webkit-details-marker { display: none; }
.tree summary:hover { background: var(--surface-2); }
.tree-main { align-items: center; display: flex; flex: 1; flex-wrap: wrap; gap: 4px 10px; min-width: 0; }
.tree-host { color: var(--text); font-family: "Space Mono", monospace; font-weight: 700; overflow-wrap: anywhere; }
.tree-host:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.tree-kind { background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; color: var(--accent); font-size: 0.72rem; font-weight: 700; padding: 1px 9px; }
.tree-meta { color: var(--muted); flex: none; font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.tree-dot { background: var(--danger); border-radius: 50%; flex: none; height: 12px; width: 12px; }
.tree-dot[data-state="up"] { background: var(--ok); }
.tree-dot[data-state="unknown"] { background: var(--muted); }
.tree-blurb { color: var(--muted); font-size: 0.88rem; margin: 0 0 6px 28px; }
.tree-page a { align-items: baseline; border-radius: 8px; display: flex; flex-wrap: wrap; gap: 4px 12px; min-height: 40px; padding: 8px; }
.tree-page a:hover { background: var(--surface-2); }
.tree-page code { color: var(--accent); font-family: "Space Mono", monospace; font-weight: 700; overflow-wrap: anywhere; }
.tree-page span { color: var(--muted); font-size: 0.85rem; }
button.kpi { color: inherit; cursor: pointer; font: inherit; text-align: left; }
button.kpi:hover { border-color: var(--accent); }
@media (max-width: 600px) { .tree ul { margin-left: 5px; padding-left: 12px; } .tree ul > li::before { left: -12px; width: 9px; } .tree-meta { display: none; } }

/* Admin sur téléphone et en application installée */
.header { padding-top: env(safe-area-inset-top); }
@media (max-width: 760px) {
    .admin .btn, .admin .tab, .tabs a { min-height: 44px; }
    .tabs { position: sticky; top: 0; z-index: 20; background: var(--bg); padding-bottom: 2px; margin-bottom: 18px; }
    .admin { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
}
@media (display-mode: standalone) { body { overscroll-behavior-y: none; } }

/* Formation des testeurs */
.training-progress { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; height: 10px; overflow: hidden; }
.training-fill { background: var(--accent); height: 100%; transition: width .3s; width: 0; }
.training-module { margin-top: 12px; }
.training-module summary { cursor: pointer; font-weight: 600; min-height: 28px; }
.training-module[open] summary { margin-bottom: 12px; }
.training-check { color: var(--ok); font-size: 0.85rem; margin-left: 8px; }
.quiz-q { border: 0; margin: 0 0 18px; padding: 0; display: grid; gap: 8px; }
.quiz-q legend { font-weight: 600; margin-bottom: 8px; padding: 0; }

/* Espace testeurs sur téléphone et installé : zones sûres, hauteur réelle, barre de session compacte */
.viewer { height: 100vh; height: 100dvh; padding-bottom: env(safe-area-inset-bottom); }
.viewer-bar { padding-top: calc(8px + env(safe-area-inset-top)); padding-left: calc(14px + env(safe-area-inset-left)); padding-right: calc(14px + env(safe-area-inset-right)); }
@media (max-width: 640px) {
    .viewer-bar { gap: 6px; padding-bottom: 6px; }
    .viewer-tag { display: none; }
    .viewer-right { gap: 8px; }
    .viewer-bar .btn { min-height: 44px; }
    .viewer-mark::after { font-size: 9px; }
}
@media (display-mode: standalone) { .header { padding-top: env(safe-area-inset-top); } }

/* Cartes d'une même grille : même taille, même ligne de départ (pas de marge ajoutée par « .card + .card »), carte seule à taille normale */
.admin .grid > .card, .admin .grid > article { margin-top: 0; height: 100%; }
.project-card { display: flex; flex-direction: column; }
.project-card .row-actions { margin-top: auto; padding-top: 12px; }
.report-sent { background: rgba(74, 222, 128, 0.1); border: 1px solid var(--ok); border-radius: var(--radius); color: var(--ok); margin-bottom: 16px; padding: 12px 14px; }

/* Schémas de la Formation */
.illus { display: block; width: 100%; max-width: 460px; height: auto; margin: 4px auto 16px; background: var(--surface-2, var(--surface)); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; }
.illus-box { fill: var(--surface); stroke: var(--border); stroke-width: 1.5; }
.illus-accent { fill: rgba(34, 211, 238, 0.14); stroke: var(--accent); stroke-width: 1.5; }
.illus-phone { fill: var(--bg); stroke: var(--muted); }
.illus-screen { fill: var(--surface); stroke: none; }
.illus-dot { fill: var(--muted); }
.illus-line { stroke: var(--muted); stroke-width: 1.8; fill: none; }
.illus-line-d { stroke: var(--text); stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.illus-line-fill { fill: var(--muted); opacity: .5; }
.illus-fill { fill: var(--muted); }
.illus-check { stroke: var(--ok); stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.illus-no { stroke: var(--danger); stroke-width: 3; stroke-linecap: round; }
.illus-t { fill: var(--text); font-family: inherit; }
.illus-strong { font-weight: 700; fill: var(--accent); }

/* Espace testeurs : icônes des onglets, et sur téléphone une barre de navigation fixe en bas (comme Uber ou Yango) */
.tab { display: inline-flex; align-items: center; gap: 8px; position: relative; }
.tab-icon { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab-short { display: none; }
.tab-dot { background: var(--danger); border-radius: 50%; height: 8px; width: 8px; }
@media (max-width: 760px) {
    .beta-app .tabs { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; margin: 0; overflow: visible; background: var(--nav-bg, rgba(11, 13, 16, 0.96)); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-top: 1px solid var(--border); border-bottom: 0; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
    .beta-app .tabs:has(.tab:nth-child(4):last-child) { grid-template-columns: repeat(4, 1fr); }
    .beta-app .tab { flex-direction: column; justify-content: center; gap: 3px; min-height: 54px; padding: 6px 2px; margin: 0; border: 0; border-radius: 12px; font-size: 11px; font-weight: 600; }
    .beta-app .tab .tab-icon { height: 24px; width: 24px; }
    .beta-app .tab-full { display: none; }
    .beta-app .tab-short { display: block; line-height: 1.1; }
    .beta-app .tab.active { background: rgba(34, 211, 238, 0.12); border: 0; color: var(--accent); }
    .beta-app .tab-dot { position: absolute; right: 22%; top: 6px; }
    .beta-app .admin { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
    body.viewer-open .tabs { display: none; }
}

/* Thème de l'espace testeurs : suit le réglage du téléphone (sombre par défaut, clair si l'appareil est en mode clair) */
.beta-app { color-scheme: dark light; }
@media (prefers-color-scheme: light) {
    .beta-app {
        --bg: #f4f6f8; --surface: #ffffff; --surface-2: #eaeef2; --border: #d3dae2;
        --text: #12161b; --muted: #556070;
        --accent: #0e7490; --accent-ink: #ffffff; --accent-hover: #0c6179;
        --danger: #dc2626; --ok: #15803d; --warn: #b45309;
        --nav-bg: rgba(255, 255, 255, 0.96);
    }
    /* L'en-tête reste sombre : la barre d'état du téléphone (heure, batterie) y reste lisible. */
    .beta-app .header { --text: #e8ecf1; --muted: #9aa5b1; --border: #232a33; --accent: #22d3ee; --accent-ink: #04222a; --accent-hover: #67e3f5; background: #0b0d10; }
    .beta-app .illus-box { fill: #ffffff; }
    .beta-app .illus-phone { fill: #e3e8ee; }
    .beta-app .illus-screen { fill: #ffffff; }
    .beta-app .illus-accent { fill: rgba(14, 116, 144, 0.12); }
    .beta-app .viewer-report, .beta-app .viewer-thanks { box-shadow: 0 0 24px rgba(0, 0, 0, 0.15); }
    .beta-app .tab.active { background: rgba(14, 116, 144, 0.1); }
}

/* Page client des missions de test */
.audit-steps { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 20px; }
.audit-steps li { border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; font-size: 0.85rem; color: var(--muted); }
.audit-steps li.on { border-color: var(--accent); color: var(--text); }
.audit-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 10px 0; font-size: 0.92rem; }
.audit-facts dt { color: var(--muted); }
.audit-facts dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) { .audit-facts { grid-template-columns: 1fr; } .audit-facts dd { margin-bottom: 6px; } }
