/* Component stylesheet for game.data-pipeline-builder. */
html.iot-component-frame body {
  margin: 0;
  padding: 0;
  background: transparent;
}

html.iot-component-frame main,
html.iot-component-frame .page-columns,
html.iot-component-frame .content,
html.iot-component-frame #quarto-content,
html.iot-component-frame #quarto-document-content {
  display: block;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

html.iot-component-frame h1.title,
html.iot-component-frame #interactive-game > h2,
html.iot-component-frame #reference-material > h2,
html.iot-component-frame #related-resources,
html.iot-component-frame header,
html.iot-component-frame .quarto-title-block,
html.iot-component-frame nav,
html.iot-component-frame .sidebar,
html.iot-component-frame .toc-active,
html.iot-component-frame #quarto-header {
  display: none !important;
}

html.iot-component-frame #dpbGame,
html.iot-component-frame .dpb-reference-material {
  max-width: 100%;
  margin-right: 0;
  margin-left: 0;
  box-shadow: none;
}

html.iot-resource-frame-standalone #dpbGame {
  margin-bottom: 22px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

html.iot-resource-frame-standalone #dpbGame .dpb-hero {
  display: none;
}

#dpbGame,
#dpbGame *,
.dpb-reference-material,
.dpb-reference-material * {
  box-sizing: border-box;
}

#dpbGame {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto 28px;
  padding: 18px;
  color: #20343d;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f7f8f2;
  border: 1px solid #e1e2d7;
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(65, 54, 29, 0.1);
}

#dpbGame h2,
#dpbGame h3,
#dpbGame h4,
#dpbGame h5,
#dpbGame p {
  margin: 0;
  letter-spacing: 0;
}

.dpb-hero {
  padding: 22px;
  margin-bottom: 16px;
  color: #ffffff;
  background: linear-gradient(135deg, #20343d 0%, #0f7d85 55%, #b26a17 100%);
  border-radius: 8px;
}

.dpb-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.dpb-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.dpb-hero h2 {
  margin-bottom: 10px;
  color: #ffffff;
  font-size: 2rem;
  line-height: 1.1;
}

.dpb-hero p {
  max-width: 840px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.5;
}

.dpb-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 620px;
  margin-top: 18px;
}

.dpb-metric {
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.13);
}

.dpb-metric strong {
  display: block;
  color: #ffffff;
  font-size: 1.05rem;
  line-height: 1;
}

.dpb-metric span {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.72rem;
}

