/* Customer journey (pages/journey.js, pages/journey-parts.js): the route of stages with the share
   that goes on between two of them, the radar, the samples and complaints registers, and the
   journey strip on a company's page. Built on the tokens of app.css, so the dark theme follows.
   The stages carry the tints of the deal stages (DESIGN.md): neutral, blue, peach, green. */

.jr-filters { margin: 0 0 14px; }
.jr-filters .btn.sm { text-decoration: none; }

/* The route: a stop per stage, and between two stops a dotted leg that carries the share going on. */
.jr-route { list-style: none; margin: 0 0 18px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(176px, 1fr)); gap: 14px 0; }
.jr-stop { display: flex; align-items: stretch; min-width: 0; }
.jr-stop-card { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; padding: 13px 14px 12px; border-radius: var(--r-wide); border: 1px solid var(--line); border-top: 3px solid var(--neutral-300); background: var(--surface-1); color: var(--text); text-decoration: none; transition: transform .16s ease, box-shadow .16s ease; }
.jr-stop-card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow-md); }
.jr-stop-card:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.jr-stop.on .jr-stop-card { box-shadow: 0 0 0 2px var(--primary); }
.jr-stop.tone-info .jr-stop-card { border-top-color: var(--info); background: color-mix(in srgb, var(--info-soft) 60%, var(--surface-1)); }
.jr-stop.tone-peach .jr-stop-card { border-top-color: var(--peach-500); background: color-mix(in srgb, var(--accent-soft) 60%, var(--surface-1)); }
.jr-stop.tone-good .jr-stop-card { border-top-color: var(--good); background: color-mix(in srgb, var(--good-soft) 70%, var(--surface-1)); }
.jr-stop-name { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: var(--text-2); min-width: 0; }
.jr-stop-name i { font-style: normal; width: 19px; height: 19px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-1); border: 1px solid var(--line); color: var(--text-2); font-size: 10.5px; font-weight: 700; flex: none; font-variant-numeric: tabular-nums; }
.jr-stop-num { font-family: var(--display); font-size: 27px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; margin: 5px 0 2px; }
.jr-stop-sub { font-size: 11.5px; color: var(--text-2); line-height: 1.45; }
.jr-stop-sub b { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 700; }
.jr-stop-sub.muted, .jr-stop-sub.muted b { color: var(--text-3); }
.jr-leg { flex: none; width: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; position: relative; text-align: center; }
.jr-leg::before { content: ""; position: absolute; inset-inline: 0; top: 50%; border-top: 2px dotted color-mix(in srgb, var(--text-3) 50%, transparent); }
.jr-leg b, .jr-leg small { position: relative; background: var(--page); border-radius: var(--r-pill); }
.jr-leg b { padding: 1px 5px; font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--text); }
.jr-leg small { padding: 0 3px; font-size: 9.5px; line-height: 1.25; color: var(--text-3); }
.jr-leg.weak b { background: var(--bad-soft); color: var(--bad); padding: 2px 7px; }
.jr-leg.weak small { color: var(--bad); font-weight: 700; }
[dir="rtl"] .jr-stop-name, [dir="rtl"] .jr-stop-sub { font-size: 12.5px; }
[dir="rtl"] .jr-leg small { font-size: 10.5px; }
@media (max-width: 640px) {
  .jr-route { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .jr-stop { flex-direction: column; }
  .jr-leg { width: auto; flex-direction: row; gap: 6px; padding: 7px 0; }
  .jr-leg::before { inset-inline: auto; inset-block: 0; left: 50%; top: 0; border-top: 0; border-inline-start: 2px dotted color-mix(in srgb, var(--text-3) 50%, transparent); }
}
@media (prefers-reduced-motion: reduce) { .jr-stop-card { transition: none; } .jr-stop-card:hover { transform: none; } }

/* What the figures say, in words. */
.jr-notes { display: grid; gap: 8px; margin: 0 0 20px; }
.jr-note { display: flex; gap: 11px; align-items: flex-start; padding: 11px 15px; border-radius: var(--r-compact); background: var(--surface-3); font-size: 13.5px; }
.jr-note > svg { width: 17px; height: 17px; flex: none; margin-top: 3px; color: var(--text-3); }
.jr-note p { margin: 0; line-height: 1.6; }
.jr-note p + p { margin-top: 3px; color: var(--text-2); }
.jr-note.weak { background: var(--bad-soft); }
.jr-note.weak > svg { color: var(--bad); }
.jr-note.info { background: var(--info-soft); }
.jr-note.info > svg { color: var(--info); }
.jr-note.good { background: var(--good-soft); }
.jr-note.good > svg { color: var(--good); }
[dir="rtl"] .jr-arrow { display: inline-block; transform: scaleX(-1); }
.jr-cuts { margin-bottom: 24px; }
table.jr-cut th, table.jr-cut td { padding-inline: 8px; }
table.data.jr-cut th, table.data.jr-cut th.sortable { white-space: normal; line-height: 1.3; vertical-align: bottom; }
table.jr-cut th:first-child, table.jr-cut td:first-child { padding-inline-start: 18px; }

/* The companies of a stage, and the tools of a row. */
.jr-list .section-heading { flex-wrap: wrap; }
.jr-list .chips .chip, .jr-views .chip { text-decoration: none; }
.jr-views { margin: 0 0 12px; }
.jr-tools { white-space: nowrap; text-align: end; }
.jr-tools .btn + .btn { margin-inline-start: 4px; }
.jr-tools-in { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.jr-tools-in .btn + .btn { margin-inline-start: 0; }
.jr-actions { display: inline-flex; gap: 2px; vertical-align: middle; }
.jr-next { font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.jr-next b { color: var(--text); font-weight: 600; }
.jr-forecast { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 7px; font-size: 12.5px; }
.jr-forecast .chip svg { width: 12px; height: 12px; }
.jr-cell-forecast { margin-top: 6px; }
.jr-said { margin-top: 3px; }
.jr-text { max-width: 44ch; }
.jr-pager { display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 12px; }
.jr-pager .btn { text-decoration: none; }
.jr-pager .btn.disabled { pointer-events: none; opacity: .5; }

/* The radar: one card per kind of signal, the busy ones first to the eye. */
.jr-radar { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 470px), 1fr)); gap: 16px; align-items: start; }
.jr-clear { margin-bottom: 16px; }
.jr-section .card-head > svg { width: 17px; height: 17px; flex: none; color: var(--brand); }
.jr-section .card-head .small-count { margin-inline-start: auto; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.jr-section:not(.quiet) .card-head .small-count { background: var(--accent-soft); color: var(--accent-ink); }
.jr-section.quiet { box-shadow: none; background: transparent; }
.jr-section.quiet .card-head > svg { color: var(--text-3); }
.jr-section-hint { margin: 0; padding: 10px 18px 8px; font-size: 12.5px; color: var(--text-2); line-height: 1.55; }
.jr-section .empty-line { padding: 4px 18px 14px; border-bottom: 0; }
.jr-rows { display: grid; }
.jr-row { display: flex; gap: 8px 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 11px 18px; border-top: 1px solid var(--line); }
.jr-row-main { min-width: 0; flex: 1 1 250px; }
.jr-row-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.jr-row-why { font-size: 12.5px; color: var(--text-2); margin-top: 3px; line-height: 1.6; }
.jr-row-why b { color: var(--text); font-weight: 600; }
.jr-row-side { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-inline-start: auto; }
.jr-more { margin: 0; padding: 0 18px 12px; }

/* The registers. */
.jr-tiles { margin: 0 0 14px; }
.tile .jr-tile-word { font-size: 18px; white-space: normal; line-height: 1.25; padding: 5px 0 4px; }

/* The one-press answers of a call, a WhatsApp message and a sample. */
.jr-who { margin: 0 0 10px; font-weight: 600; }
.jr-outcomes { gap: 8px; margin: 2px 0 14px; }
.jr-outcomes .chip { font-size: 13px; padding: 9px 15px; cursor: pointer; }
.jr-outcomes .chip:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }

