/* Component stylesheet for game.dashboard-designer. */
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 #ddGame,
html.iot-component-frame .dd-reference-material {
  max-width: 100%;
  margin-right: 0;
  margin-left: 0;
  box-shadow: none;
}

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

html.iot-resource-frame-standalone #ddGame .dd-hero {
  display: none;
}

#ddGame,
#ddGame *,
.dd-reference-material,
.dd-reference-material * {
  box-sizing: border-box;
}

#ddGame {
  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: #f4f8fb;
  border: 1px solid #d8e4ea;
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(24, 54, 68, 0.1);
}

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

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

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

.dd-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;
}

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

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

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

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

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

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

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

.dd-progress-card,
.dd-stat,
.dd-scenario-card,
.dd-design-panel,
.dd-preview-panel,
.dd-feedback,
.dd-final-panel {
  border: 1px solid #d9e5ea;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(24, 54, 68, 0.07);
}

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

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

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

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

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

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

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

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

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

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

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

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

.dd-scenario-tag,
.dd-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;
}

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

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

.dd-role {
  margin-top: 4px !important;
  color: #60757d;
  font-weight: 750;
}

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

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

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

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

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

.dd-design-panel {
  display: grid;
  gap: 16px;
}

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

.dd-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;
}

.dd-step h4 {
  color: #20343d;
  font-size: 1rem;
}

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

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

.dd-widget-btn {
  min-height: 128px;
  padding: 12px;
  border: 1px solid #d8e3e8;
  border-radius: 8px;
  color: #20343d;
  background: #ffffff;
  cursor: pointer;
  text-align: left;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.dd-widget-btn:hover,
.dd-widget-btn:focus-visible {
  border-color: #0f8b8d;
  box-shadow: 0 8px 18px rgba(15, 139, 141, 0.16);
  outline: none;
}

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

.dd-widget-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;
}

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

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

.dd-canvas {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-height: 142px;
  padding: 12px;
  border: 1px dashed #a9c3cc;
  border-radius: 8px;
  background: #f7fbfc;
}

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

.dd-preview-empty {
  color: #d7e8ee;
}

.dd-canvas-widget {
  display: grid;
  grid-template-columns: 36px 1fr 28px;
  gap: 8px;
  align-items: center;
  min-height: 52px;
  padding: 8px;
  border: 1px solid #d5e3e8;
  border-radius: 8px;
  background: #ffffff;
}

.dd-canvas-widget 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;
}

.dd-canvas-widget strong {
  color: #20343d;
  font-size: 0.86rem;
}

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

.dd-preview-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

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

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

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

.dd-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);
}

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

.dd-preview-grid {
  display: grid;
  gap: 8px;
  min-height: 250px;
  padding: 12px;
}

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

.dd-preview-grid.split {
  grid-template-columns: 1.2fr 0.8fr;
}

.dd-preview-grid.sidebar {
  grid-template-columns: 0.72fr 1.28fr;
}

.dd-preview-widget {
  display: flex;
  min-height: 94px;
  flex-direction: column;
  justify-content: center;
  padding: 12px;
  border: 1px solid #34495d;
  border-radius: 8px;
  color: #d8e8ee;
  background: #253449;
}

.dd-preview-icon {
  display: inline-flex;
  width: 34px;
  height: 28px;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  border-radius: 7px;
  color: #102328;
  background: #8bd8cc;
  font-size: 0.68rem;
  font-weight: 900;
}

.dd-preview-widget strong {
  color: #ffffff;
  font-size: 1.1rem;
}

.dd-preview-widget span:last-child {
  margin-top: 3px;
  color: #9eb5c0;
  font-size: 0.75rem;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

.dd-feedback-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

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

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

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

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

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

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

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

.dd-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;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  .dd-status,
  .dd-feedback-grid {
    grid-template-columns: 1fr;
  }

  .dd-widget-palette {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dd-preview-grid.sidebar,
  .dd-preview-grid.split {
    grid-template-columns: 1fr;
  }
}

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

  .dd-hero {
    padding: 18px;
  }

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

  .dd-metrics,
  .dd-widget-palette,
  .dd-canvas,
  .dd-score-detail {
    grid-template-columns: 1fr;
  }

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

  .dd-widget-btn {
    min-height: 112px;
  }

  .dd-design-panel,
  .dd-preview-panel,
  .dd-scenario-card,
  .dd-feedback {
    padding: 12px;
  }
}

