* {
  box-sizing: border-box;
}

:root {
  --portal-top-offset: 28px;
  --portal-edge-offset: 32px;
  --portal-top-control-top: 24.85px;
  --portal-top-control-size: 42px;
  --portal-top-control-icon-size: 21px;
  --portal-top-control-reserved-space: 56px;
  --course-topbar-height: 35.7px;
  --course-topbar-content-offset: 48.5px;
  --course-back-link-font-size: 1.45rem;
  --course-back-link-gap: 9px;
  --course-back-link-icon-width: 8px;
  --course-back-link-icon-height: 12px;
  --course-back-link-icon-stroke: 1.35;
  --lesson-body-font-size: calc(1.08rem * 1.15);
  --lesson-title-font-size: clamp(calc(3.6rem * 0.85), 3.825vw, calc(6rem * 0.85));
  --lesson-heading-two-font-size: clamp(2.15rem, 2.625vw, 2.95rem);
  --lesson-heading-three-font-size: clamp(1.7rem, 2.15vw, 2.15rem);
  --lesson-lead-font-size: 1.4rem;
}

html {
  min-height: 100%;
  background: var(--color-page);
  color: var(--color-text);
  font-family: var(--font-ui);
}

body {
  min-height: 100vh;
  margin: 0;
}

button,
input {
  font: inherit;
}

.page-shell {
  width: min(1120px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 48px 0;
  display: grid;
  align-items: center;
}

.page-shell--course {
  width: min(1620px, calc(100% - 64px));
  height: 100vh;
  min-height: 0;
  padding: calc(var(--portal-top-offset) + var(--course-topbar-content-offset)) 0 32px;
  align-items: start;
  overflow: hidden;
}

.page-shell--auth {
  min-height: var(--auth-visible-height, 100svh);
  align-content: center;
}

.page-shell--auth .auth-layout {
  position: fixed;
  top: var(--auth-layout-y, 50svh);
  left: 50%;
  width: min(520px, calc(100vw - 32px));
  margin: 0;
  transform: translateX(-50%);
}

.portal-layout {
  display: grid;
  gap: 32px;
}

.auth-layout {
  width: min(520px, 100%);
  margin: 0 auto;
}

.course-card,
.course-panel,
.lesson-row {
  background: var(--color-block);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-large);
}

.access-form {
  padding: 0;
  display: grid;
  gap: 20px;
  font-family: var(--font-heading);
  font-weight: 400;
  text-align: center;
}

.access-form h1 {
  font-size: 2rem;
  font-weight: 400;
}

.access-form label {
  color: var(--color-text);
  font-size: 1.8rem;
  font-weight: 400;
  line-height: 1.25;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--color-brand);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
.lead {
  overflow-wrap: anywhere;
}

h1,
h2 {
  margin: 0;
  font-family: var(--font-heading);
  line-height: 1;
}

h1 {
  font-size: 4rem;
}

h2 {
  font-size: 2.8rem;
}

.lead,
.course-card p,
.lesson-row small,
.asset-list span,
.form-note {
  color: var(--color-muted);
  line-height: 1.6;
}

.lead {
  max-width: 640px;
  margin: 24px 0 0;
  font-size: 1.2rem;
}

label {
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 92px;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  caret-color: var(--color-brand);
  color: var(--color-brand);
  font-family: var(--font-ui);
  font-size: var(--access-key-font-size, 2.25rem);
  font-weight: 800;
  text-align: center;
}

input::placeholder {
  color: var(--color-placeholder);
}

input:focus {
  outline: 0;
}

.access-form--error input {
  caret-color: #ff4d4d;
  color: #ff4d4d;
}

.theme-toggle {
  position: fixed;
  top: var(--portal-top-control-top);
  right: var(--portal-edge-offset);
  z-index: 20;
  width: var(--portal-top-control-size);
  min-height: var(--portal-top-control-size);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-text);
  display: grid;
  place-items: center;
}

.theme-toggle__icon {
  width: var(--portal-top-control-icon-size);
  height: var(--portal-top-control-icon-size);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.theme-toggle__icon--moon {
  fill: currentColor;
  stroke: none;
}

.theme-toggle__icon--sun {
  display: none;
}

:root[data-theme="light"] .theme-toggle__icon--moon {
  display: none;
}

:root[data-theme="light"] .theme-toggle__icon--sun {
  display: block;
}

button {
  min-height: 52px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--color-brand);
  color: #07140c;
  font-weight: 800;
  cursor: pointer;
}

