#appView, #detailView { background: #f1f5f8; color: #192c40; }
#appView .library-main { max-width: 1152px; margin-inline: auto; padding: 32px 24px 60px; }
.library-heading { align-items: center; margin-bottom: 24px; }
.library-heading h1 { color: #14283d; font-size: clamp(28px, 4vw, 42px); line-height: 1.15; letter-spacing: -.035em; }
.library-heading .count { display: inline-block; margin-top: 6px; }
.pipeline-library-actions, .pipeline-card-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
#grid .pipeline-card {
  display: flex;
  flex-flow: row wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 16px 20px;
  min-height: 0;
  border: 1px solid #dee1ee;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 3px 10px #25234a09;
}
.pipeline-card-content { flex: 1 1 325px; min-width: 0; }
.pipeline-card-heading, .pipeline-card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 9px; }
.pipeline-card-meta { margin-top: 5px; }
.pipeline-card h3 { color: #22253a; font-size: 16px; line-height: 1.45; margin: 0; min-width: 0; overflow-wrap: anywhere; }
.pipeline-card-description { color: #535d70; margin: 0; line-height: 1.55; min-width: 0; overflow-wrap: anywhere; }
.pipeline-card-description p { margin: 0; }
.pipeline-card-actions { max-width: 100%; margin-inline-start: auto; justify-content: flex-end; }
.pipeline-start, .pipeline-controls .primary, #detailRecordBtn { background: #126656; border-color: #126656; color: white; }
.pipeline-start:hover, .pipeline-controls .primary:hover, #detailRecordBtn:hover { background: #0d5145; border-color: #0d5145; color: #fff; }
.pipeline-start span { margin-left: 10px; }

#detailView .detail-header { padding: 14px clamp(14px, 3vw, 34px); gap: 12px; }
#detailView .dh-left h2 { color: #152a3f; font-size: 17px; line-height: 1.4; min-width: 0; overflow-wrap: anywhere; }
#detailView .dh-right { flex-wrap: wrap; }
#detailView .detail-main { display: grid; grid-template-columns: minmax(230px, 290px) minmax(0, 1fr); align-items: start; gap: 22px; max-width: 1320px; padding: 24px 24px 64px; }
.pipeline-sidebar { position: sticky; top: 0; max-height: calc(100dvh - 125px); overflow: auto; padding: 17px 13px; background: #fff; border: 1px solid #dbe5ec; border-radius: 15px; }
.pipeline-sidebar h3 { margin: 0 4px 6px; font-size: 16px; }
.pipeline-sidebar > p { margin: 0 4px 9px; font-size: 12px; color: #54687b; }
.pipeline-meter { height: 5px; margin: 0 4px 16px; background: #e8eef3; border-radius: 8px; overflow: hidden; }
.pipeline-meter i { display: block; height: 100%; background: #218161; transition: width .2s; }
#pipelineSteps { list-style: none; margin: 0; padding: 0; }
#pipelineSteps li { position: relative; }
#pipelineSteps li:not(:last-child)::before { content: ''; position: absolute; width: 2px; left: 23px; top: 32px; bottom: -14px; background: #e0e8ee; pointer-events: none; }
#pipelineSteps button { width: 100%; background: transparent; border: 1px solid transparent; border-radius: 10px; display: grid; grid-template-columns: 24px minmax(0,1fr); align-items: start; gap: 9px; text-align: left; padding: 9px 10px; color: #243a4e; cursor: pointer; position: relative; }
#pipelineSteps button:hover { background: #f2f6f9; }
#pipelineSteps button[aria-current="step"] { background: #e8f0f6; border-color: #d0dfe9; }
.pipeline-dot { display: grid; place-items: center; border-radius: 100%; width: 24px; height: 24px; background: #e6edf3; color: #50677b; font-weight: 750; }
.pipeline-node-copy { display: grid; gap: 3px; }
.pipeline-node-title { font-size: 13px; font-weight: 650; line-height: 1.45; overflow-wrap: anywhere; }
.pipeline-node-status { font-size: 11px; color: #526779; }
[data-status="pass"] .pipeline-dot { background: #cdeedf; color: #146046; }
[data-status="pass"] .pipeline-node-status { color: #176b4f; }
[data-status="fail"] .pipeline-dot { background: #f8dddd; color: #a52f37; }
[data-status="fail"] .pipeline-node-status { color: #9d3238; }
[data-status="na"] .pipeline-node-copy { opacity: .72; }
.pipeline-content { min-width: 0; }
#activeStepsPanel { display: none !important; }
#detailSteps > .tree-node > .tree-node-body { border-radius: 15px; padding: clamp(14px, 3vw, 26px); border-color: #dbe5ec; box-shadow: none; }
#detailSteps > .tree-node > .tree-node-body > .step-head .step-title { font-size: clamp(17px, 2.4vw, 23px); font-weight: 720; }
#detailSteps .step-checkbox:checked + .step-title { color: #20374a; text-decoration: none; }
#detailSteps .tree-node.focused > .tree-node-body { border-color: #a9cbbf; box-shadow: none; }
#detailSteps .nc-panel { border-radius: 14px; }
.pipeline-controls { display: flex; justify-content: space-between; margin: 17px 0; gap: 8px; }
.pipeline-utilities { margin-top: 20px; color: #415a70; }
.pipeline-utilities summary { cursor: pointer; width: fit-content; }
#detailUtilities { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
@media (max-width: 760px) {
  #detailView .detail-main { grid-template-columns: minmax(0,1fr); gap: 12px; padding: 12px; }
  .pipeline-sidebar { position: static; max-height: 35dvh; }
  #appView .library-main { padding: 22px 14px 42px; }
  #detailView .dh-left { gap: 8px; }
}
@media (max-width: 560px) {
  #grid .pipeline-card { padding: 13px 14px; }
  .pipeline-card-actions { margin-inline-start: 0; justify-content: flex-start; }
}

#pipelineSteps button[data-status="pass"] .pipeline-node-title { color: #17604a; }
#pipelineSteps button[data-status="pass"][aria-current="step"] { background: #ecf8f2; border-color: #b5ddca; }

#pipelineSteps li { margin-inline-start: calc(var(--directory-depth, 0) * 9px); }
#pipelineSteps li:not(:last-child)::before { left: 19px; top: 23px; bottom: -9px; }
#pipelineSteps button { grid-template-columns: 16px minmax(0, 1fr); }
#pipelineSteps button[aria-current="location"] { background: #e8f0f6; border-color: #d0dfe9; }
#pipelineSteps .pipeline-dot { width: 15px; height: 15px; margin-top: 2px; border: 1px solid #a3b4c2; background: #fff; font-size: 10px; }
#pipelineSteps button[data-status="pass"] .pipeline-dot,
#pipelineSteps button[data-status="fail"] .pipeline-dot { background: #22805d; color: white; border-color: #22805d; }
#pipelineSteps button[data-status="na"] .pipeline-dot { background: #e7edf2; }
#detailSteps .directory-preview { display: block !important; }
#detailSteps .tree-node-body, #detailSteps .nc-sub-row { scroll-margin-block-start: 12px; }
#detailSteps .directory-target { outline: 2px solid #94bfb3; outline-offset: 2px; }
#detailSteps > .tree-node { scroll-margin-top: 10px; }
.task-filters { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 12px 0; }
.task-filters [aria-pressed="true"] { background: #e3f2eb; border-color: #9cc9b8; color: #185947; }
.task-notice { color: #435b70; padding: 10px 12px; border-radius: 8px; background: #f0f5f9; }
.task-row, .task-readonly li { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid #dae5ea; }
.task-row small, .task-readonly small { display: block; margin-top: 4px; color: #51677a; }
.task-readonly { padding-left: 20px; }
#taskHubMore { margin-top: 12px; }
