/* Starter 02, slides 33-36. Scoped styles: no changes to other lessons. */
.pot-slide {
  --pot-ink: #0b2447;
  --pot-muted: #334b66;
  --pot-blue: #0b63ce;
  container-type: size;
  height: 100%; min-height: 0; min-width: 0;
  color: var(--pot-ink);
}
.pot-slide * { box-sizing: border-box; }
.pot-columns {
  height: 100%; min-height: 0;
  display: grid; gap: 18px; gap: clamp(12px, 1.65cqw, 22px);
  align-items: stretch;
}
.pot-equal { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.pot-connection-columns { grid-template-columns: minmax(0, 2.35fr) minmax(0, 1fr); }
.pot-stack {
  display: flex; flex-direction: column; justify-content: center;
  gap: 12px; gap: clamp(10px, 1.2cqw, 16px); min-width: 0; min-height: 0;
}
.pot-panel {
  min-width: 0; border: 1px solid #d7e3ef; border-radius: 17px;
  padding: 16px; padding: clamp(12px, 1.5cqw, 20px);
  background: #fff; color: var(--pot-ink);
  box-shadow: 0 6px 18px rgba(11,36,71,.04);
}
.pot-panel h3 {
  margin: 0 0 .38em; font-size: 24px; font-size: clamp(19px, 2.2cqw, 28px);
  line-height: 1.18; font-weight: 850; color: var(--pot-ink);
  overflow-wrap: normal; word-break: normal;
}
.pot-panel p {
  margin: .4em 0 0; font-size: 21px; font-size: clamp(16px, 1.9cqw, 23px);
  line-height: 1.35; color: var(--pot-muted);
  overflow-wrap: normal; word-break: normal;
}
.pot-slide b, .pot-slide strong {
  display: inline; width: auto; height: auto; margin: 0; padding: 0;
  font-size: inherit; font-weight: 850; line-height: inherit;
  background: none; border: 0; border-radius: 0; color: var(--pot-ink);
  white-space: normal;
}
.pot-slide .pot-accent { background: #f0f6fd; border-color: #bdd7f2; }
.pot-range {
  display: flex; align-items: center; gap: 20px;
  font-size: 42px; font-size: clamp(34px, 4cqw, 50px);
  line-height: 1.05; margin: .22em 0; color: var(--pot-blue);
}
.pot-range b { color: var(--pot-blue); }
.pot-range span { color: #859bb3; font-size: .7em; }
.pot-path { display: flex; flex-wrap: wrap; align-items: center; gap: .2em .4em; }
.pot-path b { white-space: nowrap; }
.pot-port { display: flex; align-items: center; gap: .35em; flex-wrap: wrap; }
.pot-port b { white-space: nowrap; }
.pot-callout {
  padding: 11px 14px; border-radius: 12px; border-left: 4px solid #f28c28;
  color: var(--pot-ink); background: #fff5e9;
  font-size: 19px; font-size: clamp(16px, 1.7cqw, 21px); line-height: 1.3;
}
.pot-visual {
  min-width: 0; min-height: 0; height: 100%; margin: 0;
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border: 1px solid #d7e3ef; border-radius: 18px;
}
.pot-image-area {
  position: relative; min-height: 0; min-width: 0; flex: 1;
  display: grid; place-items: center; padding: 12px;
}
.pot-image-area img { display: block; width: 100%; height: 100%; min-height: 0; min-width: 0; object-fit: contain; }
.pot-intro .pot-image-area { padding: 22px; }
.pot-visual figcaption {
  flex: none; display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 9px 12px; margin: 0; border-top: 1px solid #e0e9f2;
  font-size: 14px; font-size: clamp(12px, 1.25cqw, 16px); line-height: 1.3;
  color: var(--pot-muted); background: #f7fafd;
}
.pot-visual figcaption a { flex: none; text-decoration: none; color: #084f9e; font-weight: 800; white-space: nowrap; }
.pot-visual figcaption a:hover { text-decoration: underline; }
.pot-visual figcaption a:focus-visible { outline: 3px solid #f28c28; outline-offset: 3px; border-radius: 2px; }
.pot-code-layout { height: 100%; min-height: 0; display: grid; grid-template-rows: minmax(0,1fr) minmax(0,1fr); gap: clamp(12px,1.5cqw,20px); }
.pot-notes { min-width: 0; min-height: 0; display: grid; align-items: stretch; gap: clamp(10px,1.2cqw,16px); }
.pot-notes-three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.pot-notes-two { grid-template-columns: minmax(0,.95fr) minmax(0,1.05fr); }
.pot-step {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.45em; height: 1.45em; margin-right: .1em; border-radius: .4em;
  background: #e3effc; color: var(--pot-blue); font-size: .82em; vertical-align: .06em;
}
.pot-panel .pot-equation { color: var(--pot-blue); font-weight: 900; white-space: nowrap; font-size: clamp(17px,2.1cqw,25px); }
.pot-panel .pot-hint { border-top: 1px solid #ccdcec; padding-top: .48em; font-size: clamp(14px,1.5cqw,18px); }
.pot-challenge .pot-code-layout { grid-template-rows: minmax(0,.86fr) minmax(0,1.14fr); }
.pot-challenge .pot-panel p { font-size: clamp(16px,1.82cqw,22px); line-height: 1.32; }
.pot-challenge .pot-panel .pot-hint { font-size: clamp(14px,1.45cqw,17px); }

/* A taller stage on smaller laptops/tablets preserves legibility rather than clipping. */
@media (min-width: 781px) and (max-width: 1190px) {
  .slide-stage:has(.slide.active .pot-slide) { aspect-ratio: auto; height: 660px; }
  .pot-connection-columns { grid-template-columns: minmax(0,1.6fr) minmax(0,1fr); }
  .pot-notes-three { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 780px) {
  .slide-stage:has(.slide.active .pot-slide) { min-height: 640px; height: 82vh; }
  .slide:has(.pot-slide) { overflow: auto; }
  .slide:has(.pot-slide) .slide-body { flex: 0 0 auto; }
  .pot-slide { container-type: inline-size; height: auto; }
  .pot-columns { height: auto; grid-template-columns: minmax(0,1fr); }
  .pot-visual { height: auto; min-height: 250px; }
  .pot-image-area { flex: none; height: 290px; padding: 12px; }
  .pot-code-layout { height: auto; grid-template-rows: auto auto; }
  .pot-code-visual { min-height: 0; }
  .pot-code-visual .pot-image-area { height: auto; aspect-ratio: 5.22; }
  .pot-visual figcaption { flex-wrap: wrap; font-size: 13px; }
  .pot-notes-three, .pot-notes-two { grid-template-columns: minmax(0,1fr); }
  .pot-panel { padding: 15px; }
  .pot-panel h3 { font-size: 22px; }
  .pot-panel p, .pot-challenge .pot-panel p { font-size: 18px; }
  .pot-panel .pot-hint, .pot-challenge .pot-panel .pot-hint { font-size: 16px; }
}

/* Numeric ranges and variable names stay intact; sentences wrap naturally. */
.pot-slide .pot-token { white-space: nowrap; display: inline; }

/* Interactive potentiometer exploration: image/applications left, live lab right. */
.pot-sim-columns { grid-template-columns:minmax(0,1fr) minmax(0,1.85fr); }
.pot-sim-info { display:grid; grid-template-rows:minmax(100px,1fr) auto auto; gap:12px; min-width:0; min-height:0; }
.pot-sim-photo { margin:0; min-height:0; display:flex; flex-direction:column; align-items:center; border:1px solid #d7e3ef; border-radius:16px; background:#fff; padding:10px; }
.pot-sim-photo img { flex:1; min-height:0; width:100%; height:100%; object-fit:contain; }
.pot-sim-photo figcaption { color:var(--pot-ink); font-size:clamp(14px,1.5cqw,20px); font-weight:850; line-height:1.3; padding-top:5px; }
.pot-sim-apps { padding:clamp(12px,1.3cqw,18px); }
.pot-sim-apps h3 { font-size:clamp(19px,2cqw,26px); }
.pot-sim-apps p { font-size:clamp(16px,1.7cqw,21px); }
.pot-live-lab { display:flex; flex-direction:column; min-width:0; min-height:0; height:100%; overflow:hidden; border:1px solid #bed4eb; border-radius:18px; background:#fff; }
.pot-live-head { flex:none; display:flex; align-items:center; justify-content:space-between; gap:8px; padding:12px; border-bottom:1px solid #d7e3ef; background:#edf5fd; }
.pot-live-head strong { font-size:clamp(14px,1.5cqw,19px); }
.pot-live-head a { font-size:clamp(12px,1.2cqw,15px); color:#084f9e; font-weight:800; text-decoration:none; }
.pot-live-head a:focus-visible { outline:3px solid #f28c28; outline-offset:3px; }
.pot-live-frame { flex:1; width:100%; min-height:0; border:0; background:#f5f9fd; }
.pot-live-foot { flex:none; padding:9px 12px; border-top:1px solid #d7e3ef; color:#334b66; font-size:clamp(12px,1.35cqw,17px); line-height:1.3; text-align:center; }
@media (min-width:781px) and (max-width:1190px) {
  .pot-sim-columns { grid-template-columns:minmax(0,1fr) minmax(0,1.5fr); }
  .pot-live-head { flex-wrap:wrap; gap:3px; }
}
@media (max-width:780px) {
  .pot-sim-columns { grid-template-columns:1fr; }
  .pot-sim-info { grid-template-rows:220px auto auto; }
  .pot-live-lab { height:490px; }
  .pot-live-head { flex-wrap:wrap; }
}

@media (min-width:781px) {
  .slide-stage:has(.slide.active .pot-simulation) { width:100%; aspect-ratio:auto; height:clamp(620px,44vw,760px); min-height:620px; }
  .slide-stage:has(.slide.active .pot-simulation):fullscreen { width:100vw; height:100vh; min-height:0; }
}