.theme-toggle:hover,
.theme-toggle:focus-visible,
.top-dropdown__trigger:hover,
.top-dropdown__trigger:focus-visible,
.portal-top-link:hover,
.portal-top-link:focus-visible {
  color: var(--color-brand);
  outline: 0;
}

.top-dropdown--open .top-dropdown__trigger,
.top-dropdown:focus-within .top-dropdown__trigger,
:root:not(.device-menu-js) .top-dropdown:hover .top-dropdown__trigger {
  color: var(--color-brand);
}

.portal-top-controls {
  position: fixed;
  top: var(--portal-top-control-top);
  left: var(--portal-edge-offset);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 24px;
}

.portal-top-controls__toggle {
  display: none;
  min-height: var(--portal-top-control-size);
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--color-text);
  appearance: none;
}

.portal-top-controls__panel {
  display: flex;
  align-items: center;
  gap: 24px;
}

.top-dropdown {
  position: relative;
}

.top-dropdown::after {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 14px;
  content: "";
}

.top-dropdown__trigger {
  min-height: var(--portal-top-control-size);
  padding: 0;
  background: transparent;
  color: var(--color-text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}

.refresh-key-form {
  margin: 0;
}

.portal-top-link {
  min-height: var(--portal-top-control-size);
  padding: 0;
  background: transparent;
  color: var(--color-text);
  display: inline-flex;
  align-items: center;
  font-weight: 800;
  text-decoration: none;
}

.portal-top-controls__toggle-line {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 180ms ease, opacity 180ms ease;
}

.top-dropdown__chevron {
  width: 12px;
  height: 8px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  transition: transform 160ms ease;
}

.top-dropdown__dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: min(360px, calc(100vw - (var(--portal-edge-offset) * 2)));
  padding: 16px;
  border: 0;
  border-radius: var(--radius-device-menu);
  background: var(--color-block);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  visibility: hidden;
}

.top-dropdown--support .top-dropdown__dropdown {
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
}

.top-dropdown--open .top-dropdown__dropdown,
.top-dropdown:focus-within .top-dropdown__dropdown,
:root:not(.device-menu-js) .top-dropdown:hover .top-dropdown__dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  visibility: visible;
}

.top-dropdown--open.top-dropdown--support .top-dropdown__dropdown,
.top-dropdown--support:focus-within .top-dropdown__dropdown,
:root:not(.device-menu-js) .top-dropdown--support:hover .top-dropdown__dropdown {
  transform: translateX(-50%) translateY(0);
}

.top-dropdown--open .top-dropdown__chevron,
.top-dropdown:focus-within .top-dropdown__chevron,
:root:not(.device-menu-js) .top-dropdown:hover .top-dropdown__chevron {
  transform: rotate(180deg);
}

.top-dropdown__title,
.top-dropdown__item {
  margin: 0;
}

.top-dropdown__title {
  color: var(--color-muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.35;
}

.top-dropdown__title + .top-dropdown__item,
.top-dropdown__title + .top-dropdown__items {
  margin-top: 8px;
}

.top-dropdown__item + .top-dropdown__title,
.top-dropdown__items + .top-dropdown__title {
  margin-top: 16px;
}

.top-dropdown__items {
  display: grid;
  gap: 6px;
}

.top-dropdown__item {
  width: 100%;
  min-height: 0;
  padding: 0;
  background: transparent;
  color: var(--color-text);
  font-weight: 700;
  line-height: 1.4;
  text-align: left;
}

.device-menu__item--action:hover,
.device-menu__item--action:focus-visible {
  color: #ff4d4d;
  outline: 0;
}

.top-dropdown__support-value,
.top-dropdown__support-code {
  margin: 0;
}

.top-dropdown__support-value a {
  color: var(--color-text);
  text-decoration: none;
}

.top-dropdown__support-value a:hover,
.top-dropdown__support-value a:focus-visible {
  color: var(--color-brand);
  outline: 0;
}

.top-dropdown__support-code {
  color: var(--color-text);
  font-weight: 800;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.secondary-button {
  background: var(--color-active);
  color: var(--color-text);
}

.form-note {
  margin: 0;
  font-size: 0.95rem;
}

.messages {
  position: fixed;
  top: 68px;
  right: 16px;
  width: min(420px, calc(100% - 32px));
  z-index: 10;
}

.message {
  margin: 0;
  padding: 14px 16px;
  border-radius: var(--radius-control);
  background: var(--color-active);
  color: var(--color-text);
}

body.portal-confirm-open {
  overflow: hidden;
}

.portal-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  padding: 24px;
  background: rgb(0 0 0 / 72%);
  display: grid;
  place-items: center;
}

.portal-confirm-dialog {
  width: min(460px, calc(100vw - 32px));
  padding: 24px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-block);
  display: grid;
  gap: 20px;
}

