/* Component stylesheet for game.architecture-pattern-matcher. */
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 > h1,
html.iot-component-frame #interactive-game > h2,
html.iot-component-frame #reference-material > h2,
html.iot-component-frame #scenario-walkthroughs > h2,
html.iot-component-frame #real-world-scenarios-walkthrough > 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 #apm-app,
html.iot-component-frame .reference-material {
  max-width: 100%;
  margin-right: 0;
  margin-left: 0;
  box-shadow: none;
}

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

html.iot-resource-frame-standalone #apm-app .apm-hero {
  display: none;
}

#apm-app,
#apm-app * {
  box-sizing: border-box;
}

#apm-app {
  max-width: 980px;
  margin: 0 auto 28px;
  padding: 18px;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #20343d;
  background: #f3f8f9;
  border: 1px solid #d9e6e8;
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(28, 55, 63, 0.1);
}

#apm-app h2,
#apm-app h3,
#apm-app p {
  margin: 0;
}

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

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

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

.apm-hero h2 {
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  line-height: 1.08;
  letter-spacing: 0;
  margin-bottom: 10px;
  color: #ffffff;
}

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

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

.apm-metric {
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
}

.apm-metric strong {
  display: block;
  font-size: 1.05rem;
  line-height: 1;
}

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

.apm-toolbar {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto auto;
  gap: 10px;
  align-items: end;
  padding: 14px;
  margin-bottom: 14px;
  background: #ffffff;
  border: 1px solid #dce7ea;
  border-radius: 8px;
}

.apm-field label {
  display: block;
  margin-bottom: 6px;
  color: #546b73;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.apm-select {
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid #cbd9dd;
  border-radius: 8px;
  color: #20343d;
  background: #ffffff;
  font: inherit;
  font-weight: 650;
}

.apm-btn {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #ffffff;
  background: #0f8b8d;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease;
}

.apm-btn:hover:not(:disabled) {
  background: #0c7476;
  transform: translateY(-1px);
}

.apm-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.apm-btn.secondary {
  color: #20343d;
  background: #ffffff;
  border-color: #cbd9dd;
}

.apm-btn.secondary:hover:not(:disabled) {
  background: #f2f7f8;
}

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

.apm-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 74px;
  align-content: center;
  padding: 12px;
  background: #ffffff;
  border: 1px solid #dce7ea;
  border-radius: 8px;
}

.apm-progress-hint {
  color: #6b7f86;
  font-size: 0.82rem;
  font-weight: 750;
}

.apm-dot {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #60757d;
  background: #e9f1f3;
  font-size: 0.75rem;
  font-weight: 800;
}

.apm-dot.current {
  color: #ffffff;
  background: #0f8b8d;
  box-shadow: 0 0 0 3px rgba(15, 139, 141, 0.2);
}

.apm-dot.correct {
  color: #ffffff;
  background: #2e7d32;
}

.apm-dot.wrong {
  color: #ffffff;
  background: #b94a48;
}

.apm-stat {
  min-height: 74px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid #dce7ea;
  border-radius: 8px;
}

.apm-stat strong {
  display: block;
  color: #20343d;
  font-size: 1.6rem;
  line-height: 1;
}

.apm-stat span {
  display: block;
  margin-top: 7px;
  color: #627982;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.apm-scenario {
  padding: 18px;
  margin-bottom: 14px;
  background: #ffffff;
  border: 1px solid #dce7ea;
  border-left: 5px solid #0f8b8d;
  border-radius: 8px;
}

.apm-scenario-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 10px;
}

.apm-scenario-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 9px;
  border-radius: 999px;
  color: #0d6567;
  background: #e2f3f3;
  border: 1px solid #b8dfdf;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.apm-scenario h3 {
  color: #20343d;
  font-size: 1.35rem;
  line-height: 1.2;
  margin-bottom: 9px;
}

.apm-scenario p {
  color: #49616a;
  line-height: 1.58;
}

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

.apm-req {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  color: #20343d;
  background: #f7fbfc;
  border: 1px solid #d4e2e5;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 750;
}

.apm-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.apm-choice {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  min-height: 124px;
  padding: 16px;
  border: 2px solid #d7e3e6;
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
  text-align: left;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    transform 0.15s ease;
}

