/*
 * The pipeline surfaces: live progress stepper, file-note review + editing, reports.
 * See 01_tokens.css for the load-order contract.
 */

/* --- Progress panel (stepper) --- */

.progress-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-3);
  flex-wrap: wrap;
  margin: 0 0 var(--gap-3);
}
.progress-state .badge { font-size: 0.85rem; padding: 0.25rem 0.75rem; }

.progress-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0;
  list-style: none;
  padding: 0;
  margin: var(--gap-1) 0 0;
  counter-reset: step;
}

/* No connector line between steps: it can only be drawn per-step with a :not(:last-child)
   guard, which knows nothing about wrapping, so every step that happened to end a wrapped
   row trailed a rule into empty space. The numbered (then ticked) circles carry the sequence
   on their own, and this makes the list wrap at any width without looking broken. */
.progress-steps .step {
  display: flex;
  align-items: center;
  gap: var(--gap-1);
  font-size: 0.82rem;
  color: var(--muted);
  padding-right: 1.1rem;
}
.progress-steps .step::before {
  counter-increment: step;
  content: counter(step);
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  display: inline-grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--white);
  flex: none;
}
.progress-steps .step-done { color: var(--green); }
.progress-steps .step-done::before { content: "✓"; background: var(--green-soft); border-color: var(--green-line); color: var(--green); }
.progress-steps .step-current { color: var(--navy); font-weight: 700; }
.progress-steps .step-current::before { background: var(--navy); border-color: var(--navy); color: var(--white); animation: pulse 1.4s ease-in-out infinite; }

.notify-enable { margin-top: var(--gap-3); font-size: 0.85rem; }
.notify-enable::before { content: "🔔"; }

/* Dev Board #4931 1.4: the SharePoint link leads the page once the note is filed. */
.filed-panel {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--gap-2);
  margin-top: var(--gap-3);
  padding: 0.85rem var(--gap-4);
  background: var(--green-soft);
  border: 1px solid var(--green-line);
  border-radius: var(--radius-sm);
}
.filed-panel .hint { flex: 1 1 100%; margin: 0; }
.filed-path { word-break: break-word; }

.error-panel {
  background: var(--red-soft);
  border: 1px solid var(--red-line);
  border-radius: var(--radius-sm);
  padding: 0.85rem var(--gap-4);
  margin-top: var(--gap-2);
}
.error-panel p { margin-bottom: var(--gap-2); }
/* Dev Board #4931 1.3: a note that is not in the client's folder needs a person, so it reads
   as an alert rather than a status line. */
.error-panel-prominent { border: 2px solid var(--red); border-left-width: 6px; color: var(--red); }
.error-panel-prominent .filing-status { color: var(--ink); }
.error-panel .button-danger { margin-right: var(--gap-2); margin-top: var(--gap-1); }

.error-message {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  white-space: pre-wrap;
  word-break: break-word;
}

/* --- SharePoint filing status ---
   The filed-to line is the one place an adviser learns WHERE a note landed, so the folder
   path is rendered as a trail of links rather than a sentence with one "open in SharePoint"
   at the end. */

.filing-status { margin: 0 0 var(--gap-3); }
.filing-status .hint { margin: 0; }
.filing-status .filing-warning { color: var(--red); font-weight: 600; }

.filing-trail {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.15rem 0.35rem;
  margin: 0.2rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.85rem;
  line-height: 1.5;
}
.filing-trail li { display: flex; align-items: baseline; gap: 0.35rem; min-width: 0; }
.filing-trail li:not(:last-child)::after { content: "›"; color: var(--line-strong); }
.filing-trail a { color: var(--navy); text-decoration: none; border-bottom: 1px solid var(--line-strong); }
.filing-trail a:hover { border-bottom-color: var(--navy); }
.filing-trail .trail-file { font-weight: 600; }
.filing-trail .trail-plain { color: var(--muted); }

/* --- File note review --- */

.missing-sections {
  background: var(--amber-soft);
  border: 1px solid var(--amber-line);
  border-radius: var(--radius-sm);
  padding: var(--gap-3) var(--gap-4);
  margin: var(--gap-2) 0 var(--gap-4);
}
.missing-sections h3 { margin: 0 0 var(--gap-1); color: var(--amber); }
.missing-sections ul { margin: var(--gap-1) 0 0; padding-left: 1.2rem; }

/* The jump list is 25 pills. It wraps into a block on a desktop review; on a phone that
   block is taller than the content it indexes, so 06_responsive turns it into a single
   horizontally-scrolling strip rather than hiding it (a 25-section note is exactly where a
   jump list earns its place on a small screen). */
.note-index {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0 0 var(--gap-4);
  padding: 0;
  list-style: none;
}
.note-index a {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-pill);
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.78rem;
}
.note-index a:hover { border-color: var(--navy); color: var(--navy); }
.note-index a.is-empty { color: var(--muted); border-style: dashed; }

.note-section { border-top: 1px solid var(--line); padding: 0.85rem 0; scroll-margin-top: 4rem; }
.note-section:first-child { border-top: 0; }
.note-section h3 { margin: 0 0 0.35rem; display: flex; align-items: center; gap: var(--gap-2); }
.note-section p:last-child { margin-bottom: 0; }
.section-prose { white-space: normal; }

.not-captured { color: var(--muted); font-style: italic; }

.section-fields { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem var(--gap-4); margin: 0; }
.section-fields dt { font-weight: 600; color: var(--muted); font-size: 0.9rem; }
.section-fields dd { margin: 0; min-width: 0; }

.section-list { margin: var(--gap-1) 0; padding-left: 1.25rem; }

/* --- File note editing --- */

.edit-section { padding: 0.9rem 1.25rem var(--gap-2); margin-bottom: var(--gap-4); box-shadow: none; }
.edit-rows input[type="text"] { max-width: none; padding: 0.35rem 0.5rem; }
.sticky-actions {
  position: sticky;
  bottom: 0;
  background: rgba(244, 245, 248, 0.92);
  backdrop-filter: blur(4px);
  padding: var(--gap-3) 0;
  margin-top: var(--gap-2);
  border-top: 1px solid var(--line);
}

/* --- Reports --- */

.reports-panel { margin: 0 0 var(--gap-4); }
.report-version { color: var(--muted); font-size: 0.85rem; font-weight: 500; margin-left: var(--gap-1); }
.classification-form .field { max-width: 28rem; }

.compliance-summary { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.compliance-summary-text { color: var(--ink-soft); }
.compliance-findings .finding-fail.finding-red td:nth-child(2) { color: var(--red); font-weight: 600; }
.compliance-findings .finding-fail.finding-amber td:nth-child(2) { color: var(--amber); font-weight: 600; }
.compliance-findings .finding-fail.finding-green td:nth-child(2) { color: var(--green); font-weight: 600; }
.compliance-findings .finding-pass td:nth-child(2) { color: var(--green); font-weight: 600; }

.draft-field { border-top: 1px solid var(--line); padding: var(--gap-3) 0; scroll-margin-top: 4rem; }
.draft-field:first-of-type { border-top: 0; }
.draft-field h4 { margin: 0 0 0.35rem; }

.placeholder {
  background: var(--amber-soft);
  color: var(--amber);
  padding: 0.05rem 0.3rem;
  border-radius: 3px;
  font-weight: 600;
}
