.scq-page body {
  background: #f5f7f9;
}

.scq-page main.content {
  max-width: 1180px;
}

.scq-page h2,
.scq-page h3,
.scq-page h4,
.scq-page p {
  letter-spacing: 0;
}

.scq-page .page-columns {
  display: block;
}

.scq-page .quarto-title-block {
  display: none;
}

.iot-component-frame body {
  background: transparent;
}

.iot-component-frame .scq-page main.content,
.iot-component-frame main.content {
  margin: 0;
  padding: 0;
  max-width: none;
}

.iot-component-frame #title-block-header,
.iot-component-frame .quarto-title-block,
.iot-component-frame nav,
.iot-component-frame .toc-actions,
.iot-component-frame .sidebar,
.iot-component-frame .page-navigation {
  display: none !important;
}

.iot-component-frame .scq-hero {
  display: none;
}

.scq-game,
.scq-reference-material {
  color: #25313b;
  font-family:
    Inter,
    "Segoe UI",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  margin: 0 auto;
  max-width: 1120px;
}

.scq-game *,
.scq-reference-material * {
  box-sizing: border-box;
}

.scq-hero {
  background:
    radial-gradient(circle at 12% 18%, rgba(41, 128, 185, 0.13), transparent 28%),
    linear-gradient(135deg, #183247 0%, #245849 58%, #7a5b24 100%);
  border-radius: 8px;
  color: #fff;
  margin: 16px 0;
  padding: 28px;
}

.scq-kicker,
.scq-metrics,
.scq-status,
.scq-action-row,
.scq-feedback-top,
.scq-scenario-top {
  align-items: center;
  display: flex;
}

.scq-kicker {
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.scq-pill {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  color: #f7fbff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 10px;
  text-transform: uppercase;
}

.scq-hero h2 {
  color: #fff;
  font-size: 2.1rem;
  line-height: 1.1;
  margin: 0 0 10px;
}

.scq-hero p {
  color: rgba(255, 255, 255, 0.88);
  font-size: 1rem;
  line-height: 1.55;
  margin: 0;
  max-width: 760px;
}

.scq-metrics {
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.scq-metric {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  min-width: 140px;
  padding: 10px 12px;
}

.scq-metric strong {
  display: block;
  font-size: 1.35rem;
}

.scq-metric span {
  color: rgba(255, 255, 255, 0.82);
  display: block;
  font-size: 0.78rem;
}

.scq-status {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(260px, 1fr) repeat(3, minmax(105px, 0.2fr));
  margin: 16px 0;
}

.scq-progress-card,
.scq-stat,
.scq-scenario-card,
.scq-panel,
.scq-feedback,
.scq-final-card,
.scq-reference-intro,
.scq-reference-section {
  background: #fff;
  border: 1px solid #dde6ec;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(22, 39, 52, 0.07);
}

.scq-progress-card,
.scq-stat {
  padding: 14px;
}

.scq-progress-label {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.scq-progress-label span,
.scq-stat span,
.scq-spec span,
.scq-scenario-tag {
  color: #667987;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.scq-progress-label strong {
  color: #22313d;
  font-size: 0.9rem;
}

.scq-progress-track {
  background: #e8eef2;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.scq-progress-track > div {
  background: linear-gradient(90deg, #2f80c5, #1f8f70);
  border-radius: inherit;
  height: 100%;
  transition: width 0.2s ease;
  width: 0;
}

.scq-stat {
  text-align: center;
}

.scq-stat strong {
  color: #143247;
  display: block;
  font-size: 1.55rem;
  line-height: 1.1;
}

.scq-scenario-card {
  border-left: 5px solid #2f80c5;
  padding: 20px;
}

.scq-scenario-top {
  justify-content: space-between;
  gap: 16px;
}

.scq-scenario-card h3 {
  color: #162b3a;
  font-size: 1.35rem;
  line-height: 1.25;
  margin: 4px 0 0;
}

.scq-scenario-score {
  background: #eef6fd;
  border: 1px solid #c8dfef;
  border-radius: 999px;
  color: #246798;
  flex: 0 0 auto;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 7px 10px;
}

.scq-scenario-copy {
  color: #43515c;
  line-height: 1.58;
  margin: 14px 0;
}

.scq-reqs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.scq-reqs span {
  background: #f1f5f7;
  border: 1px solid #dbe5ea;
  border-radius: 999px;
  color: #354a59;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 5px 9px;
}

.scq-spec-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.scq-spec {
  background: #f8fafb;
  border: 1px solid #e2e9ee;
  border-radius: 8px;
  min-width: 0;
  padding: 10px;
}

.scq-spec strong {
  color: #24333d;
  display: block;
  font-size: 0.9rem;
  line-height: 1.28;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.scq-workspace {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1.65fr) minmax(260px, 0.7fr);
  margin-top: 14px;
}

.scq-panel {
  padding: 18px;
}

.scq-step-head {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}

.scq-step-head > span {
  align-items: center;
  background: #163247;
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.82rem;
  font-weight: 800;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.scq-step-head h4 {
  color: #172a38;
  font-size: 1rem;
  margin: 0 0 3px;
}

.scq-step-head p {
  color: #5c6d79;
  font-size: 0.86rem;
  line-height: 1.4;
  margin: 0;
}

.scq-option-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.scq-option {
  align-items: flex-start;
  background: #fff;
  border: 1px solid #dbe5eb;
  border-radius: 8px;
  color: #263845;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  padding: 12px;
  text-align: left;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.scq-option:hover:not(:disabled),
.scq-option.is-selected {
  border-color: #2f80c5;
  box-shadow: 0 8px 18px rgba(47, 128, 197, 0.14);
  transform: translateY(-1px);
}

#scqGame[data-iot-interactive-theme="flat"][data-iot-recolor-pilot="true"][data-iot-module="sensors"]
  .scq-option {
  background: #fff !important;
  border-color: #dbe5eb !important;
  color: #263845 !important;
}

#scqGame[data-iot-interactive-theme="flat"][data-iot-recolor-pilot="true"][data-iot-module="sensors"]
  .scq-option
  > span {
  background: #fff1ed !important;
  color: #7a210c !important;
}

#scqGame[data-iot-interactive-theme="flat"][data-iot-recolor-pilot="true"][data-iot-module="sensors"]
  .scq-option
  :where(strong, em, dt, dd) {
  color: #263845 !important;
}

#scqGame[data-iot-interactive-theme="flat"][data-iot-recolor-pilot="true"][data-iot-module="sensors"]
  .scq-option:hover:not(:disabled),
#scqGame[data-iot-interactive-theme="flat"][data-iot-recolor-pilot="true"][data-iot-module="sensors"]
  .scq-option.is-selected {
  background: #7a210c !important;
  border-color: #7a210c !important;
  color: #fff !important;
}

#scqGame[data-iot-interactive-theme="flat"][data-iot-recolor-pilot="true"][data-iot-module="sensors"]
  .scq-option.is-selected
  > span {
  background: #5a1609 !important;
  color: #fff !important;
}

#scqGame[data-iot-interactive-theme="flat"][data-iot-recolor-pilot="true"][data-iot-module="sensors"]
  .scq-option.is-selected
  :where(strong, em, dt, dd) {
  color: #fff !important;
}

#scqGame[data-iot-interactive-theme="flat"][data-iot-recolor-pilot="true"][data-iot-module="sensors"]
  .scq-option.is-selected
  dl
  div {
  background: rgba(255, 255, 255, 0.16) !important;
}

.scq-option.is-correct {
  background: #edf9f3;
  border-color: #1f8f70;
}

.scq-option.is-wrong {
  background: #fff1ee;
  border-color: #c94c35;
}

.scq-option:disabled {
  cursor: default;
}

.scq-option > span {
  align-items: center;
  background: #eaf2f8;
  border-radius: 8px;
  color: #235f8d;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 800;
  justify-content: center;
  line-height: 1.15;
  padding: 8px;
  text-align: center;
}

.scq-option strong {
  color: #172a38;
  display: block;
  font-size: 0.94rem;
  line-height: 1.22;
  margin-bottom: 4px;
}

.scq-option em {
  color: #596a76;
  display: block;
  font-size: 0.82rem;
  font-style: normal;
  line-height: 1.35;
}

.scq-option dl {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
  margin: 10px 0 0;
}

.scq-option dl div {
  background: #f6f8fa;
  border-radius: 6px;
  min-width: 0;
  padding: 6px;
}

.scq-option dt {
  color: #71808b;
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
}

.scq-option dd {
  color: #24333d;
  font-size: 0.78rem;
  font-weight: 800;
  margin: 1px 0 0;
}

.scq-clues {
  display: grid;
  gap: 10px;
}

.scq-clues article {
  background: #f8fafb;
  border: 1px solid #e2e9ee;
  border-radius: 8px;
  padding: 12px;
}

.scq-clues span {
  color: #7a5b24;
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.scq-clues strong {
  color: #24333d;
  display: block;
  font-size: 0.9rem;
  line-height: 1.32;
  margin-top: 4px;
}

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

.scq-feedback.is-correct {
  border-color: #9ed8bb;
}

.scq-feedback.is-wrong {
  border-color: #e5b0a5;
}

.scq-feedback-top {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.scq-feedback-top strong {
  color: #172a38;
  font-size: 1rem;
}

.scq-feedback-top span {
  background: #edf6f2;
  border-radius: 999px;
  color: #1f8f70;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 5px 9px;
}

.scq-feedback p {
  color: #465762;
  line-height: 1.5;
  margin: 7px 0 0;
}

.scq-rule {
  background: #f8f4ed;
  border-left: 4px solid #a96f22;
  border-radius: 6px;
  padding: 10px 12px;
}

.scq-action-row {
  gap: 10px;
  justify-content: flex-end;
  margin-top: 14px;
}

.scq-submit,
.scq-secondary {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
  line-height: 1;
  padding: 12px 16px;
}

.scq-submit {
  background: #1f8f70;
  color: #fff;
}

.scq-submit:disabled {
  background: #98a9b5;
  cursor: not-allowed;
}

.scq-secondary {
  background: #e9eef2;
  color: #263845;
}

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

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

.scq-final-card > span {
  color: #7a5b24;
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.scq-final-card h3 {
  color: #143247;
  font-size: 2rem;
  margin: 5px 0 8px;
}

.scq-final-card p {
  color: #4b5d68;
  margin: 0 auto 16px;
  max-width: 620px;
}

.scq-result-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 16px auto;
  max-width: 520px;
}

.scq-result-grid div {
  background: #f5f8fa;
  border: 1px solid #dfe8ed;
  border-radius: 8px;
  padding: 12px;
}

.scq-result-grid strong {
  color: #1f8f70;
  display: block;
  font-size: 1.35rem;
}

.scq-result-grid span {
  color: #657886;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.scq-loading,
.scq-error,
.scq-reference-loading {
  background: #fff;
  border: 1px solid #dde6ec;
  border-radius: 8px;
  color: #596a76;
  padding: 18px;
}

.scq-error {
  color: #a33a2a;
}

.scq-reference-material {
  margin-top: 22px;
}

.scq-reference-intro,
.scq-reference-section {
  margin-bottom: 12px;
}

.scq-reference-intro {
  padding: 16px 18px;
}

.scq-reference-intro h3 {
  color: #172a38;
  font-size: 1.1rem;
  margin: 0 0 6px;
}

.scq-reference-intro p {
  color: #526471;
  line-height: 1.5;
  margin: 0;
}

.scq-reference-section {
  overflow: hidden;
}

.scq-reference-section summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  list-style: none;
  padding: 14px 16px;
}

.scq-reference-section summary::-webkit-details-marker {
  display: none;
}

.scq-reference-section summary span {
  color: #172a38;
  font-weight: 800;
}

.scq-reference-section summary em {
  background: #eef3f6;
  border-radius: 999px;
  color: #526471;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 800;
  padding: 4px 8px;
  text-transform: uppercase;
}

.scq-reference-body {
  border-top: 1px solid #e5edf2;
  padding: 16px;
}

.scq-table-wrap {
  overflow-x: auto;
}

.scq-reference-table {
  border-collapse: collapse;
  width: 100%;
}

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

.scq-reference-table th {
  color: #172a38;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.scq-reference-table td {
  color: #475a66;
  font-size: 0.9rem;
  line-height: 1.42;
}

.scq-card-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.scq-card-grid article,
.scq-mini-card-grid article {
  background: #f8fafb;
  border: 1px solid #e2e9ee;
  border-radius: 8px;
  padding: 12px;
}

.scq-card-grid h4,
.scq-mini-card-grid h4 {
  color: #172a38;
  font-size: 0.95rem;
  margin: 0 0 6px;
}

.scq-card-grid p,
.scq-mini-card-grid p {
  color: #526471;
  font-size: 0.86rem;
  line-height: 1.45;
  margin: 0;
}

.scq-mini-card-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.scq-mini-card-grid article {
  display: flex;
  gap: 12px;
}

.scq-mini-card-grid span {
  align-items: center;
  background: #eaf2f8;
  border-radius: 8px;
  color: #235f8d;
  display: inline-flex;
  flex: 0 0 92px;
  font-size: 0.76rem;
  font-weight: 800;
  justify-content: center;
  padding: 8px;
  text-align: center;
  text-transform: uppercase;
}

html.iot-resource-frame-standalone #scqGame .scq-hero {
  display: none;
}

@media (max-width: 920px) {
  .scq-status,
  .scq-workspace,
  .scq-spec-grid,
  .scq-card-grid {
    grid-template-columns: 1fr;
  }

  .scq-option-grid,
  .scq-mini-card-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .scq-game,
  .scq-reference-material {
    max-width: none;
  }

  .scq-hero {
    border-radius: 0;
    margin: 0 0 14px;
    padding: 20px;
  }

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

  .scq-status,
  .scq-scenario-card,
  .scq-workspace,
  .scq-feedback,
  .scq-action-row,
  .scq-reference-material {
    margin-left: 0;
    margin-right: 0;
  }

  .scq-scenario-card,
  .scq-panel,
  .scq-feedback,
  .scq-final-card,
  .scq-reference-intro,
  .scq-reference-section {
    border-radius: 8px;
  }

  .scq-scenario-top,
  .scq-feedback-top,
  .scq-action-row,
  .scq-mini-card-grid article {
    align-items: stretch;
    flex-direction: column;
  }

  .scq-option {
    min-height: 0;
  }

  .scq-option > span,
  .scq-mini-card-grid span {
    flex-basis: auto;
  }

  .scq-option dl,
  .scq-result-grid {
    grid-template-columns: 1fr;
  }

  .scq-reference-table,
  .scq-reference-table thead,
  .scq-reference-table tbody,
  .scq-reference-table tr,
  .scq-reference-table th,
  .scq-reference-table td {
    display: block;
    width: 100%;
  }

  .scq-reference-table thead {
    display: none;
  }

  .scq-reference-table tr {
    background: #f8fafb;
    border: 1px solid #e2e9ee;
    border-radius: 8px;
    margin-bottom: 10px;
    padding: 8px;
  }

  .scq-reference-table td {
    border-bottom: 0;
    padding: 6px 4px;
  }

  .scq-reference-table td::before {
    color: #697b87;
    content: attr(data-label);
    display: block;
    font-size: 0.7rem;
    font-weight: 800;
    margin-bottom: 2px;
    text-transform: uppercase;
  }
}
