/* lp — LivePython projects, loaded only by the free executor. */
#lp-project-controls { margin:0.3rem; min-width:0; flex-wrap:wrap; }
#lp-project-selector { display:block; text-align:left; }
#lp-project-state { align-self:center; }
#lp-project-state[data-error] { color:var(--clr-orange); }
#lp-code { display:grid; min-width:0; min-height:0; }
#lp-code > .code-editor { min-width:0; min-height:0; }
#lp-code[data-project] { display:grid; grid-template-columns:160px minmax(0, 1fr); min-width:0; min-height:0; gap:0.3rem; position:relative; }
#lp-code[data-project] > .code-editor { grid-column:2; }
#lp-code[data-project][data-collapsed] { grid-template-columns:34px minmax(0, 1fr); }
#lp-files { overflow:auto; background:var(--clr-back-dark); padding:0.2rem; min-width:0; box-sizing:border-box; }
#lp-files > .row { flex-wrap:wrap; }
#lp-files > .row > span { flex:1; }
/* Compact square buttons and mirrored icons, shared by both side panels. */
.lp-square26 { width:26px; height:26px; padding:3px; justify-content:center; flex-shrink:0; }
.lp-square26 > svg { width:18px; height:18px; }
.lp-square26 > svg:not([fill]) { fill:currentColor; }
.lp-flip-x { transform:scaleX(-1); }
/* A fixed narrow column beside a flexible pane. */
.lp-grid-right34 { display:grid; grid-template-columns:minmax(0, 1fr) 34px; min-width:0; min-height:0; }
.lp-grid-right34[data-collapsed] { grid-template-columns:34px; }
/* Fill the available width on phones; fit the full caption on desktop. */
.lp-wide-auto { width:0; }
@media (min-width: 800px) {
    .lp-wide-auto { width:auto; max-width:60vw; }
}
#lp-file-list { margin-top:0.4rem; }
#lp-file-list [data-open-file] { min-width:0; padding:0.3rem; cursor:pointer; user-select:none; -webkit-touch-callout:none; touch-action:pan-y; }
#lp-file-list [data-open-file]:focus-visible { outline:1px solid var(--clr-blue); outline-offset:-1px; }
#lp-file-list [aria-current="true"] { background:var(--clr-back-light); }
#lp-files:focus-within #lp-file-list [aria-current="true"] { background:var(--clr-blue); }
#lp-code[data-collapsed] #lp-file-list,
#lp-code[data-collapsed] #lp-files > .row > span { display:none; }
#lp-code[data-collapsed] #lp-files > .row { flex-direction:column; gap:2px; }
#lp-conflict { padding:0.4rem; border:1px solid var(--clr-orange); color:var(--clr-orange); margin:0.3rem; }
#lp-conflict > span { display:block; margin-bottom:0.3rem; white-space:pre-line; }
.lp-menu { display:block; min-width:220px; max-width:90vw; max-height:70dvh; overflow:auto; }
.lp-menu summary { cursor:pointer; }
.lp-menu details > div { padding-left:0.8rem; }
.lp-menu h4 { margin:0.4rem 0; }
#lp-mobile-tabs { margin:0.3rem; display:none; }
#task-grid.scratch:has(#lp-code) #task-solution { grid-template-rows:minmax(0, 1fr) auto; row-gap:0.6rem; }
@media (max-width: 799px) {
    .lp-grow-mobile { flex:1; }
    #lp-code[data-project],
    #lp-code[data-project][data-collapsed] { grid-template-columns:minmax(0, 1fr); }
    #lp-code[data-project] > .code-editor { grid-column:auto; }
    #lp-mobile-tabs { display:grid; grid-template-columns:minmax(0, 1fr) auto minmax(0, 1fr); }
    #lp-mobile-tabs > .row { grid-column:1; justify-self:start; }
    #lp-mobile-tabs > .code-buttons { grid-column:2; grid-row:1; }
    #lp-mobile-canvas { grid-column:3; justify-self:end; }
    #interactive-stage.active:has(#lp-code) { grid-template-columns:minmax(0, 1fr); }
    .lp-grid-right34 { grid-template-columns:minmax(0, 1fr); }
    #interactive-stage.active[data-tab="canvas"] > #lp-code,
    #interactive-stage.active:has(#lp-code):not([data-tab="canvas"]) > .lp-grid-right34 { display:none; }
}
