.custom-pattern-dialog{color:#10256B;border:1px solid #10256B;border-radius:0;padding:0;width:min(1000px,calc(100vw - 48px));height:min(760px,90dvh);max-width:none;max-height:none;background:#fff;font-family:inherit;overflow:hidden;box-sizing:border-box}
.custom-pattern-dialog::backdrop{background:rgba(16,37,107,.25)}
.custom-pattern-dialog *{box-sizing:border-box}.custom-pattern-dialog [hidden]{display:none!important}
.cp-header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:20px;border-bottom:1px solid #E3E5ED}.cp-header h3{font-size:22px;margin:0;line-height:1.2}.cp-header p{font-size:13px;margin:5px 0 0}.cp-close{width:44px;height:44px;padding:0!important;flex-shrink:0}
.cp-layout{display:grid;grid-template-columns:300px minmax(0,1fr);height:calc(100% - 160px);min-height:0}.cp-tools{overflow:auto;padding:18px;border-right:1px solid #E3E5ED;overscroll-behavior:contain}.cp-preview{min-height:0;display:flex;align-items:center;justify-content:center;padding:20px;background:#F7F8FC;overflow:hidden}.cp-preview svg{display:block;width:100%;height:100%;max-height:100%}
.cp-sources,.cp-pixels,.cp-brushes{display:flex;gap:8px}.custom-pattern-dialog button{font:inherit;font-size:14px;line-height:1.2;color:inherit;background:#fff;border:1px solid #D9DEEA;padding:11px 12px;min-height:44px;cursor:pointer;border-radius:0}.custom-pattern-dialog button:disabled{opacity:.45;cursor:default}.custom-pattern-dialog button.active{background:#FFD400;border-color:#10256B}.custom-pattern-dialog button:focus-visible,.custom-pattern-dialog canvas:focus-visible{outline:2px solid #145BFF;outline-offset:3px}.cp-sources button,.cp-pixels button{flex:1;padding-inline:4px}.cp-sources button.active{background:#10256B;color:white}.cp-source-pair{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:16px 0}.cp-source-pair canvas{width:100%;height:auto;border:1px solid #E3E5ED}.cp-label{display:flex;justify-content:space-between;gap:8px;font-weight:bold;font-size:14px;margin:18px 0 10px}.cp-size{width:100%;accent-color:#10256B;height:32px}.cp-brushes{margin:16px 0 8px}.cp-brushes button{flex:1}.cp-undo{flex:0 0 44px!important;font-size:22px!important;padding:4px!important}.cp-drawing{display:block;width:100%;height:auto;touch-action:none;border:1px solid #10256B}.cp-clear{width:100%;margin-top:8px}.cp-error{margin:12px 0 0;font-size:13px;line-height:1.4;color:#9A2F2F}.cp-draft{margin-bottom:14px;font-size:13px}.cp-draft button{width:100%;margin-top:6px}.cp-footer{height:72px;border-top:1px solid #E3E5ED;display:flex;justify-content:flex-end;align-items:center;gap:8px;padding:12px 20px;background:#fff}.cp-footer button{min-width:136px}.cp-footer .cp-apply{background:#10256B;color:#fff}.cp-pattern-icon{width:35px;height:35px;flex:0 0 auto}.cp-edit-button{width:100%;margin-top:10px}.cp-loading{font-size:13px;margin-top:12px}
@media(max-width:760px){.custom-pattern-dialog{position:fixed;inset:0;margin:0;width:100%;height:100dvh;max-height:100dvh;border:0}.cp-header{padding:12px 16px;min-height:76px}.cp-header h3{font-size:20px}.cp-header p{font-size:12px}.cp-layout{display:flex;flex-direction:column;height:calc(100% - 152px);overflow:auto;overscroll-behavior:contain}.cp-preview{order:-1;flex:0 0 230px;padding:14px;min-height:230px}.cp-tools{overflow:visible;border-right:0;padding:16px}.cp-footer{height:76px;padding:12px 16px max(12px,env(safe-area-inset-bottom));gap:8px}.cp-footer button{flex:1;min-width:0}.cp-drawing{max-width:none;margin:0}.custom-pattern-dialog.cp-draw .cp-preview{flex-basis:170px;min-height:170px}.cp-source-pair canvas{max-height:170px;object-fit:contain}.cp-header p{max-width:270px}}
@media(prefers-reduced-motion:reduce){.custom-pattern-dialog *{scroll-behavior:auto}}
