/* label-pulse.css — the folder line above the conversation list, and the list
 * of people it opens. It must read as part of the list header, not as a banner
 * pasted on top: one line, the list's own width, the list's own hairline.
 */
.crm-fold {
  --lp-ink: #1d1b1c;
  --lp-muted: #55606c;
  --lp-line: #e8ebe4;
  --lp-soft: #fbfcf9;
  --lp-blue: var(--crm-ink);
  --lp-warn: var(--crm-alert-ink, #c8243b);
  --lp-bad: #b42318;

  display: flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  border-bottom: 1px solid var(--lp-line);
  background: var(--lp-soft);
  color: var(--lp-ink);
  font-size: 12px;
  user-select: none;
  overflow: hidden;
  /* NOTHING ON THIS LINE REACTS TO THE POINTER EXCEPT THE BUTTON. The strip is
     a reading, not a control, and a whole bar lighting up under the cursor
     promises a click that does nothing. (It also used to inherit the link
     preview card's hover - the class was called `crm-lp` there too.) */
  cursor: default;
}
.crm-fold:hover { background: var(--lp-soft); }

:root.dark .crm-fold, .dark .crm-fold, [data-theme="dark"] .crm-fold {
  --lp-ink: #e8eaed;
  --lp-muted: #9aa3af;
  --lp-line: #2c3138;
  --lp-soft: #1b1e23;
  /* Dark mode's accent is the platform's own lime, not the light-mode blue:
     the dashboard around this screen turns lime in the dark, and a blue
     control inside it reads as a foreign screen. */
  --lp-blue: #d4fb08;
  --lp-warn: var(--crm-alert-ink, #c8243b);
  --lp-bad: #ff8a80;
}

/* The counts give ground first; the failure never does. In a 340px column
   there is not room for everything, so the half that is a reading shrinks and
   the half that is a job to do keeps its full width. */
.crm-fold__left {
  display: flex; align-items: center; gap: 7px;
  min-width: 0; flex: 1 1 auto; overflow: hidden; white-space: nowrap;
}
.crm-fold__n { white-space: nowrap; }
.crm-fold__n strong { font-weight: 600; font-variant-numeric: tabular-nums; }
.crm-fold__w { color: var(--lp-muted); font-weight: 400; }
.crm-fold__dot { color: var(--lp-line); }
.crm-fold__dim { color: var(--lp-muted); }

/* The one number that is a failure is the one that is a button. */
.crm-fold .crm-fold__bad {
  margin-inline-start: auto;
  flex: 0 0 auto;
  /* A flex container drops the leading space inside a child, so "542 no reply"
     rendered as "542no reply". The gap is the space. */
  display: inline-flex; align-items: baseline; gap: 4px;
  padding: 3px 10px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--lp-bad) 35%, transparent);
  background: color-mix(in srgb, var(--lp-bad) 9%, transparent);
  color: var(--lp-bad);
  font: inherit; cursor: pointer; white-space: nowrap;
}
.crm-fold .crm-fold__bad strong { font-weight: 700; font-variant-numeric: tabular-nums; }
.crm-fold .crm-fold__bad .crm-fold__w { color: var(--lp-bad); }
.crm-fold .crm-fold__bad:hover { background: color-mix(in srgb, var(--lp-bad) 16%, transparent); }

/* ------------------------------------------------------------------ panel */