.dpb-status {
  display: grid;
  grid-template-columns: 1.7fr repeat(3, minmax(96px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.dpb-progress-card,
.dpb-stat,
.dpb-scenario-card,
.dpb-stage-panel,
.dpb-design-panel,
.dpb-feedback,
.dpb-final-panel {
  border: 1px solid #dde2d8;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(65, 54, 29, 0.07);
}

.dpb-progress-card {
  padding: 12px;
}

.dpb-progress-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
  color: #60757d;
  font-size: 0.82rem;
  font-weight: 750;
}

.dpb-progress-label strong {
  color: #20343d;
}

.dpb-progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9ede7;
}

.dpb-progress-track div {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f8b8d, #c97924);
  transition: width 0.25s ease;
}

.dpb-stat {
  display: flex;
  min-height: 74px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px;
  text-align: center;
}

.dpb-stat strong {
  color: #20343d;
  font-size: 1.55rem;
  line-height: 1;
}

.dpb-stat span {
  margin-top: 6px;
  color: #7a8c94;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.dpb-loading,
.dpb-error {
  padding: 18px;
  border: 1px solid #dde2d8;
  border-radius: 8px;
  background: #ffffff;
}

.dpb-error {
  color: #842029;
  background: #fff4f3;
}

.dpb-scenario-card {
  padding: 18px;
  margin-bottom: 14px;
}

.dpb-scenario-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.dpb-scenario-tag,
.dpb-scenario-score {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 10px;
  border-radius: 999px;
  color: #0f6c73;
  background: #e2f3f2;
  font-size: 0.72rem;
  font-weight: 800;
}

.dpb-scenario-score {
  color: #7a4b00;
  background: #fff3d2;
  white-space: nowrap;
}

.dpb-scenario-card h3 {
  margin-top: 8px;
  color: #20343d;
  font-size: 1.5rem;
  line-height: 1.2;
}

.dpb-scenario-copy {
  max-width: 900px;
  color: #364f59;
  line-height: 1.55;
}

.dpb-reqs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.dpb-reqs span {
  padding: 5px 10px;
  border-radius: 999px;
  color: #20343d;
  background: #edf3f1;
  font-size: 0.78rem;
  font-weight: 800;
}

.dpb-builder {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.dpb-stage-panel,
.dpb-design-panel {
  width: 100%;
  min-width: 0;
  padding: 16px;
  grid-column: auto !important;
}

.dpb-step-head {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.dpb-step-head > span {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #ffffff;
  background: #0f8b8d;
  font-weight: 900;
}

.dpb-step h4,
.dpb-stage-panel h4 {
  color: #20343d;
  font-size: 1rem;
}

.dpb-step p,
.dpb-stage-panel p {
  margin-top: 3px;
  color: #60757d;
  font-size: 0.88rem;
  line-height: 1.45;
}

.dpb-stage-group {
  margin-top: 14px;
}

.dpb-stage-group h5 {
  margin-bottom: 8px !important;
  color: #20343d;
  font-size: 0.84rem;
  font-weight: 900;
  text-transform: uppercase;
}

.dpb-stage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
  gap: 10px;
}

.dpb-stage-btn {
  min-height: 112px;
  padding: 12px;
  border: 1px solid #d8e3e0;
  border-radius: 8px;
  color: #20343d;
  background: #ffffff;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.dpb-stage-btn:hover,
.dpb-stage-btn:focus-visible {
  border-color: #c97924;
  box-shadow: 0 8px 18px rgba(194, 112, 27, 0.16);
  outline: none;
}

.dpb-stage-btn.is-selected {
  border-color: #0f8b8d;
  background: #eaf7f6;
}

.dpb-stage-icon {
  display: inline-flex;
  width: 38px;
  height: 32px;
  align-items: center;
  justify-content: center;
  margin-bottom: 9px;
  border-radius: 8px;
  color: #ffffff;
  background: #20343d;
  font-size: 0.74rem;
  font-weight: 900;
}

.dpb-stage-btn strong {
  display: block;
  margin-bottom: 5px;
  color: #20343d;
  font-size: 0.9rem;
}

.dpb-stage-btn span:last-child {
  display: block;
  color: #60757d;
  font-size: 0.76rem;
  line-height: 1.35;
}

.dpb-design-panel {
  display: grid;
  gap: 14px;
}

.dpb-pipeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(154px, 1fr));
  gap: 10px;
  min-height: 120px;
  padding: 12px;
  border: 1px dashed #a9c3cc;
  border-radius: 8px;
  background: #f7fbfc;
}

.dpb-empty,
.dpb-preview-empty {
  display: flex;
  min-height: 86px;
  align-items: center;
  justify-content: center;
  grid-column: 1 / -1;
  color: #7a8c94;
  text-align: center;
  font-size: 0.86rem;
}

.dpb-pipeline-stage {
  display: grid;
  grid-template-columns: 36px 1fr 28px;
  gap: 8px;
  align-items: center;
  min-height: 52px;
  padding: 8px;
  border: 1px solid #d5e3e0;
  border-radius: 8px;
  background: #ffffff;
}

.dpb-pipeline-stage span {
  display: inline-flex;
  width: 34px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  color: #ffffff;
  background: #0f8b8d;
  font-size: 0.72rem;
  font-weight: 900;
}

.dpb-pipeline-stage strong {
  color: #20343d;
  font-size: 0.86rem;
}

.dpb-pipeline-stage button {
  width: 28px;
  height: 28px;
  border: 1px solid #f0b9af;
  border-radius: 7px;
  color: #a73a2a;
  background: #fff4f3;
  cursor: pointer;
  font-weight: 900;
}

.dpb-option-grid {
  display: grid;
  gap: 10px;
}

.dpb-option-grid label {
  display: grid;
  gap: 5px;
  color: #20343d;
  font-size: 0.82rem;
  font-weight: 800;
}

.dpb-option-grid select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #bdcfd6;
  border-radius: 8px;
  color: #20343d;
  background: #ffffff;
  font: inherit;
}

.dpb-preview {
  overflow: hidden;
  border: 1px solid #253b50;
  border-radius: 8px;
  background: #192333;
}

.dpb-preview-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 12px;
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dpb-preview-head span {
  color: #93cfd0;
  font-size: 0.76rem;
  font-weight: 800;
}

.dpb-preview-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
  min-height: 180px;
  padding: 12px;
}

