/* Component stylesheet for game.pipeline-flow-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.pfb-page:not(.iot-component-frame) main.content,
html.pfb-page:not(.iot-component-frame) .page-columns,
html.pfb-page:not(.iot-component-frame) #quarto-content,
html.pfb-page:not(.iot-component-frame) #quarto-document-content {
  width: min(1160px, calc(100vw - 32px));
  max-width: none;
  margin-right: auto;
  margin-left: auto;
}

html.pfb-page:not(.iot-component-frame) .page-columns {
  display: block;
}

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

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

html.iot-resource-frame-standalone #pfbGame .pfb-hero {
  display: none;
}

#pfbGame,
#pfbGame *,
.pfb-reference-material,
.pfb-reference-material * {
  box-sizing: border-box;
}

#pfbGame {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto 28px;
  padding: 18px;
  color: #243640;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f7f5ef;
  border: 1px solid #e2ddcf;
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(40, 46, 54, 0.1);
}

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

.pfb-hero {
  padding: 22px;
  margin-bottom: 16px;
  color: #ffffff;
  background: linear-gradient(135deg, #223348 0%, #0f7a78 58%, #b96527 100%);
  border-radius: 8px;
}

.pfb-kicker,
.pfb-reqs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pfb-kicker {
  margin-bottom: 14px;
}

.pfb-pill,
.pfb-reqs span,
.pfb-scenario-tag,
.pfb-scenario-score {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
}

.pfb-pill {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.28);
  text-transform: uppercase;
}

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

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

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

.pfb-metric {
  min-height: 64px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
}

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

.pfb-metric span {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.76rem;
  font-weight: 800;
}

.pfb-status {
  display: grid;
  grid-template-columns: minmax(210px, 1.4fr) repeat(3, minmax(100px, 0.6fr));
  gap: 10px;
  margin-bottom: 16px;
}

.pfb-progress-card,
.pfb-stat,
.pfb-scenario-card,
.pfb-panel,
.pfb-feedback,
.pfb-final-card {
  background: #ffffff;
  border: 1px solid #dfe3df;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(34, 48, 54, 0.06);
}

.pfb-progress-card {
  min-height: 68px;
  padding: 12px 14px;
}

.pfb-progress-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: #334956;
  font-size: 0.82rem;
  font-weight: 800;
}

.pfb-progress-label span {
  color: #596f78;
}

.pfb-progress-track {
  height: 8px;
  overflow: hidden;
  background: #e6ebe7;
  border-radius: 999px;
}

.pfb-progress-track > div {
  height: 100%;
  width: 4%;
  background: linear-gradient(90deg, #0f7a78, #b96527);
  border-radius: inherit;
  transition: width 0.25s ease;
}

.pfb-stat {
  display: grid;
  min-height: 68px;
  place-items: center;
  padding: 10px;
  text-align: center;
}

.pfb-stat strong {
  color: #243640;
  font-size: 1.8rem;
  line-height: 1;
}

.pfb-stat span {
  margin-top: 4px;
  color: #596f78;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

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

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

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

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

.pfb-scenario-tag,
.pfb-scenario-score {
  color: #0d6662;
  background: #e2f4f1;
}

.pfb-scenario-score {
  color: #7a450b;
  background: #fff0d8;
  white-space: nowrap;
}

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

.pfb-scenario-copy {
  max-width: 920px;
  color: #38505c;
  line-height: 1.55;
}

.pfb-reqs {
  margin-top: 14px;
}

.pfb-reqs span {
  color: #223348;
  background: #edf3f0;
  font-size: 0.78rem;
  font-weight: 800;
}

.pfb-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
  gap: 14px;
  align-items: start;
}

.pfb-panel {
  min-width: 0;
  padding: 16px;
}

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

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

.pfb-step-head h4 {
  color: #223348;
  font-size: 1rem;
}

.pfb-step-head p {
  margin-top: 3px !important;
  color: #60757d;
  font-size: 0.88rem;
  line-height: 1.45;
}

.pfb-component-group {
  margin-top: 12px;
}

.pfb-component-group h5 {
  margin: 0 0 8px !important;
  color: #223348;
  font-size: 0.82rem;
  text-transform: uppercase;
}

.pfb-component-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.pfb-component-card {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 4px 9px;
  min-height: 96px;
  padding: 11px;
  border: 1px solid #d8e2df;
  border-radius: 8px;
  color: #223348;
  background: #ffffff;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.pfb-component-card:hover,
.pfb-component-card:focus-visible {
  border-color: #b96527;
  box-shadow: 0 8px 18px rgba(185, 101, 39, 0.16);
  outline: none;
}

.pfb-component-card.is-selected {
  border-color: #0f7a78;
  background: #eaf7f5;
}

.pfb-component-card.is-correct {
  border-color: #1e8d58;
  background: #f0faf4;
}

.pfb-component-card.is-wrong {
  border-color: #bc4b3f;
  background: #fff4f3;
}

.pfb-component-card:disabled {
  cursor: default;
}

.pfb-component-card > span {
  display: inline-flex;
  width: 34px;
  height: 30px;
  align-items: center;
  justify-content: center;
  grid-row: span 3;
  border-radius: 8px;
  color: #ffffff;
  background: #223348;
  font-size: 0.72rem;
  font-weight: 900;
}

.pfb-component-card strong {
  color: #223348;
  font-size: 0.88rem;
  line-height: 1.2;
}

.pfb-component-card em,
.pfb-component-card small {
  color: #405761;
  font-size: 0.74rem;
  font-style: normal;
  line-height: 1.35;
}

.pfb-component-card small {
  color: #596f78;
  font-weight: 800;
}

.pfb-pipeline-canvas {
  min-height: 250px;
  padding: 14px;
  border-radius: 8px;
  color: #ffffff;
  background: #1f3040;
}

.pfb-empty-flow {
  display: grid;
  min-height: 220px;
  place-items: center;
  color: rgba(255, 255, 255, 0.66);
  border: 1px dashed rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  text-align: center;
}

.pfb-flow-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pfb-flow-list li {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 8px;
  align-items: center;
}

.pfb-flow-step {
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #ffffff;
  background: #0f7a78;
  font-size: 0.78rem;
  font-weight: 900;
}

.pfb-flow-node {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 8px;
  align-items: center;
  min-height: 48px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  text-align: left;
}

.pfb-flow-node.is-position-ok {
  border-color: #8ee0aa;
  background: rgba(30, 141, 88, 0.22);
}

.pfb-flow-node span {
  display: inline-flex;
  width: 30px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  color: #223348;
  background: #ffffff;
  font-size: 0.72rem;
  font-weight: 900;
}

.pfb-flow-node strong {
  color: #ffffff;
  font-size: 0.82rem;
  line-height: 1.2;
}

.pfb-flow-arrow {
  color: rgba(255, 255, 255, 0.62);
  font-weight: 900;
}

.pfb-flow-meter {
  margin-top: 12px;
  padding: 14px;
  border-radius: 8px;
  color: #ffffff;
  background: #223348;
}

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

.pfb-meter-head span,
.pfb-meter-grid span {
  display: block;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.pfb-meter-head strong {
  display: block;
  margin-top: 4px;
  color: #ffffff;
  font-size: 1rem;
}

.pfb-meter-badge {
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.76rem;
  font-weight: 900;
  white-space: nowrap;
}

.pfb-meter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.pfb-meter-grid div {
  min-height: 56px;
  padding: 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.pfb-meter-grid strong {
  display: block;
  margin-top: 5px;
  color: #ffffff;
  font-size: 0.96rem;
  line-height: 1;
}

.pfb-action-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}

.pfb-submit,
.pfb-secondary {
  min-height: 44px;
  padding: 10px 16px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 900;
}

.pfb-submit {
  color: #ffffff;
  background: #0f7a78;
}

.pfb-submit:hover,
.pfb-submit:focus-visible {
  background: #0b6664;
  outline: none;
}

.pfb-submit:disabled {
  background: #a4b2b5;
  cursor: not-allowed;
}

.pfb-secondary {
  color: #223348;
  background: #edf3f0;
}

.pfb-secondary:hover,
.pfb-secondary:focus-visible {
  background: #dfe9e4;
  outline: none;
}

.pfb-secondary:disabled {
  color: #87969b;
  cursor: not-allowed;
}

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

.pfb-feedback.great {
  border-color: #acd7bc;
  background: #f3fbf5;
}

.pfb-feedback.ok {
  border-color: #edd08d;
  background: #fff9eb;
}

.pfb-feedback.needs-work {
  border-color: #e4b1aa;
  background: #fff4f3;
}

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

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

.pfb-feedback-head h4 {
  margin-top: 4px !important;
  color: #223348;
  font-size: 1.12rem;
}

.pfb-feedback-head > strong {
  color: #0f7a78;
  font-size: 1.7rem;
  line-height: 1;
}

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

.pfb-score-item {
  min-height: 62px;
  padding: 10px;
  border: 1px solid #dfe5df;
  border-radius: 8px;
  background: #ffffff;
  text-align: center;
}

.pfb-score-item strong {
  display: block;
  font-size: 1.05rem;
}

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

.pfb-score-item strong.orange {
  color: #a86515;
}

.pfb-score-item strong.red {
  color: #bc4b3f;
}

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

.pfb-feedback-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 14px;
}

.pfb-feedback-grid h5,
.pfb-reasoning h5 {
  margin-bottom: 7px !important;
  color: #223348;
  font-size: 0.9rem;
}

.pfb-feedback-grid p,
.pfb-reasoning p,
.pfb-reasoning li {
  color: #405761;
  font-size: 0.88rem;
  line-height: 1.5;
}

.pfb-reasoning ul {
  margin: 0;
  padding-left: 18px;
}

.pfb-reasoning {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #dfe5df;
  border-radius: 8px;
  background: #ffffff;
}

.pfb-reasoning p {
  margin-top: 10px !important;
}

.pfb-next {
  margin-top: 14px;
}

.pfb-final-card {
  padding: 24px;
  text-align: center;
}

.pfb-final-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  color: #0d6662;
  background: #e2f4f1;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.pfb-final-card h3 {
  margin-top: 10px !important;
  color: #223348;
  font-size: 1.5rem;
}

.pfb-big-score {
  margin-top: 8px;
  color: #0f7a78;
  font-size: 2.4rem;
  font-weight: 900;
  line-height: 1;
}

.pfb-final-card p {
  max-width: 620px;
  margin: 10px auto 0 !important;
  color: #405761;
  line-height: 1.5;
}

.pfb-final-chart {
  display: flex;
  min-height: 150px;
  align-items: end;
  justify-content: center;
  gap: 8px;
  margin: 20px auto;
  padding: 12px;
  border: 1px solid #dfe5df;
  border-radius: 8px;
  background: #f8faf8;
}

.pfb-final-bar-wrap {
  display: grid;
  justify-items: center;
  gap: 5px;
  color: #6b7d84;
  font-size: 0.72rem;
  font-weight: 900;
}

.pfb-final-bar {
  width: 20px;
  border-radius: 6px 6px 0 0;
  background: #bc4b3f;
}

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

.pfb-final-bar.orange {
  background: #b96527;
}

.pfb-final-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 520px;
  margin: 0 auto 18px;
}

.pfb-final-stats div {
  padding: 12px;
  border: 1px solid #dfe5df;
  border-radius: 8px;
  background: #ffffff;
}

.pfb-final-stats strong {
  display: block;
  color: #223348;
  font-size: 1.35rem;
}

.pfb-final-stats span {
  display: block;
  margin-top: 3px;
  color: #6b7d84;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

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

.pfb-reference-intro,
.pfb-reference-loading {
  margin: 0 0 12px !important;
  padding: 14px 16px;
  border: 1px solid #dfe4e2;
  border-radius: 8px;
  color: #405761;
  background: #ffffff;
  line-height: 1.5;
}

.pfb-reference-material details {
  margin-bottom: 10px;
  border: 1px solid #dfe4e2;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.pfb-reference-material summary {
  min-height: 46px;
  padding: 13px 16px;
  color: #223348;
  cursor: pointer;
  font-weight: 900;
}

.pfb-reference-content {
  padding: 0 16px 16px;
  color: #405761;
}

.pfb-reference-content > p {
  margin: 0 0 12px !important;
  line-height: 1.5;
}

.pfb-reference-table-wrap {
  overflow-x: auto;
  border: 1px solid #dfe5df;
  border-radius: 8px;
}

.pfb-reference-table-wrap table {
  width: 100%;
  min-width: 650px;
  border-collapse: collapse;
}

.pfb-reference-table-wrap th,
.pfb-reference-table-wrap td {
  padding: 10px 12px;
  border-bottom: 1px solid #e6ebe6;
  text-align: left;
  vertical-align: top;
}

.pfb-reference-table-wrap th {
  color: #223348;
  background: #edf3f0;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.pfb-reference-table-wrap td {
  color: #405761;
  font-size: 0.86rem;
  line-height: 1.45;
}

.pfb-reference-card-grid,
.pfb-mini-card-grid {
  display: grid;
  gap: 10px;
}

.pfb-reference-card-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pfb-reference-card-grid article,
.pfb-mini-card-grid article {
  min-width: 0;
  padding: 12px;
  border: 1px solid #dfe5df;
  border-radius: 8px;
  background: #fbfcfb;
}

.pfb-reference-card-grid h5,
.pfb-mini-card-grid h5 {
  margin: 0 0 6px !important;
  color: #223348;
  font-size: 0.92rem;
}

.pfb-reference-card-grid p,
.pfb-mini-card-grid p {
  margin: 0 !important;
  color: #405761;
  font-size: 0.86rem;
  line-height: 1.45;
}

.pfb-mini-card-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.pfb-mini-card-grid article {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 9px;
}

.pfb-mini-card-grid article > span {
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #ffffff;
  background: #0f7a78;
  font-size: 0.8rem;
  font-weight: 900;
}

@media (max-width: 960px) {
  .pfb-workspace,
  .pfb-feedback-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  #pfbGame {
    padding: 14px;
  }

  .pfb-status,
  .pfb-score-detail,
  .pfb-meter-grid,
  .pfb-mini-card-grid {
    grid-template-columns: 1fr 1fr;
  }

  .pfb-component-grid,
  .pfb-reference-card-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  html.pfb-page:not(.iot-component-frame) main.content,
  html.pfb-page:not(.iot-component-frame) .page-columns,
  html.pfb-page:not(.iot-component-frame) #quarto-content,
  html.pfb-page:not(.iot-component-frame) #quarto-document-content {
    width: min(100vw - 20px, 100%);
  }

  .pfb-hero {
    padding: 18px;
  }

  .pfb-hero h2 {
    font-size: 1.55rem;
  }

  .pfb-metrics,
  .pfb-status,
  .pfb-score-detail,
  .pfb-meter-grid,
  .pfb-mini-card-grid,
  .pfb-final-stats {
    grid-template-columns: 1fr;
  }

  .pfb-scenario-top,
  .pfb-feedback-head,
  .pfb-action-row {
    align-items: stretch;
    flex-direction: column;
  }

  .pfb-submit,
  .pfb-secondary {
    width: 100%;
  }

  .pfb-reference-table-wrap table {
    min-width: 560px;
  }
}