.portal-confirm-message {
  margin: 0;
  color: var(--color-text);
  font-size: 1.15rem;
  font-weight: 400;
  line-height: 1.5;
}

.portal-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.portal-confirm-button {
  min-width: 132px;
}

.portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.portal-layout--courses {
  width: 100%;
}

.portal-layout--ide-tokens {
  width: min(920px, 100%);
}

.ide-token-intro {
  display: grid;
  gap: 16px;
}

.ide-token-intro .lead,
.ide-token-card--empty h2,
.ide-token-card--empty .lead {
  font-family: var(--font-heading);
}

.ide-token-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.ide-token-card {
  padding: 24px;
  background: var(--color-block);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-course-card);
  display: grid;
  align-content: start;
  gap: 18px;
}

.ide-token-card--hidden {
  display: none;
}

.ide-token-card__meta {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.ide-token-card__value {
  display: block;
  margin: 0;
  color: var(--color-text);
  font-family: Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ide-token-card form {
  margin: 0;
}

.ide-token-card__action {
  width: fit-content;
  min-height: 0;
  padding: 0;
  background: transparent;
  color: var(--color-brand);
  display: inline-block;
  justify-self: start;
  text-align: left;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 400;
  line-height: 1.1;
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: var(--underline-origin, 50%) 100%;
  background-size: 0 1px;
  transition: background-size 190ms ease;
}

.ide-token-card__action:hover,
.ide-token-card__action:focus-visible {
  background-size: 100% 1px;
  outline: 0;
}

.course-grid,
.lesson-content,
.asset-list,
.lesson-navigation {
  display: grid;
  gap: 16px;
}

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

.course-card {
  position: relative;
  aspect-ratio: 1 / 1;
  padding: 28px;
  border: 1px solid transparent;
  border-radius: var(--radius-course-card);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 14px;
  overflow: hidden;
  text-decoration: none;
  transition: border-color 180ms ease, transform 160ms ease;
}

.course-card:hover,
.course-card:focus-visible {
  border-color: var(--color-course-card-border-hover);
  outline: 0;
  transform: scale(1.02);
}

.course-card__media {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgb(0 0 0 / 12%) 0%, rgb(0 0 0 / 56%) 100%),
    rgb(255 255 255 / 8%);
}

.course-card__media-fallback {
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  opacity: 0.86;
}

.course-card__media-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.course-card--with-media .course-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      180deg,
      rgb(0 0 0 / 8%) 0%,
      rgb(0 0 0 / 18%) 48%,
      rgb(0 0 0 / 52%) 100%
    );
}

.course-card h2 {
  position: relative;
  z-index: 1;
  max-width: 100%;
  font-size: 1.2rem;
  font-weight: 400;
  line-height: 1.05;
  text-wrap: balance;
}

:root[data-theme="light"] .course-card--with-media h2 {
  color: #ffffff;
}

.course-card p {
  margin: 0;
}

.course-card,
.portal-header a,
.lesson-row,
.asset-list a,
.lesson-navigation a {
  color: var(--color-text);
}

.course-card,
.lesson-row,
.asset-list a,
.lesson-navigation a {
  text-decoration-color: var(--color-brand);
  text-underline-offset: 4px;
}

