:root {
  /* Thème clair (défaut). data-theme="auto" suit le système ; "light"/"dark" forcent.
     Accent bleu, gris neutres ; sombre en noir profond. */
  --bg: #f5f6f8; --bg-side: #eceef2; --card: #ffffff; --text: #16191f; --muted: #5d6573;
  --border: #dde1e8; --hover: rgba(22, 25, 31, 0.06); --code-bg: #eff1f5;
  --accent: #2563eb; --accent-text: #ffffff; --error-bg: #fdecec; --error: #b42318;
  --info-bg: #e8f0fe; --info: #1d4ed8; --focus: #2563eb; --warn: #9a5b00;
  --add-bg: #e7f6ec; --add: #1a7f3c; --del-bg: #fdecec; --del: #b42318;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --bg-side: #0a0a0a; --card: #111111; --text: #ececec; --muted: #8b8b8b;
    --border: #262626; --hover: rgba(255, 255, 255, 0.07); --code-bg: #161616;
    --accent: #3b72f0; --accent-text: #ffffff; --error-bg: #3a1414; --error: #ff8a80;
    --info-bg: #10203f; --info: #9dbcff; --focus: #6e9bff; --warn: #e3b341;
    --add-bg: #0f2a19; --add: #6fdd95; --del-bg: #3a1414; --del: #ff8a80;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --bg-side: #0a0a0a; --card: #111111; --text: #ececec; --muted: #8b8b8b;
  --border: #262626; --hover: rgba(255, 255, 255, 0.07); --code-bg: #161616;
  --accent: #3b72f0; --accent-text: #ffffff; --error-bg: #3a1414; --error: #ff8a80;
  --info-bg: #10203f; --info: #9dbcff; --focus: #6e9bff; --warn: #e3b341;
  --add-bg: #0f2a19; --add: #6fdd95; --del-bg: #3a1414; --del: #ff8a80;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--card);
}
.brand { font-weight: 700; text-decoration: none; color: var(--text); }
.nav { display: flex; align-items: center; gap: 16px; }
.inline { display: inline; margin: 0; }
.wrap { padding: 32px 16px; display: flex; justify-content: center; }
.card {
  width: 100%; max-width: 440px; background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 24px;
}
h1 { font-size: 1.5rem; margin: 0 0 16px; }
h2 { font-size: 1.1rem; margin: 24px 0 8px; }
.form { display: flex; flex-direction: column; gap: 8px; }
.form-secondary { margin-top: 12px; }
label { font-weight: 600; font-size: 0.95rem; }
label.check { font-weight: 400; display: flex; align-items: center; gap: 8px; }
input[type="email"], input[type="password"], input[type="text"], input[type="url"],
input[type="search"], select, textarea {
  width: 100%; padding: 10px 12px; font-size: 1rem; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px;
}
input:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
button, .button {
  font: inherit; cursor: pointer; border-radius: 8px; padding: 10px 16px;
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  text-decoration: none; display: inline-block; text-align: center;
}
.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; margin-top: 8px; }
button.link { background: none; border: none; padding: 0; color: var(--accent); text-decoration: underline; }
.muted { color: var(--muted); font-size: 0.95rem; }
.alert { padding: 10px 12px; border-radius: 8px; margin: 0 0 16px; }
.alert-error { background: var(--error-bg); color: var(--error); }
.alert-info { background: var(--info-bg); color: var(--info); }
.table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.table th, .table td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
/* Saisie du code : 6 cases (amélioration progressive, code-input.js) */
.is-hidden { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.code-boxes { display: flex; gap: 8px; justify-content: space-between; }
.code-boxes input {
  width: 100%; max-width: 48px; height: 52px; padding: 0; text-align: center;
  font: 600 1.5rem ui-monospace, monospace; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px;
}

/* ============================================================ application (coque) */
.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; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 50; background: var(--card); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }
.icon { flex: none; display: inline-block; vertical-align: -0.2em; }
.small { font-size: 0.875rem; }
.warn { color: var(--warn); }
.grow { flex: 1; }
.danger { color: var(--error); border-color: var(--error); background: transparent; }
button.danger:hover { background: var(--error-bg); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
fieldset.choices { border: 0; padding: 0; margin: 8px 0; display: flex; flex-direction: column; gap: 6px; }
fieldset.choices legend { font-weight: 600; font-size: 0.95rem; margin-bottom: 4px; }
code { font: 0.9em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 5px; }

body.app { height: 100vh; height: 100dvh; overflow: hidden; }
.shell { display: flex; height: 100%; }
.sidebar {
  width: 272px; flex: none; display: flex; flex-direction: column; gap: 4px;
  background: var(--bg-side); border-right: 1px solid var(--border); padding: 12px 10px;
}
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 10px; }
.side-action, .side-link, .side-list a, .side-account {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px;
  color: var(--text); text-decoration: none; min-width: 0;
}
.side-action { font-weight: 600; }
.side-action:hover, .side-link:hover, .side-list a:hover, .side-account:hover { background: var(--hover); }
.side-list a[aria-current="page"], .side-account[aria-current="page"] { background: var(--hover); font-weight: 600; }
.side-list span, .side-account span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-search { display: flex; align-items: center; gap: 8px; padding: 0 10px; margin: 2px 0 6px; color: var(--muted); }
.side-search input { border: 0; background: transparent; padding: 6px 0; }
.side-search input:focus-visible { outline: none; }
.side-search:focus-within { box-shadow: inset 0 -2px 0 var(--focus); }
.side-scroll { flex: 1; overflow-y: auto; min-height: 0; }
.side-title { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin: 16px 10px 4px; }
.side-ws { font-size: 0.8rem; color: var(--muted); margin: 8px 10px 2px; }
.side-list { list-style: none; margin: 0; padding: 0; }
.side-list a { flex-direction: row; }
.side-list a:has(.side-conv) { flex-direction: column; align-items: flex-start; gap: 0; }
.side-conv { max-width: 100%; }
.side-sub { font-size: 0.75rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.side-link { color: var(--muted); font-size: 0.9rem; }
.side-empty { color: var(--muted); font-size: 0.9rem; margin: 2px 10px 4px; }
.side-foot { border-top: 1px solid var(--border); padding-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.side-foot-row { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; }
.theme-switch { display: flex; gap: 2px; margin: 0; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px;
  padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn[aria-pressed="true"] { color: var(--accent); background: var(--hover); }

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topline { display: flex; align-items: center; gap: 6px; min-height: 52px; padding: 8px 16px; border-bottom: 1px solid var(--border); }
.topline-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; overflow: hidden; }
.crumb { color: var(--muted); text-decoration: none; font-weight: 400; }
.crumb:hover { text-decoration: underline; }
.crumb-sep { color: var(--muted); font-weight: 400; }
.crumb-current { overflow: hidden; text-overflow: ellipsis; }
.main { flex: 1; overflow-y: auto; padding: 24px 16px 32px; }
.main:focus { outline: none; }
.main > .alert { max-width: 760px; margin: 0 auto 16px; }
.thread-col { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.thread-col.start { padding-top: 10vh; }
.thread-col.start > p { text-align: center; }
.hello { font-size: 1.75rem; font-weight: 600; text-align: center; margin: 0 0 8px; }
.accent { color: var(--accent); }
.center-card { max-width: 520px; margin: 4vh auto; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 24px; }
.center-card.wide { max-width: 760px; }
.project-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.chip { padding: 4px 12px; border: 1px solid var(--border); border-radius: 999px; color: var(--text); text-decoration: none; font-size: 0.9rem; }
.chip[aria-current="true"] { border-color: var(--accent); color: var(--accent); }
.conv-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.conv-list li + li { border-top: 1px solid var(--border); }
.conv-list a { display: flex; align-items: center; gap: 10px; padding: 12px 14px; color: var(--text); text-decoration: none; }
.conv-list a:hover { background: var(--hover); }
.conv-list a span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-list time { color: var(--muted); font-size: 0.8rem; }
.search-form, .row { display: flex; gap: 8px; align-items: center; }
.search-form .primary, .row button { margin-top: 0; display: inline-flex; gap: 6px; align-items: center; }
.inline-form { margin-bottom: 12px; }

/* ============================================================ fil */
.thread { display: flex; flex-direction: column; gap: 18px; }
.msg { display: flex; }
.msg-user { justify-content: flex-end; }
.bubble { background: var(--hover); border-radius: 16px; padding: 10px 14px; }
.msg-assistant .md { width: 100%; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p, .md ul, .md ol, .md blockquote, .md pre { margin: 0 0 10px; }
.md h3, .md h4, .md h5, .md h6 { margin: 16px 0 8px; font-size: 1.05rem; }
.md pre, .tool-out, .diff {
  background: var(--code-bg); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
  overflow-x: auto; font: 0.85rem/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.md pre code { background: none; padding: 0; }
.md-table { overflow-x: auto; margin: 0 0 10px; }
.md-table table { border-collapse: collapse; font-size: 0.925rem; }
.md-table th, .md-table td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; vertical-align: top; }
.md-table th { background: var(--hover); font-weight: 600; }
.md-table .t-center { text-align: center; }
.md-table .t-right { text-align: right; }
.md blockquote { border-left: 3px solid var(--border); padding-left: 12px; color: var(--muted); }
.live-text { white-space: pre-wrap; }
/* Étapes d'outil compactes : pastille à la taille du contenu, pleine largeur une fois ouverte. */
.tool { align-self: flex-start; max-width: 100%; border: 1px solid var(--border); border-radius: 8px; background: var(--card); }
.tool[open] { align-self: stretch; }
.tool + .tool { margin-top: -10px; }
.tool summary { display: flex; align-items: center; gap: 6px; padding: 3px 10px; cursor: pointer; color: var(--muted); font-size: 0.8rem; list-style: none; }
.tool summary .icon { width: 14px; height: 14px; }
.tool summary::-webkit-details-marker { display: none; }
.tool-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--text); }
.tool[open] .tool-label { flex: 1; }
.tool-state { font-size: 0.75rem; margin-left: 6px; white-space: nowrap; }
.tool.is-error .tool-state { color: var(--error); }
.tool.is-running .tool-state { color: var(--accent); }
.tool-out { margin: 0 12px 12px; max-height: 360px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.perm { border: 1px solid var(--accent); border-radius: 12px; padding: 14px; background: var(--card); }
.perm-title { display: flex; align-items: center; gap: 8px; font-size: 1rem; margin: 0 0 6px; }
.perm-label { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9rem; margin: 0 0 8px; overflow-wrap: anywhere; }
.diff { max-height: 420px; overflow: auto; margin: 0 0 10px; }
.diff span { display: block; white-space: pre-wrap; overflow-wrap: anywhere; padding-left: 1ch; text-indent: -1ch; }
.d-add { background: var(--add-bg); color: var(--add); }
.d-del { background: var(--del-bg); color: var(--del); }
.d-hunk { color: var(--accent); }
.d-file { color: var(--muted); }
.perm-form { display: flex; flex-direction: column; gap: 8px; }
.perm-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.perm-actions .primary { margin-top: 0; }
.working { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.9rem; }
/* Indicateur « l'agent travaille » : 4 points en carré, mouvement orbital (chacun glisse vers le
   centre, rebondit, dérive, revient), décalés de 0,2 s sur un cycle de 1,6 s. */
.dots { position: relative; width: 14px; height: 14px; flex-shrink: 0; display: inline-block; }
.dots i {
  position: absolute; width: 4px; height: 4px; border-radius: 50%; background: var(--accent);
  animation: dots 1.6s ease-in-out infinite; --dx: 2.5px; --dy: 2.5px;
}
.dots i:nth-child(1) { left: 1px; top: 1px; }
.dots i:nth-child(2) { right: 1px; top: 1px; animation-delay: 0.2s; --dx: -2.5px; }
.dots i:nth-child(3) { right: 1px; bottom: 1px; animation-delay: 0.4s; --dx: -2.5px; --dy: -2.5px; }
.dots i:nth-child(4) { left: 1px; bottom: 1px; animation-delay: 0.6s; --dy: -2.5px; }
@keyframes dots {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 1; }
  25% { transform: translate(var(--dx), var(--dy)) scale(0.6); opacity: 0.45; }
  50% { transform: translate(0, 0) scale(1.15); opacity: 1; }
  75% { transform: translate(-1px, 1px) scale(0.8); opacity: 0.7; }
}
@media (prefers-reduced-motion: reduce) { .dots i { animation: none; } }
.turn-note { margin: 0; }

/* ============================================================ saisie */
/* Conversation : la saisie reste collée en bas de la page, même quand le fil est court. */
.main.main-chat { padding-bottom: 0; }
.thread-col.chat { min-height: 100%; }
.chat .composer-wrap { margin-top: auto; padding-bottom: 16px; }
.composer-wrap { position: sticky; bottom: 0; padding-top: 8px; background: linear-gradient(transparent, var(--bg) 16px); display: flex; flex-direction: column; gap: 8px; }
.composer { border: 1px solid var(--border); border-radius: 16px; background: var(--card); padding: 10px 12px 8px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06); }
.composer:focus-within { border-color: var(--muted); }
.composer textarea { border: 0; background: transparent; padding: 4px 2px; resize: none; min-height: 56px; max-height: 40vh; font: inherit; }
.composer textarea:focus-visible { outline: none; }
.composer-bar { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.model-pill { font-size: 0.8rem; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px; max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.send-btn { width: 34px; height: 34px; padding: 0; border-radius: 10px; background: var(--accent); color: var(--accent-text); border: 0; display: inline-flex; align-items: center; justify-content: center; }
.stop-form { margin: 0; display: flex; justify-content: center; }
.stop-btn { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 6px 14px; }

/* ============================================================ panneau de droite */
.panel { width: 320px; flex: none; border-left: 1px solid var(--border); background: var(--bg); overflow-y: auto; padding: 16px; }
.panel-sec { border: 1px solid var(--border); border-radius: 12px; background: var(--card); padding: 12px 14px; margin-bottom: 12px; }
.panel-sec h2 { font-size: 0.95rem; margin: 0 0 8px; }
.steps, .outputs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 0.875rem; }
.steps li, .outputs li { display: flex; gap: 8px; align-items: flex-start; min-width: 0; }
.steps span, .outputs span { overflow-wrap: anywhere; }
.steps .is-done .icon { color: var(--add); }
.steps .is-error .icon { color: var(--error); }
.steps .is-running .icon { color: var(--accent); }
/* Panneau « Contexte » : barre empilée (SVG, sans style inline) + tableau par catégorie. */
.ctx-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 0 0 8px; font-size: 0.95rem; }
.ctx-bar { display: block; width: 100%; height: 8px; border-radius: 4px; overflow: hidden; margin-bottom: 10px; }
.ctx-guard { stroke: var(--text); stroke-width: 1.5; vector-effect: non-scaling-stroke; opacity: 0.6; }
.c-messages { fill: #4f7fd9; background: #4f7fd9; }
.c-results { fill: #d9733b; background: #d9733b; }
.c-tools { fill: #2a9d7a; background: #2a9d7a; }
.c-system { fill: #8f8a83; background: #8f8a83; }
.c-instructions { fill: #b9a98f; background: #b9a98f; }
.c-reserve { fill: #5d5953; background: #5d5953; }
.c-free { fill: var(--hover); background: var(--hover); }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 8px; vertical-align: -1px; }
.ctx-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.ctx-table th { text-align: left; font-weight: 400; padding: 3px 0; width: 100%; max-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctx-table td { text-align: right; padding: 3px 0 3px 8px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ctx-more { margin-top: 8px; font-size: 0.85rem; }
.ctx-more summary { cursor: pointer; color: var(--muted); }
.ctx-more ul { list-style: none; margin: 6px 0 0; padding: 0 0 0 18px; }
.ctx-more li { display: flex; justify-content: space-between; padding: 2px 0; }
.outputs li { align-items: baseline; }
.o-path { flex: 1; min-width: 0; }
.o-state { font-size: 0.75rem; color: var(--muted); white-space: nowrap; }
.o-nouveau .o-state { color: var(--add); }
.o-supprimé .o-state { color: var(--del); }
.o-supprimé .o-path { text-decoration: line-through; color: var(--muted); }

/* ============================================================ fenêtres */
.modal { border: 1px solid var(--border); border-radius: 14px; background: var(--card); color: var(--text); padding: 20px; width: min(440px, calc(100vw - 32px)); }
.modal::backdrop { background: rgba(0, 0, 0, 0.45); }
.modal h2 { margin-top: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.modal-actions .primary { margin-top: 0; }

/* ============================================================ petits écrans */
.only-narrow, .only-panel-narrow { display: none; }
@media (max-width: 1180px) {
  .only-panel-narrow { display: inline-flex; }
  .panel { position: fixed; inset: 0 0 0 auto; width: min(340px, 100vw); z-index: 30; transform: translateX(100%); transition: transform 0.2s; }
  .panel:target, .panel.is-open { transform: none; box-shadow: -4px 0 16px rgba(0, 0, 0, 0.15); }
  .panel-head { display: flex; justify-content: flex-end; margin-bottom: 8px; }
}
@media (max-width: 820px) {
  .only-narrow { display: inline-flex; }
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; transform: translateX(-100%); transition: transform 0.2s; }
  .sidebar:target, .sidebar.is-open { transform: none; box-shadow: 4px 0 16px rgba(0, 0, 0, 0.15); }
  .main { padding: 16px 12px 24px; }
  .bubble { max-width: 92%; }
  .hello { font-size: 1.4rem; }
}
@media (prefers-reduced-motion: reduce) { .panel, .sidebar { transition: none; } }

/* ============================================================ secrets */
.redacted { display: flex; align-items: center; gap: 6px; margin: 10px 0 0; color: var(--add); }
.secret-list { margin-bottom: 12px; }
.secret-row { display: flex; align-items: center; gap: 12px; padding: 6px 8px 6px 14px; }
.secret-row .muted { flex: 1; }
.center-card h2 { display: flex; align-items: center; gap: 8px; }

/* ============================================================ actions des messages, compte à rebours */
.msg-body { display: flex; flex-direction: column; min-width: 0; max-width: 100%; }
.msg-user .msg-body { align-items: flex-end; max-width: 85%; }
.msg-user .bubble { max-width: 100%; }
.msg-assistant .msg-body { width: 100%; }
.msg-meta { display: flex; align-items: center; gap: 2px; margin-top: 2px; min-height: 26px; color: var(--muted); font-size: 0.75rem; opacity: 0.55; transition: opacity 0.15s; }
.msg:hover .msg-meta, .msg-meta:focus-within { opacity: 1; }
@media (hover: none) { .msg-meta { opacity: 1; } }
.msg-meta .ts { margin-right: 6px; white-space: nowrap; }
.icon-btn.mini { width: 26px; height: 26px; }
.icon-btn.mini .icon { width: 15px; height: 15px; }
.icon-btn.is-copied, .code-copy.is-copied { color: var(--add); }
.md pre { position: relative; }
.code-copy {
  position: absolute; top: 6px; right: 6px; padding: 2px 8px; font-size: 0.75rem; border-radius: 6px;
  background: var(--card); color: var(--muted); border: 1px solid var(--border); opacity: 0; transition: opacity 0.15s;
}
.md pre:hover .code-copy, .code-copy:focus-visible { opacity: 1; }
@media (hover: none) { .code-copy { opacity: 1; } }
.perm-timer { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-size: 0.85rem; color: var(--muted); }
.perm-timer progress { flex: 1; height: 6px; border: 0; border-radius: 999px; background: var(--hover); appearance: none; -webkit-appearance: none; }
.perm-timer progress::-webkit-progress-bar { background: var(--hover); border-radius: 999px; }
.perm-timer progress::-webkit-progress-value { background: var(--accent); border-radius: 999px; transition: width 1s linear; }
.perm-timer progress::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
.perm-timer.is-urgent { color: var(--error); }
.perm-timer.is-urgent progress::-webkit-progress-value { background: var(--error); }
.perm-timer.is-urgent progress::-moz-progress-bar { background: var(--error); }
.perm-left { white-space: nowrap; }
@media (max-width: 820px) { .perm-timer { flex-wrap: wrap; } .perm-timer progress { flex-basis: 100%; } }

/* Heure des messages : au survol seulement, sauf pour le dernier message du fil. */
.msg .ts { display: none; }
.msg:hover .ts, .msg:focus-within .ts, article.msg:last-of-type .ts { display: inline; }
