/* listenlive — design sobre, mobile-first, lisible. */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --text: #161a1d;
  --muted: #6b7280;
  --line: #e3e7ec;
  --accent: #2f6d63;        /* vert calme */
  --accent-soft: #e6f1ee;
  --new: #2f6d63;
  --updated: #b8741a;
  --danger: #b3261e;
  /* Paliers de notation (juré) : exceptionnel / solide / basique / fragile */
  --b-exc: #1f7a4d; --b-exc-soft: #e3f3ea;
  --b-sol: #2f6d63; --b-sol-soft: #e6f1ee;
  --b-bas: #b8741a; --b-bas-soft: #fbeede;
  --b-fra: #b3261e; --b-fra-soft: #fbe6e4;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.05);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15181b;
    --surface: #1d2125;
    --surface-2: #242a2f;
    --text: #eef1f3;
    --muted: #9aa4ad;
    --line: #2c3338;
    --accent: #5fb3a3;
    --accent-soft: #1f2d2a;
    --new: #5fb3a3;
    --updated: #e0a45a;
    --b-exc: #57c98c; --b-exc-soft: #16301f;
    --b-sol: #5fb3a3; --b-sol-soft: #1f2d2a;
    --b-bas: #e0a45a; --b-bas-soft: #33270f;
    --b-fra: #e8736b; --b-fra-soft: #341a1a;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.screen { min-height: 100dvh; display: flex; flex-direction: column; }
[hidden] { display: none !important; }

/* ---------- Login ---------- */
#login { align-items: center; justify-content: center; padding: 24px; }
.login-card {
  width: 100%; max-width: 360px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 32px 26px; text-align: center;
}
.brand { font-size: 30px; font-weight: 700; letter-spacing: -.5px; margin: 0 0 6px; }
.brand .dot { color: var(--accent); }
.tagline { color: var(--muted); margin: 0 0 26px; font-size: 15px; }
#login-form { display: flex; flex-direction: column; gap: 12px; }
input {
  font: inherit; padding: 14px 16px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--surface-2); color: var(--text);
}
input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
button {
  font: inherit; cursor: pointer; border: none; border-radius: 12px;
  padding: 14px 18px; font-weight: 600; background: var(--accent); color: #fff;
  transition: transform .06s ease, opacity .15s ease;
}
button:active { transform: scale(.985); }
button:disabled { opacity: .55; cursor: default; }
.error { color: var(--danger); font-size: 14px; margin: 4px 0 0; }

/* ---------- App ---------- */
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--bg); z-index: 5;
}
.brand-small { font-weight: 700; letter-spacing: -.3px; }
.brand-small .dot { color: var(--accent); }
.pill {
  font-size: 13px; font-weight: 600; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 5px 11px; border-radius: 999px; display: inline-flex; align-items: center; gap: 7px;
}
.pill .led { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.pill.live .led { background: var(--accent); animation: pulse 1.6s ease-in-out infinite; }
.pill.live { color: var(--accent); }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.35} }

.hd-right { display: flex; align-items: center; gap: 10px; }
.hd-spacer { width: 38px; }

/* Bascule de langue FR / EN (segmenté compact, à côté de « Redémarrer »). */
.lang-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface-2); height: 38px; }
.lang-toggle .lang-opt {
  background: transparent; color: var(--muted); border: none; border-radius: 0;
  padding: 0 11px; height: 100%; font-size: 12.5px; font-weight: 700; letter-spacing: .02em;
}
.lang-toggle .lang-opt + .lang-opt { border-left: 1px solid var(--line); }
.lang-toggle .lang-opt.active { background: var(--accent); color: #fff; }
.icon-btn {
  background: transparent; border: 1px solid var(--line); color: var(--text);
  width: 38px; height: 38px; padding: 0; border-radius: 10px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn svg { width: 19px; height: 19px; }

/* Le bas réserve la hauteur du footer fixe + la safe-area. Valeur de repli
   généreuse (état à 2 boutons) ; app.js l'ajuste finement via paddingBottom. */
main { flex: 1; overflow-y: auto; padding: 10px 12px calc(150px + env(safe-area-inset-bottom)); width: 100%; max-width: 680px; margin: 0 auto; }

/* Historique */
#history-list { display: flex; flex-direction: column; gap: 8px; }
.hist-item {
  display: block; width: 100%; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; color: var(--text); font: inherit; box-shadow: var(--shadow);
}
.hist-item .ht { font-weight: 650; font-size: 15px; margin-bottom: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hist-item .hm { font-size: 12.5px; color: var(--muted); }
.link-danger { background: transparent; color: var(--danger); border: none; padding: 2px 4px; font-size: 13px; font-weight: 600; width: auto; }
#history main .section-head h2 { font-size: 13px; text-transform: none; letter-spacing: 0; color: var(--text); }

.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 2px 2px 7px; }
.section-head h2 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0; }
.next { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.resume {
  background: var(--accent-soft); color: var(--text);
  border-radius: 10px; padding: 8px 11px; margin: 0 0 9px;
  font-size: 13.5px; line-height: 1.35; border: 1px solid var(--line);
}
.resume:empty { display: none; }

.points { display: flex; flex-direction: column; gap: 6px; }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid var(--line); border-radius: 10px;
  padding: 9px 12px; box-shadow: var(--shadow);
  animation: rise .22s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.card.is-new { border-left-color: var(--new); }
.card.is-updated { border-left-color: var(--updated); }
.card .top { display: flex; align-items: center; gap: 7px; margin-bottom: 1px; }
.card h3 { font-size: 15px; margin: 0; font-weight: 650; line-height: 1.25; flex: 1; }
.card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.35; }
.badge { flex: none; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: 2px 6px; border-radius: 999px; }
.badge.new { background: var(--accent-soft); color: var(--new); }
.badge.upd { background: rgba(184,116,26,.14); color: var(--updated); }
.empty { color: var(--muted); text-align: center; padding: 28px 16px; font-size: 14px; }

#transcript-section { margin-top: 14px; }
.toggle {
  width: 100%; background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--line); font-weight: 600; font-size: 13px; padding: 10px 13px; text-align: left;
}
.transcript {
  margin-top: 7px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px; max-height: 24dvh; overflow-y: auto;
  color: var(--muted); font-size: 13.5px; line-height: 1.4; white-space: pre-wrap; word-break: break-word;
}
.transcript:empty::after { content: attr(data-empty); color: var(--muted); }

