/* The thread's right column, condensed and balanced:
   - compact thread goal at the top (discreet ✎ button);
   - Documents & Attachments (only what waits for the user, with ✓ file and 2 side by side buttons Documents / Attachments);
   - Participants with a "⊙ Toi ▾" pill in the header and gauges without a noisy age;
   - wake-ups sorted chronologically and condensed to the next 2;
   - real Decisions separated from the life Journal in Details & history.
   Colours exclusively through the tokens of agora.css (theme.test.mjs). */

@media (min-width: 1200px) {
  #thread-main .thread-head .th-docs,
  #thread-main .thread-head .th-who { display: none; }
}

/* -- Order and breathing of the right column cards -- */
#thread-main .thread-rail { gap: 10px; }
#thread-main .thread-rail > .card { padding: 11px 13px; border-radius: 13px; }
#thread-main .thread-rail > .rail-head { order: 0; }
#thread-main .thread-rail > .rail-ident { order: 0; }
#thread-main .thread-rail > .thread-goal { order: 1; }
#thread-main .thread-rail > .thread-docs { order: 2; }
#thread-main .thread-rail > .thread-people { order: 3; }
#thread-main .thread-rail > .thread-tracking { order: 4; padding: 4px 6px; }
#thread-main .thread-rail > .rail-actions { order: 5; }

/* -- 1. Compact thread goal -- */
#thread-main .thread-goal .section-title { margin: 0; align-items: center; }
#thread-main .thread-goal .goal-text {
  margin: 5px 0 0;
  font-size: 12.8px;
  line-height: 1.42;
  color: var(--text);
}
#thread-main .thread-goal .goal-edit-btn.icon-alone {
  min-height: 24px;
  width: 26px;
  padding: 0;
  justify-content: center;
  border-radius: 7px;
  font-size: 12px;
  color: var(--muted);
}

/* -- 2. "For You" card + "Pinned" section + 2 buttons Documents /
   Attachments -- */
#thread-main .thread-docs { display: flex; flex-direction: column; gap: 6px; }
#thread-main .thread-docs .section-title { margin: 0 0 2px; }

/* sober "Pinned" section, without a nested violet frame, taking up the
   diagonal pin and the typographic rhythm of pinned threads */
.doc-sec-pins {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.doc-sec-pins.with-suite {
  padding-bottom: 8px;
  margin-bottom: 2px;
  border-bottom: 1px solid var(--edging);
}
.doc-head-pins {
  display: flex;
  align-items: center;
  gap: 6px;
}
.doc-head-pins .ic-mark {
  flex: none;
  color: var(--accent);
}
/* A pinned line is a sober unified card (same surface as Participants),
   with its filled pin nested at the top right inside the card */
.doc-l-r.pin-r {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  padding: 7px 8px 8px 9px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}
.doc-l-r.pin-r:hover,
.doc-l-r.pin-r:focus-within {
  border-color: rgba(var(--accent-rgb), .38);
}
.doc-l-r.pin-r > .doc-l {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
}
.doc-l-r.pin-r > .doc-l:hover,
.doc-l-r.pin-r > .doc-l:focus-visible {
  background: none;
  border-color: transparent;
}
.doc-l-r.pin-r .doc-l-t b {
  font-weight: 600;
  color: var(--text);
}
.doc-l-mod {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--live);
  font-weight: 600;
}
.doc-l-mod::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--live);
}
.doc-l-mod::after {
  content: '·';
  margin-left: 2px;
  color: var(--faint);
  font-weight: 400;
}
.doc-l-pin {
  flex: none;
  width: 24px;
  height: 24px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--faint);
  cursor: pointer;
}
.doc-l-r.pin-r > .doc-l-pin {
  margin: -1px -2px 0 0;
}
.doc-l-pin:hover,
.doc-l-pin:focus-visible {
  color: var(--text);
  background: rgba(var(--accent-rgb), .14);
  outline: none;
}
.doc-l-pin.on {
  color: var(--accent);
}
.doc-l-pin.on:hover,
.doc-l-pin.on:focus-visible {
  color: var(--accent);
  background: rgba(var(--accent-rgb), .18);
}
/* On a computer, the unset pin of an ordinary line only shows on hover */
@media (pointer: fine) {
  #thread-main .thread-docs .doc-l-r:not(.pin-r) .doc-l-pin:not(.on) {
    opacity: 0;
  }
  #thread-main .thread-docs .doc-l-r:hover .doc-l-pin,
  #thread-main .thread-docs .doc-l-r:focus-within .doc-l-pin,
  #thread-main .thread-docs .doc-l-pin:focus-visible {
    opacity: 1;
  }
}
@media (hover: none) {
  .doc-l-pin { width: 36px; height: 36px; }
}
/* Toggle button in a document's top bar: same 32px size as Page | Board and
   ± Diff */