.dpb-flow-node,
.dpb-opt-stage {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  color: #d8e8ee;
  background: #253449;
  font-size: 0.82rem;
}

.dpb-flow-node span,
.dpb-opt-stage::first-letter {
  font-weight: 900;
}

.dpb-flow-node span {
  display: inline-flex;
  width: 30px;
  height: 26px;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  color: #102328;
  background: #8bd8cc;
  font-size: 0.68rem;
  font-weight: 900;
}

.dpb-flow-arrow {
  color: #c97924;
  font-weight: 900;
}

.dpb-submit {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: #c97924;
  cursor: pointer;
  font-weight: 900;
}

.dpb-submit:hover,
.dpb-submit:focus-visible {
  background: #a65f18;
  outline: none;
}

.dpb-submit:disabled {
  color: #eff5f6;
  background: #9aadb5;
  cursor: not-allowed;
}

.dpb-feedback {
  padding: 16px;
  margin-top: 14px;
}

.dpb-feedback.great {
  border-color: #65b99f;
  background: #f0faf6;
}

.dpb-feedback.ok {
  border-color: #e0a12f;
  background: #fff8e7;
}

.dpb-feedback.needs-work {
  border-color: #d96f61;
  background: #fff4f3;
}

.dpb-feedback-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.dpb-feedback-head span {
  color: #60757d;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.dpb-feedback-head h4 {
  margin-top: 4px !important;
  color: #20343d;
  font-size: 1.25rem;
}

.dpb-feedback-head > strong {
  padding: 7px 10px;
  border-radius: 8px;
  color: #ffffff;
  background: #20343d;
  white-space: nowrap;
}

.dpb-score-detail,
.dpb-health-grid,
.dpb-feedback-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.dpb-feedback-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dpb-score-item {
  padding: 10px;
  border: 1px solid #d9e5ea;
  border-radius: 8px;
  background: #ffffff;
  text-align: center;
}

.dpb-score-item strong {
  display: block;
  font-size: 1.1rem;
}

.dpb-score-item strong.green {
  color: #1e8d58;
}

.dpb-score-item strong.orange {
  color: #a46500;
}

.dpb-score-item strong.red {
  color: #b43c2d;
}

.dpb-score-item span {
  display: block;
  margin-top: 4px;
  color: #7a8c94;
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.dpb-health {
  padding: 10px;
  border: 1px solid #d9e5ea;
  border-radius: 8px;
  background: #ffffff;
}

.dpb-health div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  color: #20343d;
  font-size: 0.82rem;
  font-weight: 850;
}

.dpb-health-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6eef2;
}

.dpb-health-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.dpb-feedback-grid h5 {
  margin: 0 0 8px;
  color: #20343d;
  font-size: 0.95rem;
}