.lesson-list {
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.lesson-row {
  min-height: 96px;
  padding: 20px;
  display: grid;
  gap: 8px;
  text-decoration: none;
}

.lesson-row span,
.lesson-row small {
  display: block;
}

.lesson-row span {
  color: var(--color-brand);
  font-weight: 800;
}

.lesson-row--empty {
  color: var(--color-muted);
}

.lesson-layout {
  display: grid;
  gap: 32px;
}

.course-workspace {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding-top: 0;
}

.course-topbar {
  position: fixed;
  top: var(--portal-top-offset);
  right: calc(var(--portal-edge-offset) + var(--portal-top-control-reserved-space));
  left: var(--portal-edge-offset);
  z-index: 20;
  min-height: var(--course-topbar-height);
  margin: 0;
  display: flex;
  align-items: center;
  pointer-events: none;
}

.course-back-link {
  max-width: min(760px, 100%);
  color: var(--color-text);
  display: inline-flex;
  align-items: center;
  gap: var(--course-back-link-gap);
  font-family: var(--font-heading);
  font-size: var(--course-back-link-font-size);
  font-weight: 400;
  line-height: 1.1;
  pointer-events: auto;
  text-decoration: none;
}

.course-back-link__icon {
  width: var(--course-back-link-icon-width);
  height: var(--course-back-link-icon-height);
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: var(--course-back-link-icon-stroke);
}

.course-back-link__text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.course-workspace__grid {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(420px, 3fr) minmax(180px, 1fr);
  gap: 20px;
  align-items: start;
  position: relative;
}

.course-panel {
  padding: 28px;
  border-radius: var(--radius-course-panel);
}

.course-panel__title {
  margin: 0 0 20px;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.2;
  text-transform: uppercase;
}

.course-panel__empty {
  margin: 0;
  color: var(--color-muted);
}

.course-lesson-nav {
  display: grid;
  gap: 14px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.course-lesson-nav li {
  width: 100%;
  min-width: 0;
}

.course-panel--lessons .course-panel__title {
  font-weight: 800;
}

.course-lesson-nav__link {
  width: auto;
  min-width: 0;
  max-width: 100%;
  color: var(--color-text);
  display: inline-block;
  overflow: hidden;
  font-family: var(--font-heading);
  font-size: var(--lesson-body-font-size);
  font-weight: 400;
  line-height: 1.1;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.course-lesson-nav__link:hover,
.course-lesson-nav__link:focus-visible {
  outline: 0;
}

.course-lesson-nav__link--active {
  color: var(--color-brand);
}

.course-lesson {
  height: 100%;
  min-height: 0;
  font-family: var(--font-heading);
}

.course-panel--lessons,
.course-lesson {
  overflow-y: auto;
  overscroll-behavior: contain;
}

.course-panel--lessons {
  max-height: 100%;
}

.course-lesson h1 {
  font-size: var(--lesson-title-font-size);
}

.course-lesson .lead {
  max-width: 760px;
  font-size: var(--lesson-lead-font-size);
  line-height: 1.55;
}

.course-lesson h2 {
  font-size: var(--lesson-heading-two-font-size);
  line-height: 1.08;
}

.course-lesson h3 {
  font-size: var(--lesson-heading-three-font-size);
  line-height: 1.12;
}

.course-lesson,
.course-lesson h1,
.course-lesson h2,
.course-lesson h3,
.course-lesson h4,
.course-lesson h5,
.course-lesson h6,
.course-lesson .eyebrow,
.course-lesson .lead,
.lesson-content,
.lesson-content *,
.lesson-navigation a {
  font-weight: 400;
}

.course-lesson .eyebrow {
  font-family: var(--font-ui);
  font-weight: 800;
}

.lesson-content strong {
  font-weight: 800;
}

.course-lesson--empty {
  width: min(780px, 100%);
}

.course-assets {
  height: 100%;
  max-height: 100%;
  min-height: 0;
  align-self: start;
  display: grid;
  gap: 20px;
  grid-template-rows: auto minmax(0, 1fr);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.course-panel--assets {
  min-height: 0;
}

.course-fullscreen-toggle {
  display: none;
  width: 29.333px;
  min-height: 29.333px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
}

.course-fullscreen-toggle:hover,
.course-fullscreen-toggle:focus-visible {
  color: var(--color-brand);
  outline: 0;
}

.course-fullscreen-toggle__icon {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.course-fullscreen-toggle__icon-collapse {
  display: none;
}

.course-fullscreen-toggle__corner {
  --corner-x: 0;
  --corner-y: 0;

  transform: translate(var(--corner-x), var(--corner-y));
  transform-box: view-box;
  transform-origin: center;
  transition: transform 160ms ease;
}

.course-fullscreen-toggle__corner--top-left {
  --corner-offset-x: -2px;
  --corner-offset-y: -2px;
}

.course-fullscreen-toggle__corner--top-right {
  --corner-offset-x: 2px;
  --corner-offset-y: -2px;
}

.course-fullscreen-toggle__corner--bottom-right {
  --corner-offset-x: 2px;
  --corner-offset-y: 2px;
}

.course-fullscreen-toggle__corner--bottom-left {
  --corner-offset-x: -2px;
  --corner-offset-y: 2px;
}

.course-fullscreen-toggle:hover:not([aria-pressed="true"]) .course-fullscreen-toggle__corner,
.course-fullscreen-toggle:focus-visible:not([aria-pressed="true"]) .course-fullscreen-toggle__corner,
.course-fullscreen-toggle[aria-pressed="true"] .course-fullscreen-toggle__corner {
  --corner-x: var(--corner-offset-x);
  --corner-y: var(--corner-offset-y);
}

.course-fullscreen-toggle[aria-pressed="true"]:hover .course-fullscreen-toggle__corner,
.course-fullscreen-toggle[aria-pressed="true"]:focus-visible .course-fullscreen-toggle__corner {
  --corner-x: 0;
  --corner-y: 0;
}

.course-fullscreen-toggle[aria-pressed="true"] .course-fullscreen-toggle__icon-expand {
  display: none;
}

.course-fullscreen-toggle[aria-pressed="true"] .course-fullscreen-toggle__icon-collapse {
  display: inline;
}

.course-fullscreen-toggle__label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  margin: -1px;
  clip: rect(0 0 0 0);
  overflow: hidden;
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .course-fullscreen-toggle__corner {
    transition: none;
  }
}

@media (min-width: 761px) and (orientation: landscape) {
  .course-fullscreen-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: start;
    align-self: end;
  }

  .page-shell--course-expanded {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .course-workspace--lesson-expanded .course-topbar {
    top: 0;
    right: 0;
    left: 0;
    height: calc(var(--portal-top-offset) + var(--course-topbar-content-offset));
    min-height: calc(var(--portal-top-offset) + var(--course-topbar-content-offset));
    padding: var(--portal-top-offset)
      calc(var(--portal-edge-offset) + var(--portal-top-control-reserved-space)) 24px
      var(--portal-edge-offset);
    background: var(--color-page);
  }

  .course-workspace--lesson-expanded .course-back-link {
    max-width: 100%;
  }

  .course-workspace--lesson-expanded {
    height: auto;
  }

  .course-workspace--lesson-expanded .course-workspace__grid {
    height: auto;
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }

  .course-workspace--lesson-expanded .course-lesson {
    grid-column: 1;
    grid-row: auto;
    height: auto;
    min-height: 0;
    order: 1;
    overflow-y: visible;
    overscroll-behavior: auto;
  }

  .course-workspace--lesson-expanded .course-assets {
    grid-column: 1;
    grid-row: auto;
    height: auto;
    max-height: none;
    order: 2;
    grid-template-rows: none;
    overflow-y: visible;
  }

  .course-workspace--lesson-expanded .course-panel--assets-empty {
    display: none;
  }

  .course-workspace--lesson-expanded .course-panel--lessons {
    grid-column: 1;
    grid-row: auto;
    height: auto;
    max-height: none;
    order: 3;
    overflow-y: visible;
    overscroll-behavior: auto;
  }

  .course-workspace--lesson-expanded .course-panel--assets {
    overflow-y: visible;
  }

  .course-workspace--lesson-expanded .course-fullscreen-toggle {
    order: -1;
    align-self: start;
    justify-self: end;
  }
}

.lesson-content {
  margin-top: 36px;
  font-size: var(--lesson-body-font-size);
  line-height: 1.7;
}

.lesson-heading {
  margin: 18px 0 0;
  line-height: 1.1;
}

.lesson-paragraph {
  margin: 0;
  hyphens: auto;
  overflow-wrap: break-word;
  text-align: justify;
  text-align-last: left;
}

.lesson-paragraph--attention {
  color: #d97706;
}

.lesson-paragraph--hidden-hint {
  color: var(--color-text);
  cursor: text;
  user-select: text;
}

.lesson-hidden-hint__body,
.lesson-hidden-hint__body * {
  color: transparent;
}

.lesson-hidden-hint__body::selection,
.lesson-hidden-hint__body *::selection {
  color: var(--color-text);
  background: var(--color-active);
}

.lesson-callout,
.lesson-code,
.lesson-image-placeholder,
.lesson-table-wrap {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-course-panel);
}

.lesson-callout,
.lesson-image-placeholder {
  padding: 20px;
  background: var(--color-block);
}

.lesson-callout {
  border-left: 4px solid var(--color-brand);
  hyphens: auto;
  overflow-wrap: break-word;
  text-align: justify;
  text-align-last: left;
}

.lesson-code {
  overflow-x: auto;
  margin: 0;
  padding: 20px;
  background: var(--color-code-block);
  color: var(--color-code-text);
  white-space: pre;
}

.lesson-code,
.lesson-code code,
.lesson-content code,
.lesson-inline-code {
  font-family: var(--font-code);
  font-feature-settings: "liga" 0, "calt" 0;
  font-variant-ligatures: none;
}

.lesson-code code {
  display: block;
  line-height: 1.65;
  tab-size: 2;
  white-space: pre;
}

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

.lesson-example__pane {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-course-panel);
  background: var(--color-code-block);
}

.lesson-example__title {
  margin: 0 0 10px;
  color: var(--color-muted);
  font-family: var(--font-ui);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.2;
  text-transform: uppercase;
}

.lesson-example__code {
  overflow-x: auto;
  margin: 0;
  color: var(--color-code-text);
  font-family: var(--font-code);
  font-size: 0.98rem;
  line-height: 1.55;
  tab-size: 2;
  white-space: pre;
}

.lesson-example__code code {
  font-family: inherit;
  white-space: pre;
}

.lesson-table-wrap {
  overflow-x: auto;
  background: var(--color-block);
}

.lesson-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 0.98rem;
  line-height: 1.45;
}

.lesson-table th,
.lesson-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  vertical-align: top;
}