.crm-foldp {
  --lp-ink: #1d1b1c;
  --lp-muted: #55606c;
  --lp-line: #e8ebe4;
  --lp-card: #ffffff;
  --lp-soft: #f6f7f3;
  --lp-blue: var(--crm-ink);
  --lp-warn: var(--crm-alert-ink, #c8243b);
  --lp-bad: #b42318;

  position: fixed;
  z-index: 70;
  overflow: auto;
  padding: 14px 18px 18px;
  border-inline-start: 1px solid var(--lp-line);
  background: var(--lp-soft);
  color: var(--lp-ink);
  font-size: 13px;
  text-align: start;
}

:root.dark .crm-foldp, .dark .crm-foldp, [data-theme="dark"] .crm-foldp {
  --lp-ink: #e8eaed;
  --lp-muted: #9aa3af;
  --lp-line: #2c3138;
  --lp-card: #1b1e23;
  --lp-soft: #15181c;
  --lp-blue: #d4fb08;
  --lp-warn: var(--crm-alert-ink, #c8243b);
  --lp-bad: #ff8a80;
}

.crm-foldp * { box-sizing: border-box; }
.crm-foldp button, .crm-foldp a, .crm-foldp input, .crm-foldp select { font: inherit; }

.crm-foldp__head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.crm-foldp__title { font-size: 15px; font-weight: 700; }
.crm-foldp__sub { font-size: 12px; color: var(--lp-muted); margin-top: 2px; unicode-bidi: plaintext; }
.crm-foldp .crm-foldp__x {
  margin-inline-start: auto; width: 26px; height: 26px; flex: 0 0 auto;
  border: 1px solid var(--lp-line); border-radius: 8px;
  background: var(--lp-card); color: var(--lp-muted); cursor: pointer; line-height: 1;
}
.crm-foldp .crm-foldp__x:hover { color: var(--lp-ink); border-color: var(--lp-blue); }

/* Export belongs where the hand is - beside the ✕ - not at the foot of three
   hundred rows, where he did not find it. */
.crm-foldp .crm-foldp__out {
  margin-inline-start: auto; flex: 0 0 auto; height: 26px; padding: 0 12px;
  border: 1px solid var(--lp-line); border-radius: 8px;
  background: var(--lp-card); color: var(--lp-muted); cursor: pointer; font-size: 12px;
}
.crm-foldp .crm-foldp__out:hover { color: var(--lp-blue); border-color: var(--lp-blue); }
.crm-foldp .crm-foldp__x { margin-inline-start: 0; }

/* CAN WE STILL WRITE TO THEM. The button exists only while somebody could
   actually be reached; when nobody can, the line says why in words. */
.crm-foldp__reach { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.crm-foldp__reach.is-shut {
  padding: 9px 12px; border-radius: 8px;
  border: 1px dashed var(--lp-line); background: transparent;
}
.crm-foldp__shut { font-size: 11.5px; color: var(--lp-muted); line-height: 1.5; }
.crm-foldp .crm-foldp__act {
  flex: 0 0 auto; padding: 6px 14px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--lp-blue) 40%, transparent);
  background: color-mix(in srgb, var(--lp-blue) 10%, transparent);
  color: var(--lp-blue); cursor: pointer; font-size: 12.5px; white-space: nowrap;
}
.crm-foldp .crm-foldp__act strong { font-weight: 700; font-variant-numeric: tabular-nums; }
.crm-foldp .crm-foldp__act:hover, .crm-foldp .crm-foldp__act.is-on {
  background: color-mix(in srgb, var(--lp-blue) 20%, transparent);
}
.crm-foldp__reachnote { font-size: 11.5px; color: var(--lp-muted); flex: 1 1 160px; }

.crm-foldp__chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.crm-foldp .crm-foldp__chip {
  padding: 5px 12px; border: 1px solid var(--lp-line); border-radius: 999px;
  background: var(--lp-card); color: var(--lp-muted); cursor: pointer;
  font-size: 12px; white-space: nowrap;
}
.crm-foldp .crm-foldp__chip:hover { border-color: var(--lp-blue); color: var(--lp-blue); }
.crm-foldp .crm-foldp__chip.is-on {
  border-color: color-mix(in srgb, var(--lp-blue) 40%, transparent);
  background: color-mix(in srgb, var(--lp-blue) 10%, transparent);
  color: var(--lp-blue); font-weight: 600;
}

.crm-foldp__tiles {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; margin-bottom: 12px;
}
.crm-foldp__tile {
  padding: 10px 12px; border: 1px solid var(--lp-line); border-radius: 8px; background: var(--lp-card);
}
.crm-foldp__v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.crm-foldp__l { font-size: 11.5px; color: var(--lp-muted); margin-top: 2px; }
.crm-foldp__tile.is-bad { border-color: color-mix(in srgb, var(--lp-bad) 45%, var(--lp-line)); }
.crm-foldp__tile.is-bad .crm-foldp__v { color: var(--lp-bad); }
.crm-foldp__tile.is-warn .crm-foldp__v { color: var(--lp-warn); }

/* What the two failures mean, in words, always on screen. The owner asked what
   "55" meant - the answer belongs here, not behind a hover. */
.crm-foldp__why {
  padding: 10px 12px; margin-bottom: 12px;
  border: 1px solid var(--lp-line); border-radius: 8px; background: var(--lp-card);
  font-size: 12px; line-height: 1.55;
}
.crm-foldp__whyline { color: var(--lp-muted); }
.crm-foldp__whyline + .crm-foldp__whyline { margin-top: 5px; }
.crm-foldp__whyn { color: var(--lp-ink); font-weight: 700; }
.crm-foldp__whyn.is-bad { color: var(--lp-bad); }
.crm-foldp__whyn.is-warn { color: var(--lp-warn); }
.crm-foldp__whynote { margin-top: 7px; font-size: 11.5px; color: var(--lp-muted); opacity: .85; }

/* Which door they came in by: an ad folder is not automatically a WhatsApp
   folder, and answering an Instagram DM in WhatsApp is not possible. */
.crm-foldp__doors { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.crm-foldp__doorlbl { font-size: 11.5px; color: var(--lp-muted); }
.crm-foldp__door {
  padding: 3px 10px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--lp-blue) 30%, transparent);
  background: color-mix(in srgb, var(--lp-blue) 8%, transparent);
  color: var(--lp-blue); font-size: 11.5px; white-space: nowrap;
}
.crm-foldp__door strong { font-weight: 700; font-variant-numeric: tabular-nums; }
/* On a row it is a quiet mark beside the name, not a figure of its own. */
.crm-foldp__door.is-door {
  padding: 1px 7px; font-size: 10.5px; font-weight: 600;
  border-color: color-mix(in srgb, var(--lp-blue) 28%, transparent);
}