.dpb-feedback-grid p,
.dpb-feedback-grid li,
.dpb-note {
  color: #364f59;
  font-size: 0.88rem;
  line-height: 1.5;
}

.dpb-feedback-grid ul {
  margin: 0;
  padding-left: 18px;
}

.dpb-opt-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  margin-bottom: 10px;
}

.dpb-opt-stage {
  color: #20343d;
  background: #e7f5f3;
  font-weight: 800;
}

.dpb-note {
  margin-top: 12px !important;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.dpb-next {
  width: 100%;
  margin-top: 14px;
}

.dpb-final {
  margin-top: 14px;
}

.dpb-final-panel {
  padding: 24px;
  text-align: center;
}

.dpb-final-badge {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  color: #0f6c73;
  background: #e2f3f2;
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.dpb-final-panel h3 {
  margin-top: 12px !important;
  color: #20343d;
  font-size: 1.6rem;
}

.dpb-big-score {
  margin: 12px 0 4px;
  color: #c97924;
  font-size: 3rem;
  font-weight: 900;
  line-height: 1;
}

.dpb-final-panel p {
  color: #60757d;
}

.dpb-final-chart {
  display: flex;
  justify-content: center;
  align-items: end;
  gap: 8px;
  min-height: 154px;
  margin: 22px 0;
}

.dpb-final-bar-wrap {
  display: grid;
  justify-items: center;
  gap: 5px;
}

.dpb-final-bar-wrap span {
  color: #20343d;
  font-size: 0.72rem;
  font-weight: 900;
}

.dpb-final-bar-wrap strong {
  color: #60757d;
  font-size: 0.7rem;
}

.dpb-final-bar {
  width: 24px;
  border-radius: 5px 5px 0 0;
  background: #0f8b8d;
}

.dpb-final-bar.green {
  background: #1e8d58;
}

.dpb-final-bar.orange {
  background: #e0a12f;
}

.dpb-final-bar.red {
  background: #d45b4d;
}

.dpb-reference-material {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto 28px;
  color: #20343d;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.dpb-reference-intro {
  margin: 0 0 12px;
  color: #60757d;
  line-height: 1.5;
}

.dpb-reference-material details {
  overflow: hidden;
  margin-bottom: 10px;
  border: 1px solid #d9e5ea;
  border-radius: 8px;
  background: #eef5f7;
}

.dpb-reference-material summary {
  padding: 13px 15px;
  color: #20343d;
  cursor: pointer;
  font-weight: 850;
}

.dpb-reference-content {
  padding: 0 15px 15px;
  color: #364f59;
}

.dpb-reference-content p {
  margin: 0 0 8px;
  line-height: 1.5;
}

.dpb-reference-content ul {
  margin: 0;
  padding-left: 18px;
  line-height: 1.55;
}

.dpb-reference-loading {
  padding: 14px;
  border: 1px solid #d9e5ea;
  border-radius: 8px;
  background: #ffffff;
}

@media (min-width: 1040px) {
  .dpb-builder {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
  }

  .dpb-stage-panel {
    grid-column: 1 / -1 !important;
  }
}

@media (max-width: 900px) {
  #dpbGame {
    padding: 14px;
  }

  .dpb-status,
  .dpb-score-detail,
  .dpb-health-grid,
  .dpb-feedback-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  #dpbGame {
    padding: 10px;
    border-radius: 8px;
  }

  .dpb-hero {
    padding: 18px;
  }

  .dpb-hero h2 {
    font-size: 1.6rem;
  }

  .dpb-metrics,
  .dpb-stage-grid,
  .dpb-pipeline {
    grid-template-columns: 1fr;
  }

  .dpb-scenario-top,
  .dpb-feedback-head,
  .dpb-preview-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .dpb-stage-btn {
    min-height: 104px;
  }

  .dpb-stage-panel,
  .dpb-design-panel,
  .dpb-scenario-card,
  .dpb-feedback {
    padding: 12px;
  }
}
