/* v0.9.6.1: intrinsic sizing; no assumptions about preview/hosting dimensions. */
.page-view, .workspace-shell > *, .first-start-card, .student-home-room > *,
.student-manage-main > *, .header-right, .main-nav { min-width: 0; }
.student-home-room, .student-manage-card, .classroom-card { overflow-wrap: anywhere; }

#view-lab .stage { width: 100%; max-width: 100%; height: auto; aspect-ratio: 4 / 3; }
#view-lab .stage-panel { grid-column: auto; }
#view-lab .stage-wrap { min-width: 0; width: 100%; }
#view-lab .stage img { object-fit: contain; }
#view-lab .robot, #view-lab .obstacle, #view-lab .star { width: 13.5%; height: 18%; }
#view-lab .editor-toolbar-row { grid-template-columns: minmax(0, 1fr); }
#view-lab .lab-save-state { justify-self: start; max-width: 100%; white-space: normal; }
#view-lab .panel-title-row, #view-lab .stage-run-actions { min-width: 0; }
#view-lab .panel-title-row { flex-wrap: wrap; }
#view-lab .dropzone, #view-lab .python-ide { max-width: 100%; min-width: 0; }
#view-lab .dropzone { overscroll-behavior: contain; }
#view-lab .python-code-surface { min-width: 0; }
#view-lab #pythonEditor { overscroll-behavior: contain; }
/* Translate an intrinsically wide highlight layer within the clipped surface;
   clipping a 100%-wide pre BEFORE translating made long code disappear. */
#view-lab .python-highlight {
  inset: 0 auto auto 0; width: max-content; min-width: 100%;
  height: auto; min-height: 100%; max-height: none; overflow: visible;
}
#view-lab .python-highlight, #view-lab #pythonEditor, #view-lab .python-gutter pre {
  font-variant-ligatures: none;
}
@media (min-width: 1025px) {
  #view-lab .workspace-shell {
    display: grid; grid-template-columns: minmax(185px, .72fr) minmax(330px, 1.28fr) minmax(350px, 1.42fr);
    gap: clamp(10px, 1vw, 16px); align-items: start;
  }
}
@media (min-width: 1281px) {
  #view-lab .workspace-shell { grid-template-columns: minmax(210px, .72fr) minmax(390px, 1.28fr) minmax(430px, 1.42fr); }
}
@media (max-width: 1024px) {
  .mobile-lab-tabs { position: sticky; top: 0; scroll-margin-top: var(--site-header-height, 0px); }
  #view-lab .python-ide, #view-lab .python-code-surface {
    min-height: 240px; height: clamp(240px, 55dvh, 560px); max-height: none;
  }
  #view-lab .stage-run-actions { position: static; }
  #view-lab .stage { width: 100%; }
}
@media (max-width: 700px) {
  #view-lab .python-highlight, #view-lab #pythonEditor, #view-lab .python-gutter pre {
    font-size: 16px !important; line-height: 26px !important;
  }
}
@media (orientation: landscape) and (max-height: 520px) {
  .mobile-lab-tabs { position: static; }
}
/* v0.9.8: public learning scope is focused on P.4-P.6 and M.1-M.3. */
.archived-path-notice{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:16px 0;padding:16px;border:1px solid var(--line);border-radius:12px;background:#f2f7ff}
.archived-path-notice>div{min-width:0}.archived-path-notice p{margin:4px 0 0;line-height:1.6;overflow-wrap:anywhere}
.archived-path-notice .secondary-cta{flex-shrink:0}
.archived-progress{margin:20px 0;padding:16px;border:1px solid var(--line);border-radius:12px;background:#f8fbff;overflow-wrap:anywhere}
.archived-progress summary{font-weight:600;cursor:pointer}.archived-progress p{line-height:1.7}
@media(max-width:700px){.archived-path-notice{align-items:stretch;flex-direction:column}.archived-path-notice .secondary-cta{justify-content:center}}
