:root {
    --bg: #f6f4f1;
    --paper: #ffffff;
    --line: #e7e3dd;
    --text: #121a2f;
    --muted: #68707f;
    --brand: #781428;
    --brand-soft: rgba(120, 20, 40, 0.08);
    --shadow: 0 18px 45px rgba(17, 24, 39, 0.05);
    --radius: 22px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: linear-gradient(180deg, #fbfaf8 0%, var(--bg) 100%);
    color: var(--text);
}
.container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}
.stack-lg > * + * { margin-top: 28px; }
.stack-md > * + * { margin-top: 18px; }
.stack-sm > * + * { margin-top: 12px; }

.page-header {
    padding: 44px 0 22px;
}
.header-inner {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: end;
}
.eyebrow, .section-kicker, .mini-label {
    text-transform: uppercase;
    letter-spacing: .14em;
    font-size: 11px;
    color: var(--brand);
    font-weight: 700;
}
h1, h2, h3, p { margin: 0; }
h1 {
    margin-top: 10px;
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.02;
}
.lead {
    margin-top: 14px;
    max-width: 780px;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.6;
}
.header-card {
    min-width: 260px;
    background: rgba(255,255,255,.72);
    backdrop-filter: blur(8px);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: var(--shadow);
}
.header-card span { color: var(--muted); }

.card {
    background: rgba(255,255,255,.84);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}
.section-head h2 { margin-top: 8px; }
.print-btn, .primary-btn {
    border: none;
    cursor: pointer;
    border-radius: 14px;
    padding: 14px 20px;
    font-weight: 700;
}
.print-btn {
    background: #efe9e3;
    color: var(--text);
}
.primary-btn {
    background: linear-gradient(135deg, #8d1830 0%, var(--brand) 100%);
    color: #fff;
    min-width: 220px;
    box-shadow: 0 16px 30px rgba(120, 20, 40, 0.18);
}
.actions { display: flex; justify-content: flex-start; }
.audit-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.grid {
    display: grid;
    gap: 16px;
}
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5-cards { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.report-grid { grid-template-columns: 1.15fr .85fr; }
label span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}
input, select {
    width: 100%;
    border: 1px solid #dad4ce;
    border-radius: 14px;
    background: #fff;
    padding: 14px 15px;
    font-size: 14px;
    color: var(--text);
    outline: none;
}
input:focus, select:focus {
    border-color: rgba(120,20,40,.45);
    box-shadow: 0 0 0 4px rgba(120,20,40,.08);
}
.toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
}
.toggle {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    padding: 10px 12px;
    border-radius: 999px;
    color: var(--text);
}
.toggle input { width: auto; }

.hero-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}
.score-card {
    text-align: center;
    padding: 28px;
}
.score-card.accent {
    background: linear-gradient(180deg, #fff 0%, #fff7f8 100%);
    border-color: rgba(120,20,40,.18);
}
.score-main {
    font-size: clamp(56px, 8vw, 86px);
    line-height: 1;
    margin: 12px 0 10px;
    color: var(--brand);
    font-weight: 700;
}
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 800;
}
.badge-low { background: #fee2e2; color: #991b1b; }
.badge-mid { background: #fef3c7; color: #92400e; }
.badge-high { background: #dcfce7; color: #166534; }
.business-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-content: center;
    background: linear-gradient(135deg, #fff 0%, #faf4f4 100%);
}
.business-card p, .muted { color: var(--muted); line-height: 1.6; }

.metric-card {
    padding: 20px;
}
.metric-title {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.metric-value {
    font-size: 34px;
    font-weight: 700;
    margin: 10px 0 12px;
}
.facts {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
    line-height: 1.6;
}
.detail-block + .detail-block {
    border-top: 1px solid var(--line);
    padding-top: 18px;
}
.social-list {
    display: grid;
    gap: 10px;
}
.social-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 10px;
    background: #fcfbfa;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
}
.recommendation {
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 18px;
    background: #fff;
}
.recommendation-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.priority {
    display: inline-flex;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 800;
}
.priority-critique { background: #fee2e2; color: #991b1b; }
.priority-haute { background: #fef3c7; color: #92400e; }
.priority-moyenne { background: #e0f2fe; color: #075985; }
.priority-basse { background: #e5e7eb; color: #374151; }
.gain {
    color: var(--brand);
    font-weight: 800;
}
.projection-card {
    background: linear-gradient(180deg, #fff 0%, #fff8f8 100%);
    border-color: rgba(120,20,40,.18);
}
.projection-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 16px;
}
.projection-grid > div {
    background: rgba(255,255,255,.85);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 18px;
}
.projection-grid p { color: var(--muted); line-height: 1.6; margin-top: 8px; }

@media (max-width: 1080px) {
    .grid-5-cards,
    .hero-grid,
    .report-grid,
    .projection-grid,
    .grid-4,
    .grid-3 {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 760px) {
    .container { width: min(100% - 20px, 1180px); }
    .header-inner,
    .section-head,
    .social-item,
    .grid-5-cards,
    .hero-grid,
    .report-grid,
    .projection-grid,
    .grid-4,
    .grid-3 {
        grid-template-columns: 1fr;
        display: grid;
    }
    .header-inner,
    .section-head { display: flex; flex-direction: column; align-items: stretch; }
    .actions { display: block; }
    .primary-btn, .print-btn { width: 100%; }
    .social-item { display: block; }
}

@media print {
    body { background: #fff; }
    .page-header { padding-top: 10px; }
    .print-btn, .actions { display: none !important; }
    .card { box-shadow: none; background: #fff; }
}