.trv-pin-b {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 11px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--muted);
  font: 500 12.5px var(--sans);
  white-space: nowrap;
  cursor: pointer;
}
.trv-pin-b[hidden] { display: none; }
.trv-pin-b .trv-ic,
.trv-pin-b .ic-mark {
  width: 13px;
  height: 13px;
  flex: none;
}
.trv-pin-b:hover {
  color: var(--text);
  border-color: var(--ligne-forte);
}
.trv-pin-b.on {
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), .38);
  background: rgba(var(--accent-rgb), .1);
}
.trv-pin-b.on:hover {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), .18);
}
.trv-pin-b:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.doc-footer-duo {
  display: flex;
  gap: 6px;
  padding-top: 7px;
  margin-top: 2px;
  border-top: 1px solid var(--edging);
}
.doc-footer-duo.alone {
  padding-top: 0;
  margin-top: 0;
  border-top: 0;
}
.doc-footer-btn {
  flex: 1 1 0;
  min-width: 0;
  min-height: 31px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--veil-nav);
  color: var(--muted);
  font: 500 11.5px var(--sans);
  cursor: pointer;
  white-space: nowrap;
}
.doc-footer-btn span:nth-child(2) {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}
.doc-footer-btn:hover,
.doc-footer-btn:focus-visible {
  color: var(--text);
  border-color: rgba(var(--accent-rgb), .5);
  background: rgba(var(--accent-rgb), .08);
}

/* -- Full screen view `/fils/<id>/docs` -- */
.docs-thread-body { max-width: 880px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.docs-thread-sec { display: flex; flex-direction: column; gap: 8px; }
.docs-thread-sec-t { font: 600 11.5px var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--faint); }
.docs-thread-list { display: flex; flex-direction: column; gap: 6px; }
.docs-thread-notes { border-top: 1px solid var(--line); padding-top: 12px; }
.docs-thread-notes > summary { cursor: pointer; margin-bottom: 8px; }

/* -- 3. Participants: "⊙ Toi ▾" pill in the header + 2 lines per agent -- */
#thread-main .thread-people .section-title { margin: 0 0 7px; align-items: center; gap: 7px; }
#thread-main .thread-people .people { display: flex; flex-direction: column; gap: 6px; }

.ppl-you-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 23px;
  padding: 0 8px;
  border-radius: 99px;
  border: 1px solid rgba(var(--human-rgb), .38);
  background: rgba(var(--human-rgb), .1);
  color: var(--humain);
  font: 500 11.5px var(--sans);
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
}
.ppl-you-pill:hover,
.ppl-you-pill:focus-visible {
  border-color: var(--humain);
  background: rgba(var(--human-rgb), .18);
  color: var(--text-strong);
}
.ppl-you-chevron { font-size: 10px; opacity: .8; }

.ppl-add-btn {
  min-height: 25px;
  padding: 0 9px;
  border-radius: 99px;
  border: 1px solid rgba(var(--accent-2-rgb), .35);
  background: rgba(var(--accent-2-rgb), .07);
  color: var(--accent-2);
  font: 500 11.5px var(--sans);
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
}
.ppl-add-btn:hover,
.ppl-add-btn:focus-visible {
  border-color: var(--accent-2);
  background: rgba(var(--accent-2-rgb), .14);
  color: var(--text);
}
.ppl-empty { margin: 0; font-size: 12px; }

#thread-main .thread-people .ppl.agent {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}
#thread-main .thread-people .ppl.agent .ppl-l1 {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
}
#thread-main .thread-people .ppl.agent .ppl-l1 .ppl-name {
  flex: 1 1 0;
  min-width: 0;
  max-width: none;
  font-size: 12.8px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#thread-main .thread-people .ppl.agent .ppl-l1 .ppl-act { flex: none; font-size: 11px; }
#thread-main .thread-people .ppl.agent .ppl-l1 .gs-more { margin-left: auto; flex: none; }
/* blocked delivery, the reason under the participant. */
#thread-main .thread-people .ppl-blocked {
  padding-left: 19px;
  font-size: 11.5px;
  color: var(--warn);
  overflow-wrap: anywhere;
}
#thread-main .thread-people .ppl-l2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-left: 19px;
  font-size: 11.5px;
  color: var(--muted);
}
#thread-main .thread-people .ppl-l2 .tag.modele {
  background: none;
  border: 0;
  padding: 0;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
#thread-main .thread-people .ppl.humain {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 6px 10px;
  border-radius: 10px;
}
#thread-main .thread-people .ppl.humain .gs-more { margin-left: auto; flex: none; }

/* -- 4. Wake-ups condensed & sorted -- */
#thread-main .thread-wakeups .wakeups-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#thread-main .thread-wakeups .reveil.wakeup-compact {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-2);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.wakeup-compact-h {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.wakeup-when-badge {
  flex: none;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(var(--accent-2-rgb), .12);
  color: var(--accent-2);
  font: 600 10.5px var(--mono);
}
.wakeup-cadence-short {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  color: var(--faint);
}
#thread-main .thread-wakeups .wakeup-compact .chip.wakeup-withdraw {
  min-height: 22px;
  padding: 0 7px;
  font-size: 11px;
}
.wakeup-text-short {
  font-size: 12px;
  line-height: 1.38;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  cursor: pointer;
}
.wakeup-text-short.deplie {
  display: block;
}
.wakeup-more-btn {
  align-self: flex-start;
  padding: 4px 8px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  font: 500 11.5px var(--sans);
  cursor: pointer;
}
.wakeup-more-btn:hover { color: var(--accent-2); }

/* -- 5. Thread journal in Details & history -- */
.facts-journal {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--edging);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.facts-journal-t {
  font: 600 10.5px var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--faint);
}
.facts-journal-i {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 11.8px;
  line-height: 1.38;
  color: var(--muted);
}
.facts-journal-m {
  font: 400 10.5px var(--mono);
  color: var(--faint);
}
