/* Dana thread-status colours for Element Web.
 * custom.dana.js writes data-dana-state + data-dana-label onto each thread row.
 * Source of truth is a native Matrix reaction on the thread root:
 *   ✅ by a human -> closed (green)   ❓ by Dana -> waiting on human (red)   neither -> open (grey)
 *
 * Visual priority is deliberate: RED is the only state allowed a background tint.
 * "Closed" must recede — the panel exists to surface what still needs the human.
 */

/* belt-and-braces: never style inside an opened thread, only list rows */
.mx_ThreadView [data-dana-state] { all: revert; }

li[data-shape="ThreadsList"][data-dana-state] {
  position: relative;
  padding-inline-start: 16px;
  border-radius: 8px;
}

li[data-shape="ThreadsList"][data-dana-state]::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  inset-block: 6px;
  inline-size: 4px;
  border-radius: 0 3px 3px 0;
  background: var(--dana-colour);
  opacity: var(--dana-bar-opacity, 1);
}

li[data-shape="ThreadsList"][data-dana-state="red"] {
  --dana-colour: #e04540;
  --dana-chip: #d0342f;
  /* layered, NOT background-color: this selector outranks Element's own row rule,
   * so replacing the background would discard whatever the theme ships underneath */
  background-image: linear-gradient(color-mix(in srgb, #ff5b55 10%, transparent) 0 100%);
}
li[data-shape="ThreadsList"][data-dana-state="grey"] {
  --dana-colour: #7a828e;      /* clearly bluer and lighter than the green bar */
  --dana-chip: #616b78;
}
li[data-shape="ThreadsList"][data-dana-state="green"] {
  /* muted green, NOT dimmed green: still clears the 3:1 non-text indicator floor */
  --dana-colour: #2e8b6b;   /* distinctly green, not a second slate bar next to grey */
  --dana-chip: #2a7a5e;   /* >= 4.5:1 with white ink */
}

/* closed threads step back through weight, never through opacity - dimming text
 * below the contrast floor is not "de-emphasis", it is an accessibility bug */
li[data-shape="ThreadsList"][data-dana-state="green"] .mx_EventTile_line { font-weight: 400; }


/* Status chip. A filled chip with white ink, deliberately: it is the accessibility
 * fallback, so it must clear AA on the light AND the dark Element theme without
 * knowing which one is active. A hairline-on-transparent chip cannot do that. */
li[data-shape="ThreadsList"] .dana-pill {
  display: inline-block;
  vertical-align: middle;
  margin-inline-start: 8px;
  block-size: 18px;
  line-height: 18px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
  color: #fff;
  background-color: var(--dana-chip);   /* opaque: a translucent chip let the
                                           timestamp read through the label */
  opacity: 1;
}


