/* écran 04 · chronologie (et « Mon histoire » côté client) */
.ch { display: grid; grid-template-columns: minmax(0, 1fr) 560px; align-items: start; min-height: 100vh; }
.ch-left { min-width: 0; padding: 24px 28px 48px; }
.ch-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.ch-sup { font-size: 12.5px; color: var(--muted); }
.ch-h1 { font-family: var(--serif); font-weight: 500; font-size: 30px; margin-top: 4px; line-height: 1.15; }
.ch-contrab { display: flex; align-items: center; gap: 10px; border-radius: 9px; padding: 8px 12px; font-size: 13.5px; font-weight: 600; border: 1px solid var(--border); background: #fff; color: var(--steel); cursor: pointer; }
.ch-contrab.on { background: var(--dark-2); border-color: var(--dark-2); color: #fff; }
.ch-knob { width: 30px; height: 17px; border-radius: 9px; position: relative; background: var(--faint-3); flex: none; }
.ch-knob i { position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: #fff; transition: left .15s; }
.ch-contrab.on .ch-knob { background: var(--blue); } .ch-contrab.on .ch-knob i { left: 15px; }
.ch-chips { display: flex; gap: 8px; margin: 16px 0 14px; flex-wrap: wrap; }
.ch-chip { font-size: 13px; font-weight: 500; border-radius: 999px; padding: 6px 13px; background: #fff; border: 1px solid var(--line); color: var(--text-2b); cursor: pointer; }
.ch-chip.c-wait { color: var(--wait-fg); } .ch-chip.c-lack { color: var(--lack-fg); } .ch-chip.c-ok { color: var(--ok-fg); }
.ch-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }
.ch-contrabar { background: var(--dark-2); color: #D9DEE5; border-radius: 12px; padding: 12px 16px; margin-bottom: 12px; font-size: 13.5px; line-height: 1.5; }
.ch-list { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.ch-ph { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 16px; background: var(--surface-2); border: 0; border-bottom: 1px solid var(--line-soft); border-top: 1px solid var(--line-soft); text-align: left; cursor: pointer; color: var(--ink); }
.ch-ph:first-child { border-top: 0; }
.ch-phn { font-size: 12px; font-weight: 700; color: var(--label); }
.ch-ph h3 { font-size: 14.5px; font-weight: 700; }
.ch-phmeta { font-size: 12.5px; color: var(--meta); margin-left: auto; text-align: right; }
.ch-gap { padding: 8px 16px; border-bottom: 1px solid var(--line-soft-2); font-size: 12.5px; } .ch-gap b { font-weight: 600; }
.ch-gap .rule { border-top: 0; height: 1px; background: repeating-linear-gradient(90deg, var(--gap-line) 0 5px, transparent 5px 10px); }
.ch-row { display: grid; grid-template-columns: 100px minmax(0, 1fr) 112px 44px; gap: 12px; align-items: start; padding: 13px 16px; border-bottom: 1px solid var(--line-soft-2); cursor: pointer; background: #fff; }
.ch-row:hover { background: var(--surface-2); }
.ch-row.on { background: var(--select); box-shadow: inset 3px 0 0 var(--blue); }
.ch-date { font-size: 12.5px; color: var(--meta); line-height: 1.4; padding-top: 1px; } .ch-date div { font-size: 11px; color: var(--faint); margin-top: 2px; }
.ch-title { min-width: 0; font-size: 14.5px; font-weight: 500; line-height: 1.4; }
.ch-mine { font-size: 12px; font-weight: 400; color: var(--meta); }
.ch-weak { margin-top: 6px; font-size: 12.5px; line-height: 1.45; color: var(--steel); background: var(--soft); border-radius: 6px; padding: 6px 9px; font-weight: 400; } .ch-weak b { font-weight: 700; }
.ch-row .pill { padding: 4px 9px; font-size: 12px; }
.ch-nb { font-size: 12.5px; color: var(--muted); text-align: right; padding-top: 3px; }
.ch-more { display: block; width: 100%; padding: 10px 16px 10px 128px; border: 0; border-bottom: 1px solid var(--line-soft-2); background: #fff; text-align: left; font-size: 13px; color: var(--blue); font-weight: 500; cursor: pointer; }

/* panneau du fait ouvert */
.ch-panel { position: sticky; top: 0; height: 100vh; overflow: auto; background: #fff; border-left: 1px solid var(--line); display: flex; flex-direction: column; }
.with-admin .ch-panel { top: 38px; height: calc(100vh - 38px); }
.ch-pbody { padding: 22px 28px 0; flex: 1; }
.ch-ptop { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 12.5px; color: var(--meta); }
.ch-ptitle { font-family: var(--serif); font-weight: 500; font-size: 26px; line-height: 1.25; margin-top: 10px; text-wrap: balance; }
.ch-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.ch-card { border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; min-width: 0; }
.ch-k { display: flex; justify-content: space-between; align-items: baseline; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--label); font-weight: 700; }
.ch-edit { font-size: 12px; text-transform: none; letter-spacing: 0; font-weight: 500; }
.ch-k2 { font-size: 11px; color: var(--label); margin: 8px 0 4px; }
.ch-dval { font-size: 15px; font-weight: 600; margin-top: 4px; }
.ch-card .prec i { font-size: 11px; padding: 2px 6px; font-weight: 600; background: var(--line-soft-2); }
.ch-card .prec i.on { background: var(--ink); color: #fff; }
.ch-why { font-size: 12px; line-height: 1.45; color: var(--muted); margin-top: 8px; }
.ch-pillw { margin-top: 6px; } .ch-pillw .pill { padding: 4px 9px; font-size: 12px; }
.ch-trace { font-size: 12.5px; line-height: 1.5; color: var(--text-2); margin-top: 8px; }
.ch-src { font-size: 12px; color: var(--muted); margin-top: 4px; }
.ch-dform { display: flex; flex-direction: column; gap: 8px; } .ch-dform .input { font-size: 13px; padding: 7px 9px; }
.ch-precpick { flex-wrap: wrap; gap: 4px; }
.ch-precpick button { border: 0; font-size: 12px; padding: 4px 9px; border-radius: 5px; background: var(--line-soft-2); color: var(--label); font-weight: 600; cursor: pointer; }
.ch-precpick button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.ch-story { font-family: var(--serif); font-size: 17.5px; line-height: 1.66; color: #22262B; margin-top: 18px; text-wrap: pretty; max-width: 64ch; }
.ch-story.empty-story { font-size: 15px; color: var(--meta); font-style: italic; }
.ch-notes { margin-top: 14px; } .ch-note { font-size: 13px; color: var(--text-2b); padding: 6px 10px; background: var(--soft-2); border-radius: 6px; margin-top: 6px; }
.ch-contra { margin-top: 16px; background: var(--dark-2); color: #D9DEE5; border-radius: 10px; padding: 13px 15px; }
.ch-ck { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: #8A95A3; font-weight: 700; }
.ch-cclaim { font-size: 14px; line-height: 1.5; color: #fff; margin-top: 6px; } .ch-cans { font-size: 12.5px; color: #9AA3AF; margin-top: 5px; } .ch-ctrace { font-size: 11.5px; color: #6F7A88; margin-top: 6px; }
.ch-wform { display: flex; flex-direction: column; gap: 8px; }
.input.dark { background: #232B36; border-color: var(--dark-line); color: #fff; font-size: 13.5px; } .input.dark::placeholder { color: #6F7A88; }
.ch-addweak { display: block; margin-top: 12px; font-size: 13px; }
.ch-sech { display: flex; justify-content: space-between; align-items: baseline; margin: 22px 0 8px; }
.ch-sec { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--label); font-weight: 700; }
.ch-mt { margin-top: 20px; margin-bottom: 8px; }
.ch-sm { font-size: 12.5px; font-weight: 500; }
.ch-pieces { display: flex; flex-direction: column; }
.ch-piece { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 7px 0; border: 0; border-top: 1px solid var(--line-soft-2); background: none; text-align: left; color: var(--ink); cursor: pointer; font-size: 13.5px; line-height: 1.4; }
.ch-piece .cote { justify-content: center; padding: 2px 5px; }
.ch-est { display: block; font-size: 12px; color: var(--meta); margin-top: 1px; }
.ch-size { font-size: 12px; color: var(--label); }
.ch-none { font-size: 13px; color: var(--meta); padding: 4px 0; }
.ch-lack { display: block; width: 100%; border: 1px solid var(--lack-border); background: var(--lack-box); border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; text-align: left; cursor: pointer; color: inherit; }
.ch-lackt { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; font-weight: 600; color: var(--lack-fg); line-height: 1.4; }
.ch-lacku { font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.ch-lackc { font-size: 12.5px; line-height: 1.5; color: var(--lack-text); margin-top: 4px; } .ch-lacks { font-size: 12px; color: var(--lack-meta); margin-top: 5px; }
.ch-q { font-size: 13.5px; line-height: 1.5; color: var(--text-2); padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; }
.ch-tabs { display: grid; gap: 4px; background: var(--line-soft-2); border-radius: 9px; padding: 3px; }
.ch-tabs button { border: 0; border-radius: 7px; padding: 7px 8px; font-size: 12.5px; font-weight: 600; background: transparent; color: var(--muted); cursor: pointer; }
.ch-tabs button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(16,24,40,.1); }
.ch-viswho { font-size: 12px; color: var(--muted); margin: 8px 0 4px; }
.ch-nomsg { font-size: 13px; color: var(--meta); padding: 14px 0; line-height: 1.5; }
.ch-msg { padding: 11px 13px; border-radius: 10px; margin-top: 8px; }
.ch-msg.msg-shared { background: #fff; border: 1px solid var(--border); } .ch-msg.msg-firm { background: var(--line-soft-2); border: 1px solid var(--line-soft-2); } .ch-msg.msg-private { background: #fff; border: 1px dashed var(--faint-2); }
.ch-msgh { display: flex; gap: 8px; font-size: 12px; color: var(--meta); } .ch-msgh b { font-weight: 600; color: var(--steel); } .ch-msgh .push { margin-left: auto; }
.ch-msgb { font-size: 13.5px; line-height: 1.55; color: #22262B; margin-top: 4px; white-space: pre-wrap; }
.ch-editor { margin-top: 10px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.ch-editor textarea { width: 100%; border: 0; resize: vertical; padding: 10px 12px; font-size: 13.5px; outline: none; color: var(--ink); display: block; min-height: 56px; }
.ch-editf { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px 8px 12px; background: var(--surface-2); border-top: 1px solid var(--line-soft); font-size: 12px; color: var(--muted); }
.ch-editf b { font-weight: 600; color: var(--steel); }
.ch-bar { position: sticky; bottom: 0; margin-top: 24px; background: #fff; border-top: 1px solid var(--line); padding: 14px 28px; }
.ch-acts { display: flex; gap: 8px; } .ch-acts .btn { flex: 1; padding: 10px; } .ch-acts .btn.primary { flex: 1.4; }
.ch-actnote { font-size: 12px; color: var(--meta); margin-top: 8px; }
.ch-decided { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--text-2); } .ch-decided .btn { margin-left: auto; }
.ch-plain { font-size: 15px; line-height: 1.6; color: var(--text-2); margin: 12px 0 18px; max-width: 60ch; }
.ch-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ch-storyin { font-family: var(--serif); font-size: 17px; line-height: 1.6; }
@media (max-width: 1180px) { .ch { grid-template-columns: minmax(0, 1fr); } .ch-panel { position: static; height: auto; border-left: 0; border-top: 1px solid var(--line); } .with-admin .ch-panel { height: auto; } }
@media (max-width: 860px) {
  .ch-left { padding: 18px 16px 24px; } .ch-row { grid-template-columns: 76px minmax(0, 1fr); } .ch-row > div:nth-child(3) { grid-column: 2; } .ch-nb { display: none; }
  .ch-more { padding-left: 16px; } .ch-pbody { padding: 18px 16px 0; } .ch-bar { padding: 12px 16px; } .ch-cards, .ch-row2 { grid-template-columns: 1fr; } .ch-acts { flex-wrap: wrap; }
}
