/* IAL — application contributeur. Charte IAL · Jeli (J17) : tout vient des jetons de /static/ial.css (thème Jour, Nuit automatique). */
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--coton); color: var(--ink); font: 15px/22px var(--font-sans); -webkit-font-smoothing: antialiased; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- barre haute : bandeau indigo profond, logo nuit ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; min-height: 56px; background: var(--indigo-deep); color: var(--on-night); position: sticky; top: 0; z-index: var(--z-nav); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand .logo { height: 28px; width: auto; display: block; }
.brand small { font-size: 13px; line-height: 18px; color: var(--on-night-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .right { display: flex; align-items: center; gap: 10px; }
.langbtn { background: transparent; color: var(--on-night); border: 1.5px solid var(--on-night-muted); border-radius: var(--radius-sm); padding: 5px 10px; font-size: 13px; font-weight: 600; min-height: 32px; }
.net { color: var(--vert); font-size: 14px; } .net.off { color: var(--rouge); }
@media (prefers-color-scheme: dark) { .net { color: #5fcf9f; } .net.off { color: #f28b82; } }

/* ---------- mise en page ---------- */
main { padding: 16px; max-width: 560px; margin: 0 auto; padding-bottom: 96px; }
h1 { font-size: 24px; line-height: 30px; font-weight: 600; letter-spacing: -0.01em; margin: 8px 0 6px; }
.lead { color: var(--ink-muted); margin: 0 0 18px; }
.hero-logo { height: 40px; width: auto; display: block; margin: 8px 0 16px; }
.hint { font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.card { background: var(--coton-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px 16px; margin: 12px 0; }
.card ul { padding-left: 18px; margin: 6px 0; } .card li { margin: 6px 0; }
.card p { margin: 6px 0; }
a { color: var(--indigo); }

/* ---------- formulaires ---------- */
label { display: block; font-size: 13px; line-height: 18px; font-weight: 600; color: var(--ink); margin: 14px 0 6px; }
label > span { display: block; margin-bottom: 6px; }
input, select, textarea { width: 100%; font: 400 15px/22px var(--font-sans); padding: 10px 12px; min-height: 44px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-md); background: var(--coton-raised); color: var(--ink); }
input::placeholder, textarea::placeholder { color: var(--ink-faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--indigo); box-shadow: 0 0 0 3px var(--indigo-soft); }
textarea { resize: vertical; font-family: var(--font-parole); font-size: 19px; line-height: 28px; }
.row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.check { display: flex; gap: 10px; align-items: center; font-size: 15px; font-weight: 400; color: var(--ink); margin-top: 14px; }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; min-height: 0; padding: 0; accent-color: var(--indigo); vertical-align: middle; }
.check input { width: 22px; height: 22px; }
label.check.small { font-size: 14px; margin: 6px 0; display: flex; }

/* ---------- boutons ---------- */
button { font: 600 15px/22px var(--font-sans); cursor: pointer; border: 1.5px solid transparent; border-radius: var(--radius-md); padding: 10px 16px; min-height: 44px; color: var(--ink); background: var(--coton-soft); }
button:disabled { opacity: .45; cursor: not-allowed; }
button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.primary { width: 100%; background: var(--indigo); color: var(--on-indigo); margin-top: 16px; min-height: 48px; }
.primary:active { background: var(--indigo-hover); }
.ghost { background: var(--coton-raised); border-color: var(--line-strong); color: var(--indigo); }
.ghost.small { padding: 6px 10px; font-size: 13px; min-height: 36px; }
.link { background: none; color: var(--indigo); text-decoration: none; padding: 8px; width: 100%; font-weight: 600; }
.link.small { font-size: 13px; padding: 4px 0 8px; width: auto; text-align: left; }
.btn-link { display: inline-block; background: var(--indigo); color: var(--on-indigo); border-radius: var(--radius-md); padding: 11px 16px; text-decoration: none; font-weight: 600; margin: 4px 6px 4px 0; }
.btn-link.ghost { background: var(--coton-raised); color: var(--indigo); border: 1.5px solid var(--line-strong); }

/* ---------- accueil : notices, Tissu, indicateurs ---------- */
.announce { background: var(--indigo-soft); color: var(--ink); border-radius: var(--radius-lg); padding: 10px 14px; margin-bottom: 10px; font-size: 14px; line-height: 20px; }
.announce.entry { background: var(--vert-soft); }
.goal { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.goalbar.tissu { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; height: 32px; }
.goalbar.tissu i { display: block; border-radius: 4px; background: var(--coton-soft); border: 1px solid var(--line); }
.goalbar.tissu i.ok { background: var(--indigo); border-color: var(--indigo); }
.goalbar.tissu i.ok:nth-child(5n) { background: var(--terre); border-color: var(--terre); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.stats div { background: var(--coton-raised); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 10px 8px; text-align: center; }
.stats b { display: block; font-size: 22px; line-height: 28px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); font-variant-numeric: tabular-nums; }
.stats span { font-size: 12px; line-height: 16px; color: var(--ink-muted); }

/* ---------- onglets des tâches : chips ---------- */
.tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.tab { flex: 1; background: var(--coton-raised); border: 1.5px solid var(--line-strong); color: var(--ink); padding: 8px 6px; font-size: 14px; min-height: 40px; border-radius: var(--radius-pill); }
.tab.active { background: var(--indigo); color: var(--on-indigo); border-color: var(--indigo); }
.tabs.six { flex-wrap: wrap; }
.tabs.six .tab { flex: 1 1 22%; min-width: 22%; font-size: 14px; padding: 8px 6px; }
.tabs.six .tab.locked { opacity: .55; }
.tabs.six .tab.locked::after { content: ""; display: inline-block; width: 12px; height: 12px; margin-left: 4px; vertical-align: -1px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='11' x='3' y='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='11' x='3' y='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E") center / contain no-repeat; }
.tabs.six .tab.more { display: none; }
.tabs.six.expanded .tab.more { display: block; }
.tabs.six .tab.toggle { background: transparent; border-style: dashed; color: var(--indigo); }
.tabs.six.expanded .tab.toggle { display: none; }
#screen-mine .tabs { margin-top: 12px; flex-wrap: wrap; }
#screen-mine .tab { flex: 1 1 30%; }

/* ---------- la carte Parole ---------- */
.task { min-height: 120px; padding: 18px 18px 14px; }
.task-kind { font-size: 13px; line-height: 18px; font-weight: 600; color: var(--indigo); margin: 0 0 8px; }
.task-kind:empty { display: none; }
.campaign { display: inline-block; background: var(--ocre-soft); color: var(--ocre-deep); border-radius: var(--radius-pill); padding: 3px 10px; font-size: 13px; margin: 0 0 8px; }
.task-text { font-family: var(--font-parole); font-size: 26px; line-height: 36px; font-weight: 400; margin: 0; color: var(--ink); }
.task-fr { color: var(--ink-muted); font-size: 15px; line-height: 22px; margin: 8px 0 0; }
.task-fr:not(:empty)::before { content: "— "; }
.task-reward { font-size: 13px; line-height: 18px; color: var(--vert); margin: 10px 0 0; font-weight: 600; }
#btnHelp { margin-top: 6px; }
#btnInstructions::before, #btnHelp::before { content: ""; display: inline-block; width: 16px; height: 16px; margin-right: 6px; vertical-align: -3px; background: currentColor; -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; }
#btnInstructions { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z'/%3E%3Cpath d='M16 9a5 5 0 0 1 0 6'/%3E%3C/svg%3E"); }
#btnHelp { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E"); }

/* ---------- enregistreur : bandes, chrono, bouton terre ---------- */
.recorder { text-align: center; margin-top: 8px; }
.timer { font-variant-numeric: tabular-nums; font-size: 28px; line-height: 32px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); margin: 8px 0 6px; }
.level { height: 32px; margin: 0 24px 14px; border-radius: 4px; background: repeating-linear-gradient(90deg, var(--coton-deep) 0 6px, transparent 6px 10px); }
.level div { height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--indigo) 0 6px, transparent 6px 10px, var(--indigo) 10px 16px, transparent 16px 20px, var(--indigo) 20px 26px, transparent 26px 30px, var(--indigo) 30px 36px, transparent 36px 40px, var(--terre) 40px 46px, transparent 46px 50px); transition: width .1s; }
.controls { display: flex; gap: 10px; justify-content: center; }
.controls.after { margin-top: 10px; }
.controls.after button { flex: 1; margin-top: 0; }
.big { font-size: 17px; font-weight: 600; padding: 14px 28px; border-radius: var(--radius-pill); min-width: 200px; min-height: 56px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.rec { background: var(--terre); color: var(--on-terre); box-shadow: var(--shadow-pop); } .rec:active { background: var(--terre-hover); }
.stop { background: var(--ink); color: var(--coton); animation: ial-halo 1.6s ease-in-out infinite; }
@keyframes ial-halo { 0%, 100% { box-shadow: 0 0 0 4px rgba(168, 76, 38, .18); } 50% { box-shadow: 0 0 0 12px rgba(168, 76, 38, .06); } }
@media (prefers-reduced-motion: reduce) { .stop { animation: none; } }
.rec::before, .stop::before { content: ""; width: 22px; height: 22px; background: currentColor; -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; }
.rec { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 19v3'/%3E%3Cpath d='M19 10v2a7 7 0 0 1-14 0v-2'/%3E%3Crect x='9' y='2' width='6' height='13' rx='3'/%3E%3C/svg%3E"); }
.stop { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Crect x='5' y='5' width='14' height='14' rx='3'/%3E%3C/svg%3E"); }
#playback { width: 100%; margin-top: 12px; }
.status { min-height: 22px; text-align: center; color: var(--ink-muted); margin: 10px 0 0; }
.status.ok { color: var(--vert); } .status.err { color: var(--rouge); }

/* ---------- validation, transcription, traduction, évaluation ---------- */
.validator { text-align: center; margin-top: 8px; }
.validator audio { width: 100%; margin: 6px 0 4px; }
.validator .controls { gap: 12px; }
.good { background: var(--indigo); color: var(--on-indigo); min-width: 140px; } .badv { background: var(--rouge); color: var(--on-rouge); min-width: 140px; }
.reason { background: var(--coton-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 12px 14px; margin-top: 12px; text-align: left; }
.reason .primary { margin-top: 10px; }
.choice { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; background: var(--coton-raised); border: 1.5px solid var(--line-strong); border-radius: var(--radius-lg); padding: 12px 14px; margin: 8px 0; font-size: 16px; font-weight: 400; color: var(--ink); }
.choice:active, .choice:focus { border-color: var(--indigo); }
.choice .tag { flex: 0 0 auto; background: var(--indigo); color: var(--on-indigo); border-radius: 50%; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.choice .txt { flex: 1; font-family: var(--font-parole); font-size: 19px; line-height: 28px; }
#labelOptions .choice { padding: 10px 14px; font-size: 15px; } #labelOptions .choice .txt { font-family: var(--font-sans); font-size: 15px; line-height: 22px; }
.svcard { background: var(--coton-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 12px 14px; margin: 8px 0; }
.svcard b { display: block; margin-bottom: 4px; }
.svcard .bar { height: 6px; background: var(--coton-soft); border-radius: 4px; overflow: hidden; margin: 6px 0; }
.svcard .bar div { height: 100%; background: var(--indigo); }

/* ---------- listes et pastilles ---------- */
.list { list-style: none; padding: 0; margin: 0; }
.list li { background: var(--coton-raised); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 10px 12px; margin: 6px 0; display: flex; gap: 8px; align-items: baseline; }
.list .txt { flex: 1; font-size: 14px; } .list small { color: var(--ink-muted); }
.list .empty { color: var(--ink-muted); justify-content: center; }
.badge { font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 3px 8px; border-radius: var(--radius-sm); background: var(--coton-soft); color: var(--ink); white-space: nowrap; }
.badge.pending { background: var(--indigo-soft); color: var(--indigo); } .badge.validated { background: var(--vert-soft); color: var(--vert); } .badge.rejected { background: var(--rouge-soft); color: var(--rouge); }
.badge.level { background: var(--ocre-soft); color: var(--ocre-deep); }
.refcode { font-size: 22px; font-weight: 700; letter-spacing: .06em; display: flex; align-items: center; gap: 10px; margin: 6px 0; font-variant-numeric: tabular-nums; }
table.lb { width: 100%; border-collapse: collapse; font-size: 14px; }
table.lb td { padding: 8px 4px; border-bottom: 1px solid var(--line); }
table.lb tr.me td { background: var(--indigo-soft); font-weight: 600; }
table.lb td.rank { width: 28px; color: var(--ink-muted); } table.lb td.num { text-align: right; font-variant-numeric: tabular-nums; }
.camp { margin: 8px 0; }
.camp .bar { height: 8px; background: var(--coton-soft); border-radius: 4px; overflow: hidden; margin-top: 4px; }
.camp .bar div { height: 100%; background: var(--indigo); }
.camp small { color: var(--ink-muted); }
.msgs li { display: block; }
.msgs li.unread { background: var(--indigo-soft); border-color: var(--indigo-soft); }
.msgs .when { display: block; font-size: 12px; color: var(--ink-muted); margin-top: 2px; }
.msgs .txt { display: block; white-space: pre-wrap; }

/* ---------- consentement : la bulle de Jeli ---------- */
.consent-audio { background: var(--terre-soft); border-radius: var(--radius-xl) var(--radius-xl) var(--radius-xl) var(--radius-sm); padding: 12px 14px; margin: 8px 0; }
.consent-audio p { margin: 0 0 6px; display: flex; align-items: center; gap: 8px; color: var(--terre); }
.consent-audio .jeli-ico { width: 24px; height: 24px; flex: none; }
.consent-audio audio { width: 100%; }

/* ---------- barre basse ---------- */
.bottom { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: var(--coton-raised); border-top: 1px solid var(--line); padding: 6px 8px max(8px, env(safe-area-inset-bottom)); z-index: var(--z-nav); }
.bottom button { flex: 1; position: relative; background: none; border: 0; border-radius: var(--radius-md); color: var(--ink-muted); padding: 6px 4px 4px; min-height: 52px; font-size: 11px; line-height: 14px; font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.bottom button svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.bottom button.active { color: var(--indigo); }
.bottom button.active::before { content: ""; position: absolute; top: -7px; left: 50%; width: 28px; height: 3px; margin-left: -14px; border-radius: 0 0 3px 3px; background: var(--indigo); }
.bottom .dot { position: absolute; top: 4px; left: calc(50% + 6px); width: 9px; height: 9px; border-radius: 50%; background: var(--terre); }