.apm-choice:hover {
  border-color: #0f8b8d;
  background: #f6fbfc;
  transform: translateY(-1px);
}

.apm-choice.selected {
  border-color: #0f8b8d;
  background: #eaf7f7;
}

.apm-choice.correct-answer {
  border-color: #2e7d32;
  background: #eef8f0;
}

.apm-choice.wrong-answer {
  border-color: #b94a48;
  background: #fff1f0;
}

.apm-choice-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #ffffff;
  background: #20343d;
  font-weight: 900;
  font-size: 1.15rem;
}

.apm-choice-name {
  display: block;
  color: #20343d;
  font-size: 1rem;
  font-weight: 850;
  line-height: 1.25;
}

.apm-choice-desc {
  display: block;
  margin-top: 5px;
  color: #5c7179;
  font-size: 0.84rem;
  line-height: 1.42;
}

.apm-feedback {
  display: none;
  padding: 16px;
  margin-bottom: 14px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #dce7ea;
}

.apm-feedback.show {
  display: block;
}

.apm-feedback.correct {
  border-color: #2e7d32;
  background: #eef8f0;
}

.apm-feedback.incorrect {
  border-color: #b94a48;
  background: #fff1f0;
}

.apm-feedback strong {
  display: block;
  margin-bottom: 8px;
  color: #20343d;
  font-size: 1rem;
}

.apm-feedback div {
  color: #40575f;
  line-height: 1.54;
}

.apm-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 12px 0 0;
}

.apm-empty,
.apm-final {
  padding: 28px;
  text-align: center;
  background: #ffffff;
  border: 1px solid #dce7ea;
  border-radius: 8px;
}

.apm-empty strong,
.apm-final strong {
  display: block;
  color: #20343d;
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.apm-empty span,
.apm-final span {
  display: block;
  color: #60757d;
  line-height: 1.45;
}

.apm-final-score {
  color: #0f8b8d;
  font-size: 2.5rem;
  line-height: 1;
  font-weight: 900;
  margin-bottom: 10px;
}

.apm-helper {
  margin-top: 16px;
  padding: 13px;
  color: #40575f;
  background: #ffffff;
  border: 1px solid #dce7ea;
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.apm-helper strong {
  color: #20343d;
}

.reference-intro {
  margin: 0 0 12px;
  color: #52656e;
  line-height: 1.5;
}

.reference-scan {
  overflow-x: auto;
  margin: 12px 0 18px;
  border: 1px solid #dbe5e9;
  border-radius: 8px;
  background: #ffffff;
}

.reference-scan-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
  margin: 0;
  font-size: 0.88rem;
}

.reference-scan-table th,
.reference-scan-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #e6eef1;
  text-align: left;
  vertical-align: top;
}

.reference-scan-table th {
  color: #17313b;
  background: #edf6f7;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.reference-scan-table tr:last-child td {
  border-bottom: 0;
}

.reference-mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 12px 0 18px;
}

.reference-mini {
  padding: 12px;
  border: 1px solid #dbe5e9;
  border-radius: 8px;
  background: #f8fbfc;
}

.reference-mini strong {
  display: block;
  margin-bottom: 4px;
  color: #17313b;
}

.reference-mini span {
  color: #52656e;
  line-height: 1.4;
}

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

.reference-card {
  padding: 14px;
  border: 1px solid #dbe5e9;
  border-radius: 8px;
  background: #ffffff;
}

.reference-card h4 {
  margin: 0 0 5px;
  color: #20343d;
  font-size: 1rem;
  line-height: 1.25;
}

.reference-role {
  margin: 0 0 10px;
  color: #667a83;
  line-height: 1.42;
}

.reference-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 10px;
}

.reference-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  color: #20343d;
  background: #e9f1f3;
  font-size: 0.72rem;
  font-weight: 800;
}

.reference-card dl {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 7px 10px;
  margin: 0;
}

.reference-card dt {
  color: #627982;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.reference-card dd {
  margin: 0;
  color: #2f3f47;
  line-height: 1.42;
}

.reference-card ol,
.reference-card ul {
  margin: 8px 0 0;
  padding-left: 1.1rem;
  color: #2f3f47;
}

.reference-card li {
  margin: 4px 0;
  line-height: 1.4;
}

