/* Business controls only; Engine's generated shell stylesheet remains last. */
.gradient-heading,.gradient-row {grid-template-columns:minmax(0,1fr) minmax(0,2fr);grid-gap:12px}
.gradient-distribution {min-width:0;display:flex;align-items:center}
.gradient-distribution input {min-width:0;flex:1}
.gradient-distribution output {width:30px;margin-left:7px;flex-shrink:0}
.collection-panel {border-bottom:1px solid #ccc;padding:0 0 14px;margin-bottom:18px}
.collection-top {display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;font-size:12px}
.collection-thumbnails {display:flex;min-width:0;margin-bottom:8px}
.collection-thumb {width:23%;margin-right:2%;padding:3px;background:#e5e5e5;border:1px solid transparent;color:inherit;min-width:0}
.collection-thumb[aria-pressed="true"] {border-color:#555;background:#d5d5d5}
.collection-thumb img {display:block;width:100%;height:48px;object-fit:contain}
.collection-thumb span {display:block;font-size:11px;text-align:center}
.collection-actions {display:flex;flex-wrap:wrap;margin:4px -5px}
.collection-actions button,.collection-panel button:not(.collection-thumb),.collection-edit-library button {font:inherit;color:inherit;background:transparent;border:0;padding:7px 5px;cursor:pointer}
.collection-actions button:disabled,.collection-panel button:disabled {opacity:.35;cursor:default}
.collection-layers button {font-size:11px}
.collection-range {display:flex;align-items:center;font-size:12px;margin:8px 0}
.collection-range input {flex:1;min-width:0;margin:0 12px;accent-color:#151515}
.collection-range output {width:40px;text-align:right;font-size:11px}
.collection-note {font-size:10px;color:#777;margin:5px 0 0;line-height:1.6}
.collection-store {justify-content:space-between}
.collection-selection {position:absolute;border:1px solid #555;pointer-events:none;box-sizing:border-box}
.collection-selection span {position:absolute;top:-19px;left:0;white-space:nowrap;font-size:10px;background:#eee;color:#333;padding:1px 3px}
.collection-selection.is-locked {border-style:dashed}
.collection-active #tile-overlay {pointer-events:none}
.collection-board #canvas-wrap {background:#e5e5e5;outline:1px solid #bbb}
.collection-board .effect-rail {visibility:hidden}
.collection-board .controls > :not(.collection-panel) {display:none!important}
.collection-active #angle-controls,.collection-active #stamp-scale-controls,.collection-active #loose-angle-controls {display:none!important}
.collection-active .collection-edit-library {display:none}
.editing-notice {font-size:11px;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;margin-bottom:12px;padding-bottom:9px;border-bottom:1px solid #ccc}
.editing-notice button {font-size:11px}
.collection-edit-library {display:flex;justify-content:space-between;font-size:12px;padding:10px 0}
.collection-modal {position:fixed;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.3);z-index:1000;display:flex;align-items:center;justify-content:center;padding:20px;box-sizing:border-box}
.collection-dialog {width:560px;max-width:100%;max-height:90%;overflow:auto;background:#f3f3f3;padding:22px;box-sizing:border-box;font:13px/1.7 JCS,sans-serif;color:#222;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
.collection-dialog header {display:flex;justify-content:space-between;align-items:center;margin-bottom:18px}
.collection-dialog h2 {font-size:16px;margin:0;font-weight:500}
.collection-dialog h3 {font-size:14px;font-weight:500;margin:12px 0 6px}
.collection-dialog button {font:inherit;border:1px solid #aaa;border-radius:0;padding:7px 10px;background:transparent;color:inherit;cursor:pointer}
.collection-dialog button:disabled {opacity:.4}
.collection-confirm {display:block;width:100%;margin:12px 0}
.library-entry {display:flex;flex-wrap:wrap;align-items:center;border-top:1px solid #ccc;padding:12px 0}
.library-entry img {width:48px;height:48px;object-fit:contain;margin-right:5px;background:#e5e5e5}
.library-entry span {width:100%;margin:6px 0}
.library-entry button {margin-right:8px}
.collection-help-content section {padding-bottom:24px;margin-bottom:24px;border-bottom:1px solid #ccc}
.collection-help-content section>img {width:100%;display:block;background:#e5e5e5}
.collection-help-content footer {font-size:12px}
.collection-help-content p {margin:7px 0}
.collection-help-content a {color:inherit}
#collection-help {margin-left:auto}
#collection-entry {margin-right:8px}
[hidden] {display:none!important}
@media(max-width:500px){.collection-dialog{padding:18px}.collection-modal{padding:12px}.sheet-controls{flex-wrap:wrap}.output-options{flex-shrink:0}#output-controls span{padding-left:7px;padding-right:7px}.preview-footer{flex-wrap:wrap}.collection-thumb img{height:38px}}
#output-controls {grid-template-columns:repeat(2,minmax(0,1fr));flex:0 0 132px;min-width:132px}
.collection-active .canvas-stage::before,.collection-active .canvas-stage::after {display:none}
.collection-active .preview-workspace {grid-template-columns:minmax(0,1fr) var(--effect-size)}
.collection-board .preview-workspace {grid-template-columns:minmax(0,1fr)}
.collection-board .effect-rail {display:none}
.collection-help-content section {display:grid;grid-template-columns:90px minmax(0,1fr);grid-gap:0 20px;padding:16px 0;margin:0}
.collection-help-content section>img {grid-row:1/3;width:90px;height:90px;object-fit:cover;align-self:center}
.collection-help-content section h3 {margin:0 0 6px}
@media(max-width:500px){#output-controls {flex-basis:132px;min-width:132px}.collection-help-content section {grid-template-columns:78px minmax(0,1fr);grid-gap:0 14px}.collection-help-content section>img{width:78px;height:78px}}
@font-face {font-family:JCS;src:url('./postage-jcs-regular.woff2?v=20261026-controls-r6') format('woff2');font-weight:400;font-style:normal;font-display:swap}
@font-face {font-family:JCS;src:url('./postage-jcs-medium.woff2?v=20261026-controls-r6') format('woff2');font-weight:500;font-style:normal;font-display:swap}
/* Collection controls use quiet surfaces, including inside Engine's shared shell. */
body .collection-panel button,body .collection-dialog button,body .editing-notice button,body .collection-edit-library button {border:0!important;box-shadow:none!important;background:transparent;padding:8px 10px;}
body .collection-panel button:hover:not(:disabled),body .collection-dialog button:hover:not(:disabled),body .editing-notice button:hover:not(:disabled),body .collection-edit-library button:hover:not(:disabled) {background:#e5e5e5!important;}
body .collection-panel .collection-thumb {background:transparent;padding:5px;}
body .collection-panel .collection-thumb[aria-pressed="true"] {background:#dedede!important;border:0!important;}
body .collection-actions {gap:4px;margin:4px 0;}
body .collection-top button {padding:8px 10px;}
/* Explicit business scope wins over the shared shell's default button contract. */
#collection-panel button,#collection-panel .collection-thumb[aria-pressed="true"],#editing-notice button,#store-editor,#library-editor,body .collection-modal .collection-dialog button {border:0!important;box-shadow:none!important;}
#collection-panel button {background:transparent;padding:8px 10px;}
#collection-panel .collection-thumb {padding:5px;}
#collection-panel .collection-thumb[aria-pressed="true"] {background:#dedede!important;}
#collection-panel .collection-layers button {padding:7px 5px;min-width:0;font-size:11px;}

/* Align collection controls as groups, with one stable row of object actions. */
.collection-top {flex-wrap:wrap;gap:4px 12px;}
.collection-primary-actions {display:flex;align-items:center;justify-content:flex-end;margin-left:auto;gap:4px;}
#collection-panel .collection-primary-actions button {padding:8px 6px;min-width:44px;min-height:44px;white-space:nowrap;text-decoration:none;}
#collection-panel .collection-primary-actions button::after {display:none;}
#collection-panel .collection-layers {justify-content:flex-start;gap:4px;}
#collection-panel .collection-layers button {padding-left:6px;padding-right:6px;min-width:44px;min-height:44px;}
#collection-panel .collection-store {align-items:center;gap:12px;}
#collection-panel .collection-store button {padding-left:0;padding-right:0;}
.collection-edit-library button:first-child {padding-left:0;}
.collection-edit-library button:last-child {padding-right:0;}

/* Keep editor navigation together instead of distributing each button across the row. */
.editing-notice {gap:4px 12px;}
.editing-actions {display:flex;align-items:center;justify-content:flex-end;gap:4px;margin-left:auto;}
#editing-notice .editing-actions button {padding:8px 6px;min-height:44px;min-width:44px;white-space:nowrap;}
#editing-notice #collection-entry {margin:0;}

/* Library actions align with the thumbnail, description and clear action. */
.library-entry-actions {display:flex;flex:0 0 100%;align-items:center;justify-content:flex-start;gap:4px;margin-left:-6px;}
body .collection-modal .library-entry-actions button {margin:0;min-width:44px;min-height:44px;padding:8px 6px;text-align:left;}
body .collection-modal .collection-dialog .library-clear {padding:8px 0;min-height:44px;text-align:left;}

/* Keep library navigation outside the scrolling entries, including older WebViews. */
.collection-library-dialog {display:flex;flex-direction:column;overflow:hidden;}
.collection-library-dialog > header {flex:0 0 auto;}
.collection-library-content {min-height:0;overflow-y:auto;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch;}