/* A company's own journey, on its page. */
.jr-strip { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--r-wide); padding: 16px 20px 14px; margin: 16px 0; }
.jr-strip-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.jr-strip-head h2 { font-size: 14px; }
.jr-strip-link { margin-inline-start: auto; }
.jr-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); }
.jr-steps li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; padding: 22px 3px 0; font-size: 11.5px; color: var(--text-3); min-width: 0; }
.jr-steps li::before { content: ""; position: absolute; top: 7px; inset-inline-start: -50%; width: 100%; border-top: 2px dotted color-mix(in srgb, var(--text-3) 50%, transparent); }
.jr-steps li:first-child::before { display: none; }
.jr-steps li.done::before { border-top: 2px solid var(--brand); }
.jr-steps .dot { position: absolute; top: 1px; left: 50%; transform: translateX(-50%); width: 14px; height: 14px; border-radius: 50%; background: var(--surface-1); border: 2px solid color-mix(in srgb, var(--text-3) 55%, transparent); z-index: 1; }
.jr-steps li.done .dot { background: var(--brand); border-color: var(--brand); }
.jr-steps li.here .dot { box-shadow: 0 0 0 4px var(--brand-soft); }
.jr-steps li b { font-weight: 600; color: var(--text-2); overflow-wrap: anywhere; line-height: 1.3; }
.jr-steps li.done b { color: var(--text); }
.jr-steps li.here b { color: var(--brand-ink); font-weight: 700; }
.jr-steps small { font-size: 10.5px; }
.jr-strip-foot { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--text-2); }
.jr-last b { color: var(--text); font-weight: 600; }
@media (max-width: 720px) {
  .jr-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 14px; }
  .jr-steps li:nth-child(5)::before { display: none; }
}

/* A sample or a complaint as a small card, in the company's column. */
.jr-mini { border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface-1); padding: 14px 16px; margin-bottom: 10px; }
.jr-mini-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.jr-mini-head b { font-size: 13.5px; overflow-wrap: anywhere; }
.jr-mini .micro { margin-top: 4px; line-height: 1.6; }
.jr-mini-tools { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
#nav a[data-nav="journey"] { white-space: nowrap; }
