/* Pencil Cards reference arranger: white, silver, navy and true A4 dimensions. */
/* Leave room for the shared navigation, including its collapsed toggle. */
html:has(#gnavSidebar) .motion-stage{width:calc(100% - 40px)}
@media(min-width:900px){html:has(#gnavSidebar.open) .motion-stage{width:calc(100% - 155px)}}
.original-paper-shell{aspect-ratio:210/297;height:min(690px,calc(100dvh - 126px))}
.original-paper-shell[data-ratio="landscape"]{aspect-ratio:297/210;height:auto;width:min(940px,100%);max-height:calc(100dvh - 126px)}
.original-paper-shell[data-ratio="square"]{aspect-ratio:1}
.original-action:disabled{opacity:.45;cursor:wait}
.original-workspace{justify-content:safe center;align-items:safe center}
.library-title-row{grid-template-columns:auto minmax(0,1fr) auto}
.library-total{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:6px;min-width:130px}
.library-total strong{font-size:24px}.library-total span{margin:0}
#pencil-lang{height:31px;padding:0 10px;margin-left:8px;border:1px solid #cdd6e3;border-radius:9px;background:#fff;color:#213a65;font-size:10px;font-weight:800;cursor:pointer}
@media(max-width:780px){.library-total{display:flex;min-width:0}.library-total strong,.library-total span{display:none}h1{font-size:24px}.original-editor-title h2{font-size:15px}.original-paper-shell{height:min(545px,calc(100dvh - 290px))}.original-editor-header .original-editor-actions{grid-column:1/-1;justify-content:flex-end}.original-paper-shell[data-ratio="landscape"]{height:auto;width:100%;max-height:calc(100dvh - 290px)}.original-workspace{padding:15px}.study-pair{min-width:0;width:100%;height:auto;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.study-sheet{width:100%;height:auto}.study-paper{width:100%;height:auto}.study-sheet figcaption{grid-template-columns:20px minmax(0,1fr)}.study-sheet figcaption small{display:none}.study-workspace{justify-content:safe center;padding:16px}.study-sheet figcaption span{font-size:9px}.study-grid-opacity-title{margin-top:9px}.original-controls{grid-template-columns:repeat(5,minmax(165px,1fr))}}
@media(max-width:430px){h1{font-size:20px}}

/* Keep the primary settings short; sketch controls live in the right-hand rail. */
.study-layout{grid-template-columns:200px minmax(0,1fr) 280px}
.study-controls{padding:16px 14px}
.study-control-group{padding:0 0 12px 29px;margin-bottom:12px}
.study-step{width:21px;height:21px;border-radius:6px}
.study-control-group h3{margin:0 0 7px;font-size:11px}
.study-control-group p{margin-top:5px;font-size:9px;line-height:1.4}
.study-mode{padding:8px 9px;border-radius:8px}
.study-mode small{display:none}
.study-mode-buttons{gap:5px}
.study-grid-buttons{gap:5px}.study-grid-buttons button{padding:7px 3px}
.study-grid-opacity-title{margin-top:10px}
.study-workspace{padding:20px 24px;justify-content:safe center}
.study-pair{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px;min-width:0;width:min(100%,850px,calc((100dvh - 210px) * var(--study-ratio) * 2 + 24px));height:auto}
.study-sheet{width:100%;height:auto}.study-paper{width:100%;height:auto}
.study-crop-tip{font-size:9px;text-align:center;line-height:1.5}.study-save-status{font-size:10px}
.study-sketch-controls{min-width:0;padding:10px 12px;border-left:1px solid #d4dce8;background:#f9fbfd;overflow:auto;color:#213a65;line-height:1.2}
.study-sketch-controls>.study-eyebrow{display:none}
.study-sketch-controls h3{font-size:13px;margin:0 0 5px}
.study-sketch-note,#study-sketch-status{font-size:9px;line-height:1.4;color:#758197;margin:4px 0 8px}
.study-sketch-modes{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.study-sketch-modes button,#study-sketch-reset{min-height:27px;padding:5px;border:1px solid #cdd6e3;border-radius:7px;background:#fff;color:#40506a;font-size:10px;font-weight:800;cursor:pointer}
.study-sketch-modes{grid-template-columns:repeat(3,minmax(0,1fr));gap:4px}
.study-sketch-modes button.is-active{border-color:#294b7d;background:#e7edf6;color:#213a65}
.study-sketch-adjustments{display:grid;grid-template-columns:1fr 1fr;gap:3px 10px;margin:9px 0}
.study-sketch-adjustments label{display:flex;justify-content:space-between;font-size:10px;font-weight:800;margin:0}
.study-sketch-adjustments label:first-child{grid-column:1;grid-row:1}.study-sketch-adjustments input:nth-child(2){grid-column:1;grid-row:2}.study-sketch-adjustments label:nth-child(3){grid-column:2;grid-row:1}.study-sketch-adjustments input:nth-child(4){grid-column:2;grid-row:2}
.study-sketch-adjustments input{display:block;width:100%;accent-color:#213a65;margin:0}
.study-sketch-adjustments[data-disabled]{opacity:.5}
#study-sketch-reset{width:100%;font-size:10px}
.study-sketch-controls button:focus-visible,.study-sketch-controls input:focus-visible{outline:2px solid #294b7d;outline-offset:3px}
.study-opacity-control{margin:7px 0 9px}.study-opacity-control label{display:flex;justify-content:space-between;font-size:10px;font-weight:800;margin-bottom:3px}
.study-sketch-controls input[type=range]{width:100%;height:15px;margin:0;accent-color:#213a65}
.study-opacity-control[data-disabled]{opacity:.5}
.study-tone-panel{border-top:1px solid #d4dce8;padding-top:7px;margin:7px 0}
.study-tone-panel summary{font-size:10px;font-weight:800;cursor:pointer;list-style-position:inside;margin-bottom:6px}
.study-tone-sliders,.study-level-sliders{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 10px;margin:7px 0}
.study-tone-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:1px 3px;font-size:9px;line-height:1.15;color:#40506a}
.study-tone-row input{grid-column:1/-1}.study-tone-row output{font-weight:800;color:#213a65}
.study-level-sliders{grid-template-columns:repeat(3,minmax(0,1fr));padding-top:5px;border-top:1px solid #d4dce8}
.study-tone-presets,.study-curve-presets,.study-tone-actions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px}
.study-sketch-controls .study-tone-panel button,.study-tone-actions button{border:1px solid #cdd6e3;border-radius:6px;background:#fff;color:#213a65;font-size:9px;padding:5px 2px;min-height:25px;cursor:pointer}
.study-tone-actions{grid-template-columns:repeat(3,minmax(0,1fr));margin:6px 0}.study-tone-actions button:disabled{opacity:.45;cursor:default}
.study-tone-actions #study-sketch-reset{font-size:9px;min-height:25px}
#study-curve{display:block;width:100%;height:78px;border:1px solid #cdd6e3;border-radius:7px;touch-action:none;cursor:crosshair;background:#fff}
#study-curve-help{font-size:8px;color:#758197;margin:3px 0 6px;line-height:1.3}
@media(max-width:1150px) and (min-width:781px){.study-layout{grid-template-columns:175px minmax(0,1fr) 250px}.study-workspace{padding:16px}.study-sketch-controls{padding:10px}.study-controls{padding:16px 10px}.study-pair{gap:18px}}
@media(max-width:780px){
  .study-layout{grid-template-columns:1fr;grid-template-rows:auto auto minmax(0,1fr)}
  .study-controls{grid-row:1;grid-template-columns:repeat(3,minmax(145px,1fr));padding:8px;gap:10px;max-height:none}
  .study-control-group{margin:0;padding:0 0 0 25px;border:0}
  .study-control-group h3{font-size:10px}.study-mode{padding:6px 7px}
  .study-grid-opacity-title{margin-top:5px}
  .study-sketch-controls{grid-row:2;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:7px 10px;overflow:auto;padding:9px;border:0;border-bottom:1px solid #d4dce8;align-items:center;max-height:min(380px,45dvh)}
  .study-sketch-controls>.study-eyebrow,.study-sketch-note,#study-sketch-status{display:none}
  .study-sketch-controls h3{font-size:11px;margin:0;grid-column:1;grid-row:1}
  .study-opacity-control{grid-column:2;grid-row:1;margin:0}
  .study-sketch-modes{grid-column:1/-1;grid-row:2;grid-template-columns:repeat(5,minmax(0,1fr));gap:4px}
  .study-sketch-modes button{min-height:29px;font-size:9px;padding:5px}
  .study-sketch-adjustments{grid-column:1/-1;grid-row:3;gap:4px 10px;align-items:center;margin:0}
  .study-sketch-adjustments label{font-size:9px;margin:0;gap:5px}
  .study-tone-panel{grid-column:1/-1;grid-row:4;margin:0}.study-tone-actions{grid-column:1/-1;grid-row:5;margin:0}
  #study-sketch-reset{min-height:25px;font-size:9px}
  .study-workspace{grid-row:3;padding:14px;gap:9px}
  .study-pair{width:100%;gap:14px;min-height:0;height:auto}
}
