:root {
  /* Charte GOAPEL (couleurs du logo) */
  --navy: #0a2a8c;        /* « GO » */
  --navy-dark: #061c5e;
  --orange: #f85a00;      /* « APEL » : accents, jamais sous du petit texte blanc */
  --orange-text: #c2410c; /* orange lisible pour du texte sur fond clair */
  --sky: #1e88e5;         /* bleu du pictogramme */
  --brand: var(--navy); --brand-dark: var(--navy-dark); --ok: #12a150; --danger: #e5322d;
  --bg: #f3f5fa; --card: #fff; --ink: #0f1a33; --muted: #5a6478; --line: #e1e6f0;
  --tint: #e9eefb;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
.hidden { display: none !important; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
label { display: block; font-size: 14px; color: var(--muted); margin: 12px 0 4px; }
.btn { width: 100%; padding: 13px; border: 0; border-radius: 10px; background: var(--brand); color: #fff; font-weight: 600; margin-top: 16px; }
.btn.secondary { background: var(--tint); color: var(--brand-dark); }
.btn.accent { background: var(--orange); }
.btn.small { width: auto; padding: 8px 14px; margin: 0; }
.link { background: none; border: 0; color: var(--navy); text-decoration: underline; text-underline-offset: 3px; padding: 8px 0; }
.wrap { max-width: 520px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.auth { padding: 32px 20px; }
.logo { display: block; width: 220px; max-width: 70%; height: auto; margin: 0 auto 6px; }
.slogan { text-align: center; color: var(--navy); font-weight: 700; font-style: italic; margin: 0 0 4px; }
.slogan::after { content: ""; display: block; width: 120px; height: 3px; border-radius: 3px; background: var(--orange); margin: 6px auto 0; }
.tagline { color: var(--navy); margin: 4px 0 20px; text-align: center; font-weight: 600; white-space: nowrap; font-size: clamp(10.5px, 3.4vw, 16px); }
.wordmark { font-weight: 800; letter-spacing: .5px; }
.wordmark .go { color: inherit; } .wordmark .apel { color: var(--orange); }
.error { color: var(--danger); font-size: 14px; margin-top: 10px; min-height: 18px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); margin-top: 14px; }
.check input { width: auto; margin-top: 3px; }
header.top { background: var(--navy); color: #fff; padding: 14px 16px; display: flex; align-items: center; gap: 10px; border-bottom: 3px solid var(--orange); }
header.top .title { font-weight: 700; font-size: 18px; flex: 1; }
header.top button { background: rgba(255,255,255,.15); color: #fff; border: 0; border-radius: 8px; padding: 6px 10px; }
main { flex: 1; padding: 12px 12px 84px; }
nav.tabs { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line); display: flex; justify-content: center; }
nav.tabs .inner { display: flex; width: 100%; max-width: 520px; }
nav.tabs button { flex: 1; background: none; border: 0; padding: 10px 0 12px; color: var(--muted); font-size: 12px; }
nav.tabs button span { display: block; font-size: 20px; }
nav.tabs button.active { color: var(--navy); font-weight: 700; box-shadow: inset 0 3px 0 var(--orange); }
.card { background: var(--card); border-radius: 14px; padding: 14px; margin-bottom: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .name { font-weight: 600; }
.row .sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; background: var(--tint); flex: none; }
.avatar.big { width: 110px; height: 110px; }
.icon-btn { border: 0; background: var(--tint); color: var(--brand-dark); border-radius: 50%; width: 40px; height: 40px; font-size: 18px; }
.icon-btn.call-btn { background: #e3f6eb; color: var(--ok); }
.badge { background: var(--orange); color: #fff; border-radius: 10px; font-size: 12px; padding: 1px 7px; }
.cmk-box { display: flex; align-items: center; gap: 8px; background: var(--tint); border-left: 4px solid var(--orange); border-radius: 10px; padding: 10px 12px; font-weight: 700; color: var(--brand-dark); }
.cmk-box .grow { flex: 1; }
.empty { color: var(--muted); text-align: center; padding: 30px 10px; }
.status-ok { color: var(--ok); } .status-ko { color: var(--danger); }
.chat { display: flex; flex-direction: column; height: calc(100vh - 56px); }
.chat .msgs { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.bubble { max-width: 78%; padding: 8px 12px; border-radius: 14px; background: #fff; align-self: flex-start; white-space: pre-wrap; word-wrap: break-word; }
.bubble.mine { background: var(--brand); color: #fff; align-self: flex-end; }
.bubble .meta { font-size: 11px; opacity: .75; margin-top: 2px; text-align: right; }
.composer { display: flex; gap: 8px; padding: 10px; background: #fff; border-top: 1px solid var(--line); }
.composer button { width: auto; margin: 0; }
.call { position: fixed; inset: 0; z-index: 1000; background: linear-gradient(180deg, #1565c0 0%, var(--navy) 45%, var(--navy-dark) 100%); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center; }
.call-state { opacity: .85; margin-bottom: 18px; }
.call-photo { width: 170px; height: 170px; border-radius: 50%; object-fit: cover; background: #2b4da8; border: 4px solid var(--orange); box-shadow: 0 0 0 8px rgba(248,90,0,.18); }
.call-name { font-size: 26px; font-weight: 700; margin-top: 18px; }
.call-cmk { opacity: .8; margin-top: 4px; }
.call-timer { font-variant-numeric: tabular-nums; margin-top: 10px; min-height: 22px; }
.call-actions { display: flex; gap: 34px; margin-top: 48px; }
.round { width: 70px; height: 70px; border-radius: 50%; border: 0; font-size: 26px; background: rgba(255,255,255,.18); color: #fff; }
.round.ok { background: var(--ok); } .round.danger { background: var(--danger); }
.round[aria-pressed="true"] { background: #fff; color: var(--brand-dark); }
.toast { position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%); background: var(--navy-dark); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 1100; max-width: 90%; }
.notice { background: #fff8e6; border: 1px solid #f3d9a4; color: #6b4e00; border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.center { text-align: center; }

:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.call-error { margin-top: 16px; max-width: 320px; background: rgba(255,255,255,.12); border-left: 4px solid var(--orange); border-radius: 10px; padding: 10px 12px; font-size: 14px; line-height: 1.4; }
.install-banner { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--orange); border-radius: 12px; padding: 10px 12px; margin: 0 0 12px; }
.install-banner .grow { flex: 1; min-width: 0; }
.install-banner .sub { color: var(--muted); font-size: 13px; }
.install-banner img { border-radius: 10px; flex: none; }
.auth .install-slot { margin-top: 4px; }
#btn-install { background: var(--orange-text); }
.msg-photo { display: block; max-width: 100%; width: 240px; height: auto; border-radius: 10px; margin-bottom: 4px; cursor: zoom-in; background: var(--tint); }
.bubble.has-photo { padding: 6px 6px 4px; }
.composer .icon-btn { flex: none; }
.card.ad { border: 1px solid var(--line); background: #fffdf9; }
.ad-label { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 6px; }
.ad-close { padding: 0 4px; text-decoration: none; }
.ad-body { display: flex; gap: 10px; align-items: center; cursor: pointer; }
.ad-body img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; flex: none; }
.link.small { font-size: 12px; color: var(--muted); padding: 6px 0 0; }
.card.official.unread { border-left: 4px solid var(--orange); }
.card.official.urgent h3 { color: var(--danger); }
.card.official h3 { margin: 4px 0; font-size: 17px; }
.pre { white-space: pre-wrap; margin: 0; }
.msgs.ticket { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
select, textarea { font: inherit; }
textarea { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.slogan-boss { text-align: center; margin: 2px 0 6px; font-weight: 800; font-size: 17px; color: var(--navy); letter-spacing: .2px; }
.slogan-boss::after { content: ""; display: block; width: 90px; height: 3px; border-radius: 3px; background: var(--orange); margin: 6px auto 0; }
.fine { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.welcome { position: fixed; left: 50%; top: 68px; transform: translateX(-50%); z-index: 900; pointer-events: none;
  background: var(--navy); color: #fff; font-weight: 700; padding: 10px 18px; border-radius: 999px;
  border: 2px solid var(--orange); box-shadow: 0 6px 18px rgba(6,28,94,.25); max-width: calc(100% - 32px); text-align: center;
  opacity: 0; transition: opacity .35s, transform .35s; }
.welcome.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.welcome.hide { opacity: 0; transform: translateX(-50%) translateY(-8px); }
