:root {
  --primary: #1967d2;
  --primary-dark: #114b9e;
  --bg: #edf3fb;
  --panel: #ffffff;
  --line: #d6e0ee;
  --text: #132033;
  --muted: #607089;
  --soft-blue: #eaf2ff;
  --soft-green: #ecfdf5;
  --green: #047857;
  --soft-yellow: #fff8dc;
  --code: #101827;
  --shadow: 0 8px 24px rgba(15, 23, 42, .10);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 9px 12px;
  color: #fff;
  background: #0f172a;
  border-radius: 7px;
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
  outline: 3px solid #fbbf24;
  outline-offset: 2px;
}

header {
  min-height: 46px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #fff;
  background: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}

.header-left {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

header h1 {
  min-width: 0;
  overflow: hidden;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.portal-link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  color: #fff;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .38);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.portal-link:hover {
  background: rgba(255, 255, 255, .24);
}

.portal-link:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.level-card:focus-visible,
.chapter-link:focus-visible,
.chapter-footer a:focus-visible {
  outline: 3px solid rgba(25, 103, 210, .35);
  outline-offset: 3px;
}

/* Portal dos três níveis */
.hub-main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0 48px;
}

.hub-intro {
  margin-bottom: 26px;
  padding: 28px 30px;
  background: linear-gradient(135deg, #fff, #f5f9ff);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.eyebrow {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 5px 10px;
  color: #0f3f86;
  background: var(--soft-blue);
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.hub-intro h2 {
  max-width: 820px;
  margin-bottom: 10px;
  color: var(--primary-dark);
  font-size: clamp(25px, 3vw, 38px);
  line-height: 1.12;
}

.hub-intro p,
.section-heading p {
  max-width: 790px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.section-heading {
  margin-bottom: 15px;
}

.section-heading h2 {
  margin-bottom: 5px;
  color: var(--primary-dark);
  font-size: 22px;
}

.levels-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.level-card {
  min-width: 0;
  min-height: 245px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: inherit;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.level-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  background: var(--soft-blue);
  border-bottom: 1px solid var(--line);
}

.level-number {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--primary);
  border-radius: 10px;
  font-size: 16px;
  font-weight: 900;
}

.level-card h3 {
  color: var(--primary-dark);
  font-size: 20px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.level-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 16px;
}

.level-card-body p {
  flex: 1;
  color: #334155;
  font-size: 14px;
  line-height: 1.5;
}

.available-label,
.disabled-label {
  display: inline-flex;
  margin-top: 16px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.available-label {
  color: var(--green);
  background: var(--soft-green);
  border: 1px solid #a7f3d0;
}

.disabled-label {
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #dbe3ef;
}

.level-card.is-disabled {
  background: #f8fafc;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .06);
}

.level-card.is-disabled .level-card-head {
  background: #f1f5f9;
}

.level-card.is-disabled .level-number {
  background: #94a3b8;
}

.level-card.is-disabled h3,
.level-card.is-disabled p {
  color: #64748b;
}

@media (hover: hover) and (pointer: fine) {
  a.level-card:hover {
    transform: translateY(-2px);
    border-color: #9cc2f5;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .14);
  }
}

/* Web I */
.module-page {
  overflow: hidden;
}

.level-menu {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  overflow-x: auto;
  background: #fff;
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
}

.level-menu-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  color: #0f3f86;
  background: #f8fbff;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.level-menu-item.active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 2px 7px rgba(25, 103, 210, .28);
}

.level-menu-item.is-disabled {
  color: #64748b;
  background: #f8fafc;
  border-color: #e2e8f0;
}

.level-menu-item small {
  font-size: 10px;
  font-weight: 900;
}

.web-layout {
  height: calc(100vh - 94px);
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
}

.chapter-menu {
  padding: 12px 8px;
  overflow-y: auto;
  background: #fff;
  border-right: 1px solid var(--line);
}

.chapter-menu h2 {
  margin: 4px 7px 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.chapter-link {
  width: 100%;
  display: block;
  margin-bottom: 6px;
  padding: 10px;
  color: #0f172a;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.3;
  text-decoration: none;
}

.chapter-link:hover {
  color: var(--primary);
  background: var(--soft-blue);
}

.chapter-link.active,
.chapter-link[aria-current="location"] {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 2px 7px rgba(25, 103, 210, .3);
}

.web-content {
  min-width: 0;
  overflow-y: auto;
  padding: 16px;
}

.chapter {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 2.6vw, 30px);
  line-height: 1.58;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .08);
}

.js-ready .chapter[hidden] {
  display: none;
}

.chapter-header {
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.chapter-kicker {
  display: inline-flex;
  margin-bottom: 9px;
  padding: 4px 9px;
  color: var(--primary-dark);
  background: var(--soft-blue);
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.chapter-header h2 {
  margin-bottom: 8px;
  color: var(--primary-dark);
  font-size: clamp(25px, 3vw, 35px);
  line-height: 1.13;
}

.chapter-meta {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.chapter h3 {
  margin: 26px 0 9px;
  color: var(--primary-dark);
  font-size: 22px;
  line-height: 1.2;
}

.chapter h4 {
  margin: 19px 0 7px;
  color: var(--primary-dark);
  font-size: 17px;
}

.chapter p {
  margin: 8px 0;
}

.chapter ul,
.chapter ol {
  margin: 9px 0 13px 24px;
}

.chapter li {
  margin: 5px 0;
}

.chapter a:not(.chapter-footer a) {
  color: #0f4a9c;
  font-weight: 750;
}

.hero-box,
.concept-box,
.note-box,
.task-box,
.limit-box,
.ok-box {
  margin: 14px 0;
  padding: 15px 16px;
  border-radius: 11px;
}

.hero-box {
  background: linear-gradient(135deg, var(--soft-blue), #fff);
  border: 1px solid #bfdbfe;
}

.hero-box h3 {
  margin-top: 0;
}

.concept-box {
  background: #f8fbff;
  border: 1px solid var(--line);
}

.note-box {
  background: var(--soft-yellow);
  border-left: 5px solid #f59e0b;
}

.task-box {
  background: #f8fbff;
  border: 1px solid var(--line);
  border-left: 5px solid var(--primary);
}

.task-box h4 {
  margin-top: 0;
}

.ok-box {
  background: var(--soft-green);
  border-left: 5px solid #16a34a;
}

.limit-box {
  background: #f8fafc;
  border-left: 5px solid #64748b;
}

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

.mini-card {
  padding: 14px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.mini-card strong {
  color: var(--primary-dark);
}

.flow {
  margin: 12px 0;
  padding: 14px;
  overflow-x: auto;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: Consolas, "Courier New", monospace;
  line-height: 1.55;
  white-space: pre;
}

pre.code-block {
  margin: 10px 0 15px;
  padding: 14px 16px;
  overflow-x: auto;
  color: #f8fafc;
  background: var(--code);
  border-radius: 9px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 14px;
  line-height: 1.55;
  tab-size: 2;
}

.code-block-wrap {
  position: relative;
  margin: 10px 0 15px;
}

.code-block-wrap pre.code-block {
  margin: 0;
  padding-top: 46px;
}

.copy-code-button {
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 2;
  min-width: 67px;
  padding: 5px 9px;
  color: #e2e8f0;
  background: #263349;
  border: 1px solid #526177;
  border-radius: 6px;
  font: inherit;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
  cursor: pointer;
}

.copy-code-button:hover {
  color: #fff;
  background: #34445d;
}

.copy-code-button:focus-visible {
  outline: 3px solid #93c5fd;
  outline-offset: 2px;
}

.copy-code-button.copy-error {
  min-width: 112px;
  color: #fee2e2;
  border-color: #f87171;
}

.code-disclosure {
  margin: 14px 0 18px;
  padding: 0 12px 12px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.code-disclosure summary {
  margin: 0 -12px;
  padding: 12px;
  color: var(--primary-dark);
  font-weight: 850;
  cursor: pointer;
}

.code-disclosure[open] summary {
  border-bottom: 1px solid var(--line);
}

.code-disclosure .code-block-wrap {
  margin-bottom: 0;
}

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

.tool-figure {
  margin: 14px 0;
  overflow: hidden;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.tool-grid .tool-figure {
  margin: 0;
}

.tool-figure img {
  width: 100%;
  height: auto;
  display: block;
  background: #fff;
}

.tool-figure figcaption {
  padding: 11px 13px;
  color: var(--muted);
  font-size: 12px;
}

.checkpoint-box {
  margin: 14px 0;
  padding: 14px 16px;
  background: var(--soft-green);
  border: 1px solid #bbf7d0;
  border-left: 5px solid #16a34a;
  border-radius: 11px;
}

.checkpoint-box p {
  margin-bottom: 10px;
}

.filter-playground,
.counter-playground {
  margin: 18px 0;
  padding: 16px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.filter-playground > h4 {
  margin-top: 0;
}

.filter-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.filter-controls[hidden],
.order-options[hidden],
.order-result[hidden] {
  display: none;
}

.filter-controls span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.filter-controls button {
  min-height: 36px;
  padding: 7px 11px;
  color: var(--primary-dark);
  background: #fff;
  border: 1px solid #9fb0c6;
  border-radius: 999px;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.filter-controls button[aria-pressed="true"] {
  color: #fff;
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.filter-controls button:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 2px;
}

.filter-status {
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.filter-products {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.filter-products article {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.filter-products article[hidden] {
  display: none;
}

.filter-products img {
  width: 100%;
  aspect-ratio: 3 / 2;
  display: block;
  object-fit: cover;
}

.filter-products h5,
.filter-products p {
  margin: 9px 10px 0;
}

.filter-products h5 {
  color: var(--primary-dark);
  font-size: 13px;
}

.filter-products p {
  margin-top: 2px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 11px;
}

.counter-playground label {
  display: block;
  color: #1e293b;
  font-weight: 850;
}

.counter-playground > p {
  margin: 4px 0 8px;
  color: var(--muted);
  font-size: 12px;
}

.counter-playground textarea {
  width: 100%;
  min-height: 112px;
  padding: 9px 10px;
  color: var(--text);
  background: #fff;
  border: 1px solid #9fb0c6;
  border-radius: 7px;
  font: inherit;
  resize: vertical;
}

.counter-playground textarea:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 2px;
}

.counter-playground .character-counter {
  margin-top: 5px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.order-playground {
  margin: 18px 0;
  padding: 16px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.order-playground > h4 {
  margin-top: 0;
}

.order-playground > p {
  color: var(--muted);
}

.order-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
  padding: 12px;
  background: #fff;
  border: 1px solid #c7d6e9;
  border-radius: 9px;
}

.order-options legend {
  padding: 0 7px;
  color: var(--primary-dark);
  font-weight: 900;
}

.order-options label {
  overflow: hidden;
  color: #1e293b;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.order-options label:has(input:checked) {
  border-color: var(--primary-dark);
  box-shadow: 0 0 0 2px rgba(30, 64, 175, .16);
}

.order-options img {
  width: 100%;
  aspect-ratio: 3 / 2;
  display: block;
  object-fit: cover;
}

.order-options span {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 10px;
}

.order-options input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--primary-dark);
}

.order-options input:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 2px;
}

.order-result {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  color: var(--primary-dark);
  background: var(--soft-green);
  border: 1px solid #bbf7d0;
  border-radius: 9px;
  font-weight: 850;
}

.order-result p {
  margin: 0;
}

.order-result button {
  min-height: 36px;
  padding: 7px 11px;
  color: #fff;
  background: var(--primary-dark);
  border: 1px solid var(--primary-dark);
  border-radius: 7px;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.order-result button:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.order-result button:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 2px;
}

.storage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.storage-status {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.release-checklist {
  margin: 18px 0;
  padding: 16px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.release-checklist > h4 {
  margin-top: 0;
}

.release-checklist > p {
  color: var(--muted);
}

.release-checklist fieldset {
  display: grid;
  gap: 9px;
  margin: 12px 0;
  padding: 13px;
  background: #fff;
  border: 1px solid #c7d6e9;
  border-radius: 9px;
}

.release-checklist legend {
  padding: 0 7px;
  color: var(--primary-dark);
  font-weight: 900;
}

.release-checklist label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: #1e293b;
  font-size: 13px;
  cursor: pointer;
}

.release-checklist input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--primary-dark);
}

.release-checklist input:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 2px;
}

.release-progress {
  min-height: 22px;
  margin-bottom: 0;
  color: var(--primary-dark) !important;
  font-weight: 850;
}

.fetch-playground {
  margin: 18px 0;
  padding: 16px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.fetch-playground > h4 {
  margin-top: 0;
}

.fetch-playground > p {
  color: var(--muted);
}

.fetch-playground > button {
  min-height: 40px;
  padding: 8px 13px;
  color: #fff;
  background: var(--primary-dark);
  border: 1px solid var(--primary-dark);
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.fetch-playground > button:disabled {
  opacity: .62;
  cursor: wait;
}

.fetch-playground > button:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 2px;
}

.fetch-status {
  min-height: 20px;
  margin: 10px 0 12px;
  font-size: 12px;
  font-weight: 750;
}

.fetch-demo-products {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.fetch-demo-products[hidden] {
  display: none;
}

.fetch-demo-products article {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.fetch-demo-products img {
  width: 100%;
  aspect-ratio: 3 / 2;
  display: block;
  object-fit: cover;
}

.fetch-demo-products h5,
.fetch-demo-products p {
  margin: 9px 10px 0;
}

.fetch-demo-products h5 {
  color: var(--primary-dark);
  font-size: 13px;
}

.fetch-demo-products p {
  margin-top: 4px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 11px;
}

.fetch-demo-products strong {
  display: block;
  margin-top: 4px;
  color: var(--primary-dark);
}

.download-resource {
  margin: 14px 0 17px;
  padding: 14px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.download-resource h4 {
  margin-top: 0;
}

.download-resource figure {
  display: grid;
  grid-template-columns: minmax(260px, 420px) minmax(0, 1fr);
  align-items: stretch;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.download-resource img {
  width: 100%;
  height: 230px;
  display: block;
  object-fit: cover;
}

.download-resource figcaption {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
}

.download-resource figcaption p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.download-button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 7px 11px;
  color: #fff !important;
  background: var(--primary);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}

.download-button:hover {
  background: var(--primary-dark);
}

.download-button:focus-visible {
  outline: 3px solid rgba(25, 103, 210, .35);
  outline-offset: 3px;
}

.resource-gallery {
  margin: 14px 0 18px;
  padding: 14px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.resource-gallery h4 {
  margin-top: 0;
}

.resource-gallery > p {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
}

.resource-card {
  min-width: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.resource-card img {
  width: 100%;
  height: 145px;
  display: block;
  object-fit: cover;
}

.resource-card figcaption {
  display: flex;
  align-items: stretch;
  flex-direction: column;
  gap: 9px;
  padding: 10px;
}

.resource-card figcaption strong {
  color: var(--primary-dark);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.resource-card .download-button {
  justify-content: center;
  text-align: center;
}

.css-preview {
  margin: 14px 0 8px;
  overflow: hidden;
  color: #20241f;
  background: #fff8ed;
  border: 1px solid #d9cdbd;
  border-radius: 12px;
  box-shadow: 0 8px 22px rgba(36, 77, 63, .12);
}

.css-preview-hero {
  padding: 34px clamp(18px, 4vw, 40px);
  color: #fff;
  background:
    linear-gradient(rgba(20, 45, 37, .84), rgba(20, 45, 37, .84)),
    url("../img/programacao-web/ambiente-cafe.webp") center / cover;
}

.css-preview-hero span {
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.css-preview-hero h4 {
  margin: 5px 0;
  color: #fff;
  font-size: clamp(26px, 4vw, 38px);
}

.css-preview-hero p {
  max-width: 560px;
  margin: 0 0 15px;
}

.css-preview-action {
  display: inline-block;
  padding: 9px 13px;
  color: #244d3f;
  background: #fff;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 900;
}

.css-preview-products {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
}

.css-preview-products figure {
  display: grid;
  grid-template-columns: minmax(110px, 170px) minmax(0, 1fr);
  overflow: hidden;
  background: #fff;
  border: 1px solid #d9cdbd;
  border-radius: 9px;
}

.css-preview-products img {
  width: 100%;
  height: 110px;
  display: block;
  object-fit: cover;
}

.css-preview-products figcaption {
  display: flex;
  justify-content: center;
  flex-direction: column;
  gap: 3px;
  padding: 12px;
}

.css-preview-products strong {
  color: #244d3f;
}

.css-preview-products span {
  color: #525b55;
  font-size: 12px;
}

.resource-links {
  margin-bottom: 18px !important;
  color: var(--muted);
  font-size: 12px;
}

.responsive-preview {
  margin: 14px 0 8px;
  overflow: hidden;
  color: #20241f;
  background: #fff8ed;
  border: 1px solid #d9cdbd;
  border-radius: 12px;
  box-shadow: 0 8px 22px rgba(36, 77, 63, .12);
}

.responsive-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 7px 16px;
  padding: 16px;
  color: #fff;
  background: #244d3f;
}

.responsive-preview-head span {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.responsive-preview-head strong {
  max-width: 440px;
  font-size: 14px;
  line-height: 1.35;
}

.responsive-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr));
  gap: 13px;
  padding: 14px;
}

.responsive-preview figure {
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 1px solid #d9cdbd;
  border-radius: 9px;
}

.responsive-preview img {
  width: 100%;
  height: 145px;
  display: block;
  object-fit: cover;
}

.responsive-preview figcaption {
  flex: 1;
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 3px;
  padding: 12px;
}

.responsive-preview figcaption strong {
  color: #244d3f;
}

.responsive-preview figcaption span {
  color: #525b55;
  font-size: 12px;
}

.responsive-preview figcaption b {
  margin-top: 7px;
  color: #8a4524;
  font-size: 13px;
}

.box-model-demo {
  margin: 14px 0;
  overflow-x: auto;
  text-align: center;
}

.box-model-demo > div {
  min-width: 310px;
  padding: 18px;
  color: #6b3b23;
  background: #f5c892;
  border: 1px dashed #8a4524;
}

.box-model-demo > div > div {
  padding: 14px;
  color: #fff;
  background: #8a4524;
}

.box-model-demo > div > div > div {
  padding: 16px;
  color: #244d3f;
  background: #dce9df;
}

.box-model-demo strong {
  display: block;
  margin-top: 7px;
  padding: 14px;
  color: #fff;
  background: #244d3f;
}

.box-model-demo span {
  display: block;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.form-playground {
  margin: 18px 0;
  padding: 16px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.form-playground h4 {
  margin-top: 0;
}

.form-playground > p {
  color: var(--muted);
}

.demo-form {
  margin-top: 14px;
}

.demo-form fieldset {
  margin: 0 0 14px;
  padding: 14px;
  background: #fff;
  border: 1px solid #c7d6e9;
  border-radius: 9px;
}

.demo-form legend {
  padding: 0 7px;
  color: var(--primary-dark);
  font-weight: 900;
}

.demo-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.demo-field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.demo-field-full {
  grid-column: 1 / -1;
}

.demo-field label {
  color: #1e293b;
  font-size: 13px;
  font-weight: 850;
}

.demo-field label span,
.demo-field p {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.demo-field p {
  margin: 0;
}

.demo-field input,
.demo-field select,
.demo-field textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  color: var(--text);
  background: #fff;
  border: 1px solid #9fb0c6;
  border-radius: 7px;
  font: inherit;
  font-size: 14px;
}

.demo-field textarea {
  min-height: 110px;
  resize: vertical;
}

.demo-field input:focus-visible,
.demo-field select:focus-visible,
.demo-field textarea:focus-visible {
  outline: 3px solid #93c5fd;
  outline-offset: 2px;
  border-color: var(--primary);
}

.demo-submit {
  min-height: 40px;
  padding: 8px 14px;
  color: #fff;
  background: var(--primary);
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.demo-submit:hover {
  background: var(--primary-dark);
}

.demo-submit:focus-visible {
  outline: 3px solid #93c5fd;
  outline-offset: 3px;
}

.demo-status {
  margin: 12px 0 0 !important;
  padding: 10px 12px;
  color: #065f46;
  background: var(--soft-green);
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
}

code.inline-code {
  padding: 1px 5px;
  color: #163a68;
  background: #eef4fb;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-family: Consolas, "Courier New", monospace;
  font-size: .94em;
}

.table-wrap {
  margin: 13px 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 14px;
}

.table-wrap th,
.table-wrap td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.table-wrap th {
  color: var(--primary-dark);
  background: #f3f8ff;
}

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

.check-list {
  margin-left: 0 !important;
  list-style: none;
}

.check-list li {
  position: relative;
  padding-left: 25px;
}

.check-list li::before {
  content: "✓";
  position: absolute;
  left: 2px;
  color: #15803d;
  font-weight: 900;
}

.chapter-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.chapter-footer a,
.chapter-footer span {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 12px;
  color: var(--primary-dark);
  background: #fff;
  border: 1px solid #b9d3f6;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.chapter-footer span {
  color: #64748b;
  background: #f8fafc;
  border-color: #e2e8f0;
}

.chapter-footer a:hover {
  background: var(--soft-blue);
}

@media (max-width: 980px) {
  .levels-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 1050px) {
  .module-page {
    overflow: auto;
  }

  .level-menu {
    position: sticky;
    top: 0;
    z-index: 40;
  }

  .web-layout {
    height: auto;
    display: block;
  }

  .chapter-menu {
    position: sticky;
    top: 48px;
    z-index: 30;
    display: flex;
    gap: 7px;
    padding: 7px 8px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .chapter-menu h2 {
    display: none;
  }

  .chapter-link {
    width: auto;
    min-width: max-content;
    margin: 0;
    padding: 8px 10px;
  }

  .web-content {
    overflow: visible;
    padding: 10px;
  }
}

@media (max-width: 640px) {
  .hub-main {
    width: min(100% - 20px, 760px);
    padding-top: 18px;
  }

  .hub-intro {
    padding: 19px 17px;
  }

  .hub-intro h2 {
    font-size: 25px;
  }

  .levels-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .level-card {
    min-height: 0;
  }

  .mini-grid {
    grid-template-columns: 1fr;
  }

  .tool-grid {
    grid-template-columns: 1fr;
  }

  .chapter {
    padding: 17px 15px;
    border-radius: 11px;
  }

  .chapter h3 {
    font-size: 20px;
  }

  pre.code-block {
    padding: 12px;
    font-size: 12.5px;
  }

  .chapter-footer {
    align-items: stretch;
  }

  .download-resource figcaption {
    align-items: stretch;
    flex-direction: column;
  }

  .download-button {
    justify-content: center;
    white-space: normal;
  }

  .download-resource figure {
    grid-template-columns: 1fr;
  }

  .download-resource img {
    height: 190px;
  }

  .resource-grid {
    grid-template-columns: 1fr;
  }

  .resource-card img {
    height: 180px;
  }

  .css-preview-products {
    grid-template-columns: 1fr;
  }

  .css-preview-products figure {
    grid-template-columns: minmax(100px, 140px) minmax(0, 1fr);
  }

  .demo-form-grid {
    grid-template-columns: 1fr;
  }

  .demo-field-full {
    grid-column: auto;
  }

  .filter-products {
    grid-template-columns: 1fr;
  }

  .filter-products article {
    display: grid;
    grid-template-columns: minmax(96px, 130px) minmax(0, 1fr);
    align-items: center;
  }

  .filter-products img {
    grid-row: 1 / 3;
    height: 100%;
  }

  .order-options {
    grid-template-columns: 1fr;
  }

  .order-options label {
    display: grid;
    grid-template-columns: minmax(96px, 130px) minmax(0, 1fr);
    align-items: center;
  }

  .order-options img {
    height: 100%;
  }

  .fetch-demo-products {
    grid-template-columns: 1fr;
  }

  .fetch-demo-products article {
    display: grid;
    grid-template-columns: minmax(96px, 130px) minmax(0, 1fr);
    align-items: center;
  }

  .fetch-demo-products img {
    grid-row: 1 / 3;
    height: 100%;
  }

  .chapter-footer a,
  .chapter-footer span {
    flex: 1;
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 720px) {
  header {
    height: 46px;
    min-height: 46px;
    max-height: 46px;
    padding: 0 10px;
    gap: 8px;
  }

  .header-left {
    flex: 1 1 auto;
    gap: 8px;
  }

  header h1 {
    flex: 1 1 auto;
    font-size: 16px;
  }

  .portal-link {
    padding: 5px 9px;
    font-size: 12px;
  }

  .brand {
    display: none;
  }

  .level-menu {
    min-height: 46px;
    padding: 6px 7px;
    gap: 6px;
  }

  .level-menu-item {
    padding: 7px 10px;
    font-size: 12px;
  }

  .chapter-menu {
    top: 46px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

/* MbB: quebrar visualmente linhas longas de comandos, preservando o codigo ao copiar. */
@media(max-width:820px){
  .module-page pre.code-block,.module-page pre.code-block > code{
    white-space:pre-wrap;overflow-wrap:anywhere;word-break:normal;min-width:0;max-width:100%;
  }
  .module-page pre.code-block{overflow-x:hidden;}
}
