/* Narrative choreography sits above the shared Fluent portal components. */
.j-threads {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
  overflow: visible;
}
.j-threads path {
  fill: none;
  stroke: var(--colorBrandStroke1);
  stroke-width: 1.25;
  stroke-dasharray: 1;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.j-time {
  flex-direction: column;
  width: min(310px, 100%);
  gap: 10px;
  margin-top: 8px;
}
.j-date-track {
  position: relative;
  display: flex;
  justify-content: space-between;
  width: 100%;
}
.j-date-track::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 22px;
  right: 22px;
  height: 1px;
  background: #cfc7b2;
}
.j-time .j-date-stop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  color: #514b40;
  font-weight: 400;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  z-index: 1;
}
.j-date-stop i {
  width: 9px;
  height: 9px;
  border: 1px solid #746c5e;
  background: #f4f1e8;
  border-radius: 50%;
}
.j-date-stop[aria-current] { color: #7b1e3b; font-weight: 600; }
.j-date-stop[aria-current] i { background: #7b1e3b; border-color: #7b1e3b; outline: 3px solid #f4f1e8; }
.j-date-stop[data-past="true"] i { background: #746c5e; }
.j-time .j-source-count { border: 0; padding: 0; font-size: 11px; font-weight: 400; }
.j-source {
  transform: translate(var(--gather-x, 0px), calc(var(--gather-y, 0px) + 24px * (1 - var(--arrival, 1))))
    rotate(calc(var(--tilt, 0deg) * (1 - var(--gather))))
    scale(calc(.98 + .02 * var(--arrival, 1) - .26 * var(--gather)));
}
.j-contributions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--spacingHorizontalM);
  padding: var(--j-inset);
  padding-bottom: 42px;
  flex: none;
  opacity: calc(var(--contribute-in, 0) * (1 - var(--contribute-out, 0)));
  transform: translateY(calc(10px * (1 - var(--contribute-in, 0))));
}
.j-contribution {
  display: flex;
  flex-direction: column;
  gap: var(--spacingVerticalS);
  padding: 12px;
  border: 1px solid var(--colorNeutralStroke2);
  border-radius: var(--borderRadiusMedium);
  background: var(--colorNeutralBackground2);
  min-width: 0;
}
.j-contribution > span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--colorNeutralForeground2);
  font-size: 11px;
}
.j-contribution .icon { width: 14px; height: 14px; }
.j-contribution p { font-size: 12px; line-height: 1.5; }
#journey:is([data-scene="extract"], [data-scene="compose"], [data-scene="read"]) .j-library-body {
  grid-template-columns: minmax(0, 1fr);
}
.j-reader { position: relative; }
.j-related-subject {
  display: flex;
  align-items: center;
  gap: 6px;
  align-self: flex-end;
  font-size: 11px;
  color: #514b40;
  padding: 5px 8px;
  background: var(--colorNeutralBackground2);
  border: 1px solid var(--colorNeutralStroke2);
  border-radius: var(--borderRadiusMedium);
  opacity: var(--contribute-in, 0);
}
.j-related-subject .icon { width: 14px; height: 14px; }
#journey:is([data-scene="extract"], [data-scene="compose"]) .j-reader { padding-top: 0; }
#journey:is([data-scene="extract"], [data-scene="compose"]) [data-document="dishwasher"] { gap: 12px; }
#journey:is([data-scene="extract"], [data-scene="compose"]) [data-document="dishwasher"] { position: relative; }
#journey:is([data-scene="extract"], [data-scene="compose"]) .j-related-subject {
  position: absolute;
  top: 0;
  right: 0;
  max-width: 46%;
}
#journey:is([data-scene="extract"], [data-scene="compose"]) .j-document-heading {
  align-self: flex-start;
  width: 52%;
  text-align: center;
  padding-inline: 12px;
  background: var(--colorNeutralBackground1);
}
#journey[data-scene="compose"] .j-reader .prose p { position: relative; }
#journey[data-scene="compose"] .j-reader .prose p::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--colorBrandStroke1);
  opacity: calc(1 - var(--contribute-out, 0));
}
#journey[data-scene="read"] .j-reader { padding: clamp(18px, 2.4vw, 36px); }
#journey[data-scene="read"] .j-reader .prose { max-width: 640px; font-size: 16px; line-height: 1.75; }
.j-device { max-height: calc(570px + 50px * var(--phone)); }
#journey:is([data-scene="library"], [data-scene="search"], [data-scene="results"]) .j-library-body { flex: 0 1 auto; }
.j-shelves { gap: 10px; padding-block: 20px; }
.j-shelf .collection-open { padding-block: 18px; }
.j-shelf .row-title { gap: 8px; }
.j-shelf .row-title .icon { flex: none; color: var(--colorBrandForeground1); }
.j-reader .prose p { transition: background-color 200ms ease; }
#journey[data-scene="agent"] .j-reader .prose > p:first-child {
  background: color-mix(in srgb, var(--colorBrandBackground2) calc(var(--agent-connection, 0) * 100%), transparent);
  box-shadow: none;
}
.j-agent-reading { padding-block: 12px; }
.j-evidence { gap: 18px; }
.j-evidence article { border-left-color: var(--colorNeutralStroke2); }
[data-evidence="cabinet"] { opacity: var(--evidence-first, 1); transform: translateY(calc(12px * (1 - var(--evidence-first, 1)))); }
[data-evidence="connection"] { opacity: var(--evidence-second, 1); transform: translateY(calc(12px * (1 - var(--evidence-second, 1)))); }
.j-evidence-plus { opacity: 0; }
.j-insight-result { border: 0; padding-top: 42px; transform: translateY(calc(8px * (1 - var(--insight-in, 0)))); }
.j-insight-result h2 { order: -1; }
.j-insight-result > p { font-size: 14px; }
.j-insight-label { font-size: 11px; }
.j-confirmation { margin-top: 12px; }
.prose fluent-button.citation {
  display: inline-flex;
  vertical-align: middle;
  --buttonPaddingBlock: 0px;
  --buttonPaddingInline: 4px;
  min-height: 24px;
  height: 24px;
  padding: 0 4px;
  font-size: 10px;
  line-height: 16px;
  color: #701c38;
  background: var(--colorBrandBackground2);
  border-radius: var(--borderRadiusSmall);
  cursor: pointer;
}
.prose fluent-button.citation::part(control) { min-height: 24px; padding: 0 4px; }
.prose fluent-button.citation .icon { width: 12px; height: 12px; }
.prose fluent-button.citation:hover { color: #52152a; background: #e8d5dc; }
.prose fluent-button.citation:focus-visible { outline: 2px solid #7b1e3b; outline-offset: 2px; }
.j-traced-passage { background: var(--colorBrandBackground2); }
.j-original {
  position: fixed;
  inset: auto;
  margin: 0;
  padding: 20px;
  width: min(420px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--colorNeutralStroke1);
  border-radius: var(--borderRadiusLarge);
  color: var(--colorNeutralForeground1);
  background: var(--colorNeutralBackground1);
  box-shadow: var(--shadow16);
  font-family: var(--fontFamilyBase);
}
.j-original:popover-open { display: flex; flex-direction: column; gap: 14px; }
.j-original > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.j-original > header > span { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #514b40; }
.j-original h2 { font-size: 18px; line-height: 1.4; }
.j-original pre { white-space: pre-wrap; overflow-wrap: anywhere; font: 11px/1.6 var(--fontFamilyMonospace, monospace); color: #514b40; padding-bottom: 12px; border-bottom: 1px solid var(--colorNeutralStroke2); }
.j-original-body { display: flex; flex-direction: column; gap: 12px; font-size: 14px; line-height: 1.65; }
.j-original-body p { white-space: pre-wrap; }
.j-original mark { color: inherit; background: var(--colorBrandBackground2); text-decoration: underline; text-decoration-color: #7b1e3b; text-underline-offset: 3px; }
.j-original img { width: 100%; height: auto; }
@media (min-width: 721px) and (min-height: 700px) {
  #journey[data-chapter="0"] .j-source-grid { grid-template-rows: minmax(0, 1fr) 220px minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .j-time { width: 240px; gap: 5px; margin-top: 3px; }
  .j-date-stop { gap: 4px; }
  .j-source { transform: translateY(calc(10px * (1 - var(--arrival, 1)))); }
  .j-device { max-height: none; }
  .j-contributions { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 10px; padding-bottom: 30px; gap: 8px; }
  .j-contribution { padding: 8px; gap: 5px; }
  .j-contribution p { font-size: 11px; line-height: 1.4; }
  .j-contribution[data-contribution="chat"] { display: none; }
  .j-related-subject { padding: 4px 6px; font-size: 10px; }
  #journey[data-scene="read"] .j-reader { padding: var(--j-inset); }
  #journey[data-scene="read"] .j-reader .prose { font-size: 14px; line-height: 1.6; }
  .j-reader .prose p:nth-child(2) { display: block; }
  .j-reader .citation { display: inline-flex; }
  .j-shelf .collection-open { padding-block: 12px; }
  .j-shelves { gap: 6px; padding-block: 12px; }
  .j-insight-result { padding-top: 32px; gap: 10px; }
  .j-evidence { gap: 8px; }
  .j-original { padding: 14px; }
  .j-original-body { font-size: 13px; }
}
@media (max-height: 650px) {
  .j-contributions { padding: 10px; padding-bottom: 32px; }
  .j-contribution { padding: 8px; gap: calc(5px * (1 - var(--compact-compose, 0))); }
  .j-contribution p {
    font-size: 11px;
    max-height: calc(120px * (1 - var(--compact-compose, 0)));
    opacity: calc(1 - var(--compact-compose, 0));
    overflow: clip;
  }
  .j-related-subject { font-size: 10px; }
  .j-insight-result { padding-top: 24px; gap: 10px; }
  .j-reader .prose { line-height: 1.5; }
  .j-shelves { padding-block: 8px; gap: 4px; }
  .j-shelf .collection-open { padding-block: 10px; }
  #journey.j-compact .j-shelf .row-summary {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    overflow: hidden;
  }
  #journey.j-compact[data-scene="suggest"] .j-insight { padding: 12px; gap: 8px; }
  #journey.j-compact[data-scene="suggest"] .j-insight-result { padding-top: 18px; gap: 8px; }
  #journey.j-compact[data-scene="suggest"] .j-insight-result > p { font-size: 13px; line-height: 1.5; }
  #journey.j-compact[data-scene="suggest"] .j-insight-label { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .j-source, .j-contributions, .j-insight-result, .j-evidence article { transform: none; }
}
@media (forced-colors: active) {
  .j-threads path { stroke: Highlight; }
  .j-date-stop[aria-current] i { background: Highlight; }
}
