@font-face {
  font-family: Iosevka;
  font-weight: 400;
  font-display: swap;
  src: url('/learn-arduino-app/fonts/iosevka-400-DnzhOSIo.woff2') format('woff2');
}
@font-face {
  font-family: Iosevka;
  font-weight: 700;
  font-display: swap;
  src: url('/learn-arduino-app/fonts/iosevka-700-BxdwZZnN.woff2') format('woff2');
}
:root {
  --bg: #fdfdfe;
  --bg-deep: #edf3fc;
  --sidebar: #edf3fc;
  --card: #fefeff;
  --card-soft: #fefefff5;
  --code-bg: #f5f8fe;
  --line: #6f94c9;
  --line-soft: #d6e1f2;
  --navy: #00238a;
  --navy-2: #0032a0;
  --ink: #0032a0;
  --muted: #5a73a8;
  --faint: #95a6c9;
  --teal: #0a7c88;
  --teal-deep: #0a7c88;
  --trace: #c2d3ec;
  --track: #dfe7f4;
  --sans: Iosevka, ui-monospace, monospace;
  --cond: Iosevka, ui-monospace, monospace;
  --mono: Iosevka, ui-monospace, monospace;
}
:root[data-pe-theme='dark'] {
  color-scheme: dark;
  --bg: #101a30;
  --bg-deep: #152139;
  --sidebar: #182641;
  --card: #16233c;
  --card-soft: #16233cf5;
  --code-bg: #111d33;
  --line: #44638c;
  --line-soft: #2c4264;
  --navy: #dfebff;
  --navy-2: #c6d9ff;
  --ink: #c6d9ff;
  --muted: #96aed2;
  --faint: #728aab;
  --teal: #70dac0;
  --teal-deep: #70dac0;
  --trace: #2c4264;
  --track: #2b3c58;
  --kw: #9ec1ff;
  --fn: #e9b88c;
}
.artboard {
  background: var(--bg);
}
.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--line);
}
.traces {
  opacity: 0.45;
}
.brand-text h1 {
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.035em;
}
.lesson,
.info,
.code-panel,
.flyout,
.viewbar,
.minimap,
.sch-panel {
  border-radius: 2px;
  box-shadow: none;
}
.lesson-title,
.lesson.is-active .lesson-title,
.side-nav a {
  color: var(--ink);
}
.lesson:hover {
  background: var(--bg-deep);
  box-shadow: none;
}
button,
[role='button'],
.side-nav a {
  min-width: 44px;
  min-height: 44px;
}
:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Replace upstream fixed paper colors with the host palette in both themes. */
html:root .info-card,
html:root .code-card,
html:root .progress,
html:root .progress-card,
html:root .feature-icon,
html:root .side-toggle,
html:root .credit-side,
html:root .lesson,
html:root .lesson.is-active,
html:root .lesson-step {
  background: var(--card);
  color: var(--ink);
  border-color: var(--line);
  border-radius: 2px;
  box-shadow: none;
}
html:root .info-body,
html:root .callout,
html:root .code,
html:root .viewbar,
html:root .minimap {
  border-radius: 2px;
}
html:root .clock,
html:root .lede,
html:root .features li,
html:root .tabs button,
html:root .callout p,
html:root .info-content .sub {
  color: var(--muted);
}
html:root .tabs button.is-active,
html:root .lesson .lesson-title,
html:root .lesson.is-active .lesson-title {
  color: var(--navy);
}
html:root .side-nav svg {
  stroke: var(--navy-2);
}
html:root .side-nav svg.fill {
  fill: var(--navy-2);
}
html:root .lesson:hover {
  background: var(--bg-deep);
}
html.compact .sidebar {
  background: var(--sidebar);
  border-top: 1px solid var(--line);
  box-shadow: none;
}
html.compact .stage {
  background: var(--bg-deep);
  border-radius: 2px;
}