#ddGame[data-iot-recolor-pilot="true"][data-iot-module="visualization"] {
  --dd-module-accent: #1e88e5;
  --dd-module-strong: #0d47a1;
  --dd-module-ink: #092f6b;
  --dd-module-hover: #083a86;
  --dd-module-tint: #edf7ff;
  --dd-module-border: #a8d0f7;
  background: #f3f9ff;
  border-color: var(--dd-module-border);
  box-shadow: none;
}

#ddGame[data-iot-recolor-pilot="true"][data-iot-module="visualization"] .dd-hero {
  color: #20343d;
  background: var(--dd-module-tint);
  border: 1px solid var(--dd-module-border);
  border-left: 4px solid var(--dd-module-strong);
}

#ddGame[data-iot-recolor-pilot="true"][data-iot-module="visualization"]
  :where(.dd-hero h2, .dd-hero p, .dd-pill, .dd-metric strong, .dd-metric span) {
  color: #20343d;
}

#ddGame[data-iot-recolor-pilot="true"][data-iot-module="visualization"]
  :where(.dd-pill, .dd-metric) {
  background: #ffffff;
  border-color: var(--dd-module-border);
}

#ddGame[data-iot-recolor-pilot="true"][data-iot-module="visualization"]
  :where(
    .dd-submit,
    .dd-step-head > span,
    .dd-canvas-widget span,
    .dd-feedback-head > strong,
    .dd-final-bar
  ) {
  background: var(--dd-module-strong);
  border-color: var(--dd-module-strong);
  color: #ffffff;
}

#ddGame[data-iot-recolor-pilot="true"][data-iot-module="visualization"] .dd-submit:hover,
#ddGame[data-iot-recolor-pilot="true"][data-iot-module="visualization"] .dd-submit:focus-visible {
  background: var(--dd-module-hover);
}

#ddGame[data-iot-recolor-pilot="true"][data-iot-module="visualization"] .dd-progress-track div {
  background: linear-gradient(90deg, var(--dd-module-strong), var(--dd-module-ink));
}

#ddGame[data-iot-recolor-pilot="true"][data-iot-module="visualization"]
  :where(.dd-widget-btn:hover, .dd-widget-btn:focus-visible, .dd-widget-btn.is-selected) {
  border-color: var(--dd-module-strong);
  box-shadow: 0 8px 18px rgba(13, 71, 161, 0.16);
}

#ddGame[data-iot-recolor-pilot="true"][data-iot-module="visualization"] .dd-widget-btn.is-selected {
  background: var(--dd-module-tint);
}

#ddGame[data-iot-recolor-pilot="true"][data-iot-module="visualization"]
  :where(
    .dd-progress-card,
    .dd-stat,
    .dd-scenario-card,
    .dd-design-panel,
    .dd-preview-panel,
    .dd-feedback,
    .dd-final-panel,
    .dd-score-item,
    .dd-canvas-widget
  ) {
  border-color: color-mix(in srgb, var(--dd-module-accent) 24%, #d9e5ea);
}

#ddGame[data-iot-recolor-pilot="true"][data-iot-module="visualization"]
  :where(.dd-scenario-tag, .dd-final-badge) {
  color: var(--dd-module-ink);
  background: var(--dd-module-tint);
}

#ddGame[data-iot-recolor-pilot="true"][data-iot-module="visualization"]
  :where(.dd-step h4, .dd-feedback-grid h5, .dd-big-score) {
  color: var(--dd-module-ink);
}

#ddGame[data-iot-recolor-pilot="true"][data-iot-module="visualization"] .dd-preview {
  border-color: var(--dd-module-strong);
  background: #132a4d;
}

#ddGame[data-iot-recolor-pilot="true"][data-iot-module="visualization"] .dd-preview-widget {
  border-color: #2f5689;
  background: #1b385f;
}

#ddGame[data-iot-recolor-pilot="true"][data-iot-module="visualization"] .dd-preview-icon {
  color: #ffffff;
  background: var(--dd-module-strong);
}

#ddGame[data-iot-recolor-pilot="true"][data-iot-module="visualization"]
  ~ .dd-reference-material
  details {
  border-color: var(--dd-module-border);
  background: var(--dd-module-tint);
}

#ddGame[data-iot-recolor-pilot="true"][data-iot-module="visualization"]
  ~ .dd-reference-material
  summary {
  color: var(--dd-module-ink);
}