.lesson-table th {
  color: var(--color-muted);
  font-family: var(--font-ui);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

.lesson-inline-code {
  color: var(--color-code-text);
  font-size: 0.94em;
  font-weight: 400;
}

.lesson-inline-math {
  display: inline-block;
  font-family: "Cambria Math", "Times New Roman", Georgia, serif;
  font-style: italic;
  letter-spacing: 0;
  white-space: nowrap;
}

.lesson-inline-math sub {
  font-size: 0.72em;
  line-height: 0;
  vertical-align: -0.35em;
}

.lesson-inline-code--keyword,
.lesson-inline-code--preprocessor,
.lesson-code-token--preprocessor,
.lesson-code-token--structure {
  color: var(--arduino-structure-color);
}

.lesson-code-token--function {
  color: var(--arduino-function-color);
}

.lesson-inline-code--type,
.lesson-code-token--type {
  color: var(--arduino-type-color);
  font-weight: 700;
}

.lesson-inline-code--constant,
.lesson-code-token--constant {
  color: var(--arduino-constant-color);
}

.lesson-code-token--string {
  color: var(--arduino-string-color);
}

.lesson-code-token--number {
  color: var(--arduino-number-color);
}

.lesson-inline-code--comment {
  color: var(--arduino-comment-color);
}

.lesson-inline-code--block-comment,
.lesson-code-token--block-comment {
  color: var(--arduino-block-comment-color);
}

.lesson-inline-code--operator,
.lesson-code-token--operator {
  color: var(--arduino-operator-color);
}

.lesson-hidden-hint__body .lesson-inline-code,
.lesson-hidden-hint__body .lesson-code-token {
  color: transparent;
}

.lesson-checklist {
  display: grid;
  gap: 10px;
  padding-left: 20px;
}

.lesson-checklist li {
  hyphens: auto;
  overflow-wrap: break-word;
  text-align: justify;
  text-align-last: left;
}

.lesson-image-placeholder {
  margin: 0;
}

.lesson-image-placeholder div {
  min-height: 160px;
  display: grid;
  place-items: center;
  background: var(--color-active);
  border-radius: var(--radius-control);
  color: var(--color-muted);
}

.lesson-image-placeholder figcaption {
  margin-top: 10px;
  color: var(--color-muted);
}

.lesson-diagram {
  width: min(620px, 100%);
  margin: 0 auto;
  padding: 10px 0 22px;
  color: var(--color-text);
}

.lesson-diagram__svg {
  width: 100%;
  aspect-ratio: 13 / 7.5;
  display: block;
  overflow: visible;
}

.lesson-diagram__stick {
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

.lesson-diagram__moving-dot,
.lesson-diagram__moving-triangle {
  fill: currentColor;
  stroke: var(--color-block);
  stroke-width: 1.5;
}

@media (prefers-reduced-motion: reduce) {
  .lesson-diagram__moving-dot,
  .lesson-diagram__moving-triangle {
    display: none;
  }
}

.lesson-embed {
  aspect-ratio: 16 / 9;
}

.lesson-video {
  width: min(860px, 100%);
  margin: 0 auto;
}

.lesson-video video {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  background: #000;
}

.lesson-embed iframe {
  width: 100%;
  height: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-large);
}

.lesson-video video {
  border: 1px solid var(--color-border);
  border-radius: 0;
}

.lesson-divider {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--color-border);
}