footer {
  position: fixed; left: 0; right: 0; bottom: 0;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 72%, transparent);
}
.footer-actions { width: 100%; max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: 9px; }
.mic-btn {
  width: 100%;
  font-size: 16px; padding: 13px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; gap: 9px;
}
/* Gros bouton : archive la réunion en cours et libère le tableau de bord. */
.save-reset-btn {
  width: 100%; font-size: 17px; font-weight: 700; padding: 15px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--accent); color: #fff; box-shadow: var(--shadow);
}
.save-reset-btn .ic { width: 21px; height: 21px; }
.mic-btn.listening { background: var(--danger); }
.mic-btn.resume { background: var(--accent); animation: micpulse 1.8s ease-out infinite; }
@keyframes micpulse {
  0% { box-shadow: 0 0 0 0 rgba(47,109,99,.5); }
  70% { box-shadow: 0 0 0 14px rgba(47,109,99,0); }
  100% { box-shadow: 0 0 0 0 rgba(47,109,99,0); }
}
.mic-btn[disabled] { background: var(--muted); }
.mic-btn .ic { width: 20px; height: 20px; }

/* ---------- Évaluation (mode juré) ---------- */
.evaluation { display: flex; flex-direction: column; gap: 11px; }
.evaluation > * { animation: rise .22s ease both; }

/* couleur de palier portée par la classe b-* */
.b-exc { --bc: var(--b-exc); --bcs: var(--b-exc-soft); }
.b-sol { --bc: var(--b-sol); --bcs: var(--b-sol-soft); }
.b-bas { --bc: var(--b-bas); --bcs: var(--b-bas-soft); }
.b-fra { --bc: var(--b-fra); --bcs: var(--b-fra-soft); }

.eval-header {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--bcs); border: 1px solid var(--line); border-left: 4px solid var(--bc);
  border-radius: 12px; padding: 12px 15px; box-shadow: var(--shadow);
}
.eval-verdict-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin-bottom: 2px; }
.eval-verdict { font-size: 15.5px; font-weight: 650; line-height: 1.3; }
.eval-total { display: flex; align-items: baseline; gap: 1px; flex: none; }
.eval-total-num { font-size: 36px; font-weight: 800; color: var(--bc); line-height: 1; font-variant-numeric: tabular-nums; }
.eval-total-max { font-size: 14px; color: var(--muted); font-weight: 600; }

.eval-resume { margin: -2px 2px 0; color: var(--muted); font-size: 13.5px; line-height: 1.4; }

.eval-scores { display: flex; flex-direction: column; gap: 7px; }
.score-row {
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--bc);
  border-radius: 10px; padding: 9px 12px; box-shadow: var(--shadow);
}
.score-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.score-left { display: flex; align-items: baseline; gap: 8px; flex: 1; min-width: 0; }
.score-label { font-weight: 650; font-size: 14px; line-height: 1.25; }
.score-weight { font-size: 11px; color: var(--muted); font-weight: 600; flex: none; }
.score-note { flex: none; display: flex; align-items: baseline; gap: 1px; }
.score-note strong { font-size: 20px; font-weight: 800; color: var(--bc); font-variant-numeric: tabular-nums; }
.score-note-max { font-size: 12px; color: var(--muted); }
.score-comment { margin: 5px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.38; }

.eval-block { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; box-shadow: var(--shadow); }
.eval-block-title { margin: 0 0 7px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.eval-ul { margin: 0; padding-left: 19px; display: flex; flex-direction: column; gap: 5px; }
.eval-ul li { font-size: 13.5px; line-height: 1.42; }
.eval-li-empty { color: var(--muted); font-style: italic; list-style: none; margin-left: -19px; }
.block-strong { border-left: 3px solid var(--b-exc); }
.block-strong .eval-block-title { color: var(--b-exc); }
.block-strong .eval-ul li::marker { color: var(--b-exc); }
.block-weak { border-left: 3px solid var(--b-bas); }
.block-weak .eval-block-title { color: var(--b-bas); }
.block-weak .eval-ul li::marker { color: var(--b-bas); }

.eval-questions .q { padding: 7px 0; border-top: 1px solid var(--line); }
.eval-questions .q:first-of-type { border-top: none; padding-top: 1px; }
.q-line { display: flex; gap: 9px; align-items: baseline; }
.q-num {
  flex: none; min-width: 19px; height: 19px; padding: 0 4px; font-size: 11px; font-weight: 700;
  color: #fff; background: var(--muted); border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums;
}
.q-text { font-size: 14px; line-height: 1.38; font-weight: 550; }
.q-intent { margin: 3px 0 0 28px; font-size: 12px; color: var(--muted); line-height: 1.32; }
.eval-questions.is-tech { border-left: 3px solid var(--accent); }
.eval-questions.is-tech .eval-block-title { color: var(--accent); }
.eval-questions.is-tech .q-num { background: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