/* Protocol Explorer workbench: courses / visualization / explanation + code. */
html:root .traces,
html:root .brand,
html:root .app-foot,
html:root .credit {
  display: none;
}
html:root .artboard {
  --course-width: 252px;
  --detail-width: clamp(300px, 25vw, 390px);
  position: relative;
  display: grid;
  grid-template-columns: var(--course-width) minmax(0, 1fr) var(--detail-width);
  grid-template-rows: 48px minmax(0, 1fr) minmax(220px, 0.9fr);
  gap: 12px;
  align-items: stretch;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 12px;
  transform: none;
  overflow: hidden;
}
html:root .pe-scene-heading {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  flex-direction: column;
  min-width: 0;
  padding: 0 184px 0 14px;
  border: 1px solid var(--line);
  background: var(--card);
}
.pe-scene-kicker {
  font: 10px var(--mono);
  color: var(--muted);
  letter-spacing: 0.1em;
}
.pe-scene-title {
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font: 700 14px var(--sans);
  color: var(--navy);
}
html:root .sidebar {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  justify-self: end;
  position: relative;
  inset: auto;
  width: auto;
  height: 44px;
  padding: 0 2px;
  border: 0;
  background: transparent;
  box-shadow: none;
  z-index: 10;
}
html:root .side-toggle,
html:root .side-label,
html:root .side-code,
html:root .side-nav li:first-child,
html:root .side-nav li:last-child {
  display: none;
}
html:root .side-nav {
  display: flex;
  width: auto;
  height: 44px;
  gap: 0;
  padding: 0;
  margin: 0;
}
html:root .side-nav li {
  display: block;
  position: static;
  width: 44px;
  height: 44px;
}
html:root .side-nav a {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  display: grid;
  place-items: center;
}
html:root .side-nav svg {
  width: 21px;
  height: 21px;
}
html:root .side-nav a:hover {
  background: var(--bg-deep);
}
html:root .flyout {
  left: calc(var(--course-width) + 24px);
  top: 68px;
  border-radius: 2px;
  background: var(--card);
  width: min(380px, calc(100% - 32px));
  max-height: calc(100% - 90px);
}
html:root .flyout h2 {
  font-size: 18px;
}
html:root .flyout .fly-list {
  font-size: 13px;
}
html:root .flyout button {
  color: var(--ink);
}
html:root .stage {
  grid-column: 2;
  grid-row: 2 / 4;
  position: relative;
  inset: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--bg);
  overflow: hidden;
}
html:root .viewbar {
  bottom: 14px;
  left: 50%;
  max-width: calc(100% - 20px);
  padding: 3px;
  background: var(--card);
  flex-wrap: wrap;
  justify-content: center;
  gap: 0;
}
html:root .viewbar button {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
}
html:root .viewbar-sep {
  margin: 0 2px;
}
html:root .view-hint {
  font: 10px var(--mono);
  bottom: 57px;
  white-space: nowrap;
}
html:root .status {
  grid-column: 3;
  grid-row: 1;
  position: relative;
  inset: auto;
  width: auto;
  height: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0;
}
html:root .progress-card {
  position: static;
  width: 100%;
  height: 100%;
  padding: 0 14px;
  gap: 12px;
  border: 0;
  background: none;
}
html:root .progress-icon {
  width: 24px;
  height: 24px;
}
html:root .progress-body {
  display: flex;
  align-items: center;
  gap: 14px;
}
html:root .progress-label {
  font-size: 11px;
  letter-spacing: 0.07em;
}
html:root .progress-row {
  flex: 1;
  margin: 0;
  gap: 10px;
}
html:root .progress-track {
  height: 5px;
}
html:root .progress-count {
  font-size: 13px;
}
html:root .clock {
  display: none;
}
html:root .info-card {
  grid-column: 3;
  grid-row: 2;
  position: relative;
  inset: auto;
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-width: 1px;
  padding: 0;
  overflow: hidden;
}
html:root .tabs {
  flex: none;
  padding: 0 8px;
  gap: 0;
  height: 45px;
  border-bottom: 1px solid var(--line-soft);
  align-items: stretch;
}
html:root .tabs button {
  flex: 1;
  min-width: 0;
  height: 44px;
  font-size: 10px;
  letter-spacing: 0;
}
html:root .tabs button.is-active::after {
  left: 4px;
  right: 4px;
  bottom: 0;
  height: 2px;
}
html:root .info-body {
  position: relative;
  inset: auto;
  flex: 1;
  min-height: 0;
  padding: 16px;
  border: 0;
}
html:root .info-content {
  padding: 0 2px 12px 0;
}
html:root .info-content h2 {
  padding-right: 30px;
  font-size: 22px;
  line-height: 1.2;
}
html:root .lede {
  max-width: none;
  font-size: 14px;
  line-height: 1.7;
}
html:root .features {
  gap: 10px;
  margin-top: 16px;
}
html:root .features li {
  font-size: 12px;
  line-height: 1.5;
  min-height: 32px;
  gap: 12px;
}
html:root .feature-icon {
  width: 32px;
  height: 32px;
  border-width: 1px;
}
html:root .feature-icon svg {
  width: 21px;
  height: 21px;
}
html:root .expand {
  width: 44px;
  height: 44px;
  top: 4px;
  right: 4px;
}
html:root .expand svg {
  width: 18px;
  height: 18px;
  margin: auto;
}
html:root .code-card {
  grid-column: 3;
  grid-row: 3;
  position: relative;
  inset: auto;
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border-width: 1px;
  overflow: hidden;
}
html:root .code-card header {
  height: 48px;
  border-bottom: 1px solid var(--line-soft);
  padding: 0 4px 0 14px;
  gap: 6px;
}
html:root .code-card h2 {
  font-size: 11px;
  line-height: 1.3;
  min-width: 0;
}
html:root .code-actions {
  gap: 1px;
}
html:root .code-actions button {
  width: 44px;
  height: 44px;
  border-radius: 0;
}
html:root .code-wrap {
  border-radius: 0;
}
html:root .code-wrap .code {
  height: 100%;
  max-height: none;
  padding: 10px 0;
  border-radius: 0;
  font-size: 12px;
  line-height: 1.85;
}
html:root .console {
  background: var(--card);
}
html:root .console-lines {
  color: var(--ink);
}
html:root .info-card.is-expanded,
html:root .code-card.is-expanded {
  grid-row: 2 / 4;
  position: relative;
  inset: auto;
  width: auto;
  height: auto;
  background: var(--card);
}
html:root .lessons {
  grid-column: 1;
  grid-row: 1 / 4;
  display: flex;
  flex-direction: column;
  position: relative;
  inset: auto;
  width: auto;
  height: auto;
  min-height: 0;
  min-width: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--card);
  overflow: hidden;
}
html:root .lessons h2 {
  flex: none;
  height: 48px;
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0 16px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 16px;
  letter-spacing: 0.08em;
}
.pe-course-tools {
  flex: none;
  padding: 12px;
  border-bottom: 1px solid var(--line-soft);
}
.pe-search {
  display: block;
}
.pe-search-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.pe-search input {
  appearance: auto;
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  padding: 0 10px;
  background: var(--bg);
  color: var(--ink);
  font: 12px var(--mono);
}
.pe-search input::placeholder {
  color: var(--muted);
  opacity: 1;
}
.pe-course-tools p {
  margin: 10px 0 0;
  font: 10px var(--mono);
  color: var(--muted);
}
html:root .lesson-list {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: 100%;
  gap: 0;
  padding: 0;
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  mask-image: none;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
html:root .lesson {
  flex: 0 0 auto;
  width: 100%;
  min-height: 64px;
  height: auto;
  gap: 8px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-left: 3px solid transparent;
  border-radius: 0;
  box-shadow: none;
  transform: none;
}
html:root .lesson[hidden] {
  display: none;
}
html:root .lesson.is-active {
  background: var(--bg-deep);
  border-left-color: var(--teal);
}
html:root .lesson:hover {
  transform: none;
  background: var(--bg-deep);
}
html:root .lesson-thumb {
  width: 42px;
  height: 42px;
  margin: 0;
}
html:root .lesson-title {
  flex: 1;
  font-size: 12px;
  line-height: 1.6;
  text-align: left;
  letter-spacing: 0.01em;
  white-space: normal;
  font-weight: 500;
}
html:root .lesson-title br {
  display: none;
}
html:root .lesson .chev {
  display: none;
}
html:root .lesson-done {
  width: 12px;
  height: 12px;
  bottom: 3px;
  left: 8px;
}
.pe-lesson-badge {
  flex: none;
  font: 9px var(--mono);
  border: 1px solid var(--line-soft);
  padding: 2px 4px;
  color: var(--muted);
}
.pe-free .pe-lesson-badge {
  color: var(--teal);
  border-color: var(--teal);
}
html:root .lesson.pe-locked::after {
  content: none;
}
html:root [data-lesson].pe-locked::after {
  content: ' · ' attr(data-unlock-price);
}
html:root .lesson-step {
  display: none;
}
html:root .pe-course-footer {
  flex: none;
  margin: 0;
  padding: 12px;
  font: 10px var(--mono);
  color: var(--muted);
  border-top: 1px solid var(--line-soft);
}

/* Compact workbench uses the existing accessible course drawer. */
html.compact,
html.compact body {
  overflow-x: hidden;
  overflow-y: auto;
}
html.compact .artboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 48px minmax(320px, calc(100dvh - 130px)) 42px minmax(280px, auto) minmax(
      300px,
      auto
    );
  grid-template-areas: none;
  height: auto;
  min-height: 100%;
  padding: 10px;
  gap: 10px;
  align-items: stretch;
}
html.compact .pe-scene-heading {
  grid-column: 1;
  grid-row: 1;
}
html.compact .sidebar {
  grid-column: 1;
  grid-row: 1;
}
html.compact .stage {
  grid-column: 1;
  grid-row: 2;
  height: auto;
  min-height: 0;
}
html.compact .status {
  grid-column: 1;
  grid-row: 3;
}
html.compact .info-card {
  grid-column: 1;
  grid-row: 4;
  min-height: 280px;
}
html.compact .code-card {
  grid-column: 1;
  grid-row: 5;
  min-height: 300px;
}
html.compact .info-card.is-expanded {
  grid-row: 4;
  min-height: 480px;
}
html.compact .code-card.is-expanded {
  grid-row: 5;
  min-height: 480px;
}
html.compact .lessons {
  display: none;
}
html.compact .flyout {
  position: fixed;
  left: 10px;
  right: 10px;
  top: 68px;
  width: auto;
  max-width: 420px;
  max-height: calc(100dvh - 88px);
  border-radius: 2px;
  background: var(--card);
}
html.compact .pe-scene-title {
  font-size: 12px;
}
html.compact .code-wrap .code {
  height: 100%;
}
@media (min-width: 1100px) and (max-width: 1250px) {
  html:root .artboard {
    --course-width: 222px;
    --detail-width: 300px;
    gap: 10px;
    padding: 10px;
  }
}
@media (max-width: 420px) {
  html:root .pe-scene-heading {
    padding-right: 178px;
    padding-left: 10px;
  }
  .pe-scene-kicker {
    font-size: 8px;
  }
}
html:root .sidebar {
  width: 176px;
  padding: 0;
  margin-right: 4px;
}
html:root .side-nav {
  width: 176px;
}
html:root .lesson.is-active .lesson-title {
  font-size: 12px;
  font-weight: 700;
}
html:root .pe-no-results {
  margin: 0;
  padding: 24px 12px;
  font: 12px var(--mono);
  color: var(--muted);
}
html:root .pe-no-results[hidden] {
  display: none;
}
html:root [data-lesson].pe-free::after {
  content: ' · FREE';
  color: var(--teal);
  font-size: 10px;
}
html:root .viewbar {
  width: max-content;
}
html.compact .viewbar-sep {
  display: none;
}
html:root .side-nav li {
  padding: 0;
  margin: 0;
  flex: 0 0 44px;
}
