/* =====================================================================
   e-Santé Bénin — feuille de style unique (~20 Ko, aucune police web :
   polices système, pour les connexions lentes et les forfaits limités).
   Palette alignée sur le portail national service-public.bj.
   ===================================================================== */
:root {
  --navy: #0a3764;
  --navy-800: #072a4d;
  --navy-50: #e7eef7;
  --green: #287d3c;
  --green-50: #e6f3e9;
  --orange: #f0a945;
  --orange-700: #9a5b00;
  --orange-50: #fdf3e2;
  --red: #da1414;
  --red-50: #fdeaea;
  --info: #0c5a9e;
  --bg: #eef2f8;
  --surface: #fff;
  --text: #16212e;
  --muted: #56657a;
  --border: #d3dce8;
  --flag-green: #008751;
  --flag-yellow: #fcd116;
  --flag-red: #e8112d;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(10, 55, 100, .06), 0 4px 16px rgba(10, 55, 100, .06);
  --focus: 0 0 0 3px #fff, 0 0 0 6px #f0a945;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Ubuntu, Arial, sans-serif;
}

/* ---------- Tailles de texte réglables ---------- */
html { font-size: 100%; -webkit-text-size-adjust: 100%; }
html.fs-1 { font-size: 112.5%; }
html.fs-2 { font-size: 125%; }
html.fs-3 { font-size: 150%; }

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); font-size: 1rem; line-height: 1.55; color: var(--text); background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; padding: 1.5rem 0 3rem; outline: none; }
img, svg { max-width: 100%; }
a { color: var(--info); text-underline-offset: 2px; }
a:hover { color: var(--navy); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
h1, h2, h3, h4 { line-height: 1.25; color: var(--navy); margin: 0 0 .6rem; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 .8rem; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 1rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.lead { font-size: 1.1rem; color: var(--muted); }
.center { text-align: center; }
.mt { margin-top: 1rem; } .mt2 { margin-top: 2rem; } .mb0 { margin-bottom: 0; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.i { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; vertical-align: -.25em; }
.i-lg { width: 2rem; height: 2rem; }
.i-xl { width: 2.75rem; height: 2.75rem; }
.js-only { display: none !important; }
.js .js-only { display: inline-flex !important; }
.js .no-js { display: none !important; }

.skip { position: absolute; left: .5rem; top: -4rem; background: var(--navy); color: #fff; padding: .75rem 1rem; z-index: 100; border-radius: 0 0 8px 8px; font-weight: 700; }
.skip:focus { top: 0; }

/* ---------- Bandeau national ---------- */
.flag { display: flex; height: 5px; }
.flag span { flex: 1; }
.flag span:nth-child(1) { background: var(--flag-green); }
.flag span:nth-child(2) { background: var(--flag-yellow); }
.flag span:nth-child(3) { background: var(--flag-red); }
.govbar { background: #fff; border-bottom: 1px solid var(--border); font-size: .85rem; }
.govbar-in { display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-height: 44px; flex-wrap: wrap; }
.gov-name { color: var(--navy); }
.a11y { display: flex; gap: .25rem; flex-wrap: wrap; margin: 0; }
.a11y-btn { display: inline-flex; align-items: center; gap: .3rem; min-height: 36px; min-width: 36px; padding: .25rem .55rem; font: inherit; font-size: .82rem; font-weight: 600; color: var(--navy); background: var(--navy-50); border: 1px solid transparent; border-radius: 8px; cursor: pointer; justify-content: center; }
.a11y-btn:hover { border-color: var(--navy); }
.a11y-btn[aria-pressed="true"] { background: var(--navy); color: #fff; }
.a11y-btn.listening { background: var(--red); color: #fff; }

/* ---------- En-tête ---------- */
.header { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 20; box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
.header-in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; }
.brand { display: flex; align-items: center; gap: .65rem; color: #fff; text-decoration: none; }
.brand span { font-size: 1.2rem; line-height: 1.1; }
.brand small { display: block; font-size: .72rem; opacity: .8; font-weight: 400; }
.brand:hover { color: #fff; }
.brand img { border-radius: 10px; }
.header-actions { display: flex; align-items: center; gap: .5rem; }
.hbtn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 10px; color: #fff; }
.hbtn:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.hbtn .badge { position: absolute; top: 2px; right: 0; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 1.35rem; height: 1.35rem; padding: 0 .35rem; border-radius: 999px; background: var(--orange); color: #1b1300; font-size: .75rem; font-weight: 800; }
.usermenu { position: relative; }
.usermenu summary { list-style: none; display: flex; align-items: center; gap: .6rem; cursor: pointer; padding: .3rem .5rem; border-radius: 10px; font-weight: 600; line-height: 1.15; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary:hover { background: rgba(255, 255, 255, .1); }
.usermenu summary small { display: block; font-weight: 400; opacity: .8; font-size: .75rem; }
.usermenu-panel { position: absolute; right: 0; top: calc(100% + .4rem); background: #fff; color: var(--text); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; min-width: 240px; border: 1px solid var(--border); }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; background: var(--orange); color: #1b1300; font-weight: 800; font-size: .9rem; flex-shrink: 0; }
.avatar-lg { width: 64px; height: 64px; font-size: 1.4rem; }
.mainnav { background: var(--navy-800); }
.mainnav-in { display: flex; gap: .15rem; overflow-x: auto; scrollbar-width: none; }
.mainnav-in::-webkit-scrollbar { display: none; }
.mainnav a { display: flex; align-items: center; gap: .45rem; padding: .8rem .85rem; color: #dbe6f3; text-decoration: none; font-weight: 600; font-size: .92rem; white-space: nowrap; border-bottom: 3px solid transparent; }
.mainnav a:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.mainnav a.active { color: #fff; border-bottom-color: var(--orange); }
.mainnav .nav-urgent { margin-left: auto; color: #ffd0d0; }
.offline-banner { background: #3b2a00; color: #ffe7b3; padding: .6rem 1rem; text-align: center; font-weight: 600; }

/* ---------- Pied de page ---------- */
.footer { background: #0b1d33; color: #c6d3e3; padding: 2rem 0; font-size: .9rem; }
.footer a { color: #fff; }
.footer-in { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 44px; padding: .55rem 1.1rem; font: inherit; font-weight: 700; font-size: .95rem; line-height: 1.2; border-radius: 10px; border: 2px solid transparent; cursor: pointer; text-decoration: none; background: var(--navy); color: #fff; text-align: center; }
.btn:hover { background: var(--navy-800); color: #fff; }
.btn-accent { background: var(--orange); color: #1b1300; }
.btn-accent:hover { background: #e39a2f; color: #1b1300; }
.btn-success { background: var(--green); }
.btn-success:hover { background: #1f6630; }
.btn-danger { background: var(--red); }
.btn-danger:hover { background: #b30f0f; }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--border); }
.btn-ghost:hover { background: var(--navy-50); color: var(--navy); }
.btn-light { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .25); }
.btn-light:hover { background: rgba(255, 255, 255, .2); }
.btn-block { width: 100%; }
.btn-lg { min-height: 56px; font-size: 1.05rem; padding: .8rem 1.4rem; }
.btn-sm { min-height: 36px; padding: .35rem .75rem; font-size: .85rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.icon-btn { display: inline-flex; align-items: center; gap: .35rem; background: var(--navy-50); color: var(--navy); border: 0; border-radius: 999px; padding: .35rem .75rem; font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer; min-height: 36px; }
.icon-btn:hover { background: #d7e3f2; }
.icon-btn.speaking { background: var(--green); color: #fff; }

/* ---------- Mise en page ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head h1 { margin: 0; }
.page-head p { margin: .25rem 0 0; }
.crumb { font-size: .9rem; margin-bottom: .5rem; display: inline-flex; align-items: center; gap: .3rem; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid-2 { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: 1rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.layout-side { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
.stack > * + * { margin-top: 1rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: .85rem; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; display: flex; align-items: center; gap: .5rem; }
.card-flat { box-shadow: none; }
.card-accent { border-left: 5px solid var(--orange); }
.card-danger { border-left: 5px solid var(--red); }
.card-success { border-left: 5px solid var(--green); }
.card-navy { background: var(--navy); color: #fff; border: 0; }
.card-navy h2, .card-navy h3 { color: #fff; }
.divider { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }

/* ---------- Tuiles pictogrammes (patient) ---------- */
.tiles { display: grid; gap: .85rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .55rem; min-height: 132px; padding: 1rem .75rem; border-radius: 16px; background: #fff; border: 2px solid var(--border); text-decoration: none; color: var(--navy); font-weight: 700; text-align: center; position: relative; }
.tile:hover { border-color: var(--navy); color: var(--navy); transform: translateY(-1px); }
.tile .i { width: 2.4rem; height: 2.4rem; }
.tile .tile-ic { display: inline-flex; padding: .6rem; border-radius: 14px; background: var(--navy-50); }
.tile.t-green .tile-ic { background: var(--green-50); color: var(--green); }
.tile.t-orange .tile-ic { background: var(--orange-50); color: var(--orange-700); }
.tile.t-red .tile-ic { background: var(--red-50); color: var(--red); }
.tile .badge { position: absolute; top: .6rem; right: .6rem; }

/* ---------- Formulaires ---------- */
.field { margin-bottom: 1rem; }
label, .label { display: block; font-weight: 700; margin-bottom: .35rem; color: var(--navy); }
.hint { display: block; font-size: .85rem; color: var(--muted); font-weight: 400; margin-top: .2rem; }
input:not([type]), input[type=text], input[type=time], input[type=tel], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=search], input[type=email], select, textarea {
  width: 100%; min-height: 48px; padding: .6rem .8rem; font: inherit; color: var(--text); background: #fff; border: 2px solid var(--border); border-radius: 10px; }
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--navy); outline: none; box-shadow: 0 0 0 3px rgba(240, 169, 69, .45); }
input.code-input { font-size: 1.6rem; letter-spacing: .4em; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 500; color: var(--text); margin-bottom: .5rem; }
.check input { width: 1.3rem; height: 1.3rem; margin-top: .15rem; accent-color: var(--navy); }
.row { display: flex; gap: .75rem; flex-wrap: wrap; }
.row > * { flex: 1 1 180px; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin: 0 0 1rem; }
legend { font-weight: 800; color: var(--navy); padding: 0 .4rem; }
.inline-form { display: inline; }
.searchbar { display: flex; gap: .5rem; }
.searchbar input { flex: 1; }

/* ---------- Tags / alertes ---------- */
.tag { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 800; letter-spacing: .01em; white-space: nowrap; background: var(--navy-50); color: var(--navy); }
.tag-ok { background: var(--green-50); color: #1c5e2c; }
.tag-warn { background: var(--orange-50); color: var(--orange-700); }
.tag-danger { background: var(--red-50); color: #a10e0e; }
.tag-info { background: #e5f0fb; color: var(--info); }
.tag-muted { background: #eceff3; color: var(--muted); }
.alert { display: flex; gap: .75rem; align-items: flex-start; padding: .9rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; border: 1px solid; font-weight: 500; }
.alert .i { margin-top: .1rem; }
.alert-success { background: var(--green-50); border-color: #b8dcc0; color: #174d24; }
.alert-error { background: var(--red-50); border-color: #f3b9b9; color: #8a0c0c; }
.alert-info { background: #e8f1fb; border-color: #bdd5ef; color: #0b4579; }
.alert-warn { background: var(--orange-50); border-color: #f2d4a2; color: #6f4200; }

/* ---------- Listes & tableaux ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; gap: .85rem; align-items: flex-start; padding: .85rem 0; border-bottom: 1px solid var(--border); }
.list > li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list-ic { display: inline-flex; padding: .55rem; border-radius: 12px; background: var(--navy-50); color: var(--navy); }
.list-ic.green { background: var(--green-50); color: var(--green); }
.list-ic.orange { background: var(--orange-50); color: var(--orange-700); }
.list-ic.red { background: var(--red-50); color: var(--red); }
.list a.stretched { text-decoration: none; color: inherit; }
.list-title { font-weight: 700; color: var(--text); margin: 0; }
.datebox { flex-shrink: 0; width: 58px; text-align: center; border-radius: 12px; background: var(--navy); color: #fff; padding: .35rem 0; line-height: 1.1; }
.datebox b { display: block; font-size: 1.35rem; }
.datebox small { font-size: .72rem; text-transform: uppercase; }
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th, .table td { padding: .65rem .6rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #f6f8fb; }
.table tr.row-alert td { background: #fff7f7; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; font-weight: 600; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 1.25rem; border-left: 3px solid var(--navy-50); }
.timeline li { position: relative; padding: 0 0 1.1rem .75rem; }
.timeline li::before { content: ""; position: absolute; left: -1.72rem; top: .3rem; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--navy); }
.timeline li.t-urgence::before { border-color: var(--red); }
.timeline li.t-cpn::before { border-color: var(--green); }
.empty { text-align: center; padding: 2rem 1rem; color: var(--muted); }
.empty .i { width: 2.5rem; height: 2.5rem; margin-bottom: .5rem; }

/* ---------- Posologie en pictogrammes ---------- */
.med { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; background: #fff; }
.med + .med { margin-top: .75rem; }
.med-head { display: flex; justify-content: space-between; gap: .75rem; align-items: flex-start; flex-wrap: wrap; }
.med-name { font-size: 1.1rem; font-weight: 800; color: var(--navy); margin: 0; }
.posology { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; margin: .85rem 0 .5rem; }
.moment { border-radius: 12px; padding: .6rem .3rem; text-align: center; background: #f4f6f9; color: #9aa6b5; border: 2px dashed #dbe2ea; }
.moment.on { background: #fff8ea; color: #7a4a00; border: 2px solid var(--orange); }
.moment.on.m-night { background: #edf0fa; color: var(--navy); border-color: var(--navy); }
.moment .i { width: 2rem; height: 2rem; }
.moment b { display: block; font-size: .8rem; margin-top: .2rem; }
.dots { display: flex; justify-content: center; gap: .25rem; margin-top: .35rem; min-height: 16px; }
.dots span { width: 14px; height: 14px; border-radius: 50%; background: var(--navy); }
.m-night .dots span { background: var(--orange); }
.duration { display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; }
.rx-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.35rem; font-weight: 800; letter-spacing: .08em; color: var(--navy); background: var(--navy-50); padding: .3rem .75rem; border-radius: 8px; display: inline-block; }
.qr { background: #fff; padding: .5rem; border-radius: 8px; border: 1px solid var(--border); width: 168px; height: 168px; }
.qr svg { width: 100%; height: 100%; }

/* ---------- Messagerie ---------- */
.chat { display: flex; flex-direction: column; gap: .6rem; max-height: 60vh; overflow-y: auto; padding: .5rem; background: #f6f8fb; border-radius: var(--radius); border: 1px solid var(--border); }
.msg { max-width: 82%; padding: .65rem .9rem; border-radius: 16px; background: #fff; border: 1px solid var(--border); }
.msg.me { align-self: flex-end; background: var(--navy); color: #fff; border-color: var(--navy); border-bottom-right-radius: 4px; }
.msg.them { align-self: flex-start; border-bottom-left-radius: 4px; }
.msg .meta { display: flex; justify-content: space-between; gap: .75rem; font-size: .75rem; opacity: .75; margin-top: .3rem; align-items: center; }
.msg p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg audio { width: 240px; max-width: 100%; margin-top: .25rem; }
.msg .icon-btn { background: rgba(255, 255, 255, .18); color: inherit; min-height: 28px; padding: .1rem .5rem; font-size: .75rem; }
.msg.pending { opacity: .6; border-style: dashed; }
.composer { display: grid; gap: .5rem; margin-top: .75rem; }
.composer-actions { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: space-between; }
.rec-status { font-weight: 700; color: var(--red); display: inline-flex; align-items: center; gap: .4rem; }

/* ---------- Indicateurs & graphiques (SVG/CSS, sans bibliothèque) ---------- */
.kpis { display: grid; gap: .85rem; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); margin-bottom: 1.25rem; }
.kpi { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.kpi .v { font-size: 1.75rem; font-weight: 800; color: var(--navy); line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--muted); font-size: .85rem; font-weight: 600; }
.kpi.warn .v { color: var(--orange-700); }
.kpi.danger .v { color: var(--red); }
.bars { display: grid; gap: .45rem; }
.bar { display: grid; grid-template-columns: minmax(90px, 32%) 1fr 3.5rem; gap: .6rem; align-items: center; font-size: .88rem; }
.bar-track { background: #eef2f7; border-radius: 4px; height: 14px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--navy); border-radius: 0 4px 4px 0; }
.bar-fill.orange { background: var(--orange); }
.bar-fill.red { background: var(--red); }
.bar-fill.green { background: var(--green); }
.bar .n { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.chart { width: 100%; height: auto; display: block; }
.chart .axis { stroke: #c9d3df; stroke-width: 1; }
.chart .grid-line { stroke: #eef2f7; stroke-width: 1; }
.chart text { font-size: 11px; fill: #56657a; font-family: var(--font); }
.chart .col { fill: var(--navy); }
.chart .col.hot { fill: var(--orange); }
.chart .val { font-weight: 700; fill: var(--text); }
.legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .85rem; color: var(--muted); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; }
.map-cell { border-radius: 10px; padding: .6rem .7rem; color: #fff; font-size: .85rem; }
.map-cell b { display: block; font-size: 1.2rem; }

/* ---------- Accueil ---------- */
.hero { background: linear-gradient(135deg, var(--navy) 0%, #0e4a86 100%); color: #fff; border-radius: 18px; padding: 2.25rem; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 2rem; align-items: center; position: relative; overflow: hidden; }
.hero h1 { color: #fff; font-size: 2.1rem; }
.hero p { color: #d6e2f0; font-size: 1.08rem; }
.hero .btn-row { margin-top: 1.25rem; }
.hero-card { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .18); border-radius: 16px; padding: 1.25rem; }
.hero-card li { display: flex; gap: .6rem; align-items: flex-start; margin-bottom: .7rem; color: #e8eff7; }
.hero-card ul { list-style: none; margin: 0; padding: 0; }
.hero-card .i { color: var(--orange); margin-top: .15rem; }
.section { margin-top: 2.25rem; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.section-title h2 { margin: 0; }
.feature { display: flex; gap: .85rem; }
.feature h3 { margin-bottom: .25rem; }
.feature p { margin: 0; color: var(--muted); font-size: .95rem; }
.article-card { display: flex; flex-direction: column; gap: .5rem; text-decoration: none; color: inherit; }
article.card { display: flex; flex-direction: column; }
article.card > .icon-btn { align-self: flex-start; margin-top: auto; }
article.card > .article-card + .icon-btn { margin-top: 1rem; }
.article-card:hover h3 { text-decoration: underline; }
.article-body { max-width: 72ch; }
.article-body h2 { margin-top: 1.5rem; }
.article-body li { margin-bottom: .35rem; }
.demo-grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.demo-acc { display: flex; gap: .75rem; align-items: center; width: 100%; text-align: left; background: #fff; border: 2px solid var(--border); border-radius: 12px; padding: .75rem; cursor: pointer; font: inherit; color: var(--text); }
.demo-acc:hover { border-color: var(--navy); }
.demo-acc b { display: block; color: var(--navy); }
.demo-acc small { color: var(--muted); display: block; line-height: 1.3; }

/* ---------- Téléphone simulé (USSD / SMS) ---------- */
.phone { width: 300px; max-width: 100%; margin: 0 auto; background: #1a1f26; border-radius: 34px; padding: 18px 14px 22px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.phone-screen { background: #cfe0c8; border-radius: 10px; min-height: 280px; padding: .75rem; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9rem; color: #13210f; white-space: pre-wrap; overflow-wrap: anywhere; }
.phone-screen.sms { background: #f3f5f8; font-family: var(--font); white-space: normal; max-height: 460px; overflow-y: auto; }
.phone-input { display: flex; gap: .4rem; margin-top: .75rem; }
.phone-input input { background: #0f1318; color: #fff; border-color: #333b46; font-family: ui-monospace, monospace; }
.phone-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; margin-top: .6rem; }
.phone-keys button { background: #2b323c; color: #fff; border: 0; border-radius: 10px; min-height: 42px; font-size: 1.05rem; font-weight: 700; cursor: pointer; }
.phone-keys button:hover { background: #3a434f; }
.sms-bubble { background: #fff; border-radius: 12px; padding: .6rem .75rem; margin-bottom: .5rem; border: 1px solid #dde3ea; font-size: .88rem; }
.sms-bubble small { display: block; color: var(--muted); font-size: .72rem; margin-bottom: .2rem; }

/* ---------- Carte d'urgence ---------- */
.emergency { border: 3px solid var(--red); border-radius: 18px; background: #fff; overflow: hidden; }
.emergency-head { background: var(--red); color: #fff; padding: 1rem 1.25rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.emergency-head h2 { color: #fff; margin: 0; }
.emergency-body { padding: 1.25rem; display: grid; grid-template-columns: 1fr auto; gap: 1rem; }
.big-fact { font-size: 1.35rem; font-weight: 800; }

/* ---------- Modes d'accessibilité ---------- */
html.hc { --bg: #fff; --surface: #fff; --text: #000; --muted: #1a1a1a; --border: #000; --navy: #00193a; --navy-50: #fff; --info: #00307a; --shadow: none; }
html.hc body { background: #fff; }
html.hc .card, html.hc .tile, html.hc .kpi, html.hc .med, html.hc input, html.hc select, html.hc textarea { border-width: 2px; border-color: #000; }
html.hc a { text-decoration: underline; text-decoration-thickness: 2px; }
html.hc .tag { border: 2px solid currentColor; background: #fff; }
html.hc .mainnav a { color: #fff; }
html.hc .moment { color: #000; }
html.hc .muted { color: #000; }
html.simple .hide-simple { display: none !important; }
html.simple .tile { min-height: 160px; font-size: 1.15rem; }
html.simple .tile .i { width: 3.2rem; height: 3.2rem; }
html.simple .moment .i { width: 2.8rem; height: 2.8rem; }
html.simple .dots span { width: 20px; height: 20px; }
.show-simple { display: none; }
html.simple .show-simple { display: block; }

/* ---------- Réactif ---------- */
@media (max-width: 900px) {
  .layout-side, .hero { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  h1 { font-size: 1.45rem; }
  .hero { padding: 1.5rem; }
  .hero h1 { font-size: 1.6rem; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .hide-sm { display: none !important; }
  .a11y-btn .lbl { display: none; }
  .card { padding: 1rem; }
  .bar { grid-template-columns: 38% 1fr 3rem; }
  .emergency-body { grid-template-columns: 1fr; }
  .table.stack-sm thead { display: none; }
  .table.stack-sm tr { display: block; border-bottom: 1px solid var(--border); padding: .5rem 0; }
  .table.stack-sm td { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: .3rem .2rem; }
  .table.stack-sm td::before { content: attr(data-label); font-weight: 700; color: var(--muted); font-size: .8rem; }
  .msg { max-width: 92%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print {
  .govbar, .header, .footer, .flag, .no-print, .btn, .icon-btn { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #999; }
  main { padding: 0; }
}