.asset-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.asset-list li {
  display: grid;
  gap: 4px;
  justify-items: start;
}

.asset-list a {
  width: fit-content;
  max-width: 100%;
  font-weight: 400;
  overflow-wrap: anywhere;
  background-image: none;
  text-decoration: none;
  transition: none;
}

.asset-list__link-text {
  display: inline;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: var(--underline-origin, 50%) 100%;
  background-size: 0 1px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  transition: background-size 190ms ease;
}

.asset-list a:hover .asset-list__link-text,
.asset-list a:focus-visible .asset-list__link-text {
  background-size: 100% 1px;
}

.asset-list a:hover,
.asset-list a:focus-visible {
  outline: 0;
}

.asset-list span {
  font-size: 0.92rem;
}

.lesson-navigation {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 36px;
}

.lesson-navigation a {
  width: fit-content;
  max-width: 100%;
  min-height: 0;
  padding: 0;
  display: inline-block;
  color: var(--color-brand);
  font-weight: 400;
  overflow-wrap: anywhere;
}

.lesson-navigation__link--previous {
  justify-self: start;
}

.lesson-navigation__link--next {
  grid-column: 2;
  justify-self: end;
  text-align: right;
}

.page-shell a:not(.course-card),
.course-topbar a,
.portal-header a {
  position: relative;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: var(--underline-origin, 50%) 100%;
  background-size: 0 1px;
  color: var(--color-text);
  text-decoration: none;
  transition: background-size 190ms ease;
}

