/* Pages réservées Journal des erreurs + Historique des modifications.
   Ordre de chargement fixé dans index.html (ex-style.css découpé : ne pas le changer). */
/* ---------- Journal des erreurs + Historique des modifications (pages réservées, voir shell.js / state.js) ---------- */
.jrn-overview { margin-bottom: 14px; }
.jrn-starts-slot:empty { display: none; }
.jrn-starts-box { margin: 0 0 18px; font-size: 13.5px; color: var(--text-muted); }
.jrn-starts-box summary { cursor: pointer; padding: 4px 0; }
.jrn-starts { margin: 6px 0 0; padding-left: 20px; columns: 2; column-gap: 32px; }
.jrn-filter { align-items: flex-end; }
.jrn-search { flex: 1 1 240px; }
.jrn-search input { width: 100%; }
.jrn-toolbar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
.jrn-copy-status { font-size: 13px; }
.jrn-list, .hist-list { display: flex; flex-direction: column; gap: 8px; }
.jrn-count-line, .hist-count-line { margin: 0 0 6px; font-size: 13px; }
.jrn-empty, .hist-empty { min-height: 180px; }

.jrn-entry {
  --tone: var(--text-muted);
  background:
    linear-gradient(100deg, color-mix(in srgb, var(--tone) 10%, transparent), transparent 45%),
    var(--bg-elevated-2);
  border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden;
}
.jrn-entry-error { --tone: #ff3860; }
.jrn-entry-warn { --tone: #ffb020; }
.jrn-entry[open] { border-color: color-mix(in srgb, var(--tone) 35%, #3a4054); }
.jrn-summary {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px;
  padding: 10px 14px; cursor: pointer; list-style: none;
}
.jrn-summary::-webkit-details-marker { display: none; }
.jrn-summary::before { content: '▸'; order: -2; color: var(--text-muted); font-size: 12px; transition: transform 0.12s; }
/* Pastille de niveau (rouge / ambre / gris), juste après la flèche, avec un léger halo de la même teinte. */
.jrn-summary::after {
  content: ''; order: -1; flex: none; width: 9px; height: 9px; border-radius: 50%;
  background: var(--tone); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tone) 22%, transparent), 0 0 10px color-mix(in srgb, var(--tone) 45%, transparent);
}
.jrn-entry[open] > .jrn-summary::before { transform: rotate(90deg); }
.jrn-count { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); }
.jrn-line { flex: 1 1 240px; min-width: 0; font-size: 14px; overflow-wrap: anywhere; }
.jrn-when { font-size: 12.5px; color: var(--text-muted); white-space: nowrap; }
.jrn-body { padding: 0 14px 14px; }
.jrn-pre {
  margin: 0 0 10px; padding: 12px 14px; max-height: 340px; overflow: auto;
  background: #0b0d12; border: 1px solid var(--border); border-radius: 8px;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.5;
  white-space: pre-wrap; overflow-wrap: anywhere; user-select: text;
}
.jrn-times { margin: 0 0 10px; font-size: 13px; }
.jrn-actions { display: flex; align-items: center; gap: 10px; }
.jrn-clip { position: fixed; left: -9999px; top: 0; opacity: 0; }

.hist-access-slot .panel-card { padding: 18px 24px; margin-bottom: 16px; }
.hist-access-help { margin: 10px 0 0; font-size: 13.5px; max-width: 72ch; }
.hist-access-note { margin: 0; }
.hist-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; margin-bottom: 14px; }
.hist-list { gap: 12px; }
.hist-entry {
  --tone: var(--text-muted);
  position: relative; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px 20px 14px 24px; overflow: hidden; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.hist-entry::before {
  content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 4px;
  background: var(--tone); box-shadow: 0 0 14px var(--tone); opacity: 0.9;
}
.hist-entry-undoable { --tone: #00e5ff; }
.hist-entry-blocked { --tone: #ffb020; }
.hist-entry-undone, .hist-entry-info { --tone: #8c93a6; }
.hist-entry-undone::before, .hist-entry-info::before { box-shadow: none; opacity: 0.5; }
.hist-entry-undone .hist-title { color: var(--text-muted); }
.hist-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.hist-tag-undo { color: #c4a6ff; background: rgba(145, 70, 255, 0.14); border-color: rgba(145, 70, 255, 0.35); }
.hist-title { margin: 0 0 2px; font-size: 16px; line-height: 1.35; overflow-wrap: anywhere; }
.hist-meta { margin: 0 0 10px; font-size: 13.5px; color: var(--text-muted); }
.hist-meta strong { color: var(--text); }
.hist-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.hist-line {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px;
  padding: 8px 12px; font-size: 14px; background: var(--bg-elevated-2); border-radius: 8px;
}
.hist-label { flex: 0 0 auto; font-weight: 700; }
.hist-values { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; min-width: 0; overflow-wrap: anywhere; }
.hist-before { color: var(--text-muted); text-decoration: line-through; text-decoration-color: rgba(255, 56, 96, 0.6); }
.hist-arrow { color: var(--text-muted); }
.hist-after { color: #7fe7ab; }
.hist-removed { font-size: 12px; color: #ff8fa3; }
.hist-detail { flex: 1 1 100%; list-style: none; margin: 4px 0 0; padding: 0 0 0 4px; font-size: 13px; color: var(--text-muted); }
.hist-actions { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.hist-note { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--border); font-size: 13.5px; }
.hist-note-blocked { color: #ffc95c; }
.hist-note-info { color: var(--text-muted); }

@media (max-width: 820px) {
  .jrn-starts { columns: 1; }
  .jrn-toolbar-actions { margin-left: 0; }
  .jrn-when { white-space: normal; }
  .hist-entry { padding: 14px 14px 12px 18px; }
  .hist-access-slot .panel-card { padding: 16px 16px; }
}
