/* Page Composition 2026-10-18: make the comic page the central work surface.
   Do not alter Page Compiler geometry or the rendered/exported canvas. */
.page-scene-tools{
  margin-top:16px;
  border:1px solid #d5dfd4;
  border-radius:12px;
  background:#f8faf6;
  color:#315040;
}
.page-scene-tools>summary{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
  padding:13px 12px;
  cursor:pointer;
  font:700 12px/1.4 system-ui,sans-serif;
  list-style:none;
}
.page-scene-tools>summary::-webkit-details-marker{display:none}
.page-scene-tools>summary span{transition:transform .15s ease}
.page-scene-tools[open]>summary span{transform:rotate(180deg)}
.page-scene-extras{padding:0 8px 9px;min-width:0}
.page-scene-extras .scene-shot-bridge{
  min-width:0;
  max-width:100%;
  margin:0 0 10px;
  padding:10px;
  box-sizing:border-box;
}
.page-scene-extras .scene-shot-choices{grid-template-columns:minmax(0,1fr)}
.page-scene-extras .scene-shot-toolbar{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
.page-scene-extras .scene-shot-toolbar button{white-space:normal;font-size:10px;padding:7px 5px}
.page-scene-extras .visual-scope-note{margin:8px 0 0;width:100%;max-width:100%;box-sizing:border-box}
.page-scene-extras .visual-scope-note button{max-width:100%;white-space:normal}
.page-panel-choice{min-width:0}
.page-panel-choice>span{min-width:0}
.page-panel-choice>span b,.page-panel-choice>span small{overflow-wrap:anywhere}

/* Desktop: rails participate in layout, rather than covering the page. */
@media (min-width:1101px){
  .page-studio .page-workspace{
    display:grid;
    grid-template-columns:314px minmax(0,1fr) 0px;
    grid-template-rows:minmax(0,1fr);
    width:100%;
    height:100%;
    min-height:0;
    overflow:hidden;
    transition:grid-template-columns .2s ease;
  }
  .page-studio.panels-hidden .page-workspace{
    grid-template-columns:0px minmax(0,1fr) 0px;
  }
  .page-studio:not(.authority-hidden) .page-workspace{
    grid-template-columns:314px minmax(0,1fr) 314px;
  }
  .page-studio.panels-hidden:not(.authority-hidden) .page-workspace{
    grid-template-columns:0px minmax(0,1fr) 314px;
  }
  .page-studio .page-panel-dock,
  .page-studio .page-authority-dock{
    position:relative;
    inset:auto!important;
    top:auto!important;
    right:auto!important;
    bottom:auto!important;
    left:auto!important;
    width:auto!important;
    min-width:0;
    height:100%;
    min-height:0;
    padding:16px 14px!important;
    border-radius:0!important;
    box-shadow:none!important;
    backdrop-filter:none!important;
    overflow-y:auto;
    overflow-x:hidden;
    opacity:1;
    transform:none!important;
    visibility:visible;
  }
  .page-studio.panels-hidden .page-panel-dock,
  .page-studio.authority-hidden .page-authority-dock{
    visibility:hidden;
    opacity:0;
    pointer-events:none;
    padding:0!important;
    border:0!important;
    overflow:hidden;
  }
  .page-studio .page-stage{
    width:100%;
    min-width:0;
    min-height:0;
    height:100%;
    overflow:hidden;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    padding:15px 14px 10px!important;
    box-sizing:border-box;
  }
  .page-studio .page-paper-wrap{
    flex:0 1 auto;
    width:auto;
    height:min(calc(100dvh - 170px),820px)!important;
    max-height:calc(100% - 39px);
    max-width:min(calc(100% - 24px),565px)!important;
    aspect-ratio:2/3;
    box-sizing:border-box;
    margin:0 auto;
  }
  .page-studio .page-statusbar{
    flex:0 0 auto;
    max-width:100%;
    min-height:24px;
    padding-top:7px;
    box-sizing:border-box;
  }
}
@media (max-width:1100px){
  /* Tablet/mobile keep temporary drawers, not permanently occupying the artboard. */
  .page-studio .page-workspace{display:block;min-width:0}
  .page-studio:not(.panels-hidden) .page-panel-dock,
  .page-studio:not(.authority-hidden) .page-authority-dock{
    display:block!important;
  }
  .page-studio .page-paper-wrap{
    max-width:min(calc(100% - 22px),565px)!important;
    height:min(calc(100dvh - 175px),780px)!important;
    max-height:calc(100% - 40px);
  }
}
@media (max-width:820px){
  .page-studio .page-panel-dock,
  .page-studio .page-authority-dock{
    width:min(320px,92vw)!important;
  }
  .page-studio .page-stage{height:100%;min-height:0}
  .page-studio .page-paper-wrap{height:min(calc(100dvh - 205px),720px)!important}
}
@media(prefers-reduced-motion:reduce){
  .page-studio .page-workspace{transition:none}
}

/* Illustrated shot choices remain within the dedicated left rail. */
.illustration-studio-panel{display:grid;gap:8px;padding:12px 2px 16px;border-bottom:1px solid #d5dfd4;margin-bottom:14px}
.illustration-studio-panel>strong{font:750 13px/1.4 system-ui,sans-serif;color:#315641}
.illustration-studio-panel>span,.illustration-studio-panel>small{font:11px/1.5 system-ui,sans-serif;color:#6b8074}
.illustration-studio-panel>button{padding:10px 8px;border:0;border-radius:9px;background:#305947;color:white;cursor:pointer;font-weight:700}
.illustration-studio-panel>button:hover{background:#214c38}
.illustration-choices{display:grid;gap:9px;min-width:0}
.illustration-choice{display:grid;gap:5px!important;color:#3e6552!important;font-size:11px!important;font-weight:650}
.illustration-choice select{width:100%;min-width:0;max-width:100%;padding:8px;border:1px solid #b7cfbf;border-radius:8px;background:white;color:#263d31;font:11px system-ui,sans-serif}

.page-illustrate-action{border-color:#9dbca5!important;color:#24573c!important;background:#e6f2e8!important;font-weight:800!important}
.page-illustrate-action:hover{background:#d6eadd!important}

/* Header height is independent of the global form-label sizing rules. */
.page-studio .page-controls{
  height:64px!important;max-height:64px!important;min-height:0;
  display:flex;align-items:center!important;justify-content:center;
  padding:4px 7px!important;box-sizing:border-box;
}
.page-studio .page-controls label{
  display:flex!important;flex-direction:column;justify-content:center;
  height:52px!important;min-height:0!important;gap:3px;
  padding:0 5px!important;margin:0!important;line-height:1.2!important;
}
.page-studio .page-controls select{
  height:34px!important;min-height:34px!important;max-height:34px!important;
  padding:5px 23px 5px 8px!important;margin:0!important;
}
@media(min-width:1101px){
  .page-studio .page-topbar{
    grid-template-columns:minmax(260px,1fr) max-content max-content!important;
    column-gap:14px!important;
  }
  .page-studio .page-topbar-end{flex-wrap:nowrap!important}
}
@media (min-width:821px) and (max-width:1100px){
  .page-studio .page-topbar{
    flex-basis:124px!important;min-height:124px!important;height:auto!important;
    grid-template-columns:minmax(0,1fr) max-content!important;
    grid-template-areas:"start end" "controls controls"!important;
    padding:8px 12px!important;row-gap:5px!important;
  }
  .page-studio .page-topbar-start{grid-area:start}
  .page-studio .page-topbar-end{grid-area:end;flex-wrap:nowrap!important}
  .page-studio .page-controls{grid-area:controls;justify-self:center;height:52px!important;max-height:52px!important}
}
@media(max-width:820px){
  .page-studio .page-topbar{
    flex-basis:178px!important;min-height:178px!important;height:auto!important;
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-areas:"start" "end" "controls"!important;
    padding:8px 10px!important;row-gap:5px!important;
  }
  .page-studio .page-topbar-start{grid-area:start}
  .page-studio .page-topbar-end{
    grid-area:end;width:100%;min-width:0;max-width:100%;
    justify-content:flex-start;overflow-x:auto;flex-wrap:nowrap!important;
  }
  .page-studio .page-controls{
    grid-area:controls;width:100%;min-width:0;max-width:100%;
    height:52px!important;max-height:52px!important;
    overflow-x:auto;justify-content:flex-start;
  }
  .page-studio .page-paper-wrap{height:min(calc(100dvh - 250px),720px)!important}
}