.page-shell .lesson-navigation a {
  color: var(--color-brand);
}

.page-shell .asset-list a {
  background-image: none;
  background-size: 0 1px;
  transition: none;
}

.page-shell a:not(.course-card):hover,
.page-shell a:not(.course-card):focus-visible,
.course-topbar a:hover,
.course-topbar a:focus-visible,
.portal-header a:hover,
.portal-header a:focus-visible {
  background-size: 100% 1px;
  outline: 0;
  text-decoration: none;
}

.page-shell a.course-lesson-nav__link--active {
  background-size: 0 1px;
  color: var(--color-brand);
}

@media (max-width: 760px) {
  :root {
    --portal-top-offset: 24px;
    --portal-edge-offset: 20px;
    --portal-top-control-top: 20.85px;
    --course-topbar-content-offset: 49.1px;
    --course-back-link-font-size: 1.28rem;
    --lesson-title-font-size: calc(3rem * 0.85);
    --lesson-heading-two-font-size: 1.95rem;
    --lesson-heading-three-font-size: 1.65rem;
    --lesson-lead-font-size: 1.35rem;
  }

  .page-shell {
    width: min(100% - 24px, 520px);
    padding: 24px 0;
    align-items: start;
  }

  .page-shell--course {
    width: min(100% - 24px, 620px);
    height: auto;
    min-height: 100vh;
    padding: calc(var(--portal-top-offset) + var(--course-topbar-content-offset)) 0 32px;
    overflow: visible;
  }

  .auth-layout {
    width: 100%;
  }

  .access-form,
  .course-card,
  .course-panel,
  .lesson-row {
    border-radius: var(--radius-large);
  }

  .course-card {
    border-radius: var(--radius-course-card);
  }

  .course-panel {
    border-radius: var(--radius-course-panel);
  }

  .lesson-example {
    grid-template-columns: 1fr;
  }

  .access-form,
  .course-card {
    padding: 24px;
  }

  h1 {
    font-size: 3rem;
  }

  h2 {
    font-size: 2.2rem;
  }

  .portal-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-dropdown__dropdown {
    width: calc(100vw - (var(--portal-edge-offset) * 2));
  }

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

  .ide-token-list {
    grid-template-columns: 1fr;
  }

  .course-workspace__grid {
    height: auto;
    grid-template-columns: 1fr;
  }

  .course-workspace {
    height: auto;
    padding-top: var(--course-topbar-height);
  }

  .course-lesson {
    height: auto;
    min-height: 0;
    order: 1;
    overflow-y: visible;
  }

  .course-assets {
    height: auto;
    max-height: none;
    order: 2;
    overflow-y: visible;
  }

  .course-panel--lessons {
    height: auto;
    max-height: none;
    order: 3;
    overflow-y: visible;
  }

  .course-panel--assets {
    overflow-y: visible;
  }

  .lesson-navigation {
    grid-template-columns: 1fr;
  }

  .lesson-navigation__link--next {
    grid-column: 1;
  }
}