@media (max-width: 720px) {
  #apm-app {
    padding: 14px;
  }

  .apm-toolbar,
  .apm-status,
  .apm-choices,
  .reference-card-grid {
    grid-template-columns: 1fr;
  }

  .apm-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .apm-choice {
    min-height: 112px;
  }

  .reference-scan-table {
    min-width: 0;
  }

  .reference-scan-table th:nth-child(n + 3),
  .reference-scan-table td:nth-child(n + 3) {
    display: none;
  }

  .reference-card dl {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}
.reference-material {
  display: block;
  width: 100%;
  max-width: 980px;
  margin: 0 auto 28px;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

.reference-map {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin: 14px 0 18px;
}

.reference-map-item {
  padding: 12px;
  border: 1px solid #dbe5e9;
  border-radius: 8px;
  background: #ffffff;
}

.reference-map-item strong,
.reference-map-item span {
  display: block;
}

.reference-map-item strong {
  color: #17313b;
  font-size: 0.92rem;
}

.reference-map-item span {
  margin-top: 4px;
  color: #5c6d76;
  font-size: 0.82rem;
  line-height: 1.35;
}

.reference-loading {
  padding: 14px;
  border: 1px solid #dbe5e9;
  border-radius: 8px;
  background: #ffffff;
  color: #52656e;
}

.reference-section {
  margin: 10px 0;
  border: 1px solid #dbe5e9;
  border-left: 5px solid #1264a3;
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

.reference-section-tip {
  border-left-color: #0f8b8d;
}

.reference-section-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 12px;
  color: #3d454b;
  background: #e7f1ff;
  cursor: pointer;
  font-weight: 750;
  list-style: none;
}

.reference-section-tip .reference-section-summary {
  background: #e6f5f2;
}

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

.reference-section-icon {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid currentColor;
  border-radius: 50%;
  color: #1264a3;
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1;
}

.reference-section-tip .reference-section-icon {
  color: #0f8b8d;
}

.reference-section-chevron {
  margin-left: auto;
  color: #52656e;
  transition: transform 0.2s ease;
}

.reference-section[open] .reference-section-chevron {
  transform: rotate(90deg);
}

.reference-section-body {
  padding: 14px 12px 16px;
  background: #ffffff;
}

#apm-app[data-iot-recolor-pilot="true"][data-iot-module="reference-architectures"] {
  --apm-module-accent: #a98200;
  --apm-module-strong: #5f4900;
  --apm-module-tint: #fff7df;
  --apm-module-border: #dfc780;
  background: #fbf8ee;
  border-color: var(--apm-module-border);
  box-shadow: none;
}

#apm-app[data-iot-recolor-pilot="true"][data-iot-module="reference-architectures"] .apm-hero {
  color: #20343d;
  background: var(--apm-module-tint);
  border: 1px solid var(--apm-module-border);
  border-left: 4px solid var(--apm-module-accent);
}

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

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

#apm-app[data-iot-recolor-pilot="true"][data-iot-module="reference-architectures"]
  :where(.apm-btn:not(.secondary), .apm-dot.current) {
  background: var(--apm-module-strong);
  border-color: var(--apm-module-strong);
  color: #ffffff;
}

#apm-app[data-iot-recolor-pilot="true"][data-iot-module="reference-architectures"]
  :where(.apm-scenario, .apm-choice:hover, .apm-choice.selected) {
  border-color: var(--apm-module-accent);
}

#apm-app[data-iot-recolor-pilot="true"][data-iot-module="reference-architectures"]
  :where(.apm-choice.selected, .apm-scenario-tag, .apm-final-score) {
  background: var(--apm-module-tint);
  color: var(--apm-module-strong);
}

#apm-app[data-iot-recolor-pilot="true"][data-iot-module="reference-architectures"]
  .apm-progress-hint {
  color: #344f59;
}

#apm-app[data-iot-recolor-pilot="true"][data-iot-module="reference-architectures"]
  .apm-choice-icon {
  color: #ffffff;
  background: var(--apm-module-strong);
}

#apm-app[data-iot-recolor-pilot="true"][data-iot-module="reference-architectures"]
  .apm-helper
  strong {
  color: var(--apm-module-strong);
}