.crm-foldp__list { display: grid; gap: 6px; }
.crm-foldp .crm-foldp__row {
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  padding: 8px 11px; border: 1px solid var(--lp-line); border-radius: 8px;
  background: var(--lp-card); color: inherit; text-decoration: none;
}
.crm-foldp .crm-foldp__row:hover { border-color: var(--lp-blue); }
/* New to us, or somebody we already had and lost again - two different kinds
   of loss, told apart on the row itself. */
.crm-foldp__mark {
  padding: 1px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 600;
  border: 1px solid var(--lp-line); color: var(--lp-muted); white-space: nowrap;
}
.crm-foldp__mark.is-new {
  border-color: color-mix(in srgb, var(--lp-warn) 40%, transparent); color: var(--lp-warn);
}
.crm-foldp__mark.is-open {
  border-color: color-mix(in srgb, var(--lp-blue) 40%, transparent); color: var(--lp-blue);
}

.crm-foldp__who { min-width: 0; flex: 1 1 auto; }
.crm-foldp__line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.crm-foldp__name { font-size: 13px; font-weight: 600; unicode-bidi: plaintext; }
/* What they actually said, in their own words. Two lines at most: this is the
   line that decides who gets opened first, not the message itself. */
.crm-foldp__said {
  font-size: 12px; color: var(--lp-ink); margin-top: 3px; unicode-bidi: plaintext;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; opacity: .85;
}
.crm-foldp__meta { font-size: 11px; color: var(--lp-muted); margin-top: 3px; unicode-bidi: plaintext; }
.crm-foldp__marks { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.crm-foldp__pill {
  padding: 2px 8px; border-radius: 999px; border: 1px solid var(--lp-line);
  font-size: 10.5px; color: var(--lp-muted); white-space: nowrap;
}
.crm-foldp__pill.is-bad { border-color: color-mix(in srgb, var(--lp-bad) 45%, transparent); color: var(--lp-bad); }

.crm-foldp__foot { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; margin-top: 14px; }
.crm-foldp .crm-foldp__link {
  padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--lp-blue); text-decoration: underline; text-underline-offset: 2px; font-size: 12.5px;
}
.crm-foldp__note { font-size: 11.5px; color: var(--lp-muted); flex: 1 1 200px; }
.crm-foldp__dim { font-size: 12.5px; color: var(--lp-muted); padding: 6px 0; }