@media (orientation: portrait) {
  :root {
    --portal-top-control-top: 17.25px;
    --portal-top-control-size: 42px;
    --portal-top-control-icon-size: 21px;
    --portal-top-control-reserved-space: 56px;
    --course-portrait-menu-height: 76.5px;
    --course-portrait-content-top: var(--course-portrait-menu-height);
    --course-portrait-bottom-space: 32px;
    --course-back-link-font-size: 1.45rem;
    --course-back-link-gap: 9px;
    --course-back-link-icon-width: 8px;
    --course-back-link-icon-height: 12px;
    --course-back-link-icon-stroke: 1.35;
  }

  .page-shell--course {
    height: auto;
    min-height: 100vh;
    padding-bottom: var(--course-portrait-bottom-space);
    padding-top: var(--course-portrait-content-top);
    overflow: visible;
  }

  .course-workspace {
    height: auto;
    padding-top: 0;
  }

  .course-topbar {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 19;
    height: var(--course-portrait-menu-height);
    min-height: var(--course-portrait-menu-height);
    margin: 0;
    padding: var(--portal-top-offset)
      calc(var(--portal-edge-offset) + var(--portal-top-control-reserved-space)) 24px
      var(--portal-edge-offset);
    background: var(--color-page);
    pointer-events: none;
  }

  .course-back-link {
    max-width: 100%;
  }

  .course-workspace__grid {
    height: auto;
    grid-template-columns: 1fr;
  }

  .course-panel {
    border-radius: var(--radius-course-panel);
    overflow: visible;
    position: relative;
  }

  .course-lesson {
    height: auto;
    min-height: 0;
    order: 1;
    overflow-y: visible;
    overscroll-behavior: auto;
  }

  .course-assets {
    height: auto;
    max-height: none;
    order: 2;
    overflow-y: visible;
  }

  .course-assets--empty,
  .course-panel--assets-empty {
    display: none;
  }

  .course-panel--lessons {
    height: auto;
    max-height: none;
    order: 3;
    overflow-y: visible;
  }

  .course-panel--assets {
    overflow-y: visible;
  }

  .lesson-navigation {
    grid-template-columns: 1fr;
  }

  .lesson-navigation__link--next {
    grid-column: 1;
  }
}

@media (max-width: 760px) and (orientation: portrait) {
  .portal-top-controls {
    position: fixed;
    top: var(--portal-top-control-top);
    left: var(--portal-edge-offset);
    z-index: 30;
    display: block;
  }

  .portal-top-controls__toggle {
    width: var(--portal-top-control-size);
    min-height: var(--portal-top-control-size);
    padding: 9px 7px;
    background: transparent;
    color: var(--color-text);
    display: inline-grid;
    align-content: center;
    gap: 6px;
    position: relative;
    z-index: 1;
  }

  .portal-top-controls__toggle:hover,
  .portal-top-controls__toggle:focus-visible {
    color: var(--color-brand);
    outline: 0;
  }

  .portal-top-controls__panel {
    position: fixed;
    inset: 0;
    padding: calc(var(--portal-top-offset) + 72px) 32px 32px;
    background: var(--color-page);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 28px;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-100%);
    transition: transform 220ms ease, opacity 220ms ease;
  }

  .portal-top-controls--open .portal-top-controls__panel {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
  }

  .portal-top-controls--open .portal-top-controls__toggle-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .portal-top-controls--open .portal-top-controls__toggle-line:nth-child(2) {
    opacity: 0;
  }

  .portal-top-controls--open .portal-top-controls__toggle-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  :root.portal-menu-open,
  :root.portal-menu-open body {
    overflow: hidden;
  }

  .portal-top-link,
  .refresh-key-button,
  .top-dropdown__trigger {
    justify-content: center;
    text-align: center;
  }

  .refresh-key-form {
    display: flex;
    justify-content: center;
  }

  .top-dropdown {
    width: min(360px, calc(100vw - 48px));
    display: grid;
    justify-items: center;
  }

  .top-dropdown__trigger {
    gap: 12px;
  }

  .top-dropdown::after {
    content: none;
  }

  .top-dropdown__dropdown {
    position: static;
    width: 100%;
    display: none;
    margin: 12px auto 0;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    visibility: visible;
  }

  .top-dropdown--support .top-dropdown__dropdown {
    left: auto;
    transform: none;
  }

  .top-dropdown--open .top-dropdown__dropdown,
  .top-dropdown:focus-within .top-dropdown__dropdown,
  :root:not(.device-menu-js) .top-dropdown:hover .top-dropdown__dropdown {
    display: block;
  }

  .top-dropdown__title,
  .top-dropdown__item,
  .top-dropdown__support-value,
  .top-dropdown__support-code {
    text-align: left;
  }

  .portal-top-controls + .theme-toggle + .page-shell {
    min-height: auto;
    padding-top: calc(var(--portal-top-offset) + var(--portal-top-control-size) + 24px);
    align-items: start;
  }
}

@media (max-width: 760px) and (orientation: portrait) {
  :root {
    --portal-top-control-top: 15.75px;
    --course-portrait-menu-height: 73.5px;
    --course-back-link-font-size: 1.28rem;
  }
}
